/* ==========================================================================
   续火花控制台 · 共享设计系统
   被 static/index.html（用户控制台）与 static/admin.html（管理后台）共同引用。

   加载顺序：theme.css 在前，各页面的内联 <style> 在后。
   因此「页面级差异」仍可在内联里覆盖，但下面这些东西全站只有这一份：
     · 调色板 / 圆角 / 阴影 / 动效曲线等基准值
     · 基础层（背景环境光、滚动条、选中态、焦点环）
     · 共用组件（按钮、卡片、表格、芯片、提示条）
   改这里 = 两页一起变。新增颜色请先加令牌，不要在页面里写死色值。
   ========================================================================== */

/* ==========================================================================
   1. 设计令牌
   ========================================================================== */
:root {
  /* ---- 底色：由深到浅，越靠上越"浮" ---- */
  --bg: #0b0e14;
  --bg-deep: #070a0f;          /* 代码块 / 日志区：比页面底再暗一档 */
  --panel: #12161f;            /* 卡片 */
  --panel2: #181d29;           /* 卡片内的次级面 / 输入框 */
  --panel3: #1e2431;           /* 悬停态 / 强调面 */
  /* ★ 2026-10-17 加：渐变起点令牌。
     以前卡片/侧栏/弹窗都写死 `linear-gradient(180deg, #141924 …)`，
     切到浅色主题就变成"从深色渐变到白色" → 卡片顶部一条脏灰带、侧栏整块发黑。 */
  --panel-top: #141924;        /* 卡片 / 侧栏 */
  --panel-raise: #161b27;      /* 弹窗等"更高一层" */
  --panel-flat: #1a1f2b;       /* 无渐变的次级底（胶囊 / 无火花标签） */
  /* 顶栏毛玻璃（两页共用同一配方）：浅色下必须换成白玻璃，否则顶部一条深灰 */
  --glass-a: rgba(11, 14, 20, .94);
  --glass-b: rgba(11, 14, 20, .74);

  /* ---- 描边 ---- */
  --border: #232a3a;
  --border-strong: #333d52;

  /* ---- 文字 ---- */
  --text: #e6e9f0;
  --muted: #8b93a7;
  --dim: #5b6478;

  /* ---- 品牌主色（火苗橙） ---- */
  --accent: #ff7a45;
  --accent-2: #ff4d6d;
  --accent-soft: rgba(255, 122, 69, .14);
  --grad-accent: linear-gradient(135deg, #ff7a45, #ff5d5d);
  --grad-flame: linear-gradient(135deg, #ff7a45, #ff4d6d);

  /* ---- 语义色（配 soft 底色使用） ---- */
  --blue: #4c8dff;   --blue-soft: rgba(76, 141, 255, .14);
  --green: #3ecf8e;  --green-soft: rgba(62, 207, 142, .13);
  --red: #ff6b6b;    --red-soft: rgba(255, 107, 107, .13);
  --red-lite: #ff9a9a;
  --yellow: #ffd479; --yellow-soft: rgba(255, 212, 121, .13);
  --purple: #a78bfa; --purple-soft: rgba(167, 139, 250, .14);

  /* ---- 圆角：一套尺度，别在页面里临时写 11px / 13px ---- */
  --r-xs: 7px;
  --r-sm: 9px;
  --r-md: 11px;
  --r-lg: 14px;
  --r-xl: 18px;
  --radius: 16px;              /* 卡片基准 */
  --r-pill: 999px;

  /* ---- 阴影：三级 + 主色辉光 ---- */
  --sh-1: 0 1px 2px rgba(0, 0, 0, .28);
  --sh-2: 0 8px 24px rgba(0, 0, 0, .34);
  --sh-3: 0 20px 56px rgba(0, 0, 0, .5);
  --sh-glow: 0 8px 26px rgba(255, 122, 69, .28);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, .035);  /* 卡片顶面微高光 */

  /* ---- 动效 ---- */
  --t-fast: .14s;
  --t: .2s;
  --ease: cubic-bezier(.22, .9, .3, 1);

  /* ---- 布局 ---- */
  --sidebar-w: 228px;
  --topbar-h: 58px;

  /* ---- 层级契约（改动前先读：
         drawer 80/81 < 引导 340 < 公告 360/370 < 用户面板 400
         < 确认框 420 < 登录页 500 < #toasts 999
         规则：用户主动打开的层永远压住系统推送的层；
             用户操作的反馈（toast）永远最高，绝不能被任何弹层遮住。） ---- */
  --z-nav: 20;
  --z-sidebar: 30;   /* 后台侧栏；必须高于 body.sb-open::after 的 25，否则手机端抽屉会被遮罩盖住点不动 */
  --z-drawer: 80;
  --z-guide: 340;
  --z-subpanel: 400;
  --z-modal: 420;
  --z-auth: 500;
  --z-toast: 999;
}

/* ★ 2026-10-17 加：浅色主题令牌。
   默认（html 上没有 data-theme）= 深色；`html[data-theme="light"]` 时切浅色。
   「跟随系统」由 theme.js 读 prefers-color-scheme 后设置 data-theme 实现。
   ⚠️ 这里**只覆盖令牌**，组件样式全部走 var() → 两页自动跟着变。
   例外是"白色高光/阴影"这类硬编码：浅色下必须换成黑色系，否则整个界面发灰。 */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f6fa;
  --bg-deep: #e9edf4;
  --panel: #ffffff;
  --panel2: #f6f8fc;           /* 输入框 / 卡片内次级面 */
  --panel3: #e9eef7;           /* 悬停 / 强调面 */
  /* 浅色下这三个起点必须变成"白/浅灰"，否则渐变会从深色开始（整块发黑） */
  --panel-top: #ffffff;
  --panel-raise: #ffffff;
  --panel-flat: #eef2f8;
  --glass-a: rgba(255, 255, 255, .95);
  --glass-b: rgba(255, 255, 255, .78);

  --border: #dbe1ec;
  --border-strong: #c3cbdb;

  --text: #1a2030;
  --muted: #5b6577;
  --dim: #8a94a6;

  /* 主色在白底上要加深，否则对比度不够、看不清 */
  --accent: #e05a26;
  --accent-2: #d93b5a;
  --accent-soft: rgba(224, 90, 38, .11);
  --grad-accent: linear-gradient(135deg, #f0763f, #e8575a);
  --grad-flame: linear-gradient(135deg, #f0763f, #d93b5a);

  --blue: #2f6fe0;   --blue-soft: rgba(47, 111, 224, .11);
  --green: #1a9c6b;  --green-soft: rgba(26, 156, 107, .11);
  --red: #d93b4e;    --red-soft: rgba(217, 59, 78, .10);
  --red-lite: #b32b3c;
  --yellow: #a9761a; --yellow-soft: rgba(201, 143, 32, .14);
  --purple: #6d4fd0; --purple-soft: rgba(109, 79, 208, .11);

  --sh-1: 0 1px 2px rgba(20, 30, 50, .06);
  --sh-2: 0 8px 24px rgba(20, 30, 50, .08);
  --sh-3: 0 20px 56px rgba(20, 30, 50, .14);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, .9);
}

/* 浅色下的环境光要收敛：同样的橙色/蓝色透明度在浅底上会脏得发黄 */
html[data-theme="light"] body {
  background:
    radial-gradient(900px 560px at 10% -10%, rgba(255, 122, 69, .07), transparent 62%),
    radial-gradient(760px 480px at 102% -4%, rgba(76, 141, 255, .06), transparent 64%),
    radial-gradient(820px 520px at 50% 112%, rgba(167, 139, 250, .05), transparent 62%),
    var(--bg);
}

/* 浅色下的「组件级」修正 —— 这些地方历史上写死了深色，光换令牌盖不住 */
html[data-theme="light"] { scrollbar-color: #c3cbdb transparent; }

html[data-theme="light"] .toast {
  /* ⚠️ 原来是 rgba(24,29,41,.94) 深底 + color:var(--text)（浅色下是深色字）
     → **黑底黑字**，手机端完全看不清（用户 2026-10-18 反馈）。 */
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 10px 30px rgba(20, 30, 50, .16);
}
/* 浅底上深色遮罩会显得很脏，压淡一些 */
html[data-theme="light"] .modal-mask,
html[data-theme="light"] .subpanel-mask {
  background: rgba(20, 30, 50, .34);
}
/* 卡片/弹窗的阴影也要换（深色阴影在白底上像脏污） */
html[data-theme="light"] .card,
html[data-theme="light"] .modal,
html[data-theme="light"] .subpanel,
html[data-theme="light"] .auth-box {
  box-shadow: 0 1px 2px rgba(20, 30, 50, .05), 0 12px 34px rgba(20, 30, 50, .08);
}

/* ==========================================================================
   2. 基础层
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scrollbar-color: #2a3245 transparent;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;

  /* 环境光：左上火苗橙 / 右上冷蓝 / 底部品紫。
     纯 #0b0e14 会显得"死黑"且没层次，三层极淡的径向光让页面有纵深；
     fixed 让光晕钉在视口上，滚动时内容像"从光里滑过"。 */
  background:
    radial-gradient(900px 560px at 10% -10%, rgba(255, 122, 69, .10), transparent 62%),
    radial-gradient(760px 480px at 102% -4%, rgba(76, 141, 255, .085), transparent 64%),
    radial-gradient(820px 520px at 50% 112%, rgba(167, 139, 250, .07), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}

/* ---- 表单控件：全站唯一来源（2026-10-17 加） ----
   ⚠️ 之前 theme.css 里**根本没有 input 样式**：index.html 自己内联了一套，admin.html 没有
   → 后台的输入框落回浏览器默认的浅灰底，在深色页面上刺眼得离谱（用户反馈的正是这个）。
   ⚠️ 用 :where() 把优先级压到 0：页面内联样式（如 index.html 的 .ipt）仍然能覆盖它，
   只有"页面没定义"的地方（比如 admin.html）才由这里兜底 —— 所以不会破坏控制台已有外观。
   ⚠️ 刻意不含 checkbox/radio（两页各自做了自定义样式），避免把它们打回原生控件。 */
:where(input[type="text"], input[type="password"], input[type="email"],
       input[type="number"], input[type="time"], input[type="search"],
       input[type="url"], input[type="tel"], input:not([type]),
       textarea, select) {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
:where(textarea) { resize: vertical; min-height: 84px; }
:where(input, textarea)::placeholder { color: var(--dim); }
:where(input, textarea, select):focus {
  border-color: var(--accent);
  background: var(--panel3);
}
:where(input, textarea, select):disabled { opacity: .55; cursor: not-allowed; }

/* ==========================================================================
   ★ 2026-10-22 全局「弹性微缩触觉反馈」（用户指定的那个按钮动画）

   按下：scale(.96) + 轻微压暗，0.09s 跟上（要"跟手"，不能拖）
   释放：回弹到 1，用 cubic-bezier(.34, 1.56, .64, 1)
         —— 曲线的 y 峰值 1.56 > 1，所以会**先冲过 1 再落回**，这就是 Spring Overshoot。
   ⚠️ 纯 CSS，不用 JS：`:active` 时的 transition 负责"按下"，松开后回到基础规则、
      基础规则用的是回弹曲线，于是自动产生超调。
   ⚠️ 用 :where() 把优先级压到 0：任何页面里的具体按钮样式都能覆盖它。
   ⚠️ 刻意**不含** checkbox/radio（不是按压按钮）、也不含可拖拽的表格行。
   ========================================================================== */
:where(button, .btn, .seg-btn, .subpanel-close, .auth-close, .dv-btn,
       .sb-toggle, .chip[onclick], [role="button"], a[onclick]) {
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1),
              filter .18s var(--ease);
  transform-origin: center;
  -webkit-tap-highlight-color: transparent;
}
:where(button, .btn, .seg-btn, .subpanel-close, .auth-close, .dv-btn,
       .sb-toggle, .chip[onclick], [role="button"], a[onclick]):active {
  transform: scale(.96);
  filter: brightness(.93);
  transition: transform .085s cubic-bezier(.4, 0, .2, 1),
              filter .085s ease;
}
/* 禁用态不做缩放（点了没反应还抖一下，反而让人以为按到了） */
:where(button, .btn, .seg-btn, [role="button"]):disabled:active {
  transform: none;
  filter: none;
}
/* 尊重系统「减少动态效果」设置 —— 这类无障碍开关不能忽略 */
@media (prefers-reduced-motion: reduce) {
  :where(button, .btn, .seg-btn, .subpanel-close, .auth-close, .dv-btn,
         .sb-toggle, .chip[onclick], [role="button"], a[onclick]) {
    transition: none;
  }
  :where(button, .btn, .seg-btn, .subpanel-close, .auth-close, .dv-btn,
         .sb-toggle, .chip[onclick], [role="button"], a[onclick]):active {
    transform: none;
    filter: none;
  }
}

/* 滚动条：细、圆、悬停才亮起来 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2a3245; border-radius: var(--r-pill);
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #3b4863; background-clip: content-box; }

::selection { background: rgba(255, 122, 69, .32); color: #fff; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 键盘可访问性：全站统一的焦点环（鼠标点击不会触发）。
   ⚠️ 这里**不要**写 border-radius —— 那会把所有被聚焦元素的圆角改成 4px，
   按钮/输入框一点就"变形"（轮廓形状本来就会跟着元素圆角走，不需要代劳）。 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   3. 排版工具类
   ========================================================================== */
.mono { font-family: ui-monospace, Menlo, Consolas, "Cascadia Mono", monospace; }
.tnum { font-variant-numeric: tabular-nums; }        /* 数字等宽：数值跳动时不抖 */
.nowrap { white-space: nowrap; }
.dim { color: var(--dim); }
.sub-t { color: var(--muted); font-size: 12px; }

/* ==========================================================================
   4. 动效：关键帧 + 工具类
   ========================================================================== */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity: 0; } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(8px); } }
