/* ============================================================================
   机器人助手 样式

   这套版式针对「用户在手机上瞄一眼机器人在干嘛」这个场景做：
   一个侧边栏（手机上折成顶部条）+ 一个能一眼读完的详情页，少造卡片、少堆徽章。

   · 颜色：两组中性色 + 墨绿（在场/在线）+ 琥珀（待办/开局中）+ 陶土（危险）。
     不用蓝紫渐变、不用纯黑，深色是主场景（晚上挂着看），浅色只是同一套变量换值。
   · 字体：不引外链字体（中文用户首屏不该等 CDN，离线/被墙就废了），
     个性靠字号/字重/字距的对比和一个只在「id、房间号、日志」出现的等宽字体。
   · 记忆点只放一处：房间座位表（.seats）—— 圆桌 + 座位，和推理学院的实际座位对上。
     其余元素一律安静：细边框、几乎不用阴影、不做逐个淡入。
   ========================================================================== */

:root {
    /* 中性色：浅色主题 */
    --bg: #eef1ef;
    --bg-rail: #e7ebe8;
    --surface: #ffffff;
    --surface-2: #f6f8f7;
    --surface-3: #eff3f1;
    --line: #dde4e0;
    --line-strong: #c6d1cb;
    --text: #0e1613;
    --text-2: #4d5c56;
    --text-3: #7c8a84;
    --jade: #0f7a5e;
    --jade-soft: rgba(15, 122, 94, .09);
    --jade-line: rgba(15, 122, 94, .32);
    --on-jade: #ffffff;
    --amber: #9a5d09;
    --amber-soft: rgba(154, 93, 9, .1);
    --amber-line: rgba(154, 93, 9, .3);
    --clay: #b23a26;
    --clay-soft: rgba(178, 58, 38, .09);
    --clay-line: rgba(178, 58, 38, .28);
    --ring: rgba(15, 122, 94, .35);
    --shadow: 0 18px 40px -18px rgba(14, 22, 19, .35), 0 2px 8px rgba(14, 22, 19, .06);

    --radius-s: 6px;
    --radius: 10px;
    --radius-l: 14px;
    --ease: cubic-bezier(.2, .7, .3, 1);
    --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
        "Noto Sans CJK SC", sans-serif;
    --rail-w: 236px;
}

:root[data-theme="dark"] {
    --bg: #0b100f;
    --bg-rail: #0e1413;
    --surface: #121a18;
    --surface-2: #16201d;
    --surface-3: #1b2724;
    --line: #223029;
    --line-strong: #31423b;
    --text: #e8efec;
    --text-2: #a3b3ac;
    --text-3: #74847d;
    --jade: #4ad3ac;
    --jade-soft: rgba(74, 211, 172, .12);
    --jade-line: rgba(74, 211, 172, .34);
    --on-jade: #04201a;
    --amber: #e2a848;
    --amber-soft: rgba(226, 168, 72, .13);
    --amber-line: rgba(226, 168, 72, .34);
    --clay: #e47763;
    --clay-soft: rgba(228, 119, 99, .13);
    --clay-line: rgba(228, 119, 99, .34);
    --ring: rgba(74, 211, 172, .45);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8), 0 2px 10px rgba(0, 0, 0, .4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-3); }
.spacer { flex: 1; }
.ic { flex: none; vertical-align: -2px; }

:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
    border-radius: var(--radius-s);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    background-clip: padding-box;
    border: 3px solid transparent;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================== 按钮 ============================== */

.btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--text-3); }
.btn.primary {
    color: var(--on-jade);
    background: var(--jade);
    border-color: var(--jade);
    font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { color: var(--text-2); background: transparent; border-color: transparent; }
.btn.ghost:hover { color: var(--text); background: var(--surface-3); }
.btn.danger { color: var(--clay); border-color: var(--clay-line); }
.btn.danger:hover { color: var(--clay); background: var(--clay-soft); border-color: var(--clay); }
.btn.small { min-height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.wide { width: 100%; min-height: 40px; margin-top: 4px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--line-strong); }

/* ============================== 表单 ============================== */

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row > span { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.form-row input,
.form-row select,
textarea {
    width: 100%;
    padding: 9px 11px;
    font-size: 14px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.form-row input::placeholder,
textarea::placeholder { color: var(--text-3); }
.form-row input:focus,
.form-row select:focus,
textarea:focus {
    background: var(--surface);
    border-color: var(--jade);
    outline: none;
    box-shadow: 0 0 0 3px var(--jade-soft);
}
.err { min-height: 18px; font-size: 12.5px; color: var(--clay); }

/* 密码框右侧的小眼睛（按钮由 app.js 插进去，这里只负责样子） */
.pwd-field { position: relative; display: block; }
.pwd-field > input { padding-right: 38px; }
.pwd-eye {
    position: absolute;
    top: 50%;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--text-3);
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 5px;
    transform: translateY(-50%);
}
.pwd-eye:hover { color: var(--text); background: var(--surface-3); }
.pwd-eye .eye-on,
.pwd-eye .eye-off { display: inline-flex; }
.pwd-eye .eye-off { display: none; }
.pwd-eye[aria-pressed="true"] { color: var(--jade); }
.pwd-eye[aria-pressed="true"] .eye-on { display: none; }
.pwd-eye[aria-pressed="true"] .eye-off { display: inline-flex; }
.wide { width: 100%; }

/* ============================== 外壳 ============================== */

.app {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
}

.rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 14px 14px;
    background: var(--bg-rail);
    border-right: 1px solid var(--line);
}
.rail-brand { display: flex; align-items: center; gap: 9px; padding: 0 6px; }
.rail-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--jade);
    background: var(--jade-soft);
    border: 1px solid var(--jade-line);
    border-radius: 9px;
}
.rail-name { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 13.5px;
    color: var(--text-2);
    text-align: left;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: var(--radius-s);
    transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-item > svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-item:hover { color: var(--text); background: var(--surface-3); }
.nav-item.active {
    color: var(--jade);
    font-weight: 600;
    background: var(--jade-soft);
}
:root[data-theme="dark"] .nav-item.active { background: var(--surface-3); }

.rail-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.rail-status {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 6px;
    font-size: 12px;
    color: var(--text-2);
}
.rail-status .live-dot { display: inline-flex; align-items: center; gap: 6px; }
.rail-status .live-dot::before {
    width: 6px;
    height: 6px;
    content: "";
    background: var(--jade);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--jade-soft);
}
.rail-status.is-error .live-dot::before { background: var(--clay); box-shadow: 0 0 0 3px var(--clay-soft); }
.rail-sync {
    overflow: hidden;
    color: var(--text-3);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rail-account {
    overflow: hidden;
    padding: 0 6px;
    font-size: 12.5px;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rail-actions { display: flex; gap: 4px; }

.main {
    min-width: 0;
    overflow-y: auto;
    padding: 30px clamp(18px, 4vw, 44px) 56px;
}
.content { max-width: 1120px; margin: 0 auto; }
/* 每个视图自己出的页头（不再是外壳上的标题栏） */
.viewhead {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0 0 18px;
}
.viewhead h1 { font-size: 25px; letter-spacing: -.025em; }
.viewmeta { font-size: 13px; color: var(--text-3); }

/* ============================== 登录 ============================== */

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 64px clamp(32px, 6vw, 80px);
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 12% 8%, var(--jade-soft) 0%, transparent 58%),
        radial-gradient(90% 70% at 88% 92%, var(--amber-soft) 0%, transparent 62%),
        var(--bg-rail);
    border-right: 1px solid var(--line);
}
/* 点阵纹理：只用 CSS 渐变，不引图片 */
.auth-brand::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    background-image: radial-gradient(var(--line-strong) .7px, transparent .7px);
    background-size: 22px 22px;
    opacity: .28;
    mask-image: radial-gradient(80% 70% at 50% 40%, #000 20%, transparent 78%);
}
.auth-mark { color: var(--jade); }
.auth-brand h1 { position: relative; z-index: 1; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.035em; }
.auth-pitch {
    position: relative;
    z-index: 1;
    font-size: clamp(15px, 1.4vw, 18px);
    line-height: 1.7;
    color: var(--text-2);
}
.auth-points {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-3);
    list-style: none;
}
.auth-points li { display: flex; gap: 9px; }
.auth-points li::before {
    flex: none;
    width: 5px;
    height: 5px;
    margin-top: 8px;
    content: "";
    background: var(--jade);
    border-radius: 50%;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}
.auth-card { width: 100%; max-width: 360px; }

.tab-bar {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    padding: 3px;
    background: var(--surface-3);
    border-radius: 9px;
}
.tab-btn {
    flex: 1;
    padding: 7px 0;
    font-size: 13.5px;
    color: var(--text-2);
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 7px;
    transition: color .15s var(--ease), background .15s var(--ease);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); font-weight: 600; background: var(--surface); }
