/* 抖音房管助手 · 控制台 —— 高级极简：石墨底、发丝线、单一强调色、克制的动效（只动透明度和位移） */
:root {
  --bg: #0b0c0f;
  --s1: #111318;
  --s2: #16191f;
  --s3: #1c1f26;
  --hair: rgba(255, 255, 255, .06);
  --hair2: rgba(255, 255, 255, .11);
  --t1: #ececf1;
  --t2: #a3a8b2;
  --t3: #6c717b;
  --acc: #ff3b5c;
  --acc2: #ff7a59;
  --high: #ff5d6c;
  --mid: #f2b54b;
  --low: #7e8490;
  --ok: #3fd18f;
  --info: #6aa3ff;
  --nick: #9cc1ff;
  --r1: 6px; --r2: 10px; --r3: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--t1); }
body {
  font: 1rem/1.55 "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "HarmonyOS Sans SC", system-ui, sans-serif;
  letter-spacing: .01em; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum";
}
::selection { background: rgba(255, 59, 92, .35); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .08); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .16); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 基础控件 ---------- */
button {
  font: inherit; font-size: .88em; color: var(--t1); background: transparent; border: 1px solid var(--hair2);
  border-radius: 8px; padding: 4px 12px; cursor: pointer; line-height: 1.5;
  transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease), color .16s;
}
button:hover { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .18); }
button:active { transform: scale(.97); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 59, 92, .28); }
button:disabled { opacity: .4; cursor: default; transform: none; }
button.pri { background: linear-gradient(135deg, var(--acc), var(--acc2)); border-color: transparent; color: #fff; font-weight: 600; }
button.pri:hover { box-shadow: 0 8px 20px -10px rgba(255, 59, 92, .9); }
button.danger { color: var(--high); border-color: rgba(255, 93, 108, .35); }
button.link { border: 0; color: var(--info); padding: 0 4px; }
button.link:hover { background: none; text-decoration: underline; }
button.x { border: 0; color: var(--t3); padding: 0 6px; font-size: 1.15em; line-height: 1; }
button.x:hover { color: var(--t1); background: none; }
input, select, textarea {
  font: inherit; font-size: .92em; color: var(--t1); background: var(--s2); border: 1px solid var(--hair2); border-radius: 8px; padding: 6px 10px;
  transition: border-color .16s var(--ease), box-shadow .2s var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 59, 92, .55); box-shadow: 0 0 0 3px rgba(255, 59, 92, .14); }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
input.num { width: 4.4em; text-align: center; padding: 4px 6px; }
input[type=range] { accent-color: var(--acc); }
input[type=checkbox] { accent-color: var(--acc); width: 15px; height: 15px; }
.s { color: var(--t3); font-size: .82em; margin: 4px 0; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
.ck { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: .9em; color: var(--t2); }

/* ---------- 框架 ---------- */
#app { display: flex; flex-direction: column; height: 100%; position: relative; overflow: hidden; }
#hd {
  padding: 10px 14px 8px; position: relative; z-index: 2;
  background: rgba(11, 12, 15, .78); backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--hair);
}
.row1 { display: flex; gap: 10px; align-items: center; }
.room { flex: 1; min-width: 0; font-weight: 600; font-size: 1.02em; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; gap: 10px; font-size: .72em; color: var(--t3); }
.st { display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: #4a4f59; transition: background .3s; }
.dot.ok { background: var(--ok); }
.dot.ok::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: pulse 2.4s var(--ease) infinite; }
.dot.warn { background: var(--mid); }
@keyframes pulse { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
.row2 { display: flex; gap: 14px; margin-top: 3px; font-size: .74em; color: var(--t3); }
#notices:empty { display: none; }
.notice {
  display: flex; gap: 8px; align-items: center; margin-top: 8px; padding: 6px 10px; border-radius: var(--r2); font-size: .82em; color: var(--t2);
  background: rgba(106, 163, 255, .08); border: 1px solid rgba(106, 163, 255, .16); animation: rise .32s var(--ease);
}
.notice::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--info); }
.notice.warn { background: rgba(242, 181, 75, .08); border-color: rgba(242, 181, 75, .2); }
.notice.warn::before { background: var(--mid); }
.notice span { flex: 1; }