@keyframes panelIn { from { transform: translateX(26px); opacity: .35; } }
@keyframes popIn   { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
/* 骨架屏的"扫光"：比单纯忽明忽暗更像在加载 */
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
/* 状态点的呼吸圈 */
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(62, 207, 142, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(62, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}
/* 品牌火苗的"呼吸"：辉光极轻微地强弱变化。
   两页的 logo 共用这一份 —— 换页时品牌块是同一种律动。 */
@keyframes flamePulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255, 122, 69, .32), inset 0 1px 0 rgba(255, 255, 255, .2); }
  50%      { box-shadow: 0 5px 24px rgba(255, 122, 69, .58), inset 0 1px 0 rgba(255, 255, 255, .2); }
}

/* 页面入场：只挂在「不会被反复重建」的容器上（如 .wrap / #content），
   否则列表每次重渲染都会重播动画，看着像闪屏。 */
.fx-in   { animation: fadeUp .34s var(--ease) both; }
.fx-pop  { animation: popIn .28s var(--ease) both; }

/* ==========================================================================
   5. 按钮（全站唯一实现）
   ========================================================================== */
.btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
  font: 600 13px/1 inherit; white-space: nowrap; cursor: pointer; user-select: none;
  transition: transform .12s var(--ease), background var(--t), border-color var(--t),
              color var(--t), box-shadow var(--t), opacity var(--t);
}
.btn:hover:not(:disabled) { background: var(--panel3); border-color: var(--border-strong); box-shadow: var(--sh-1); }
.btn:active:not(:disabled) { transform: scale(.965); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
  background: var(--grad-accent); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(255, 105, 80, .28);
}
.btn.primary:hover:not(:disabled) {
  filter: brightness(1.07); box-shadow: 0 8px 22px rgba(255, 105, 80, .38);
}
.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--panel2); }
.btn.danger {
  background: var(--red-soft); border-color: rgba(255, 107, 107, .32); color: var(--red);
}
.btn.danger:hover:not(:disabled) { background: rgba(255, 107, 107, .2); border-color: rgba(255, 107, 107, .5); }
.btn.ok {
  background: var(--green-soft); border-color: rgba(62, 207, 142, .32); color: var(--green);
}
.btn.ok:hover:not(:disabled) { background: rgba(62, 207, 142, .2); border-color: rgba(62, 207, 142, .5); }