:root[data-theme="dark"] .tab-btn.active { background: var(--surface-2); }

.auth-form { display: flex; flex-direction: column; }
.form-note {
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-2);
}
.auth-form .hint,
.auth-card > .hint {
    margin-top: 14px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-3);
    text-align: center;
}
.auth-card > .hint { margin-top: 20px; }

/* ============================== 公告 ============================== */

.block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 10px;
}
.block-head h2 { font-size: 13px; font-weight: 600; color: var(--text-2); }
.block-head .muted { font-size: 12px; }

.notice-list { display: flex; flex-direction: column; margin-bottom: 26px; }
.notice {
    border-bottom: 1px solid var(--line);
}
.notice:first-child { border-top: 1px solid var(--line); }
.notice > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 2px;
    font-size: 13.5px;
    cursor: pointer;
    list-style: none;
    border-radius: var(--radius-s);
}
.notice > summary::-webkit-details-marker { display: none; }
.notice > summary:hover { color: var(--jade); }
.notice-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-date { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.notice-chev {
    flex: none;
    width: 16px;
    color: var(--text-3);
    text-align: center;
    transition: transform .2s var(--ease);
}
.notice[open] .notice-chev { transform: rotate(90deg); }
.notice-body {
    padding: 2px 2px 14px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-2);
    white-space: pre-wrap;
    overflow-wrap: break-word;
    animation: unfold .22s var(--ease);
}

/* 登录页上的窄版公告 */
.auth-announce {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.auth-announce h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
}
.auth-announce .notice { border-bottom: none; }
.auth-announce .notice:first-child { border-top: none; }
.auth-announce .notice > summary { padding: 6px 0; font-size: 13px; }
.auth-announce .notice-body { padding-bottom: 10px; font-size: 12.5px; }

/* ============================== 首页：概览 + 机器人 ============================== */

.home-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.summary {
    flex: 1;
    min-width: 240px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-2);
    letter-spacing: -.01em;
}
.summary b { font-weight: 600; color: var(--text); }
.summary .none { color: var(--text-3); }

.bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
    gap: 12px;
}

.bot-tile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 15px 13px;
    text-align: left;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    transition: border-color .16s var(--ease), transform .16s var(--ease), background .16s var(--ease);
}
.bot-tile:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}
.bot-tile.offline { background: var(--surface-2); }
.bot-tile.offline .tile-name { color: var(--text-2); }

.tile-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tile-name {
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile-id {
    flex: none;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--text-3);
}
/* 本地昵称（命令前缀点名用）：跟在名字后面的小字，长了就截断，别把名字挤掉 */
.tile-nick {
    flex: none;
    max-width: 6.5em;
    overflow: hidden;
    font-size: 11px;
    color: var(--text-3);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 0 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile-arrow {
    flex: none;
    margin-left: auto;
    color: var(--text-3);
    transition: transform .16s var(--ease), color .16s var(--ease);
}
.bot-tile:hover .tile-arrow { color: var(--jade); transform: translateX(2px); }
.tile-now {
    min-height: 20px;
    font-size: 13px;
    color: var(--text-2);
}
.tile-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 14px; }
.tile-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; }

/* 座位条：10 个小格代表一圈座位，填满的是有人坐 */
.seat-strip { display: flex; flex: none; gap: 3px; }
.seat-strip i {
    flex: none;
    width: 9px;
    height: 9px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    border-radius: 2px;
}
:root[data-theme="dark"] .seat-strip i { background: var(--surface-3); }
.seat-strip i.on { background: var(--jade); border-color: var(--jade); }
.seat-strip i.me { background: var(--amber); border-color: var(--amber); }
.seat-strip i.off { opacity: .5; }
/* 20 人房：格子小一号，一条仍能塞进卡片 */
.seat-strip.dense { gap: 2px; }
.seat-strip.dense i { width: 6px; height: 6px; }

/* ============================== 状态点 / 徽章 ============================== */

