/* =========================================================================
   UWA Student Agent Center — 设计系统
   组件速查：
     布局    .page-head(.page-title .page-sub .page-actions)  .grid-2 .grid-3 .stack .row .spacer
     卡片    .card(.card-head h2 .card-actions)  .card.flat  .card.accent  .card.lift（可点：悬停浮起）
             标题图标块：<h2><span class="h-ico" data-icon="mail"></span>标题</h2>
     数字块  .stats > .stat(.stat-ico .stat-num .stat-label)  .stat.warn/.danger/.ok
             数字滚动：<b data-count="12.5" data-count-format="int|1|money|pct">0</b> + ui.countAll(容器)
     列表    .list > .item(.item-main .item-title .item-sub .item-side)  .item.clickable  .item.unread  .ico-tile（34px 图标块）
     标签    .chip(.on)  .badge(.red/.yellow/.green/.blue/.gray)  .light(.green/.yellow/.red/.grey)
     按钮    .btn(.primary/.ghost/.danger/.sm/.block)  .icon-btn  [data-busy] 自动转圈
     表单    .field > label + input/select/textarea  .field-row  .check
     其它    .tabs > button(.active)  .empty(.empty-ico .empty-text)  .skeleton  .progress > i  .muted .small .mono
     远程登录 RemoteLogin.mount(容器, {group, onSaved})（remote-login.js，样式 .rlm-*）
   JS 见 app.js：api.get/post/del、toast、drawer、esc、fmt.*、busy、ui.empty(文字, 图标名)、ui.count / countAll / countStop
   颜色、间距、圆角、阴影、动效时长与曲线的统一规范见 system.css 顶部。
   ========================================================================= */

:root {
  --bg: #f5f6f3; --panel: #ffffff; --panel-2: #f1f3ef; --panel-3: #e8ece5;
  --border: #e2e6de; --text: #252b26; --muted: #727a73; --faint: #9ba29b;
  --accent: #476653; --accent-2: #365440; --accent-bg: #e9efe6; --gold: #d9a521;
  --red: #e5484d; --red-bg: #fdecec; --yellow: #c98a00; --yellow-bg: #fdf5df;
  --green: #1f9d6b; --green-bg: #e5f6ee; --blue: #2f7ae5; --blue-bg: #e7f0fd;
  --shadow: 0 1px 2px rgba(20, 24, 50, .05), 0 4px 14px rgba(20, 24, 50, .05);
  --shadow-lg: 0 12px 40px rgba(20, 24, 50, .18);
  --radius: 14px; --radius-sm: 9px;
  --sidebar-w: 212px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121613; --panel: #1a1f1b; --panel-2: #232a24; --panel-3: #2d352e;
    --border: #333c34; --text: #e6eae4; --muted: #a2ada2; --faint: #758275;
    --accent: #acc4aa; --accent-2: #94b292; --accent-bg: #29382b; --gold: #f0c04a;
    --red: #ff6b70; --red-bg: #33181b; --yellow: #f2c14e; --yellow-bg: #2f2711;
    --green: #3ccf91; --green-bg: #12291f; --blue: #6aa8ff; --blue-bg: #15233a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121613; --panel: #1a1f1b; --panel-2: #232a24; --panel-3: #2d352e;
  --border: #333c34; --text: #e6eae4; --muted: #a2ada2; --faint: #758275;
  --accent: #acc4aa; --accent-2: #94b292; --accent-bg: #29382b; --gold: #f0c04a;
  --red: #ff6b70; --red-bg: #33181b; --yellow: #f2c14e; --yellow-bg: #2f2711;
  --green: #3ccf91; --green-bg: #12291f; --blue: #6aa8ff; --blue-bg: #15233a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.red { color: var(--red); } .green { color: var(--green); } .yellow { color: var(--yellow); }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.inline { display: inline; margin: 0; }

/* ---------- 外壳：侧边栏（桌面）/ 顶栏 + 底部 tab（手机） ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--panel);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 12px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: var(--accent); font-weight: 800; flex-shrink: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.devtag { background: var(--gold); color: #252b26; font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.side-nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--accent-bg); color: var(--accent); }
.side-nav .ico { width: 22px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; min-width: 18px; height: 18px;
  border-radius: 9px; display: inline-grid; place-items: center; padding: 0 5px; }
.side-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.side-foot .btn { justify-content: flex-start; width: 100%; }

.mobile-top { display: none; }
.tabbar { display: none; }
.main { margin-left: var(--sidebar-w); padding: 26px 32px 60px; max-width: calc(1180px + var(--sidebar-w)); }
.main.bare { margin: 0 auto; max-width: 100%; padding: 0; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-top { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between;
    padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--panel) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
  .mobile-top .brand { padding: 0; }
  .mobile-top-actions { display: flex; gap: 4px; }
  .main { margin-left: 0; padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: color-mix(in srgb, var(--panel) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px;
    font-size: 11px; color: var(--muted); background: none; border: none; font-family: inherit; cursor: pointer; }
  .tabbar a span, .tabbar button span { font-size: 20px; line-height: 1.1; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .active { color: var(--accent); }
}

/* 「更多」底部弹层 */
.sheet-backdrop, .drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 25, .45); z-index: 40; animation: fade .15s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--panel); border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: up .2s ease-out; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 14px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.more-grid a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 4px; border-radius: 12px;
  background: var(--panel-2); color: var(--text); font-size: 13px; }