.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.xs { padding: 4px 9px; font-size: 11.5px; border-radius: var(--r-xs); gap: 5px; }
.btn.grow { flex: 1; }

/* 行内小转圈（也用于 .busy 的遮罩转圈） */
.btn .spin {
  width: 12px; height: 12px; border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}

/* ==========================================================================
   6. 卡片（全站唯一实现）
   ========================================================================== */
.card {
  position: relative;
  /* 顶面稍亮的渐变：让卡片有"被上方光照到"的体积感，比纯色面板精致 */
  background: linear-gradient(180deg, var(--panel-top) 0, var(--panel) 46%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--inset-top), var(--sh-1);
  transition: border-color var(--t);
}
/* 可点击的卡片（如反馈卡片、指标卡）加 .card.hov 才浮起，
   普通内容卡片保持静止，避免整页都在动。 */
.card.hov { cursor: pointer; }
.card.hov:hover { border-color: var(--border-strong); box-shadow: var(--inset-top), var(--sh-2); }

.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .sub { font-size: 11.5px; color: var(--dim); }
.card-head .sp { flex: 1; }
.card.flush { padding: 0; }
.card.flush .card-head { padding: 16px 18px 0; border-bottom: none; margin-bottom: 10px; }

/* ==========================================================================
   7. 芯片 / 胶囊（语义色变体）
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 9px; border-radius: var(--r-pill);
  border: 1px solid transparent; white-space: nowrap;
}
.chip.ok      { background: var(--green-soft);  color: var(--green);  border-color: rgba(62, 207, 142, .25); }
.chip.warn    { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(255, 212, 121, .25); }
.chip.err     { background: var(--red-soft);    color: var(--red);    border-color: rgba(255, 107, 107, .25); }
.chip.info    { background: var(--blue-soft);   color: var(--blue);   border-color: rgba(76, 141, 255, .25); }
.chip.neutral { background: var(--panel2);      color: var(--muted);  border-color: var(--border); }
.chip.accent  { background: var(--accent-soft); color: var(--accent); border-color: rgba(255, 122, 69, .25); }
.chip.purple  { background: var(--purple-soft); color: var(--purple); border-color: rgba(167, 139, 250, .25); }

/* ==========================================================================
   8. 表格（全站标准：一律 <table class="tbl"> 包在 .tbl-wrap 里）
   ★ 漏写 class="tbl" 的表格会退化成浏览器默认样式 ——
     没有内边距、没有行线，看上去"挤成一坨"却完全不报错。
   ========================================================================== */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .4px;
  color: var(--muted); padding: 9px 12px; white-space: nowrap;
  background: var(--panel2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
table.tbl th:first-child { border-top-left-radius: 10px; }
table.tbl th:last-child  { border-top-right-radius: 10px; }
table.tbl td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle; transition: box-shadow var(--t-fast);
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background var(--t-fast); }
table.tbl tbody tr:hover { background: var(--panel2); }
/* 悬停时左侧亮起一道主色短杠：一眼定位当前行 */
table.tbl tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
table.tbl .mono { font-size: 11.5px; color: var(--muted); }
table.tbl .acts { display: flex; gap: 6px; flex-wrap: wrap; }
/* 长文本单元格：单行省略，悬停看全文（配合 title） */
table.tbl td.frag { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 封禁倒计时：管理员最关心的信息，给它重量 */
table.tbl td.remain { color: var(--accent); font-weight: 600; }

/* ==========================================================================
   9. 提示条（toast）
   ★ 层级永远是全站最高（--z-toast）：用户的操作反馈绝不能被任何弹层遮住。
   ★ pointer-events:none：提示条是纯通知，绝不能"吃掉"底下的点击 ——
     右侧子面板（问题反馈等）打开时，右上角的提示条正压着面板的标签栏，
     没有这一条就会让「点提交没反应」（本项目的经典翻车点）。
   ========================================================================== */
#toasts {
  position: fixed; z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 9px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  max-width: min(380px, 86vw); padding: 11px 15px;
  background: rgba(24, 29, 41, .94); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-left: 3px solid var(--blue);
  border-radius: 12px; font-size: 13px; line-height: 1.5; color: var(--text);
  box-shadow: var(--sh-2); animation: toastIn .26s var(--ease);
}
.toast::before { content: "ⓘ"; flex: none; font-size: 14px; line-height: 1.45; color: var(--blue); }
.toast.ok  { border-left-color: var(--green); }
.toast.ok::before  { content: "✓"; color: var(--green); font-weight: 700; }
.toast.err { border-left-color: var(--red); }
.toast.err::before { content: "!"; color: var(--red); font-weight: 700; }
.toast.warn { border-left-color: var(--yellow); }
.toast.warn::before { content: "⚠"; color: var(--yellow); }