.dot {
    flex: none;
    width: 8px;
    height: 8px;
    background: var(--text-3);
    border-radius: 50%;
}
.dot.tone-ok { background: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft); }
.dot.tone-busy { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot.tone-bad { background: var(--clay); box-shadow: 0 0 0 3px var(--clay-soft); }
.dot.tone-muted { background: var(--text-3); opacity: .55; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1.5px 7px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-2);
    white-space: nowrap;
    background: var(--surface-3);
    border: 1px solid transparent;
    border-radius: 999px;
}
.badge.tone-ok { color: var(--jade); background: var(--jade-soft); border-color: var(--jade-line); }
.badge.tone-busy { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.badge.tone-bad { color: var(--clay); background: var(--clay-soft); border-color: var(--clay-line); }
.badge.tone-muted { color: var(--text-3); background: transparent; border-color: var(--line-strong); }
.badge.tone-info,
.badge.tone-game { color: var(--jade); background: var(--jade-soft); border-color: var(--jade-line); }
.badge.tone-crown { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.badge.tone-live {
    color: var(--on-jade);
    font-weight: 600;
    background: var(--jade);
    border-color: var(--jade);
}
.badge .badge-lock { margin-left: 1px; opacity: .85; }

/* ============================== 申请 ============================== */

.sub-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 30px 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}
.request-list { display: flex; flex-direction: column; gap: 8px; }
.request-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 11px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.request-main { flex: 1; min-width: 220px; }
.request-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; }
.request-sub { margin-top: 2px; font-size: 12px; color: var(--text-3); }
.request-err {
    margin-top: 5px;
    padding: 5px 9px;
    font-size: 12.5px;
    color: var(--clay);
    background: var(--clay-soft);
    border-radius: var(--radius-s);
}

/* 申请表单 / 反馈 / 注销这类窄表单页 */
.form-page { max-width: 560px; }
.form-page h2 { margin-bottom: 6px; font-size: 17px; }
.form-page .sub {
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-2);
}
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ============================== 详情页 ============================== */

.back-link { margin-bottom: 12px; }

.bot-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
}
.hero-id { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.hero-id .dot { width: 9px; height: 9px; }
.hero-name { font-size: 15px; font-weight: 600; }
.hero-nick {
    font-size: 11px;
    color: var(--text-3);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 0 4px;
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hero-id .mono { color: var(--text-3); font-size: 12px; }
.hero-now {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 13.5px;
    color: var(--text-2);
}
.hero-now .sep { color: var(--line-strong); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions .spacer { flex: 1; }

.cmd-strip {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.cmd-strip input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
}
.cmd-strip input:focus {
    background: var(--surface);
    border-color: var(--jade);
    outline: none;
    box-shadow: 0 0 0 3px var(--jade-soft);
}
.cmd-strip.offline { padding-top: 12px; font-size: 13px; }

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
    align-items: start;
}
.dcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.card {
    padding: 16px 18px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
}
.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.card-head h2 { font-size: 13px; font-weight: 600; color: var(--text-2); }
.card-head .extra { font-size: 12px; color: var(--text-3); }
.card-head .actions { display: flex; gap: 6px; margin-left: auto; }

/* 折叠：图标由 app.js 换，这里只负责收起 */
.sec.collapsed .card-body { display: none; }
.sec.collapsed .card-head { margin-bottom: 0; }
.sec-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: -4px 0 -4px -6px;
    padding: 4px 6px;
    cursor: pointer;
    background: none;
    border: none;
    border-radius: var(--radius-s);
}
.sec-toggle:hover h2 { color: var(--text); }
.sec-chev { display: inline-flex; color: var(--text-3); }

/* ---- 房间座位表（详情页的记忆点） ---- */
.seats-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.seats {
    position: relative;
    width: min(100%, 276px);
    aspect-ratio: 1 / 1;
    margin: 2px 0;
    --rad: 96px;
    --seat: 27px;
}
/* 13~20 人的房间：位子多一倍，点画小一点、半径放大一点，否则挨成一团 */
.seats.dense { --rad: 102px; --seat: 22px; }
.seats-ring {
    position: absolute;
    inset: 50% auto auto 50%;
    width: calc(var(--rad) * 2);
    height: calc(var(--rad) * 2);
    border: 1px dashed var(--line-strong);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.seats-center {
    position: absolute;
    inset: 50% auto auto 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 96px;
    aspect-ratio: 1 / 1;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.seats-center b { font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.seats-center span { font-size: 11px; color: var(--text-3); }

.seat {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--seat);
    height: var(--seat);
    font-family: var(--mono);
    font-size: clamp(8.5px, calc(var(--seat) * .4), 11px);
    color: var(--text-3);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 50%;
    transform:
        translate(-50%, -50%)
        rotate(var(--angle))
        translate(var(--rad))
        rotate(calc(-1 * var(--angle)));
}
.seat.is-on { color: var(--jade); background: var(--jade-soft); border-color: var(--jade-line); }
.seat.is-master:not(.is-me) { box-shadow: inset 0 0 0 1px var(--amber); }
.seat.is-me {
    color: var(--on-jade);
    font-weight: 600;
    background: var(--jade);
    border-color: var(--jade);
    box-shadow: 0 0 0 4px var(--jade-soft);
}
.seat.is-off { background: transparent; border-style: dashed; opacity: .8; }

.seat-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 2px 14px;
    width: 100%;
    list-style: none;
}
.seat-legend-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    font-size: 12.5px;
}
.seat-legend-row .seat-no {
    flex: none;
    width: 18px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    text-align: right;
}
.seat-legend-row .legend-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.legend-state { flex: none; font-size: 11.5px; color: var(--text-3); }
.seat-legend-row.is-me .legend-name { font-weight: 600; }
.tag {
    padding: 0 4px;
    font-size: 10px;
    font-style: normal;
    color: var(--text-3);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
}

.tree-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    font-size: 12.5px;
    color: var(--text-3);
}
.tree-row .badge { color: var(--text-2); }