.more-grid a span { font-size: 24px; }
.more-grid a:hover { text-decoration: none; }

/* ---------- 页面头 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: 24px; font-weight: 750; margin: 0; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 900px) { .page-title { font-size: 21px; } }

/* ---------- 网格 ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- 卡片 ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card, .grid-auto > .card + .card, .stack > .card + .card { margin-top: 0; }
.card.flat { box-shadow: none; }
.card.accent { background: var(--panel); }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 28px; }
.card-head h2 { font-size: 16px; margin: 0; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) { .card { padding: 15px; border-radius: 13px; } }

/* ---------- 数字块 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  color: var(--text); display: block; }
a.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat-num { font-size: 26px; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.danger .stat-num { color: var(--red); } .stat.warn .stat-num { color: var(--yellow); } .stat.ok .stat-num { color: var(--green); }
@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px 11px; border-radius: 12px; }
  .stat-num { font-size: 21px; }
  .stat-label { font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border); min-width: 0; }
.item:last-child { border-bottom: none; }
.item.clickable { cursor: pointer; border-radius: 8px; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.item.clickable:hover { background: var(--panel-2); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-side { flex-shrink: 0; text-align: right; font-size: 13px; color: var(--muted); }
.item.unread .item-title { font-weight: 700; }
.item.unread::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.item.urgent .item-title { color: var(--red); }
.item.done .item-title { text-decoration: line-through; color: var(--faint); }

/* ---------- 标签 / 徽章 / 状态灯 ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); font-size: 13px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { opacity: .75; font-size: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--panel-3); color: var(--muted); white-space: nowrap; }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.accent { background: var(--accent-bg); color: var(--accent); }
.light { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--faint); }
.light.green { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.light.yellow { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-bg); }
.light.red { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.light.grey { background: var(--faint); box-shadow: 0 0 0 3px var(--panel-3); }
.dot-badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* ---------- 按钮 ---------- */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; font-size: 14px; font-weight: 550;
  font-family: inherit; line-height: 1.3; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: var(--red-bg); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[data-busy] { opacity: .6; cursor: default; pointer-events: none; }
.btn[data-busy]::before { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: none;
  background: none; color: var(--text); cursor: pointer; font-size: 17px; }
.icon-btn:hover { background: var(--panel-2); text-decoration: none; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
input, select, textarea { width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 15px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.hint { font-size: 12px; color: var(--faint); }
.input-inline { display: flex; gap: 8px; }
.input-inline input { flex: 1; min-width: 0; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; background: var(--panel-2); border-radius: 11px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 6px 14px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 550;
  cursor: pointer; font-family: inherit; white-space: nowrap; }
.tabs button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* ---------- 横幅 / 提示 ---------- */
.banners:empty { display: none; }
.banners { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 15px; border-radius: 12px; border: 1px solid transparent; font-size: 14px; }
.banner.expired { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.banner.warn { background: var(--yellow-bg); border-color: color-mix(in srgb, var(--yellow) 40%, transparent); }
.banner.info { background: var(--blue-bg); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.banner .banner-text { font-weight: 550; flex: 1; min-width: 200px; }
.alert { padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-size: 14px; background: var(--panel-2); }
.alert.error { background: var(--red-bg); color: var(--red); }
.alert.ok { background: var(--green-bg); color: var(--green); }

/* ---------- 空状态 / 骨架 / 进度 ---------- */
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 14px; }
.empty .empty-ico { font-size: 30px; display: block; margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%); background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite; border-radius: 8px; height: 14px; margin: 10px 0; }
.skeleton.lg { height: 60px; }
.progress { height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; position: relative; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s; }
.progress.green > i { background: var(--green); } .progress.yellow > i { background: var(--yellow); } .progress.red > i { background: var(--red); }
.progress .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .55; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: none; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table input { padding: 5px 8px; font-size: 14px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: down .2s ease-out; max-width: 100%; }
.toast.error { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #fff; }

/* ---------- 抽屉（右侧，手机为底部全屏） ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); z-index: 41;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: left .2s ease-out; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }
@media (max-width: 640px) {
  .drawer { top: auto; height: 92vh; width: 100vw; border-radius: 18px 18px 0 0; animation: up .22s ease-out;
    padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- 富文本（报告 / 邮件正文 / Agent 卡片） ---------- */
.prose { line-height: 1.7; overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { margin: 1em 0 .5em; }
.prose table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--border); padding: 5px 8px; }
.prose img { max-width: 100%; }
.prose blockquote { margin: 8px 0; padding: 10px 14px; border-left: 3px solid var(--border); background: var(--panel-2); border-radius: 0 10px 10px 0; color: var(--muted); font-size: 14px; }
.prose h3 { font-size: 15px; margin: 18px 0 6px; }
.prose h3:first-child { margin-top: 0; }
.prose ol, .prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; }
.mailbody { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; background: var(--panel-2);
  border-radius: 10px; padding: 14px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--accent-bg), transparent), var(--bg); }