#tabs { position: relative; display: flex; padding: 0 6px; border-bottom: 1px solid var(--hair); background: var(--bg); }
#tabs button { flex: 1; border: 0; border-radius: 0; padding: 9px 0 8px; color: var(--t3); font-size: .86em; background: none; }
#tabs button:hover { color: var(--t2); background: none; }
#tabs button.on { color: var(--t1); font-weight: 600; }
#tabs b {
  display: inline-block; min-width: 1.5em; margin-left: 4px; padding: 0 5px; border-radius: 999px; font-size: .74em; font-weight: 600; line-height: 1.55;
  background: rgba(255, 59, 92, .16); color: #ff7d93; vertical-align: 1px;
}
#tabs b:empty { display: none; }
#tabs b.pop { animation: pop .4s var(--spring); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
#ink { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; border-radius: 2px; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: transform .38s var(--spring), width .38s var(--spring); }
main { flex: 1; position: relative; overflow: hidden; }
.view { display: none; position: absolute; inset: 0; overflow-y: auto; padding: 12px; }
.view.on { display: block; animation: fade .24s var(--ease); }
#v-feed.on { display: flex; flex-direction: column; padding: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 56px 20px; animation: rise .4s var(--ease); }
.empty svg { width: 44px; height: 44px; stroke: var(--t3); opacity: .8; margin-bottom: 12px; }
.empty .t { font-size: .98em; margin: 0 0 6px; color: var(--t2); }
.empty .s { margin: 0 auto; max-width: 280px; line-height: 1.6; }

/* ---------- 待处理卡片 ---------- */
.qlist { display: flex; flex-direction: column; }
.qcard, .fcard {
  --c: var(--low);
  position: relative; background: var(--s1); border: 1px solid var(--hair); border-radius: var(--r3);
  padding: 11px 14px 11px 16px; margin-bottom: 10px;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.qcard::before, .fcard::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 0 2px 2px 0; background: var(--c); opacity: .9; }