/* ---- 基本信息（定义列表） ---- */
.fields {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px 14px;
    font-size: 13px;
}
.field-label { color: var(--text-3); white-space: nowrap; }
.field-value { min-width: 0; overflow-wrap: anywhere; }


/* ---- 正在播放 ---- */
.music-box { display: flex; flex-direction: column; gap: 8px; }
.music-name {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    font-size: 13.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.music-bar { height: 4px; overflow: hidden; background: var(--surface-3); border-radius: 2px; }
.music-fill { height: 100%; background: var(--jade); border-radius: 2px; transition: width .3s linear; }
.music-time {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--text-3);
}

/* ---- 权限 ---- */
.perm-add { display: flex; gap: 6px; }
.perm-add input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    font-size: 13px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
}
.perm-add input:focus { border-color: var(--jade); outline: none; box-shadow: 0 0 0 3px var(--jade-soft); }
.perm-add select {
    padding: 7px 8px;
    font-size: 12.5px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
}
.perm-hint { margin: 8px 0 12px; font-size: 12px; line-height: 1.6; }
.perm-list { display: flex; flex-direction: column; gap: 2px; }
.perm-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    margin: 0 -6px;
    border-radius: var(--radius-s);
}
.perm-row:hover { background: var(--surface-2); }
.perm-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.perm-level { display: inline-flex; flex: none; gap: 3px; }
.perm-level .btn { min-height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 999px; }
.perm-level .btn.active {
    color: var(--jade);
    font-weight: 600;
    background: var(--jade-soft);
    border-color: var(--jade-line);
}