.login-card { width: min(380px, 100%); }
.login-card .brand { padding: 0 0 14px; font-size: 18px; }

/* ---------- 远程登录投屏（remote-login.js 的 RemoteLogin.mount，远程登录页和初始化向导共用） ---------- */
.rlm { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rlm-status { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2);
  font-size: 12.5px; line-height: 1.5; color: var(--text); transition: background .25s, color .25s; }
.rlm-status[data-tone="ok"] { background: var(--green-bg); color: var(--green); }
.rlm-status[data-tone="warn"] { background: var(--yellow-bg); color: var(--yellow); }
.rlm-status[data-tone="error"] { background: var(--red-bg); color: var(--red); }
.rlm-dot { position: relative; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--muted); transition: background .25s; }
.rlm-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: rlm-ping 1.6s cubic-bezier(.22,1,.36,1) infinite; }
.rlm-status[data-tone="ok"] .rlm-dot { background: var(--green); }
.rlm-status[data-tone="warn"] .rlm-dot { background: var(--yellow); }
.rlm-status[data-tone="error"] .rlm-dot { background: var(--red); }
.rlm-status[data-tone="error"] .rlm-dot::after, .rlm-status[data-tone="warn"] .rlm-dot::after { animation: none; }
.rlm-status-text { flex: 1; min-width: 0; }
.rlm-retry { flex-shrink: 0; }
.rlm-screen { position: relative; display: flex; justify-content: center; align-items: center; min-height: 160px; border-radius: 12px; overflow: hidden;
  background: #111214; border: 1px solid var(--border); transition: border-color .2s, box-shadow .2s; }
.rlm-screen:focus-within { border-color: color-mix(in srgb, var(--text) 42%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent); }
.rlm-canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: var(--rlm-max-h, none); outline: none; touch-action: none; cursor: default;
  opacity: 0; transition: opacity .35s; }