/* 宽屏下若右侧子面板打开（面板铺满右侧），把提示条让到左上角，
   避免它"贴脸"盖住面板的标签栏。窄屏由页面自己的媒体查询接管（整条通栏）。 */
@media (min-width: 641px) {
  body:has(.subpanel-mask) #toasts { right: auto; left: 20px; }
}

/* ==========================================================================
   10. 尊重系统「减弱动态效果」
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Workspace refresh: calm surfaces, clear hierarchy and touch-friendly controls. */
:root { --radius:14px; --sh-glow:0 4px 12px rgba(255,122,69,.12); --topbar-h:68px; }
:root[data-theme="light"] { --bg:#f5f6f8; --bg-deep:#eceef2; --border:#e4e7ec; --text:#242932; --muted:#667080; --dim:#727c8c; --accent:#c74c24; }
html body { background:var(--bg); line-height:1.55; }
body .topbar, body .main-top { background:var(--panel); box-shadow:none; backdrop-filter:none; }
body .wrap { max-width:1320px; padding:0 32px 64px; }
body .topbar { padding:0 32px; }
body .top-right { gap:10px; }
body .brand { letter-spacing:-.4px; }
body .brand .flame, body .sb-brand .logo, body .sys-ok::before { animation:none; box-shadow:none; }
body .brand .ver { border-left:1px solid var(--border); padding-left:10px; color:var(--muted); }
body .card, body .acc-card, body .auth-box, body .sidebar { background:var(--panel); box-shadow:0 2px 5px rgba(20,30,50,.025); }
html[data-theme="light"] body .card, html[data-theme="light"] body .auth-box { box-shadow:0 2px 6px rgba(20,30,50,.025); }
body .card { padding:22px; }
body .card.flush { padding:0; }
body .btn { box-shadow:none; min-height:38px; font-weight:550; }
body .btn:hover { transform:none; box-shadow:none; }
body .btn.sm { min-height:34px; }
body .btn.xs { min-height:28px; }
body .btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
body .btn.danger { background:var(--red-soft); color:var(--red); }
body .sec-head { margin:30px 0 16px; }
body .sec-head h2 { font-size:17px; letter-spacing:-.3px; }
body .sec-head h2::before { display:none; }
body .sec-head .sub { color:var(--muted); }
body .acc-grid { grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:16px; align-items:stretch; }
body .acc-card { padding:20px; display:flex; flex-direction:column; }
body .acc-card:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(20,30,50,.06); }
body .acc-card.active { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
body .acc-card.active::after { content:"当前账号"; top:auto; bottom:70px; right:18px; font-size:10px; box-shadow:none; border:none; padding:2px 7px; }
body .acc-head { margin-bottom:12px; }
body .acc-head-info { min-width:0; }
body .acc-name { font-size:15px; }
body .acc-stats { gap:8px; margin-top:8px; padding:14px 0; border-top:1px solid var(--border); }
body .acc-stats .kv { color:var(--muted); font-size:12px; }
body .acc-stats .kv b { font-size:13px; font-variant-numeric:tabular-nums; }
body .acc-foot { margin-top:auto; padding-top:14px; border-top:1px solid var(--border); }
body .snap-bar { background:var(--panel2); border:0; padding:8px; margin-bottom:14px; }
body .add-tile { appearance:none; font:inherit; color:var(--muted); background:transparent; border:1px dashed var(--border-strong); min-height:185px; border-radius:var(--radius); }
body .add-tile .plus { background:var(--panel2); border:1px solid var(--border); width:44px; height:44px; border-radius:12px; font-size:26px; display:grid; place-items:center; }
body .detail-grid { gap:20px; }
body .card-title { font-size:15px; padding-bottom:14px; border-bottom:1px solid var(--border); }
body .f-label { font-size:12px; letter-spacing:.3px; margin-top:22px; color:var(--muted); }
body .seg { padding:4px; background:var(--panel2); border:1px solid var(--border); border-radius:10px; }
body .seg button { min-height:34px; border-radius:7px; }
body .seg button.on { box-shadow:0 1px 4px rgba(0,0,0,.06); background:var(--panel); color:var(--accent); }
body .friends { background:var(--panel); }
body .fr-row { padding-top:13px; padding-bottom:13px; }
body .hist-list { gap:12px; }
body .ipt, body textarea, body select { font-family:inherit; }
body .modal, body .subpanel { background:var(--panel); }
body .sb-item { appearance:none; background:transparent; font-family:inherit; text-align:left; width:100%; min-height:42px; }
body .sb-item.on { background:var(--accent-soft); border-color:transparent; }
body .sb-item.on::before { box-shadow:none; }
body .sidebar { background:var(--panel); }
body .content { padding:28px 32px 60px; }
body .metric { background:var(--panel); box-shadow:none; border:1px solid var(--border); }
body .tbl th { background:var(--panel2); font-weight:550; }
body .tbl td { padding-top:15px; padding-bottom:15px; }
body .tbl-wrap { overflow-x:auto; }
.workspace-intro { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:38px 0 28px; }
.eyebrow { color:var(--accent); font-size:10px; font-weight:700; letter-spacing:2px; }
.workspace-intro h1 { font-size:28px; line-height:1.4; letter-spacing:-.9px; margin:9px 0; font-weight:650; }
.workspace-intro p { color:var(--muted); font-size:13px; }
.workspace-mark { font-size:34px; width:76px; height:76px; border:1px solid var(--border); border-radius:22px; display:grid; place-items:center; background:var(--panel); transform:rotate(-7deg); }
.workspace-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--border); border-radius:14px; background:var(--panel); overflow:hidden; }
.workspace-stat { padding:20px 24px; border-right:1px solid var(--border); display:flex; flex-direction:column; }
.workspace-stat:last-child { border-right:0; }
.workspace-stat>span { color:var(--muted); font-size:12px; }
.workspace-stat strong { font-size:30px; font-weight:650; letter-spacing:-1px; line-height:1.5; font-variant-numeric:tabular-nums; }
.workspace-stat.green strong { color:var(--green); }
.workspace-stat.orange strong { color:var(--accent); }
.workspace-stat small { color:var(--muted); font-size:11px; }
.account-tools { display:flex; align-items:center; flex-wrap:wrap; gap:14px; margin-bottom:18px; }
.account-search { display:flex; align-items:center; gap:10px; padding:0 13px; width:290px; min-height:40px; background:var(--panel); border:1px solid var(--border); border-radius:9px; }
.account-search>span { color:var(--muted); font-size:22px; }
.account-search input { background:transparent; border:0; outline:0; box-shadow:none; color:var(--text); min-width:0; width:100%; font:inherit; font-size:12px; padding:8px 0; }
.account-search:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.account-filters { display:flex; gap:4px; flex-wrap:wrap; }
.account-filters button { border:0; background:transparent; color:var(--muted); font:inherit; font-size:12px; border-radius:8px; padding:9px 13px; cursor:pointer; }
.account-filters button.on { background:var(--accent-soft); color:var(--accent); font-weight:650; }
.account-result { margin-left:auto; color:var(--muted); font-size:11px; }
body #authModal { background:var(--bg); overflow-y:auto; padding:64px 24px; }
body #authModal .auth-box { max-width:440px; padding:36px; border:1px solid var(--border); border-radius:20px; animation:none; }
.auth-brand { display:flex; align-items:center; gap:8px; font-size:15px; font-weight:650; margin-bottom:36px; }
.auth-brand>span:first-child { display:grid; place-items:center; width:32px; height:32px; background:var(--accent-soft); border-radius:10px; }
.auth-brand-tag { font-size:10px; font-weight:400; color:var(--muted); border-left:1px solid var(--border); padding-left:9px; margin-left:3px; }
body #authModal .auth-title { text-align:left; font-size:26px; margin:0 0 7px; letter-spacing:-.7px; }
.auth-subtitle { color:var(--muted); font-size:12px; margin-bottom:28px; }
body #authModal .auth-close { background:var(--panel); border:1px solid var(--border); }
body #authModal .ipt { min-height:44px; }
body #authModal .auth-err { color:var(--red); }
body .skel-card .skl { background:linear-gradient(90deg,var(--panel2) 25%,var(--panel3) 50%,var(--panel2) 75%); background-size:220% 100%; }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media(min-width:1100px) { body .detail-grid { grid-template-columns:minmax(0,1.35fr) minmax(340px,1fr); } }
@media(max-width:760px) {
  body .wrap { padding:0 18px 40px; }
  body .topbar { padding:0 16px; gap:8px; height:auto; min-height:60px; flex-wrap:wrap; }
  body .top-right { gap:5px; }
  body .brand .ver, body .sys-ok { display:none; }
  .workspace-intro { padding:25px 0 20px; gap:12px; }
  .workspace-intro h1 { font-size:22px; max-width:270px; }
  .workspace-intro p { font-size:12px; max-width:280px; }
  .workspace-mark { width:50px; height:50px; font-size:24px; flex-shrink:0; border-radius:16px; }
  .workspace-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workspace-stat { padding:16px 18px; }
  .workspace-stat:nth-child(2) { border-right:0; }
  .workspace-stat:nth-child(-n+2) { border-bottom:1px solid var(--border); }
  .workspace-stat strong { font-size:26px; }
  .account-tools { gap:10px; }
  .account-search { width:100%; min-height:44px; }
  .account-result { margin-left:0; }
  .account-filters { flex:1; }
  .account-filters button { padding:10px; }
  body .acc-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  body .acc-card { padding:16px; }
  body .acc-head { gap:9px; flex-wrap:wrap; }
  body .acc-head-line { flex-wrap:wrap; }
  body .acc-stats { display:flex; flex-direction:column; }
  body .acc-card.active::after { display:none; }
  body .acc-foot { flex-wrap:wrap; }
  body .acc-foot .btn { min-height:40px; }
  body .detail-grid { grid-template-columns:minmax(0,1fr); }
  body .card { padding:18px; min-width:0; }
  body .content { padding:22px 16px 40px; }
  body .btn { min-height:42px; }
  body .btn.sm { min-height:38px; }
  body .sec-head { flex-wrap:wrap; }
  body .sec-head .sub { width:100%; }
  body #authModal .auth-box { padding:28px 24px; }
  body #authModal { align-items:flex-start; }
}
@media(max-width:440px) { body .acc-grid { grid-template-columns:minmax(0,1fr); } body .acc-stats { display:grid; grid-template-columns:1fr 1fr; } .account-result { width:100%; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

body #detail { scroll-margin-top:90px; }
@media(max-width:640px) { body .menu-btn { display:inline-flex; } }
body.mobile .acc-grid .acc-card { display:flex; }
body.mobile .acc-grid .add-tile { display:flex; }
@media(max-width:1100px) and (min-width:761px) { body .brand .ver { display:none; } body .top-right { gap:5px; } body .sys-ok { display:none; } }

body .acc-card.active::after { display:none; }

.todo-row { display:flex; justify-content:space-between; align-items:center; gap:16px; width:100%; padding:14px 4px; border:0; background:transparent; color:var(--text); cursor:pointer; font:inherit; font-size:13px; text-align:left; }
.todo-row>span:last-child { color:var(--accent); white-space:nowrap; }
.sb-backdrop { display:none; }
@media(max-width:860px) {
 body.sb-open::after { display:none; }
 body.sb-open .sb-backdrop { display:block; position:fixed; inset:0; z-index:25; background:rgba(0,0,0,.4); border:0; width:100%; height:100%; cursor:pointer; }
 body .tbl-wrap .tbl { min-width:740px; }
 body .tbl-wrap::before { content:"左右滑动查看完整表格"; display:block; position:sticky; left:0; padding:8px 14px; color:var(--muted); font-size:11px; }
}

body .time-group, body #rsT, body #reT, body #ftT { display:inline-flex; align-items:center; gap:6px; }
body .time-row { gap:12px; }
body .time-row select.h-select { width:62px; min-width:62px; padding:8px; color-scheme:inherit; }
body .time-group>span { min-width:14px; }