/* ---- 日志 ---- */
.log-list {
    overflow-anchor: none;
    min-height: 180px;
    max-height: min(46vh, 460px);
    padding: 10px 12px;
    overflow: auto;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.75;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.log-line { display: block; white-space: pre-wrap; word-break: break-word; }
.log-time { margin-right: 8px; color: var(--text-3); font-size: 11px; }
.log-line.lv-warn { color: var(--amber); }
.log-line.lv-error { color: var(--clay); }
.log-line.lv-debug { color: var(--text-3); }
.log-count { display: block; margin-top: 10px; font-size: 12px; }

/* ---- 危险区 ---- */
.danger-zone { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.danger-zone h3 { margin-bottom: 6px; font-size: 13px; color: var(--clay); }
.danger-zone p { margin-bottom: 12px; font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.danger-zone .form-row { flex-direction: row; align-items: center; gap: 10px; }
.danger-zone .form-row > span { flex: none; width: 68px; }
.danger-zone .form-row input { flex: 1; }

/* ============================== 指令表 ============================== */

.cmd-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.cmd-toolbar .search {
    flex: 0 1 320px;
    min-width: 160px;
    padding: 8px 12px;
    font-size: 13.5px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
}
.cmd-toolbar .search:focus { border-color: var(--jade); outline: none; box-shadow: 0 0 0 3px var(--jade-soft); }
.cmd-hint { margin: -8px 0 18px; font-size: 12.5px; line-height: 1.6; }
.cmd-groups { display: flex; flex-direction: column; gap: 22px; }
.cmd-group-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    padding-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    border-bottom: 1px solid var(--line);
}
.cmd-group-title .muted { font-weight: 400; }
.cmd-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 2px;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
}
.cmd-row:last-child { border-bottom: none; }
.cmd-name { flex: none; min-width: 104px; font-weight: 600; }
.cmd-help { flex: 1; min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.cmd-alias { display: block; margin-top: 1px; font-size: 11.5px; color: var(--text-3); }
.cmd-row .badge { flex: none; }
.cmd-row.disabled .cmd-name,
.cmd-row.disabled .cmd-help { color: var(--text-3); }

/* ============================== 反馈 ============================== */

.feedback-page { max-width: 720px; }
.feedback-page h2 { margin-bottom: 6px; font-size: 17px; }
.feedback-page .sub { margin-bottom: 18px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.feedback-form textarea { min-height: 104px; resize: vertical; line-height: 1.7; }
.feedback-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 12px;
}
.feedback-list { display: flex; flex-direction: column; gap: 10px; }
.feedback-row {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.feedback-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-3);
}
.feedback-body {
    margin-top: 6px;
    font-size: 13.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}
.feedback-reply {
    margin-top: 10px;
    padding: 9px 11px;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    background: var(--jade-soft);
    border-left: 2px solid var(--jade);
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
}
.feedback-reply b { display: block; margin-bottom: 2px; font-size: 11.5px; color: var(--jade); }

/* 反馈附件：选文件那一行 / 待提交预览 / 已提交的展示 */
.feedback-attach {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.fb-attach-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.fb-attach {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
}
.fb-attach-thumb {
    flex: none;
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--surface-3);
}
.fb-attach-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}
.fb-attach-del {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: var(--text-3);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-s);
    cursor: pointer;
}
.fb-attach-del:hover { color: var(--clay); border-color: var(--clay-line); background: var(--clay-soft); }

/* 上传进度：细条 + 一行小字（第几个 / 百分比 / 压缩前后大小） */
.fb-progress { margin-top: 10px; }
.fb-progress-bar {
    height: 6px;
    overflow: hidden;
    background: var(--surface-3);
    border-radius: 999px;
}
.fb-progress-fill {
    height: 100%;
    width: 0;
    background: var(--jade);
    border-radius: 999px;
    transition: width .2s ease;
}
.fb-progress-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-3);
}

.feedback-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fb-media-link { display: block; line-height: 0; }
.fb-media {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 220px;
    border-radius: var(--radius-s);
    background: #000;
}
.fb-media-item { display: flex; flex-direction: column; gap: 3px; }
.fb-media-item .fb-media { width: 220px; max-height: 160px; }

/* ============================== 个人中心 ============================== */

.account-page { max-width: 480px; }
.account-page .fields { margin-bottom: 4px; }

/* ============================== 杂项 ============================== */

.empty {
    padding: 34px 20px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-3);
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}
.empty.small { padding: 16px 12px; font-size: 12.5px; border: none; }
.empty b { color: var(--text-2); }
/* 页级空态（列表页没有机器人）收窄，别横跨整个内容区 */
.page-empty { max-width: 560px; }

.notice-slot { margin-top: 4px; }
.notice-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.notice-badge {
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
}
.notice-badge.tone-busy { color: var(--amber); background: var(--amber-soft); }
.notice-badge.tone-ok { color: var(--jade); background: var(--jade-soft); }
.notice-badge.tone-bad { color: var(--clay); background: var(--clay-soft); }
.notice-text { font-size: 13px; line-height: 1.7; color: var(--text-2); }

/* ============================== 弹窗 / 轻提示 ============================== */

.dialog {
    position: fixed;
    inset: 0;
    width: min(380px, calc(100vw - 32px));
    height: fit-content;
    margin: auto;
    padding: 22px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(6, 12, 10, .55); backdrop-filter: blur(2px); }