.rlm-screen.is-live .rlm-canvas { opacity: 1; }
.rlm-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: rgb(255 255 255 / .72); font-size: 13px; transition: opacity .35s; }
.rlm-screen.is-live .rlm-loading { opacity: 0; pointer-events: none; }
.rlm-spinner { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .16); border-top-color: rgb(255 255 255 / .85); animation: spin .8s linear infinite; }
.rlm-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rlm-type { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.rlm-type input { flex: 1; min-width: 0; }
.rlm-keys { display: flex; gap: 6px; flex-wrap: wrap; }
.rlm-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rlm-url { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes rlm-ping { 0% { transform: scale(1); opacity: .5; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
@media (max-width: 640px) {
  .rlm-type { min-width: 0; flex-basis: 100%; }
  .rlm-keys { flex: 1; } .rlm-keys .btn { flex: 1; }
  .rlm-foot .btn { flex: 1 1 100%; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes down { from { transform: translateY(-12px); opacity: 0; } }
@keyframes left { from { transform: translateX(30px); opacity: 0; } }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; }

/* Shared finishing: restrained typography, consistent focus and motion. */
.icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
.side-nav .ico { display: inline-flex; justify-content: center; }.side-nav .icon { width: 18px; height: 18px; }
.brand { font-size: 13px; letter-spacing: -.02em; padding-bottom: 28px; gap: 8px; }.brand-mark { width: 28px; height: 30px; border-radius: 7px; font-family: Georgia,serif; font-size: 22px; }
.side-nav a { font-size: 13px; padding: 10px 12px; transition: background .18s,color .18s; }.side-nav { gap: 4px; }
.side-foot { font-size: 12px; }.side-foot .icon { width: 16px; height: 16px; }
.main { padding: 36px 38px 60px; max-width: calc(1240px + var(--sidebar-w)); }.page-head { margin-bottom: 26px; }.page-title,.hello { font-weight: 600; letter-spacing: -.035em; }.page-sub { font-size: 13px; margin-top: 6px; }
.card { box-shadow: 0 1px 2px rgb(25 40 28 / .025); padding: 20px; }.card-head h2 { font-size: 14px; font-weight: 600; }.stat { box-shadow: none; padding: 19px 18px; min-width:0; overflow:hidden; }.stat-num { font-weight: 600; font-variant-numeric: tabular-nums; }.stat-label { font-size: 12px; margin-top: 8px; }
.btn,.icon-btn,.chip,.tabs button,.item.clickable,.set-nav a,.more-grid a { transition: background .18s,border-color .18s,color .18s,box-shadow .18s,transform .18s; }
.icon-btn:active { transform: scale(.93); }.btn:active { transform: translateY(1px) scale(.985); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input,select,textarea { transition: border-color .18s,box-shadow .18s,background .18s; }
.empty { padding: 32px 12px; line-height: 1.8; font-size: 13px; }.empty-ico { color: var(--faint); }.empty-ico .icon { width: 26px; height: 26px; }
.item { padding-top: 12px; padding-bottom: 12px; }.item-title { font-size: 14px; font-weight: 500; }.item-sub { font-size: 12px; margin-top: 3px; }
.progress>i,.gbar .sec,.gbar .rem,.cat-bar .fill { transform-origin: left; animation: grow-x .6s var(--ease); }.month-col .bar { transform-origin: bottom; animation: grow-y .6s var(--ease); }
.skip-link { position: fixed; left: 12px; top: -80px; padding: 10px 16px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; z-index: 100; }.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.brief-body.open { max-height: 8000px; }.todo-check { transition: background .2s,border-color .2s,color .2s,transform .2s; }.item.done .todo-check { background: var(--green); border-color: var(--green); color: #fff; transform: scale(.9); }
.set-nav a.active { color: var(--accent); background: var(--accent-bg); }.banner { font-size: 12px; }.banner .banner-text { font-weight: 450; }.banner .light { width: 6px; height: 6px; }
.chart-card,.card { transition: border-color .2s,box-shadow .2s; }.gcard:hover,.memo-card:hover { border-color: var(--faint); }
.exp-ico { font-size: 13px!important; font-weight: 550; color: var(--muted); }.rep-kind { color: var(--muted); }
.table tr { transition: background .15s; }.table tbody tr:hover { background: var(--panel-2); }
.chat-loading { padding: 30px 0; }
.expense-review-head { flex-wrap:wrap; }.expense-review-head input { width:140px;min-width:0;padding:5px 8px;font-size:12px; }
.timetable-nav { display:flex;align-items:center;gap:3px;margin:0 -4px 10px; }.timetable-nav input { padding:5px 7px;font-size:12px;width:142px;background:transparent;border:0; }.timetable-nav .icon-btn { width:27px;height:30px; }.timetable-nav .icon { width:15px; }
.pagination { display:flex;justify-content:space-between;align-items:center;gap:10px;padding-top:15px;border-top:1px solid var(--border);margin-top:14px; }.pagination .small { font-size:12px; }.expense-query { display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap; }.expense-query input[type=search] { flex:1;min-width:140px; }.expense-query input[type=month] { width:160px; }.compass-box { margin-top:18px;padding-top:18px;border-top:1px solid var(--border); }.compass-box h3 { font-size:14px;margin:0 0 10px; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } } @keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* Local entrance motion also works during redirect and conversation URL updates. */
@view-transition { navigation:none; }.main { animation:fade .22s var(--ease); }
@media(max-width:900px) { .main { padding: 22px 16px calc(84px + env(safe-area-inset-bottom)); }.page-head { margin-bottom: 20px; }.card { padding: 17px; }.mobile-top .brand { font-size: 13px; }.tabbar .icon { width: 21px; height: 21px; }.more-grid .icon { width: 24px; height: 24px; }.card-head h2 { font-size: 14px; } }
@media(max-width:520px) { .stat { padding: 13px 11px; }.stat-label { margin-top: 5px; }.stats { gap: 8px;grid-template-columns:repeat(3,minmax(0,1fr)); }#exp-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }#exp-stats .stat-num { font-size:20px; }#exp-stats .stat-label { white-space:normal; } }
html[data-motion="off"] { scroll-behavior: auto; } html[data-motion="off"]::view-transition-old(root),html[data-motion="off"]::view-transition-new(root) { animation: none; }