.qcard.lv-high, .fcard.lv-high { --c: var(--high); }
.qcard.lv-mid, .fcard.lv-mid { --c: var(--mid); }
.qcard:hover { background: var(--s2); border-color: var(--hair2); }
.qcard.sel { border-color: rgba(255, 59, 92, .32); box-shadow: 0 0 0 3px rgba(255, 59, 92, .07); }
.qcard.enter { animation: rise .3s var(--ease); }
.qcard.leaving {
  overflow: hidden; opacity: 0; transform: translateX(14px); margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0;
  transition: height .26s var(--ease), opacity .2s var(--ease), transform .26s var(--ease), margin .26s var(--ease), padding .26s var(--ease);
}
.qcard.isdone, .fcard.isdone { opacity: .55; }
.qh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9em; }
.time { color: var(--t3); font-size: .78em; }
.nick { border: 0; padding: 0; color: var(--nick); font-weight: 600; font-size: 1em; border-radius: 4px; }
.nick:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.nick.plain { color: var(--t1); cursor: default; text-decoration: none; }
.who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 6px; font-size: 12px; line-height: 1.6; }
.who .nick.sm { font-size: 12px; font-weight: 500; }
.count { margin-left: auto; color: var(--mid); font-weight: 600; font-size: .86em; }
.count.bump { animation: pop .36s var(--spring); }
.badge { font-size: .72em; padding: 0 7px; border-radius: 999px; line-height: 1.7; }
.badge.sus { background: rgba(255, 93, 108, .12); color: #ff8b97; border: 1px solid rgba(255, 93, 108, .22); }
.badge.watch { background: rgba(106, 163, 255, .1); color: #94bcff; border: 1px solid rgba(106, 163, 255, .2); }
.qtext { margin: 6px 0 4px; word-break: break-all; font-size: .98em; }
.why { color: var(--t3); font-size: .8em; margin-top: 4px; line-height: 1.5; }
.qact { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.qact button { font-size: .8em; padding: 3px 11px; }
.qact .st { color: var(--t3); font-size: .8em; }

/* 标签：规则 = 柔和底色，模型 = 描边 + 小圆点 */
.chips { display: inline-flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.chip {
  --c: var(--low);
  display: inline-flex; align-items: center; gap: 4px; font-size: .72em; line-height: 1.7; padding: 0 8px; border-radius: 999px; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
}
.chip.lv-high { --c: var(--high); }
.chip.lv-mid { --c: var(--mid); }
.chip.lv-low { --c: #9aa0aa; }
.chip.model { background: transparent; border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.chip.model::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.ok { --c: var(--ok); background: transparent; }
.chip .x { color: inherit; padding: 0 0 0 2px; font-size: 1.1em; }
details.done { margin-top: 14px; }
details.done summary { color: var(--t3); cursor: pointer; font-size: .82em; margin-bottom: 8px; list-style: none; }
details.done summary::before { content: '›'; display: inline-block; margin-right: 6px; transition: transform .2s var(--ease); }
details.done[open] summary::before { transform: rotate(90deg); }

/* ---------- 全部弹幕 ---------- */
.feedbar { padding: 10px 12px; border-bottom: 1px solid var(--hair); }
.feedbar input { width: 100%; background: var(--s1); border-radius: 999px; padding: 6px 14px; }
#feed { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
#feed-resume {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; border: 0; border-radius: 999px; padding: 6px 16px;
  background: rgba(28, 31, 38, .92); backdrop-filter: blur(10px); color: var(--t1); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .8); animation: rise .28s var(--ease);
}
.frow { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--hair); flex-wrap: wrap; font-size: .92em; animation: drop .2s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-3px); } }
.frow .nick { font-weight: 500; }
.frow .txt { word-break: break-all; color: var(--t1); }
.frow.lv-high .txt { color: #ff98a2; }
.frow.lv-mid .txt { color: #f6cf85; }
.frow .sys { color: var(--t3); font-size: .9em; }
.frow .count { margin-left: 0; font-size: .8em; }

/* ---------- 吵架 ---------- */
.flines { margin: 8px 0 2px; display: flex; flex-direction: column; gap: 4px; }
.fl { font-size: .86em; padding: 5px 10px; border-radius: 10px; background: var(--s3); word-break: break-all; max-width: 92%; }
.fl.hostile { background: rgba(255, 93, 108, .1); }
.fl.right { margin-left: auto; }
.fl b { color: var(--nick); font-weight: 500; margin-right: 2px; }
.fl .time { margin-right: 6px; }
.vs { color: var(--t3); font-size: .8em; }

/* ---------- 投票 ---------- */
.vstart { animation: rise .3s var(--ease); }
.vstart .btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.vstart .btns button { padding: 12px 0; font-size: 1.02em; border-radius: var(--r2); }
.vopts { margin-top: 12px; font-size: .9em; color: var(--t2); }
.vopts .row { flex-wrap: wrap; }
.suggest {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: var(--r2); margin-bottom: 12px; font-size: .9em;
  background: rgba(106, 163, 255, .08); border: 1px solid rgba(106, 163, 255, .18); animation: rise .3s var(--ease);
}
.vres { background: var(--s1); border: 1px solid var(--hair); border-radius: var(--r3); padding: 12px 14px; margin-top: 12px; animation: rise .3s var(--ease); }
.vhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.bar { margin: 10px 0; }
.bl { display: flex; justify-content: space-between; align-items: baseline; font-size: .92em; }
.bl span { color: var(--t2); font-size: .9em; }
.bar.lead .bl b { color: #fff; }
.bt { height: 8px; background: var(--s3); border-radius: 999px; overflow: hidden; margin-top: 5px; }
.bf { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 59, 92, .55), rgba(255, 122, 89, .55)); transition: width .6s var(--ease); }
.bar.lead .bf { background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.vsum { color: var(--t3); font-size: .82em; margin: 8px 0; }
.warn { color: var(--mid); font-size: .84em; }
.vhist { font-size: .84em; margin: 6px 0; color: var(--t2); }

/* ---------- 设置 ---------- */
.card { background: var(--s1); border: 1px solid var(--hair); border-radius: var(--r3); padding: 12px 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: .78em; font-weight: 600; letter-spacing: .08em; color: var(--t2); }
.card h3 small { color: var(--t3); font-weight: normal; letter-spacing: 0; }
.kv { display: flex; gap: 12px; align-items: center; margin: 5px 0; font-size: .9em; }
.kv > span:first-child { color: var(--t3); min-width: 3.6em; }
.mlist { display: flex; flex-direction: column; }
.mrow { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: .92em; }
.mrow:last-child { border-bottom: 0; }
.mrow b { font-weight: 500; }
.mrow.off b { color: var(--t3); }
.mrow button { font-size: .8em; padding: 2px 10px; }
.sw { position: relative; display: inline-block; width: 34px; height: 20px; flex: none; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; background: #2b2f38; border-radius: 999px; cursor: pointer; transition: background .25s var(--ease); }
.sw i::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .3s var(--spring); }
.sw input:checked + i { background: var(--acc); }
.sw input:checked + i::before { transform: translateX(14px); }
.sw input:disabled + i { opacity: .45; cursor: default; }

/* ---------- 底部抽屉 ---------- */
#drawer { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(0, 0, 0, 0); backdrop-filter: blur(0); transition: background .3s var(--ease), backdrop-filter .3s var(--ease); }
#drawer[hidden] { display: none; }
#drawer.open { background: rgba(0, 0, 0, .5); backdrop-filter: blur(3px); }
.sheet { background: var(--s1); border-top: 1px solid var(--hair2); border-radius: 18px 18px 0 0; max-height: 86%; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .42s var(--spring); box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .7); }
#drawer.open .sheet { transform: none; }
.grab { width: 36px; height: 4px; border-radius: 4px; background: var(--hair2); margin: 8px auto 0; }
.dhead { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px 8px; font-size: .98em; }
.dbody { padding: 0 16px 18px; overflow-y: auto; }
.form label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: .82em; color: var(--t3); }
.form label.ck { flex-direction: row; color: var(--t2); margin: 6px 0; }
.form input[type=text], .form select { width: 100%; }
.nolist { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; }
.umsgs { max-height: 260px; overflow-y: auto; margin-top: 6px; }
.ucard textarea { margin: 10px 0; }

/* ---------- 激活 / 上锁 ---------- */
#lock { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 59, 92, .08), transparent 60%), var(--bg); }
#lock[hidden] { display: none; }
.lbox { width: 100%; max-width: 300px; text-align: center; display: flex; flex-direction: column; gap: 12px; animation: rise .5s var(--ease); }
.lbox h2 { margin: 4px 0 0; font-size: 1.15em; font-weight: 600; letter-spacing: .04em; }
.lbox .s { margin: 0 0 6px; line-height: 1.6; }
.logo { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 700;
  background: linear-gradient(145deg, var(--acc), var(--acc2)); box-shadow: 0 14px 30px -14px rgba(255, 59, 92, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.code { text-align: center; font-size: 1.1em; letter-spacing: .12em; text-transform: uppercase; padding: 10px; border-radius: 12px; }
.lbox button { padding: 9px 0; border-radius: 12px; font-size: .95em; }
.err { color: #ff8b97; min-height: 1.3em; margin: 0; font-size: .85em; }

.renew .no { font-size: 1.9em; font-weight: 700; letter-spacing: .2em; text-align: center; margin: 8px 0 12px; background: linear-gradient(135deg, #fff, #ffb3c0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qr { display: flex; gap: 12px; justify-content: center; margin: 8px 0; }
.qr figure { margin: 0; text-align: center; font-size: .82em; color: var(--t3); }
.qr img { width: 148px; height: 148px; object-fit: contain; background: #fff; border-radius: 12px; padding: 6px; }

/* ---------- 提示 ---------- */
#toast { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 20; }
.toast {
  padding: 8px 16px; border-radius: 999px; font-size: .86em; max-width: 88%; text-align: center;
  background: rgba(28, 31, 38, .94); backdrop-filter: blur(12px); border: 1px solid var(--hair2); box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .8);
  animation: toastIn .32s var(--spring);
}
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .22s var(--ease), transform .22s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