.dialog h3 { font-size: 16px; }
.dialog p { margin: 8px 0 18px; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
#scanDialog { width: min(340px, calc(100vw - 32px)); text-align: center; }
/* 「更新授权」的密码弹窗：游戏ID 只读、一行密码、下面一句绿色说明（与真机截图同构） */
#pwdDialog { width: min(360px, calc(100vw - 32px)); }
#pwdDialog h3 { margin-bottom: 14px; }
.pwd-form .form-row { margin-bottom: 12px; }
.pwd-form .form-row input[readonly] { color: var(--text-2); background: var(--surface-2); }
.dialog .pwd-hint { margin: 2px 0 18px; font-size: 12.5px; font-weight: 600; text-align: center; color: var(--jade); }

/* 登录后的「最新公告」弹窗：正文可能很长（≤2000 字），超出就自己滚，别把按钮顶出屏幕 */
.notice-dialog { width: min(460px, calc(100vw - 32px)); }
.notice-dialog-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.notice-dialog-tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--amber); }
.notice-dialog h3 { font-size: 16.5px; line-height: 1.5; }
.notice-dialog-body {
    max-height: 46vh;
    margin-top: 8px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text-2);
    white-space: pre-wrap;
    overflow-wrap: break-word;
}
.notice-dialog .dialog-actions { margin-top: 16px; }
.scan-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    margin: 4px 0 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
}
.scan-box img { display: block; width: 240px; height: 240px; }
.scan-status { margin: 0 0 14px; font-size: 13px; color: var(--text-2); }
.scan-status.is-error { color: var(--clay); }

.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    z-index: 90;
    max-width: calc(100vw - 32px);
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    box-shadow: var(--shadow);
    transform: translateX(-50%);
    animation: toast-in .2s var(--ease);
}

/* ============================== 动效 ============================== */

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
}
@keyframes unfold {
    from { opacity: 0; }
}

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

/* ============================== 响应式 ============================== */

@media (max-width: 1080px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 卡片够宽时座位表和成员名单并排（跟视口断点不同：卡片在单栏布局下反而更宽） */
@media (min-width: 720px) {
    .seats-wrap {
        display: grid;
        grid-template-columns: 276px minmax(0, 1fr);
        align-items: center;
        column-gap: 20px;
    }
    .seats-wrap .seat-legend { align-self: start; }
    .seats-wrap .tree-row { grid-column: 1 / -1; margin-top: 4px; }
}

@media (max-width: 900px) {
    .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .rail {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 14px;
        padding: 10px 14px;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .rail-brand { padding: 0; }
    .rail-name { display: none; }
    .nav { flex-direction: row; flex: 1; gap: 2px; overflow-x: auto; }
    .nav-item { padding: 7px 9px; }
    .rail-foot {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin: 0;
    }
    .rail-account { display: none; }
    .rail-sync { display: none; }
    .main { padding: 20px 16px 48px; }
    .viewhead { margin-bottom: 16px; }
    .viewhead h1 { font-size: 21px; }

    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-brand {
        gap: 10px;
        padding: 34px 22px 26px;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .auth-brand h1 { font-size: 27px; }
    .auth-pitch { font-size: 14.5px; }
    .auth-points { display: none; }
    .auth-panel { padding: 26px 22px 40px; align-items: flex-start; }
    .auth-card { max-width: 100%; }
}

/* 超窄屏（≤360）：导航只留图标，文字交给 aria-label —— 四个中文标签放不下一行 */
@media (max-width: 360px) {
    .nav-item span { display: none; }
    .nav-item { padding: 9px 4px; }
}

@media (max-width: 640px) {
    .rail { padding: 10px 12px 8px; }
    .nav {
        order: 3;
        flex-basis: 100%;
        justify-content: space-between;
        gap: 4px;
        margin-top: 2px;
        padding-top: 6px;
        border-top: 1px solid var(--line);
    }
    .nav-item {
        flex: 1;
        justify-content: center;
        padding: 6px 2px;
        font-size: 12.5px;
        white-space: nowrap;
    }
    .nav-item > svg { width: 16px; height: 16px; }
    .rail-status .rail-sync { display: none; }
    .bot-grid { grid-template-columns: minmax(0, 1fr); }
    .seats { --rad: 88px; --seat: 25px; width: min(100%, 254px); }
    .seats.dense { --rad: 92px; --seat: 20px; }
    .seats-center { width: 88px; }
    .seats-center b { font-size: 16px; }
    .seat-legend { grid-template-columns: minmax(0, 1fr); }
    .cmd-row { flex-wrap: wrap; gap: 4px 8px; }
    .cmd-name { min-width: 0; }
    .cmd-help { flex-basis: 100%; }
    .fields { grid-template-columns: auto minmax(0, 1fr); font-size: 12.5px; }
    .danger-zone .form-row { flex-direction: column; align-items: stretch; gap: 6px; }
    .danger-zone .form-row > span { width: auto; }
}