/* ============================================================
   Personal Workbench — 「车站 · 到发时刻」· 二轮打磨版
   ------------------------------------------------------------
   THESIS: 个人工作台是一座自托管的小站——任务即车次，打卡即检票，
           今日焦点即到发时刻表。拒绝“灰底卡片 + 蓝色 SaaS”仪表盘。
   OWN-WORLD: 白天是印刷时刻表（奶油纸 + 石墨墨线 + 深琥珀车票），
           夜晚是候车厅翻牌屏（墨蓝黑板 + 翻牌琥珀数字 + 信号灯）。
           琥珀 = 唯一系统强调色；正点绿 / 晚点红 / 预警金取自站台信号。
           数据一律等宽数字。隐喻收敛：撕票虚线只出现在真正“撕票”的地方，
           普通卡片用干净 hairline + 克制的阴影。
   STORY: 每天进站：看一眼时刻表上的今日车次，检票完成事项，
           盖章打卡，正点出发。
   FIRST VIEWPORT: 墨色站牌侧栏 · 发车广播式欢迎语 · 四张车票形统计卡
           （staggered 入场）· 今日焦点 = 到发时刻表。
   FORM: 站台信息系统（assigned direction #7）
   FINISH: unreviewed and undocumented is unfinished; this build ends
           with the finish review, the verdict, and DESIGN.md
   ============================================================ */

:root {
  color-scheme: light;
  /* ---- 莫兰迪 Soft UI（治愈系习惯 App 风格）：灰蓝点状底 + 米白卡 + 低饱和 accent ----
     大圆角、轻阴影、圆润字体、emoji 图标，弱化严肃感。 */
  --bg:            #e6ebf0;   /* 亮模式：浅灰蓝底（毛玻璃卡透出纹理） */
  --card:          rgba(255, 255, 255, 0.62);   /* 亮模式：透明白玻璃卡 */
  --card2:         rgba(255, 255, 255, 0.45);   /* 内衬 */
  --ink:           #2b2f36;   /* 深字（浅底） */
  --ink-2:         #4a5058;   /* 次级字 */
  --muted:         #5f6771;   /* 说明文字（on card ≥4.5） */
  --muted-2:       #8a929c;   /* 占位/禁用 */
  --line:          rgba(43, 47, 54, 0.10);   /* hairline */
  --rule:          rgba(43, 47, 54, 0.20);   /* 强调分隔线 */
  --accent:        #b8946a;   /* 低饱和杏橙（柔和不刺眼） */
  --accent-strong: #8a6a45;   /* 加深一档：白字对比 4.9:1（原 #9c7a52 仅 3.95，WCAG AA 不达标） */
  --accent-hover:  #c4a37c;
  --accent-soft:   rgba(184, 148, 106, 0.15);
  /* 莫兰迪渐变与面板专用色（收敛硬编码） */
  --hero-a:        #c4a37c;
  --hero-b:        #b8946a;
  --brand-a:       #c4a37c;
  --rail-light:    #e2e7eb;
  --rail-dark:     #171b20;
  --primary:       #2b2f36;
  --danger:        #f0836a;   /* 参考图珊瑚红 */
  --warn:          #e8b45a;   /* 参考图金 */
  --ok:            #aec98a;   /* 参考图黄绿 */
  --purple:        #8fa3c4;   /* 参考图靛蓝 */
  --rise:          #f0836a;   /* 涨 = 红 */
  --fall:          #aec98a;   /* 跌 = 绿 */
  /* 阴影：轻柔 Soft UI（莫兰迪 tinted） */
  --shadow-sm: 0 1px 3px rgba(43, 47, 54, 0.08);
  --shadow-md: 0 4px 14px rgba(43, 47, 54, 0.08), 0 10px 26px -14px rgba(43, 47, 54, 0.16);
  --shadow-lg: 0 6px 18px rgba(43, 47, 54, 0.1), 0 28px 64px -28px rgba(43, 47, 54, 0.3);
  --card-lit:      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --grain:         0;         /* 点状纹理在 body 单独加 */
  /* radius tiers：超大圆角（Soft UI 标志） */
  --radius-xs:     12px;
  --radius-sm:     14px;
  --radius:        22px;
  --radius-lg:     32px;
  --radius-pill:   999px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: Georgia, "Songti SC", "Noto Serif SC", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Sarasa Mono SC", monospace;
}

[data-theme="dark"], [data-theme="midnight"] {
  color-scheme: dark;
  /* ---- 莫兰迪 Soft UI · dark：深夜灰蓝 + 莫兰迪暖橙 ---- */
  --bg:            #1c2025;   /* 深夜灰蓝（点状纹理叠加） */
  --card:          #262b31;   /* 深米灰卡 */
  --card2:         #2f353c;   /* 内衬 */
  --ink:           #eef0f3;   /* ink-1 */
  --ink-2:         #c2c7ce;   /* ink-2 */
  --muted:         #9298a1;   /* ink-3（400 级） */
  --muted-2:       #7a808a;
  --line:          rgba(255, 255, 255, 0.09);  /* hairline */
  --rule:          rgba(255, 255, 255, 0.18);
  --accent:        #d4ab82;   /* 柔和米橙（dark） */
  --accent-strong: #c0936a;
  --accent-hover:  #ddb795;
  --accent-soft:   rgba(212, 171, 130, 0.16);
  --primary:       #eef0f3;
  --danger:        #f0836a;   /* 珊瑚红提亮 */
  --warn:          #f2c56b;   /* 金提亮 */
  --ok:            #aec98a;   /* 黄绿提亮 */
  --rise:          #f0645c;   /* 涨 = 红 */
  --fall:          #9cb89a;   /* 跌 = 绿 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.32), 0 10px 26px -14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.38), 0 28px 64px -28px rgba(0, 0, 0, 0.6);
  --card-lit:      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --grain:         0;
}

/* ---- 多主题扩展：forest = 森林绿（明色纸感） ---- */
[data-theme="forest"] {
  --bg:            #f0f4ea;   /* 浅松纸面 */
  --card:          #fafcf5;   /* 米白车票 */
  --card2:         #e4ecda;   /* 票根内衬 */
  --ink:           #1c2618;   /* 深墨绿 */
  --ink-2:         #3d4a37;
  --muted:         #5a6b52;
  --muted-2:       #6d7d66;
  --line:          #d6e0ca;
  --rule:          #b6c7a4;
  --accent:        #3e7d4a;   /* 松针绿（链接/焦点） */
  --accent-strong: #2f6438;   /* 深松绿（按钮底） */
  --accent-hover:  #285432;
  --accent-soft:   rgba(62, 125, 74, 0.12);
  --primary:       #1c2618;
  --danger:        #b3382c;
  --warn:          #8a6710;
  --ok:            #2e7d4f;
  --purple:        #7b5ab0;
  --rise:          #b3382c;
  --fall:          #2e7d4f;
  --shadow-sm: 0 1px 3px rgba(40, 70, 40, 0.09);
  --shadow-md: 0 2px 6px rgba(40, 70, 40, 0.07), 0 12px 28px -16px rgba(40, 70, 40, 0.18);
  --shadow-lg: 0 4px 10px rgba(40, 70, 40, 0.08), 0 24px 48px -22px rgba(40, 70, 40, 0.32);
  --card-lit:      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --grain:         0.5;
}

/* ---- 多主题扩展：midnight = 深夜蓝（暗色） ---- */
[data-theme="midnight"] {
  --bg:            #0a0e17;   /* 深蓝夜 */
  --card:          #131a2a;
  --card2:         #1c2436;
  --ink:           #e6eaf2;
  --ink-2:         #c3cad6;
  --muted:         #8f9bb0;
  --muted-2:       #748099;
  --line:          #243046;
  --rule:          #35445e;
  --accent:        #7fb2ff;   /* 星夜蓝 */
  --accent-strong: #5f93e8;
  --accent-hover:  #a3c6ff;
  --accent-soft:   rgba(127, 178, 255, 0.14);
  --primary:       #e6eaf2;
  --danger:        #e05a54;
  --warn:          #e0b64c;
  --ok:            #5cbf85;
  --purple:        #a58bdc;
  --rise:          #e05a54;
  --fall:          #5cbf85;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.45), 0 14px 30px -18px rgba(0, 0, 0, 0.62);
  --shadow-lg: 0 6px 14px rgba(0, 0, 0, 0.48), 0 30px 60px -24px rgba(0, 0, 0, 0.72);
  --card-lit:      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --grain:         0.35;
}

/* ---- 多主题扩展：terminal = 老式终端（纯黑 + 荧光绿 + 全站等宽 + 直角无阴影） ---- */
[data-theme="terminal"] {
  color-scheme: dark;
  --bg:            #050505;   /* 纯黑屏 */
  --card:          #0d0d0d;   /* 近黑面板 */
  --card2:         #161616;
  --ink:           #c9ffd1;   /* 荧光白绿 */
  --ink-2:         #8fbf9a;
  --muted:         #5a8f66;
  --muted-2:       #3f6b4b;
  --line:          #1c3324;   /* 深绿描边 */
  --rule:          #2c5c37;
  --accent:        #33ff66;   /* 荧光绿（一切强调） */
  --accent-strong: #22d457;
  --accent-hover:  #5eff8b;
  --accent-soft:   rgba(51, 255, 102, 0.12);
  --primary:       #c9ffd1;
  --danger:        #ff5c5c;
  --warn:          #ffc44d;
  --ok:            #33ff66;
  --purple:        #b066ff;
  --rise:          #ff5c5c;
  --fall:          #33ff66;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --card-lit: none;
  --grain:         0;         /* 去纸纹（终端无颗粒） */
  --sans: ui-monospace, "Cascadia Mono", Consolas, "Sarasa Mono SC", "Courier New", monospace;
  --serif: var(--sans);
  --radius-xs: 0;
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --radius-pill: 0;           /* 全直角 */
}

/* ---- 多主题扩展：newsprint = 报纸排版（米黄纸 + 纯黑墨 + 全站衬线 + 直角无彩） ---- */
[data-theme="newsprint"] {
  --bg:            #f4eedd;   /* 旧报纸米黄 */
  --card:          #fbf7ec;   /* 报面 */
  --card2:         #ece4cf;
  --ink:           #16130f;   /* 纯黑墨 */
  --ink-2:         #2e2a23;
  --muted:         #5c5549;
  --muted-2:       #6f6759;
  --line:          #d9d0ba;
  --rule:          #a89e86;
  --accent:        #16130f;   /* 强调=墨黑（报纸无彩色强调） */
  --accent-strong: #201c16;
  --accent-hover:  #3a342a;
  --accent-soft:   rgba(22, 19, 15, 0.07);
  --primary:       #16130f;
  --danger:        #8c1f1f;   /* 报头深红 */
  --warn:          #6e5600;
  --ok:            #1d5c33;
  --purple:        #4a3a6b;
  --rise:          #8c1f1f;
  --fall:          #1d5c33;
  --shadow-sm: none;
  --shadow-md: 0 1px 0 rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 2px 0 rgba(0, 0, 0, 0.05);
  --card-lit: none;
  --grain:         0.55;      /* 增强纸纹 */
  --sans: Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --serif: Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --radius-xs: 0;
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --radius-pill: 0;
}

/* ---- 打工小账本主题：mint（明）—— 米黄纸底 + 深绿字 + 三色大卡 ----
   对应参考图（ref-1）：背景米黄 #F5F2E5 + 极淡绿点纹理；卡=薄荷绿/浅粉/奶油黄；
   主字墨绿 #1F4D3A；强调橙黄 #E89F2A（橙色"！"提示条）。
   这是形态级：3 张大色卡 + 插画位 + 顶部提醒条 + 大标语。 */
[data-theme="mint"] {
  /* v96：记账 App 质感 —— 米黄纸 + 奶油白卡 + 薄荷绿细描线 */
  --bg:            #F4EFE2;   /* 暖米黄纸 */
  --card:          #FBF7EC;   /* 奶油白卡 */
  --card2:         #F0EAD8;   /* 内衬米色 */
  --ink:           #2D4A3E;   /* 深森绿主字（低饱和） */
  --ink-2:         #4F6B5E;
  --muted:         #6F6B58;   /* 暖灰副文（提深：原 #8B8772 对米黄底仅 3.15:1，现 ≥4.5） */
  --muted-2:       #A8A48F;
  --line:          #E5DFCB;   /* 浅米描边 */
  --rule:          #C7C0A6;
  --accent:        #4A8C6E;   /* 薄荷绿强调（低饱和） */
  --accent-strong: #356E55;
  --accent-hover:  #3F7A60;
  --accent-soft:   rgba(74, 140, 110, 0.10);
  --primary:       #2D4A3E;
  --danger:        #B65747;
  --warn:          #B8902C;
  --ok:            #4A8C6E;
  --purple:        #6B6F8E;
  --rise:          #B65747;
  --fall:          #4A8C6E;
  --shadow-sm: 0 1px 2px rgba(80, 60, 30, 0.04);
  --shadow-md: 0 2px 8px rgba(80, 60, 30, 0.04), 0 10px 24px -16px rgba(80, 60, 30, 0.10);
  --shadow-lg: 0 4px 10px rgba(80, 60, 30, 0.05), 0 24px 48px -22px rgba(80, 60, 30, 0.16);
  --card-lit:      inset 0 1px 0 rgba(255, 255, 255, 0.55);
  --grain:         0;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
/* mint 背景：米黄 + 极淡圆点纹理（柔和记账本） */
[data-theme="mint"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(74, 140, 110, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0;
}

/* ---- 奶系绿主题：mint-dark（暗）—— 深森林 + 圆角 + 柔和投影 ---- */
[data-theme="mint-dark"] {
  color-scheme: dark;
  --bg:            #1B2A24;
  --card:          #243730;
  --card2:         #2E4239;
  --ink:           #DDE6D9;
  --ink-2:         #B8C8B3;
  --muted:         #93A691;   /* 提亮一档：原 #889A85 对卡底 4.21:1，现 ≥4.8 */
  --muted-2:       #6F8071;
  --line:          #384B41;
  --rule:          #506656;
  --accent:        #82C19A;   /* 暗下嫩芽绿（提亮） */
  --accent-strong: #5BA37B;
  --accent-hover:  #9CD2B1;
  --accent-soft:   rgba(130, 193, 154, 0.15);
  --primary:       #DDE6D9;
  --danger:        #E67864;
  --warn:          #E0B863;
  --ok:            #82C19A;
  --purple:        #B19CDF;
  --rise:          #E67864;
  --fall:          #82C19A;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.32), 0 12px 28px -16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.35), 0 24px 48px -22px rgba(0, 0, 0, 0.55);
  --card-lit:      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --grain:         0.12;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* 全局兜底：作者样式可能覆盖 UA 的 [hidden]，强制显式隐藏（AGENTS.md 已知坑） */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
/* 触控元素禁用双击缩放，点击响应更快 */
a, button, input, select, textarea, label, .item, .cal-cell, .heat-cell { touch-action: manipulation; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(255, 106, 61, 0.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "kern" 1, "tnum" 0;
  letter-spacing: -0.005em;
}
/* 终端主题：去掉琥珀光晕 + 关掉抗锯齿（CRT 扫描线下方叠加） */
[data-theme="terminal"] body {
  background: var(--bg);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}
/* 纸纹噪点：极淡的印刷颗粒覆盖全页（含卡片表面），让纸面有“触感” */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 99998; pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* 终端主题：CRT 扫描线 */
[data-theme="terminal"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 99997; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
}
button { font-family: inherit; letter-spacing: inherit; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: #fff; }
[data-theme="dark"] ::selection, [data-theme="midnight"] ::selection { background: var(--accent); color: #161006; }

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

/* 滚动条：站台细轨 */
* { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* 数据一律等宽数字 */
.tabular, .stat .s-val, .count, .mini-bar-lab, .cal-title, .progress-top,
.item .meta, .hero-date, .streak, .tab-cnt, .news-src-upd, .d-num, .d-more,
.tx-item .tx-amt, .tx-card b, .tx-cal-in, .tx-cal-out, .tx-day-head,
.tx-year-table, .stk-table, .gk-target-day, .gk-target-date, .file-meta,
.tx-total-val, .tx-filter-sum, .tx-page-info {
  font-variant-numeric: tabular-nums;
}

/* ============ 布局 ============ */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ---------- 侧栏：墨色站牌 ---------- */
.sidebar {
  width: 236px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--ink);
  color: var(--bg);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  overflow-y: auto;
}
[data-theme="dark"] .sidebar, [data-theme="midnight"] .sidebar { background: #0e151b; }
/* 终端主题：侧栏=纯黑 CRT 面板，品牌字=荧光绿 */
[data-theme="terminal"] .sidebar { background: #050505; }
/* 侧栏品牌文字：固定亮色，避免跟随 --bg 翻牌（dark/midnight 下 --bg 变深，品牌名会贴底不可见） */
[data-theme="dark"] .brand-txt, [data-theme="midnight"] .brand-txt { color: #e9e7dc; }
[data-theme="terminal"] .brand-txt { color: #33ff66; }
[data-theme="terminal"] .brand-txt small { color: #33ff66; opacity: 0.7; }
/* 奶系绿主题：品牌 logo 用嫩芽绿渐变，文字跟随 --ink（已是深森绿，自然清晰） */
[data-theme="mint"] .brand-ic { background: linear-gradient(135deg, #82C19A, #5BA37B); color: #1B2A24; }
[data-theme="mint-dark"] .brand-ic { background: linear-gradient(135deg, #82C19A, #5BA37B); color: #1B2A24; }
[data-theme="mint"] .login-logo, [data-theme="mint-dark"] .login-logo { background: linear-gradient(135deg, #82C19A, #5BA37B); color: #1B2A24; }
.sidebar::after {
  /* 站牌底部打孔线 */
  content: ""; display: block; flex-shrink: 0;
  margin: 14px 10px 2px; border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 24px;
  position: relative;
}
.brand-ic {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-a), var(--accent));
  color: #fff;
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .brand-ic, [data-theme="midnight"] .brand-ic { background: linear-gradient(135deg, var(--accent-hover), var(--accent)); color: #fff; }
.brand-ic svg { width: 18px; height: 18px; }
.brand-txt {
  font-weight: 800; font-size: 15px;
  letter-spacing: -0.01em; color: var(--bg);
  display: flex; flex-direction: column; line-height: 1.15;
}
.brand-txt small {
  font-size: 9px; font-weight: 600; letter-spacing: 0.22em;
  color: rgba(255, 179, 71, 0.85); margin-top: 3px;
  font-family: var(--mono);
}

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a, .nav-parent {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  text-decoration: none; color: rgba(255, 255, 255, 0.6);
  font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s, box-shadow .15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav a.active {
  color: #fff; font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 3px 0 0 var(--accent);
}
[data-theme="dark"] .nav a.active, [data-theme="midnight"] .nav a.active { background: rgba(255, 122, 77, 0.13); box-shadow: inset 3px 0 0 var(--accent), 0 0 22px -10px rgba(255, 180, 84, 0.5); }
.nav a.active .nic { color: var(--accent); }
[data-theme="dark"] .nav a.active .nic, [data-theme="midnight"] .nav a.active .nic { color: var(--accent); }
.nav a > span:last-child { letter-spacing: -0.01em; }

/* 导航未读角标（如资讯页未读数）：绝对定位到链接右端 */
.nav-badge {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--radius-pill);
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav a { position: relative; }
.tabbar a { position: relative; }
.tabbar .nav-badge { right: 4px; top: 6px; transform: none; }


/* 分组导航：父级标题可点击展开/收起子菜单 */
.nav-group { display: flex; flex-direction: column; }
.nav-parent {
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: left;
}
.nav-parent:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.np-label { flex: 1; letter-spacing: -0.01em; }
.np-chev {
  width: 15px; height: 15px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .55; transition: transform .2s;
}
.nav-group.open > .nav-parent { color: #fff; }
.nav-group.open > .nav-parent .np-chev { transform: rotate(90deg); }
/* 子菜单：grid 0fr/1fr 高度动画，收起时不占位 */
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-group.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub-inner { overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.nav-sub a { padding-left: 34px; }

.nic {
  width: 20px; display: inline-flex; align-items: center; justify-content: center;
  color: currentColor;
}
.nic .ic {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

.theme-btn {
  margin-top: 10px; padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: transparent; color: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-sm); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-weight: 500; transition: all .15s;
}
.theme-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.theme-btn.mini { display: none; padding: 6px 10px; margin-top: 0; border-radius: var(--radius-xs); }
/* 顶栏 mini 主题钮回到纸面配色 */
.topbar .theme-btn.mini {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.topbar .theme-btn.mini:hover { color: var(--ink); border-color: var(--rule); }

/* ---------- 主内容 ---------- */
.main {
  flex: 1; min-width: 0;
  padding: 34px 44px 88px; max-width: 1120px; margin: 0 auto;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; margin-bottom: 26px;
}
@media (min-width: 768px) {
  .topbar {
    position: sticky; top: 0; z-index: 40;
    padding: 16px 0 14px; margin-bottom: 18px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
.page-title {
  font-size: 21px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--ink); line-height: 1;
  display: flex; align-items: center; gap: 11px;
  white-space: nowrap;
}
.page-title::before {
  /* 站台菱形标 */
  content: ""; width: 9px; height: 9px; border-radius: 2.5px;
  background: var(--accent); transform: rotate(45deg); flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
[data-theme="dark"] .page-title::before, [data-theme="midnight"] .page-title::before { background: var(--accent); }

/* 顶栏右侧运行模式徽标（在线=正点 / 本地=晚点，信号灯式） */
.mode-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; line-height: 1;
  border: 1px solid; background: transparent;
  text-decoration: none;
  transition: all .15s;
}
.mode-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; display: inline-block;
  box-shadow: 0 0 0 3px transparent;
}
.mode-badge.online { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.mode-badge.online .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.mode-badge.offline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 7%, transparent); }
.mode-badge.offline .dot { animation: modeDotBlink 1.6s ease-in-out infinite; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.mode-badge:hover { filter: brightness(1.08); }
@keyframes modeDotBlink { 50% { opacity: 0.3; } }

/* 离线降级：不可用按钮显示灰色斜杠光标；离线提示条 */
.btn.offline-disabled,
button.offline-disabled {
  opacity: 0.5; cursor: not-allowed; filter: grayscale(1);
}
.offline-banner {
  margin: 0 0 14px; padding: 11px 15px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--danger) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--ink); font-size: 13px; line-height: 1.5;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.offline-banner::before {
  content: "⚠"; color: var(--danger); font-size: 15px;
}

/* 搜索：车次查询口 */
.gsearch-wrap { position: relative; flex: 1; max-width: 340px; margin-left: auto; }
.gsearch-wrap input {
  width: 100%; padding: 9px 16px;
  font-size: 13px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--sans);
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.gsearch-wrap input::placeholder { color: var(--muted-2); }
.gsearch-wrap input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.gsearch-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 420px; overflow-y: auto; padding: 6px;
}
.gs-group {
  font-size: 10px; font-weight: 700;
  color: var(--accent); padding: 10px 12px 4px;
  letter-spacing: 0.08em;
}
.gs-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  cursor: pointer; font-size: 13px; border-radius: var(--radius-xs);
}
.gs-item:hover { background: var(--card2); }
.gs-item .gs-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-item .gs-sub { font-size: 11px; color: var(--muted); white-space: nowrap; font-family: var(--mono); }
.gs-more {
  padding: 8px 12px; font-size: 11px; color: var(--muted);
  cursor: pointer; border-radius: var(--radius-xs);
}
.gs-more:hover { color: var(--accent); background: var(--card2); }
.gs-empty { padding: 24px 12px; font-size: 13px; color: var(--muted); text-align: center; }

/* 底部 tab（移动端） */
.tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px -12px rgba(0, 0, 0, 0.25);
}
.tabbar a, .tab-more {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 10px; font-weight: 500;
  padding: 4px 0; border-radius: var(--radius-xs);
}
.tabbar a.active, .tab-more.active { color: var(--ink); font-weight: 700; }
.tabbar a.active .nic, .tab-more.active .nic { color: var(--accent); }
.tabbar .nic, .tab-more .nic { width: auto; }
.tabbar .nic .ic, .tab-more .nic .ic { width: 20px; height: 20px; }
.tab-more {
  background: none; border: none; cursor: pointer; font-family: inherit;
}

/* 「更多」上滑面板 + 遮罩：默认不渲染，仅 ≤767px 启用 */
.sheet-mask, .more-sheet { display: none; }
@media (max-width: 767px) {
  .sheet-mask {
    display: block; position: fixed; inset: 0; z-index: 59;
    background: rgba(11, 17, 22, 0.45);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .sheet-mask.show { opacity: 1; pointer-events: auto; }
  .more-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--card); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 1px solid var(--rule);
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(110%); transition: transform .24s ease;
    box-shadow: var(--shadow-lg);
  }
  .more-sheet.show { transform: translateY(0); }
}
.more-sheet-hd {
  text-align: center; font-size: 13px; font-weight: 700;
  color: var(--muted); margin-bottom: 14px; letter-spacing: 0.08em;
}
.more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.more-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 13px 4px; border-radius: var(--radius); text-decoration: none;
  color: var(--ink); font-size: 12px; font-weight: 500;
  background: var(--card2); border: 1.5px solid transparent;
  transition: all .15s;
}
.more-grid a.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.more-grid .nic { width: auto; }
.more-grid .nic .ic { width: 22px; height: 22px; }

/* ============ 通用组件 ============ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm), var(--card-lit);
  transition: box-shadow .2s, border-color .2s;
  animation: cardIn .4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.card + .card { margin-top: 18px; }

.card h2 {
  font-size: 15px; font-weight: 800;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.01em; color: var(--ink);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.card h2 .count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  line-height: 1.15; align-self: center;
  color: var(--accent); font-family: var(--mono);
  padding: 4px 10px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-pill);
}
[data-theme="dark"] .card h2 .count, [data-theme="midnight"] .card h2 .count { color: var(--accent); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex-shrink: 0; }

input, select, textarea, .input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 14px; font-family: inherit; color: var(--ink); outline: none;
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus, .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.grow { flex: 1; min-width: 120px; }
/* 表单行内控件同一基线：input/select/date/按钮统一 38px 高（select 与 date 原生控件自带高度偏高，强制统一避免参差） */
.row input, .row select, .row .input, .row .btn:not(.sm) { height: 38px; }
textarea {
  width: 100%; resize: vertical; line-height: 1.7;
  font-size: 14px; padding: 12px 14px;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
select { cursor: pointer; }
/* 原生 select 展开的 option 弹层由系统绘制：color-scheme 在部分浏览器/select 已设 background 时压不住系统白底，
   给暗色主题显式指定不透明深色底做跨 Chromium/Firefox 兜底（必须不透明，半透明会露出系统白底） */
[data-theme="dark"] option, [data-theme="dark"] optgroup { background: #262b31; color: #eef0f3; }
[data-theme="midnight"] option, [data-theme="midnight"] optgroup { background: #131a2a; color: #e6eaf2; }
[data-theme="terminal"] option, [data-theme="terminal"] optgroup { background: #0d0d0d; color: #c9ffd1; }
[data-theme="mint-dark"] option, [data-theme="mint-dark"] optgroup { background: #243730; color: #dde6d9; }
[data-theme="glass"] option, [data-theme="glass"] optgroup { background: #16233d; color: #eaf0fa; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* 按钮 */
.btn {
  background: var(--accent-strong); color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background .15s, transform .1s, box-shadow .15s;
}
[data-theme="dark"] .btn, [data-theme="midnight"] .btn { background: var(--accent-strong); color: #1a1206; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn svg { width: 14px; height: 14px; display: block; }
.btn:hover { background: var(--accent-hover); }
[data-theme="dark"] .btn:hover, [data-theme="midnight"] .btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); box-shadow: 0 0 0 rgba(0, 0, 0, 0.18); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
[data-theme="dark"] .btn.ghost, [data-theme="midnight"] .btn.ghost { color: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); box-shadow: none; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn.sm { padding: 5px 13px; font-size: 12px; }

.icon-btn {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 15px; padding: 5px 7px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; transition: all .15s;
}
.icon-btn svg { width: 16px; height: 16px; display: block; }
.icon-btn:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.icon-btn.plain:hover { color: var(--ink); background: var(--card2); }
.icon-btn.plain:hover svg { color: var(--ink); }

input.invalid, select.invalid, textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
  animation: wb-shake .3s;
}
@keyframes wb-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Tabs：车票窗口 */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 3px; background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tab {
  font-size: 12px; padding: 5px 14px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--muted); background: transparent;
  border: none; font-weight: 500;
  transition: all .15s;
}
.tab:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tab.on {
  background: var(--accent-strong); color: #fff; font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .tab.on, [data-theme="midnight"] .tab.on { background: var(--accent); color: #1a1206; }

/* 列表 —— 卡片内条目（到发时刻表行） */
.list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none; border-radius: var(--radius);
  font-size: 13px;
  transition: background .15s;
}
.item:hover { background: var(--card2); }
.item .txt { flex: 1; min-width: 0; word-break: break-word; }
.item .meta {
  font-size: 11px; color: var(--muted); white-space: nowrap;
  font-family: var(--mono);
}
/* 空状态：统一由 finesse 层的 .empty（flex 列 + 🌸 emoji）定义 */
.empty a { color: var(--accent); font-weight: 600; }

.badge {
  font-size: 11px; font-weight: 700; padding: 2.5px 9px;
  border-radius: var(--radius-pill); white-space: nowrap;
  letter-spacing: 0.01em;
}
.b-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.b-warn   { color: var(--warn);   background: color-mix(in srgb, var(--warn) 8%, transparent);   border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.b-ok     { color: var(--ok);     background: color-mix(in srgb, var(--ok) 8%, transparent);     border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.b-primary{ color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
/* badge 小字对比度：light/mint 的莫兰迪浅语义色作 11px 小字时仅 1.7~4.4:1，
   badge 场景换加深色阶（不动 --danger 等全局变量，避免牵动按钮/图表配色） */
[data-theme="light"] .b-danger, [data-theme="mint"] .b-danger { color: #b4472f; }
[data-theme="light"] .b-warn,   [data-theme="mint"] .b-warn   { color: #8a6414; }
[data-theme="light"] .b-ok,     [data-theme="mint"] .b-ok     { color: #2e7d4f; }
[data-theme="light"] .b-primary,[data-theme="mint"] .b-primary{ color: #7d5f3c; }
/* 定期账单：模式徽标可点击切换 */
.badge[data-act] { cursor: pointer; }
.badge[data-act]:hover { filter: brightness(1.1); }
.tag {
  font-size: 11px; padding: 2px 9px;
  background: var(--card2); color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* 涨跌文字（股票）：rise=红 涨 / fall=绿 跌（A股惯例） */
.rise { color: var(--rise); }
.fall { color: var(--fall); }

/* 语义色圆点：尺寸统一，颜色由 data-color/inline 提供 */
.dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* 强调链接（替代内联 color:var(--accent)） */
.accent-link { color: var(--accent); }
.accent-link:hover { color: var(--accent-hover); text-decoration: underline; }

/* 卡片头部 .count 内嵌控件（习惯月份切换等） */
.count-ctrl { display: flex; gap: 6px; align-items: center; }

/* 资讯今日精选：序号 + 标题链接 */
.rank-num { color: var(--muted); margin-right: 6px; }
.dl-title { font-weight: 700; text-decoration: none; }
.dl-title:hover { color: var(--accent); }

/* ============================================================
   设计规范 · 通用工具类（收敛各模块散落的内联样式）
   ------------------------------------------------------------
   原则：静态布局 / 间距 / 字号 / 输入尺寸一律走类，不再内联；
   数据驱动的动态色（分类色 dot、涨跌、图表）仍按需内联 token。
   ============================================================ */

/* —— 副注文字：替代散落各处 "font-size:12px;color:var(--muted)" —— */
.sub {
  font-size: 12px; color: var(--muted); line-height: 1.6;
}
.sub-11 { font-size: 11px; color: var(--muted); line-height: 1.6; }
.sub-13 { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* —— 间距刻度：sp-<side>-<scale>，替代散落的 6/8/10/12/14/16px —— */
.sp-t-xs  { margin-top: 6px; }    .sp-b-xs  { margin-bottom: 6px; }
.sp-t-sm  { margin-top: 8px; }    .sp-b-sm  { margin-bottom: 8px; }
.sp-t-md  { margin-top: 10px; }   .sp-b-md  { margin-bottom: 10px; }
.sp-t-lg  { margin-top: 12px; }   .sp-b-lg  { margin-bottom: 12px; }
.sp-t-xl  { margin-top: 14px; }   .sp-b-xl  { margin-bottom: 14px; }
.sp-t-2x  { margin-top: 16px; }   .sp-b-2x  { margin-bottom: 16px; }
.sp-t-3x  { margin-top: 20px; }   .sp-b-3x  { margin-bottom: 20px; }

/* —— 输入尺寸刻度（配合固定宽度刻度 .w-* 使用） —— */
.input-xs { padding: 4px 9px; font-size: 12px; border-radius: var(--radius-xs); }
.input-sm { padding: 6px 11px; font-size: 12px; }
.input-md { padding: 9px 13px; font-size: 14px; }

/* —— 固定输入宽度刻度（替代内联 style="width:xxx"） —— */
.w-60  { width: 60px !important; }  .w-80  { width: 80px !important; }
.w-90  { width: 90px !important; }  .w-100 { width: 100px !important; }
.w-110 { width: 110px !important; } .w-120 { width: 120px !important; }
.w-130 { width: 130px !important; } .w-140 { width: 140px !important; }
.w-150 { width: 150px !important; } .w-160 { width: 160px !important; }
.w-170 { width: 170px !important; } .w-180 { width: 180px !important; }
.w-200 { width: 200px !important; } .w-230 { width: 230px !important; }
.w-250 { width: 250px !important; }

/* —— 文字色：替代内联 color:var(--*) —— */
.c-danger { color: var(--danger); }
.c-ok     { color: var(--ok); }
.c-warn   { color: var(--warn); }
.c-muted  { color: var(--muted); }
.c-accent { color: var(--accent); }
.c-white  { color: #fff; }

/* —— 单属性杂项工具类 —— */
.sp-l-md { margin-left: 10px; }
.cur-p   { cursor: pointer; }
.nowrap  { white-space: nowrap; }
.align-c { align-items: center; }
.mg0     { margin: 0; }
.fx1     { flex: 1; }
.fw7     { font-weight: 700; }
.db      { display: block; }
.dim     { opacity: 0.6; }

/* —— 通用预览灯箱（drive.js 弹窗去重） —— */
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.lightbox .lb-close { position: absolute; top: 15px; right: 20px; background: none; border: none; color: #fff; font-size: 40px; cursor: pointer; line-height: 1; }
.lightbox .lb-body { max-width: 95%; max-height: 95%; overflow: auto; }
.lightbox .lb-title { color: #fff; margin-bottom: 10px; text-align: center; }
.lightbox .lb-media { max-width: 100%; max-height: 85vh; display: block; margin: 0 auto; }
.lightbox .lb-frame { width: 100%; height: 85vh; border: none; }

/* —— 按钮尺寸语义：表单内「添加 / 提交」主操作统一为紧凑小按钮 —— */
.in-card-btn { padding: 5px 13px; font-size: 12px; }
/* 独立浮层/首屏大按钮 */
.hero-btn { padding: 9px 18px; font-size: 14px; }

/* —— tab 即按钮：使 <button class="tab"> 与 <span class="tab"> 渲染一致 —— */
button.tab { font-family: inherit; letter-spacing: inherit; }

/* 任务看板：按优先级 3 列（高/中/低） */
.kb-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 4px; }
.kb-col { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 10px; min-height: 120px; box-shadow: var(--shadow-sm); }
.kb-col-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.kb-ico { font-size: 14px; }
.kb-tt { flex: 1; }
.kb-cnt { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kb-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.kb-card { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); transition: border-color .12s, transform .12s; }
.kb-card:hover { border-color: var(--rule); }
.kb-card.over { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, var(--bg)); }
.kb-card-row { display: flex; align-items: center; gap: 6px; }
.kb-title { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.35; }
.kb-card-meta { display: flex; align-items: center; gap: 4px; margin-top: 6px; flex-wrap: wrap; font-size: 11px; }
.kb-card-meta .tag { font-size: 10px; padding: 1px 5px; }
.kb-card-meta .badge { font-size: 10px; padding: 1px 5px; }
.kb-empty { color: var(--muted); font-size: 12px; padding: 14px 4px; text-align: center; }
.kb-more { width: 100%; margin-top: 8px; background: transparent; border: 1px dashed var(--line); border-radius: 6px; padding: 6px; color: var(--muted); font-size: 12px; cursor: pointer; }
.kb-more:hover { border-color: var(--rule); color: var(--ink); }
.kb-foot { margin-top: 10px; color: var(--muted); font-size: 11px; text-align: center; }
@media (max-width: 1023px) { .kb-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .kb-board { grid-template-columns: 1fr; gap: 10px; } .kb-col { padding: 10px; } }
button.tab:focus-visible { outline-offset: 0; }
.tab svg { width: 13px; height: 13px; display: inline-block; vertical-align: -0.15em; margin-right: 3px; }

/* —— 通用图标按钮内联 SVG 对齐 —— */
.inline-svg { display: inline-flex; vertical-align: -0.125em; }
.inline-svg svg { width: 14px; height: 14px; }

/* —— 列表式条目组（卡片内 ul/div 纵向条目，复用 .list 语义） —— */
.stack { display: flex; flex-direction: column; }
.stack-sm { display: flex; flex-direction: column; gap: 4px; }
.stack-md { display: flex; flex-direction: column; gap: 8px; }

/* —— 右侧自动吸附（替代内联 margin-left:auto 分隔） —— */
.mla { margin-left: auto; }

/* ============================================================
   浮层反馈：加载指示 / Toast 提示 / 路由骨架屏
   ------------------------------------------------------------
   由 app.js 的 showLoading / showToast / navigate 动态创建，
   类驱动替代原内联 cssText，纳入明暗主题 token 体系。
   ============================================================ */
.wb-loading {
  position: fixed; top: 20px; right: 20px; z-index: 99999;
  padding: 12px 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500; color: var(--ink);
}
.wb-loading .spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: wb-spin .8s linear infinite;
}
@keyframes wb-spin { to { transform: rotate(360deg); } }

.wb-toast {
  position: fixed; top: 20px; right: 20px; z-index: 99999;
  padding: 12px 20px; background: var(--card);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500; color: var(--ink);
  max-width: 320px;
  animation: wb-toast-in .3s ease;
}
.wb-toast.success { border-left-color: var(--ok); }
.wb-toast.error   { border-left-color: var(--danger); }
.wb-toast.warning { border-left-color: var(--warn); }
@keyframes wb-toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.wb-toast.hide { opacity: 0; transform: translateX(100%); transition: all .3s ease; }

/* —— 骨架屏 shimmer 占位：路由切换 + 资讯加载共用 —— */
.sk-line {
  height: 14px; border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--card2) 25%, var(--line) 37%, var(--card2) 63%);
  background-size: 400% 100%;
  animation: wb-shimmer 1.4s ease infinite;
  margin-bottom: 12px;
}
.sk-line.short { width: 40%; }
.sk-block {
  height: 90px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--card2) 25%, var(--line) 37%, var(--card2) 63%);
  background-size: 400% 100%;
  animation: wb-shimmer 1.4s ease infinite;
}
.wb-skeleton { padding: 4px 0; }
@keyframes wb-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ============ 仪表盘 ============ */
.hero-greet {
  font-size: clamp(30px, 4.6vw, 42px); font-weight: 800;
  margin: 4px 0 12px;
  letter-spacing: -0.035em; line-height: 1.06;
  color: var(--ink);
  animation: heroIn .45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-greet::after {
  /* 琥珀句点 —— 到站广播 */
  content: "."; color: var(--accent); margin-left: 2px;
}
.hero-date {
  color: var(--muted); font-size: 14px; margin-bottom: 30px;
  font-weight: 500;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
  border-image: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 10px) 1;
}
.hero-date b { color: var(--accent); font-weight: 700; }

/* 仪表盘：考公倒计时横幅（点击跳考公页，≤7 天标红） */
.dash-gk {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; margin: -16px 0 22px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius); cursor: pointer;
  box-shadow: var(--shadow-sm), var(--card-lit);
}
.dash-gk:hover { border-color: var(--rule); }
.dash-gk-ico { font-size: 20px; }
.dash-gk-name { font-weight: 700; display: flex; flex-direction: column; }
.dash-gk-name small { font-weight: 500; font-size: 12px; color: var(--muted); }
.dash-gk-day { margin-left: auto; font-size: 14px; color: var(--muted); white-space: nowrap; }
.dash-gk-day b { font-size: 22px; color: var(--accent); margin: 0 2px; font-family: var(--mono); }
.dash-gk.urgent { border-color: var(--danger); border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--card)); }
.dash-gk.urgent .dash-gk-day b { color: var(--danger); }

/* 仪表盘：倒数日横幅（次级日程）——与考公横幅拉开主次：虚线描边 + 紫色左条 + 淡化背景 */
.dash-anniv {
  border-style: dashed;
  border-left-style: solid;
  border-left-width: 3px;
  border-left-color: var(--purple);
  background: color-mix(in srgb, var(--purple) 4%, var(--card));
}
.dash-anniv .dash-gk-day b { color: var(--purple); }
.dash-anniv.urgent { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, var(--card)); }
.dash-anniv.urgent .dash-gk-day b { color: var(--danger); }
@media (max-width: 640px) {
  .dash-anniv .dash-gk-day { font-size: 12px; }
  .dash-anniv .dash-gk-day b { font-size: 18px; }
}

/* 仪表盘：预算预警横幅（超支/预测超支） */
.dash-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin: -10px 0 18px;
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: border-color .15s;
  box-shadow: var(--shadow-sm);
}
.dash-banner.over { color: var(--danger); border-color: var(--danger); border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--card)); }
.dash-banner.warn { color: #C77E00; border-color: #F59E0B; border-left-color: #F59E0B; background: color-mix(in srgb, #F59E0B 8%, var(--card)); }
.dash-banner.ok { color: var(--ok); border-color: var(--ok); border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--card)); }
.dash-banner:hover { box-shadow: var(--shadow-md); }
.dash-banner .c-accent { color: var(--accent); margin-left: auto; font-weight: 700; }

/* 月度预算卡：超支/预测超支时整张卡片红/橙边框 */
.card.card-over { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 4%, var(--card)); }
.card.card-warn { border-color: #F59E0B; background: color-mix(in srgb, #F59E0B 4%, var(--card)); }

/* 仪表盘·每周回顾：本周关键数据逐行展示 */
.wr-stats { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.7; color: var(--ink); }

/* ============ 仪表盘 · 统计卡（数据窗口） ============ */
/* 视觉语言：四张并列的核心数字卡 = 到发屏上的数据窗口。
   层次由卡片本体承载（亮色纸片 / 暗色黑板浮起），数字是唯一主角，
   标签轻、数字重、副注更轻；装饰只剩标签前的琥珀菱形标
   （与 page-title / chart-tt / month-sub 同一套菱形语言）。 */
.stat-grid {
  display: grid;
  /* finesse bento：首卡更宽（今日焦点 = 主指标），其余三卡等宽 */
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 22px; margin-bottom: 34px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px 22px;
  cursor: pointer; position: relative;
  box-shadow: var(--shadow-sm), var(--card-lit);
  transition: border-color .18s, box-shadow .18s, transform .15s;
  animation: statIn .45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  overflow: hidden;
}
.stat:nth-child(1) { animation-delay: .04s; }
.stat:nth-child(2) { animation-delay: .09s; }
.stat:nth-child(3) { animation-delay: .14s; }
.stat:nth-child(4) { animation-delay: .19s; }
@keyframes statIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), var(--card-lit);
  transform: translateY(-1px);
}
/* finesse KPI 解剖：右上 tinted icon chip（替代 emoji 裸放） */
.s-ico {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  font-size: 16px; line-height: 1;
}
/* 标签：轻 —— 小号 + 琥珀菱形标 */
.stat .s-lab {
  font-size: 11px; color: var(--muted);
  font-weight: 600; letter-spacing: 0.03em;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.stat .s-lab::before {
  content: ""; flex-shrink: 0;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent); transform: rotate(45deg);
}
/* 数字：重 —— 等宽粗体（finesse：tabular-nums + 负 tracking + roll-up） */
.stat .s-val {
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.12;
  color: var(--ink);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
/* 副注：更轻 */
.stat .s-sub {
  font-size: 11px; color: var(--muted); margin-top: 11px;
  font-family: var(--mono);
  letter-spacing: 0.01em;
}
/* 首张：琥珀主标（今日焦点 = 首班车） */
.stat:first-child .s-lab { color: var(--accent); font-weight: 700; }
.stat:first-child .s-val { color: var(--accent-strong); }
[data-theme="dark"] .stat:first-child .s-val, [data-theme="midnight"] .stat:first-child .s-val { color: var(--accent); }

/* 暗色：卡片从黑板干净浮起 —— 提亮描边 + 上沿受光 + 加长悬浮投影
   （投影必须与 28px 粗体数字的重量匹配，1px 微影在深底上不可见） */
[data-theme="dark"] .stat, [data-theme="midnight"] .stat {
  border-color: #2a3944;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.5),
    0 16px 34px -16px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .stat:hover, [data-theme="midnight"] .stat:hover {
  border-color: rgba(255, 122, 77, 0.45);
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.55),
    0 22px 44px -18px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* hover 引导：右下角琥珀箭头提示可点击查看（仅带 data-go 的跳转卡） */
.stat[data-go]::after {
  content: "→";
  position: absolute; right: 12px; bottom: 10px;
  font-size: 14px; font-weight: 700; color: var(--accent);
  opacity: 0; transform: translateX(-5px);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.stat[data-go]:hover::after {
  opacity: 1; transform: translateX(0);
}

.chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.chart-grid-2 { grid-template-columns: repeat(2, 1fr); }
.chart-box { min-width: 0; }
/* reports 财务图表：容器固定高度保证 doughnut(饼图) + 底部图例不溢出截断
   （chart-box 本身无高度而 chart 用 maintainAspectRatio:false，若容器高度不够，
   bottom legend 会挤压圆图导致饼图下半被裁 —— finance 的 tx-chart-wrap 已有 220px 先例） */
.chart-grid-2 .chart-box { height: 250px; }
.chart-tt {
  font-size: 11px; font-weight: 700; color: var(--muted);
  margin-bottom: 10px; letter-spacing: 0.03em;
}
.chart-tt::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); margin-right: 7px; transform: rotate(45deg); }
.chart-box canvas { width: 100% !important; }
.chart-box canvas[height] { max-height: 100% !important; }

/* 净资产趋势（净资产总览卡内嵌 sparkline） */
.nw-trend { margin-top: 14px; position: relative; }
.nw-trend canvas { display: block; width: 100% !important; height: 90px !important; }
.nw-trend-hint { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
@media (max-width: 640px) { .nw-trend canvas { height: 70px !important; } }

.dash-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.dash-col { display: flex; flex-direction: column; gap: 20px; }

/* 归档区：数据概览与每周回顾（<details> 渐进披露） */
.archive { margin: 0 0 16px; }
.archive summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--card-lit);
  font-weight: 700; font-size: 13px; color: var(--ink);
  transition: border-color .18s, box-shadow .18s;
}
.archive summary::-webkit-details-marker { display: none; }
.archive summary:hover { border-color: var(--accent); box-shadow: var(--shadow-md), var(--card-lit); }
.archive summary::after {
  content: "▾"; margin-left: auto; color: var(--muted);
  font-size: 12px; transition: transform .2s;
}
.archive[open] summary::after { transform: rotate(180deg); }
.ar-diamond {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); transform: rotate(45deg);
  display: inline-block; margin-right: 8px; flex-shrink: 0;
}
.ar-hint { font-size: 11px; font-weight: 500; color: var(--muted); }
.archive-in { display: flex; flex-direction: column; gap: 16px; padding: 16px 0 4px; }
.archive-in .card + .card { margin-top: 0; }

.mini-bar {
  height: 6px; border-radius: var(--radius-pill);
  background: var(--card2); border: 1px solid var(--line);
  overflow: hidden; margin-top: 14px;
}
.mini-bar i {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width .5s cubic-bezier(0.4, 0, 0.2, 1);
}
.mini-bar-lab {
  font-size: 11px; color: var(--muted); margin-top: 8px;
  font-family: var(--mono);
}
.footnote {
  text-align: center; color: var(--muted-2); font-size: 12px;
  line-height: 1.7; max-width: 560px; margin: 0 auto;
  margin-top: 22px; padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ============ 事务 / 任务 ============ */
.due-quick { display: flex; gap: 6px; }
.chk {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--rule);
  flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; background: transparent;
  transition: all .15s;
}
[data-theme="dark"] .chk, [data-theme="midnight"] .chk { color: #161006; }
.chk:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.item.done .chk {
  background: var(--accent-strong);
  border-color: var(--accent-strong); border-style: solid;
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: punch .3s cubic-bezier(0.2, 0.7, 0.3, 1.4);
}
[data-theme="dark"] .item.done .chk, [data-theme="midnight"] .item.done .chk { background: var(--accent); border-color: var(--accent); }
@keyframes punch {
  0% { transform: scale(0.4); }
  100% { transform: scale(1); }
}
.item.done .chk::after { content: "✓"; font-weight: 800; }
.item.done .txt {
  color: var(--muted); text-decoration: line-through;
  text-decoration-thickness: 1.5px; text-decoration-color: var(--muted-2);
}

/* ============ 仪表盘 · 今日焦点 = 到发时刻时间轴 ============ */
/* 结构：左侧时间刻度列（时段 chip）+ 撕票虚线脊柱 + 右侧「车次行」（检票 + 标题 + 徽标） */
.focus-tl { position: relative; padding: 4px 2px; }
.focus-tl::before {
  content: ""; position: absolute; left: 60px; top: 12px; bottom: 12px;
  border-left: 1.5px dashed var(--rule); opacity: .8;
}
.tl-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px; align-items: center;
  padding-left: 6px;
}
.tl-slot {
  justify-self: start;
  font-size: 10px; font-family: var(--mono); font-weight: 600;
  color: var(--muted);
  background: var(--card2); border: 1px solid var(--line);
  border-radius: var(--radius-xs); padding: 2px 6px;
  white-space: nowrap; letter-spacing: 0.02em;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
/* 逾期 = 晚点红 */
.tl-slot.late {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--card));
}
/* 已检票 = 正点绿 */
.tl-slot.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: color-mix(in srgb, var(--ok) 8%, var(--card));
}
.tl-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
/* 「已检票」区：撕票虚线分隔 */
.tl-sep {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 6px; color: var(--muted-2);
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
}
.tl-sep::before, .tl-sep::after {
  content: ""; flex: 1; border-top: 1px dashed var(--rule);
}

.pri-dot { width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); flex-shrink: 0; }

.item.editing { display: block; background: var(--card2); padding: 14px; border: 1px dashed var(--rule); }
.item.editing .edit-form { width: 100%; }

/* 月历：月度时刻表 */
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-title {
  font-weight: 800; font-size: 20px;
  letter-spacing: -0.02em; color: var(--ink);
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd {
  text-align: center; font-size: 10px; color: var(--muted);
  font-weight: 700; padding: 6px 0; letter-spacing: 0.08em;
}
.cal-cell {
  min-height: 70px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 8px 10px; cursor: pointer; font-size: 12px; position: relative;
  border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.dim { opacity: .35; }
.cal-cell.today {
  background: var(--accent-strong); color: #fff; border-color: var(--accent-strong);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .cal-cell.today, [data-theme="midnight"] .cal-cell.today { background: var(--accent); color: #161006; border-color: var(--accent); }
.cal-cell.today .d-num { color: #fff; font-weight: 800; }
[data-theme="dark"] .cal-cell.today .d-num, [data-theme="midnight"] .cal-cell.today .d-num { color: #161006; }
.cal-cell.today::after {
  content: ""; position: absolute; top: 8px; right: 10px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .cal-cell.today::after, [data-theme="midnight"] .cal-cell.today::after { background: #161006; box-shadow: 0 0 0 2px rgba(22, 16, 6, 0.3); }
.cal-cell.sel { box-shadow: 0 0 0 2px var(--accent) inset; }
.d-num {
  display: inline-flex; font-weight: 700;
  font-size: 13px;
}
.d-dots { display: flex; gap: 3px; margin-top: 8px; flex-wrap: wrap; }
.d-dot { width: 5px; height: 5px; border-radius: 50%; }
.d-more { font-size: 10px; color: var(--muted); font-family: var(--mono); }

/* ============ 笔记 / 沉淀 ============ */
.notes-layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 16px;
  align-items: start;
}
.folder-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.folder-li {
  font-size: 12px; font-weight: 600; padding: 4px 13px;
  border-radius: var(--radius-pill); cursor: pointer;
  color: var(--muted); background: var(--card2);
  border: 1px solid var(--line);
  transition: all .15s;
}
.folder-li:hover { color: var(--ink); border-color: var(--rule); }
.folder-li.on { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
[data-theme="dark"] .folder-li.on, [data-theme="midnight"] .folder-li.on { background: var(--accent); color: #161006; border-color: var(--accent); }
.note-li {
  padding: 12px 14px; border-radius: var(--radius);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; margin-bottom: 4px;
  transition: all .15s;
}
.note-li:hover { background: var(--card2); }
.note-li.on {
  background: var(--card); border-color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent), var(--card-lit);
}
.note-li.on .n-title { color: var(--ink); }
.note-li .n-title {
  font-weight: 700; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -0.01em; line-height: 1.35;
  color: var(--ink-2);
}
.note-li .n-sub {
  font-size: 11px; color: var(--muted);
  margin-top: 4px; display: flex; gap: 6px; align-items: center;
  flex-wrap: wrap; font-family: var(--mono);
}
.md-preview {
  font-size: 15px; overflow-wrap: break-word;
  line-height: 1.75; color: var(--ink-2);
  padding: 4px 0;
}
/* 笔记列表滚动容器 + 预览高度（替代内联样式） */
.note-scroll {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 520px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.n-preview { min-height: 300px; padding: 6px 2px; }
/* 笔记编辑器状态栏：字数 + 未保存提示 */
.n-editor-status {
  display: flex; gap: 12px; justify-content: flex-end;
  margin-top: 6px; font-size: 11px; color: var(--muted);
  font-family: var(--mono);
}
.n-editor-status #nDirty { color: var(--warn); font-family: inherit; }
.md-preview h1, .md-preview h2, .md-preview h3 {
  font-weight: 800; margin: 20px 0 10px;
  line-height: 1.25; letter-spacing: -0.02em; color: var(--ink);
}
.md-preview h1 { font-size: 26px; }
.md-preview h2 { font-size: 20px; }
.md-preview h3 { font-size: 16px; }
.md-preview p { margin: 12px 0; }
.md-preview ul, .md-preview ol { margin: 12px 0; padding-left: 24px; }
.md-preview blockquote {
  border-left: 3px solid var(--accent);
  padding: 6px 16px; color: var(--ink-2);
  margin: 14px 0;
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.md-preview code {
  background: var(--card2); padding: 2px 7px;
  font-family: var(--mono); font-size: 13px;
  border-radius: var(--radius-xs);
}
.md-preview pre {
  background: var(--card2); padding: 14px 16px;
  border: 1px solid var(--line);
  overflow-x: auto; margin: 14px 0; border-radius: var(--radius);
}
.md-preview pre code { background: none; padding: 0; }
.md-preview hr { border: none; border-top: 1px dashed var(--rule); margin: 20px 0; }
.md-preview a { color: var(--accent); border-bottom: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
.md-preview a:hover { border-bottom-color: var(--accent); }
.md-preview table { border-collapse: collapse; margin: 14px 0; font-size: 13px; display: block; overflow-x: auto; max-width: 100%; }
.md-preview th, .md-preview td { border: 1px solid var(--line); padding: 6px 10px; white-space: nowrap; }
.md-preview th { background: var(--card2); }

/* ============ 生活 / 习惯 ============ */
.habit-card {
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.habit-card:last-child { border-bottom: none; padding-bottom: 4px; }
.habit-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.habit-head .name {
  font-weight: 800; font-size: 14px;
  flex: 1; display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.01em;
}
.habit-head .streak {
  font-size: 11px; color: var(--accent);
  font-family: var(--mono); font-weight: 700;
  padding: 2px 10px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius-pill);
}
.habit-head .streak::before { content: "● "; font-size: 9px; }
/* 习惯本周进度徽标 */
.habit-head .wk-goal {
  font-size: 11px; color: var(--muted);
  font-family: var(--mono); font-weight: 700; white-space: nowrap;
  padding: 2px 10px; background: var(--card2);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
}
.habit-head .wk-goal.done { color: var(--ok); border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--card2)); }
@media (max-width: 640px) {
  .habit-head { flex-wrap: wrap; gap: 8px; }
  .habit-head .name { flex-basis: 100%; }
}
.heat-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.heat-cell {
  aspect-ratio: 1.5; background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--muted-2);
  font-family: var(--mono);
  transition: all .15s;
}
.heat-cell:hover { border-color: var(--accent); }
.heat-cell.on {
  color: #fff; font-weight: 800;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .heat-cell.on, [data-theme="midnight"] .heat-cell.on { color: #161006; background: var(--accent); border-color: var(--accent); }
.heat-cell.future { opacity: .4; cursor: not-allowed; }
.heat-cell.today-cell { box-shadow: 0 0 0 2px var(--accent) inset; }

/* 财务 */
.progress-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; margin-bottom: 10px;
  color: var(--muted);
}
.progress-top b {
  color: var(--ink); font-weight: 800;
  font-size: 28px; letter-spacing: -0.03em;
  font-family: var(--mono);
}
.progress-top b::after {
  content: "%"; color: var(--accent); margin-left: 1px;
}
.bar {
  height: 8px; background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.bar > i {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width .5s cubic-bezier(0.4, 0, 0.2, 1);
}
.month-sub {
  font-weight: 800; font-size: 13px;
  color: var(--ink); margin: 20px 0 8px;
  letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 8px;
}
.month-sub::before {
  content: ""; display: inline-block;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg) translateY(-1px);
}

/* 记账：总览（累计结余 + 本月/本年指标卡） */
.tx-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
/* 累计结余：居中大字 */
.tx-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}
.tx-total-lab {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.tx-total-val {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  font-family: var(--mono);
}
/* 本月 / 本年指标卡：一行 5 个等宽 */
.tx-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.tx-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tx-card-lab {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.tx-card b {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-card-sub {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 记账：储蓄目标区 */
.tx-goal { margin-bottom: 6px; }
.tx-goal .progress-top { margin-bottom: 8px; }
.tx-goal .progress-top b { font-size: 22px; }
.tx-goal-edit {
  margin-top: 10px; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.tx-goal-edit input {
  width: 100px; padding: 4px 10px; font-size: 12px;
  border-radius: var(--radius-pill);
}

/* 记账：月度预算提示行（超支红 / 接近预算橙） */
.tx-budget-tip { margin-top: 8px; font-size: 12px; color: var(--muted); }
.tx-budget-tip.over { color: var(--danger); font-weight: 800; }
.tx-budget-tip.warn { color: var(--warn); font-weight: 700; }

/* 记账：录入表单 */
.tx-form select { min-width: 90px; }

/* 记账：日期分组 */
.tx-day + .tx-day { margin-top: 14px; }
.tx-day-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 0 4px 6px; border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.tx-day-sub {
  color: var(--ink); font-weight: 800; font-size: 12px;
}

/* 记账：单条流水 */
.tx-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.tx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: all .15s;
}
.tx-item:hover { background: var(--card2); border-left-color: var(--accent); }
.tx-dot {
  flex-shrink: 0;
  width: 8px; height: 8px; border-radius: 50%;
}
.tx-cat {
  flex-shrink: 0;
  font-weight: 700; font-size: 13px; color: var(--ink);
  min-width: 56px;
}
.tx-note {
  flex: 1; min-width: 0; color: var(--muted);
  font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tx-amt {
  font-weight: 800; font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  font-family: var(--mono);
}

/* 记账：流水明细年份选择器（含"全部年份"） */
.tx-year-sel {
  font-size: 12px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  cursor: pointer;
}
.tx-year-sel:focus { border-color: var(--accent); outline: none; }

/* 记账：流水行操作按钮组（复制/编辑/删除，分组描边，触控热区加大） */
.tx-acts {
  display: flex; align-items: center; gap: 2px;
  flex-shrink: 0; margin-left: 4px;
  padding: 2px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card2);
}
.tx-acts .icon-btn {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 14px;
}
.tx-acts .icon-btn.plain:hover { color: var(--ink); background: var(--card); }
.tx-acts .icon-btn:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, transparent); }

/* 记账：饼图容器 */
.tx-chart-box {
  margin-top: 14px; padding: 14px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tx-chart-box .chart-tt {
  font-size: 12px; color: var(--muted); font-weight: 700;
  margin-bottom: 8px; letter-spacing: -0.005em;
}
.tx-chart-box canvas {
  max-height: 200px;
}

/* 记账：行内编辑 */
.tx-item.tx-editing {
  display: block;
  background: var(--card2);
  padding: 10px;
  border-left: 2px solid var(--accent);
}
.tx-edit-form input, .tx-edit-form select { font-size: 13px; }

/* 记账：日历视图（复用 .cal-grid/.cal-cell，叠加收支小字） */
.tx-cal-cell { display: flex; flex-direction: column; gap: 1px; }
.tx-cal-in, .tx-cal-out {
  font-size: 10px; font-weight: 700; line-height: 1.3;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tx-cal-in { color: var(--ok); }
.tx-cal-out { color: var(--danger); }
.cal-cell.today .tx-cal-in, .cal-cell.today .tx-cal-out { color: #fff; opacity: .95; }
[data-theme="dark"] .cal-cell.today .tx-cal-in, [data-theme="dark"] .cal-cell.today .tx-cal-out, [data-theme="midnight"] .cal-cell.today .tx-cal-in, [data-theme="midnight"] .cal-cell.today .tx-cal-out { color: #161006; }
.tx-cal-detail-head {
  font-size: 13px; font-weight: 800; color: var(--ink);
  margin-bottom: 8px;
}

/* 记账：年账表 */
.tx-year-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tx-year-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.tx-year-table th {
  text-align: right; font-size: 11px; color: var(--muted);
  font-weight: 700; padding: 6px 8px;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.04em;
  background: var(--card2);
}
.tx-year-table th:first-child, .tx-year-table td:first-child { text-align: left; }
.tx-year-table td {
  text-align: right; padding: 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.tx-year-table tbody tr:hover { background: var(--card2); }
.tx-yr-row { cursor: pointer; }
.tx-yr-row.dim { opacity: .4; }
.tx-yr-cnt { color: var(--muted); font-weight: 500; }
.tx-year-table tfoot td {
  border-bottom: none; border-top: 2px solid var(--ink);
  font-weight: 800; padding-top: 10px;
}
.tx-year-tip {
  margin-top: 10px; font-size: 12px; color: var(--muted);
}

/* 年账视图：今年 vs 去年月度支出对比 */
.tx-year-cmp { margin-top: 18px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.tx-year-cmp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.tx-year-cmp-tt { font-size: 12px; font-weight: 700; color: var(--ink); }
.tx-year-cmp-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.tag-ok { color: var(--ok); background: rgba(74,158,99,0.10); }
.tag-warn { color: #C77E00; background: rgba(245,158,11,0.12); }
.tag-danger { color: var(--danger); background: rgba(204,102,102,0.10); }
.tx-year-cmp canvas { width: 100% !important; height: 160px !important; }
.tx-year-cmp-legend { margin-top: 8px; font-size: 11px; color: var(--muted); }
.lg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
@media (max-width: 640px) { .tx-year-cmp canvas { height: 140px !important; } }

/* 股票：持仓表 + 搜索建议 */
.stk-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stk-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.stk-table th {
  text-align: right; font-size: 11px; color: var(--muted);
  font-weight: 700; padding: 6px 8px;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.04em; white-space: nowrap;
  background: var(--card2);
}
.stk-table th:first-child, .stk-table td:first-child { text-align: left; }
.stk-table td {
  text-align: right; padding: 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 700; white-space: nowrap;
}
.stk-table tbody tr:hover { background: var(--card2); }
.stk-code { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.stk-sub { display: block; font-size: 11px; font-weight: 500; }
.stk-ops { white-space: nowrap; }
.stk-foot { margin-top: 10px; font-size: 12px; color: var(--muted); }
.stk-tip { font-size: 11px; color: var(--muted); }
.stk-edit-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stk-search-wrap { position: relative; display: inline-block; }
.stk-sug {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  min-width: 230px; max-height: 260px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
}
/* 窄屏：建议浮层不超出视口右缘（否则被 overflow-x:hidden 裁切） */
@media (max-width: 767px) {
  .stk-sug { position: fixed; left: 12px; right: 12px; min-width: 0; }
}
.stk-sug-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 12px; cursor: pointer; font-size: 13px;
}
.stk-sug-item:hover { background: var(--card2); }
.stk-sug-item span { color: var(--muted); font-size: 12px; }

/* 记账：分类管理 */
.tx-cat-mgr {
  margin-bottom: 12px; padding: 12px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tx-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tx-cat-chip { display: inline-flex; align-items: center; gap: 6px; }
.tx-cat-del {
  border: none; background: none; cursor: pointer;
  color: var(--muted); padding: 0 2px;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.tx-cat-del svg { width: 12px; height: 12px; display: block; }
.tx-cat-del:hover { color: var(--danger); }
.tx-cat-tip { font-size: 11px; color: var(--muted); }
#finNewCatColor {
  width: 42px; height: 34px; padding: 2px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--card); cursor: pointer;
}

/* 记账 v3：详细展开 / 筛选汇总条 / 可点金额 / 日期范围 */
.tx-detail {
  list-style: none;
  background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px; margin: 2px 0 6px;
  font-size: 12px; line-height: 1.9; color: var(--ink-2);
}
.tx-detail span {
  display: inline-block; width: 70px;
  color: var(--muted); font-size: 11px;
}
.tx-filter-sum {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 12px; color: var(--muted);
  padding: 8px 10px; margin-bottom: 10px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
.tx-filter-sum b { font-size: 12px; color: var(--ink); }
.tx-lnk { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.tx-lnk:hover { opacity: .75; }
.tx-range-sep { color: var(--muted); flex-shrink: 0; }
.tx-item[title] { cursor: pointer; }

/* 记账：分页器 / 图表卡头部 / 空态 / 按钮禁用 */
.tx-page-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.tx-page-info { font-variant-numeric: tabular-nums; }
.tx-page-btns { display: flex; gap: 8px; }
.tx-chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}
.tx-chart-meta b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tx-chart-wrap { position: relative; height: 220px; }
.tx-chart-wrap canvas { max-height: 100% !important; }
.tx-chart-empty { padding: 28px 0; }
.btn:disabled, .btn[disabled] {
  background: var(--card2);
  color: var(--muted-2);
  border: 1px solid var(--line);
  cursor: not-allowed;
  box-shadow: none;
}
.btn:disabled:hover, .btn[disabled]:hover {
  background: var(--card2);
  color: var(--muted-2);
}

/* 仅 PC 展示（导入/导出等桌面功能，移动端隐藏） */
@media (max-width: 767px) {
  .pc-only { display: none !important; }
}

@media (max-width: 640px) {
  .tx-cards { grid-template-columns: repeat(2, 1fr); }
  .tx-total-val { font-size: 26px; }
  .tx-cat { min-width: 48px; font-size: 12px; }
  .tx-note { font-size: 12px; }
  /* 日历格子在窄屏降高，收支小字只留得下的 */
  .tx-cal-cell { min-height: 54px; padding: 5px 4px; }
  .tx-cal-in, .tx-cal-out { font-size: 9px; }
  .tx-year-table { font-size: 12px; }
  .tx-year-table td, .tx-year-table th { padding: 6px 5px; }
  .tx-detail span { width: 62px; }
  .tx-filter-sum { gap: 8px; font-size: 11px; }
}
/* 641–767px（小平板/横放大屏）：记账指标卡也由 5 列降为 2 列，避免拥挤截断 */
@media (max-width: 767px) and (min-width: 641px) {
  .tx-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 快捷入口 ============ */
.ql-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.ql-card {
  background: var(--card); padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  box-shadow: var(--shadow-sm), var(--card-lit);
  transition: all .2s;
}
.ql-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), var(--card-lit);
  transform: translateY(-1px);
}
.ql-ic {
  width: 40px; height: 40px; border-radius: 10px;
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.ql-name {
  font-weight: 700; font-size: 13px;
  text-decoration: none; color: var(--ink);
  word-break: break-all; letter-spacing: -0.005em;
  line-height: 1.35;
}
.ql-name:hover { color: var(--accent); }
.ql-ops {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 2px; opacity: 0;
  transition: opacity .15s;
}
.ql-card:hover .ql-ops { opacity: 1; }
.ql-ops .icon-btn { background: var(--card); border: 1px solid var(--line); }
.ql-card { cursor: pointer; }
.ql-empty { grid-column: 1 / -1; }
.ql-cred {
  position: absolute; top: 8px; left: 8px;
  font-size: 13px; opacity: 0; transition: opacity .15s;
}
.ql-card:hover .ql-cred { opacity: 1; }

/* 凭据浮层 */
.cred-add { margin-top: 10px; }
.cred-add input { flex: 1; min-width: 140px; }
.cred-hint { font-size: 12px; color: var(--muted); flex: 1 1 100%; }
.cred-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cred-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 22px; width: 100%; max-width: 380px;
  position: relative;
}
.cred-close {
  position: absolute; top: 6px; right: 10px;
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.cred-close:hover { color: var(--ink); }
.cred-title { font-weight: 800; font-size: 16px; margin-bottom: 2px; }
.cred-url {
  font-size: 12px; color: var(--muted); word-break: break-all;
  margin-bottom: 16px;
}
.cred-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.cred-label { flex-shrink: 0; width: 44px; font-size: 13px; color: var(--muted); }
.cred-value {
  flex: 1; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: var(--card2); color: var(--ink); font-size: 13px;
}
.cred-copy { flex-shrink: 0; padding: 7px 12px; font-size: 12px; }
.cred-tip { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.6; }

/* ============ 资讯 ============ */
.news-note {
  font-size: 12px; color: var(--muted); margin-top: 12px;
  line-height: 1.7;
}
.news-src-blk {
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.news-src-blk:first-child { padding-top: 4px; }
.news-src-blk:last-child { border-bottom: none; padding-bottom: 4px; }
.news-src-head {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 14px;
  margin-bottom: 14px; letter-spacing: -0.01em;
}
.news-src-head .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.news-src-head .news-src-upd {
  margin-left: auto; font-size: 11px; color: var(--muted);
  font-weight: 500; font-family: var(--mono);
}
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.news-card {
  background: var(--card); overflow: hidden;
  display: flex; flex-direction: column; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--card-lit);
  transition: all .2s;
}
.news-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), var(--card-lit);
  transform: translateY(-1px);
  text-decoration: none;
}
.news-thumb-wrap { position: relative; overflow: hidden; }
.news-thumb {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  display: block; background: var(--card2);
  transition: transform .35s ease;
}
.news-card:hover .news-thumb { transform: scale(1.05); }
/* 缩略图加载失败：隐藏坏图，露出下方的占位层（不整块收起防卡片高度跳动） */
.news-thumb.err { display: none; }
/* 无缩略图 / 缩略图失败时的分类占位层 */
.news-thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; width: 100%;
  background:
    linear-gradient(135deg, var(--card2) 0%, color-mix(in srgb, var(--accent) 8%, var(--card2)) 100%);
  color: var(--muted); font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; font-family: var(--mono);
}
.news-thumb-wrap .news-thumb-placeholder {
  position: absolute; inset: 0; z-index: 0; height: auto; aspect-ratio: auto;
}
.news-thumb-wrap .news-thumb { position: relative; z-index: 1; }
.news-thumb-placeholder.video {
  color: #fff; font-size: 18px;
  background: rgba(11, 17, 22, .62);
}
.news-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%; background: rgba(11, 17, 22, .65);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; backdrop-filter: blur(6px);
}
.news-body {
  padding: 14px 16px 16px; display: flex; flex-direction: column;
  gap: 8px; flex: 1;
}
.news-title {
  font-weight: 800; font-size: 14px;
  line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; letter-spacing: -0.01em;
}

/* 资讯：关注关键词高亮 */
mark.news-kw {
  background: color-mix(in srgb, var(--warn) 30%, transparent);
  color: inherit; border-radius: 3px; padding: 0 2px;
}
.news-card:hover .news-title { color: var(--accent); }
.news-sum {
  font-size: 12px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-meta {
  display: flex; align-items: center; gap: 8px; font-size: 11px;
  color: var(--muted); margin-top: auto; font-family: var(--mono);
  border-top: 1px solid var(--line); padding-top: 9px;
}
.news-degraded {
  font-size: 13px; color: var(--muted); background: var(--card2);
  border: 1px solid var(--line);
  padding: 16px 18px; line-height: 1.75; border-radius: var(--radius);
}
.news-degraded-hint { font-size: 11px; margin-top: 6px; opacity: .85; }

.news-card.read { opacity: .5; }
.news-card.read:hover { opacity: .9; }
.news-fav {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 15px; line-height: 1; color: var(--muted-2);
  padding: 3px 5px; border-radius: var(--radius-sm);
}
.news-fav:hover { color: var(--accent); background: var(--card2); }
.news-fav.on { color: var(--accent); }
/* 卡片内来源小字 + 日期分隔 */
.news-src {
  font-size: 11px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 45%;
}
.news-date { white-space: nowrap; }
.news-meta .news-fav { margin-left: auto; }
/* 站内阅读按钮（book 图标） */
.news-read { flex-shrink: 0; }
.news-read svg { width: 15px; height: 15px; }
/* 卡片底部操作行：打开原文链接 */
.news-card-actions {
  margin-top: 2px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex; justify-content: flex-end;
  opacity: 0; transition: opacity .15s;
}
.news-card:hover .news-card-actions,
.news-card.read .news-card-actions { opacity: 1; }
.news-origin {
  font-size: 11px; color: var(--muted); font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
}
.news-origin:hover { color: var(--accent); }
.news-origin svg { width: 11px; height: 11px; }

/* ---------- 时间混排视图（RSS 阅读器式列表） ---------- */
.tl-news {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
}
.tl-news:hover { background: var(--card2); }
.tl-news-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tl-news-cat {
  flex-shrink: 0; font-size: 10px; font-weight: 700; color: var(--muted);
  min-width: 44px;
}
.tl-news-title {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tl-news-title:hover { color: var(--accent); }
.tl-news-title.read { color: var(--muted); font-weight: 500; }
.tl-news-src {
  flex-shrink: 0; font-size: 11px; color: var(--muted); max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tl-news-date { flex-shrink: 0; font-size: 11px; color: var(--muted); font-family: var(--mono); }
@media (max-width: 640px) {
  .tl-news-src { display: none; }
  .tl-news-cat { min-width: 36px; }
}

/* ===== 番茄钟（专注计时器） ===== */
/* 悬浮按钮 + 浮层面板；右下角固定，跨路由存在 */
.focus-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--accent); color: #1a1206; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform .15s, box-shadow .15s;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.focus-fab:hover { transform: translateY(-1px); box-shadow: var(--shadow-md), 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.focus-fab.running { background: var(--danger); color: #fff; animation: focusPulse 1.6s ease-in-out infinite; }
.focus-fab.paused { background: var(--warn); color: #1a1206; }
.focus-fab.finished { background: var(--ok); color: #fff; }
@keyframes focusPulse { 0%,100% { box-shadow: var(--shadow-md), 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); } 50% { box-shadow: var(--shadow-md), 0 0 0 12px color-mix(in srgb, var(--danger) 0%, transparent); } }

.focus-panel {
  position: fixed; right: 18px; bottom: 72px; z-index: 91;
  width: 320px; max-width: calc(100vw - 24px);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md), var(--card-lit);
  padding: 0; overflow: hidden;
  animation: focusIn .18s ease-out;
}
@keyframes focusIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.focus-head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.focus-tt { font-size: 14px; font-weight: 800; flex: 1; }
.focus-body { padding: 16px 14px; text-align: center; }
.focus-ring {
  --pct: 0; width: 140px; height: 140px; margin: 4px auto 10px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--line) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.focus-ring::before { content: ""; position: absolute; inset: 8px; background: var(--card); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.focus-time { position: relative; font-family: var(--mono); font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.focus-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.focus-type select { width: 100%; padding: 7px 10px; font-size: 13px; }
.focus-acts { display: flex; gap: 6px; margin-top: 10px; }
.focus-acts .btn { flex: 1; }
.focus-stat { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink); }
.focus-stat b { color: var(--accent); font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 16px; }
.focus-stat-tip { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) { .focus-fab { right: 12px; bottom: 84px; padding: 8px 12px; font-size: 12px; } .focus-panel { right: 8px; bottom: 96px; width: calc(100vw - 16px); } }

/* ---------- 站内阅读器浮层 ---------- */
.reader-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.reader-box {
  position: relative;
  width: 100%; max-width: 720px; height: 86vh;
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: heroIn .3s cubic-bezier(0.2, 0.7, 0.2, 1);
  /* 阅读主题默认（paper）：跟随站点主题 */
  --reader-bg: var(--card);
  --reader-ink: var(--ink);
  --reader-ink2: var(--ink-2);
  --reader-muted: var(--muted);
  --reader-line: var(--line);
  --reader-accent: var(--accent);
}
/* 阅读主题 3 档：night（夜间）/ sepia（米黄），paper 走默认 */
.reader-box[data-theme="night"] {
  --reader-bg: #14181c;
  --reader-ink: #d7dde2;
  --reader-ink2: #b8c1c9;
  --reader-muted: #8a96a0;
  --reader-line: #2a3238;
  --reader-accent: #8fc1e8;
}
.reader-box[data-theme="sepia"] {
  --reader-bg: #f6efe0;
  --reader-ink: #43382c;
  --reader-ink2: #5f5345;
  --reader-muted: #8d8171;
  --reader-line: #e2d7c0;
  --reader-accent: #a05c2c;
}
.reader-box {
  background: var(--reader-bg);
  border-color: var(--reader-line);
}
/* 顶部进度条 */
.reader-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 3;
  background: transparent; pointer-events: none;
}
.reader-progress i {
  display: block; height: 100%; width: 0;
  background: var(--reader-accent); opacity: .8;
  transition: width .1s linear;
}
.reader-close {
  position: static; flex-shrink: 0;
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--reader-muted); cursor: pointer;
  margin-left: 2px;
}
.reader-close:hover { color: var(--reader-ink); }
.reader-scroll { flex: 1; overflow-y: auto; padding: 26px 40px 44px; }
.reader-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 22px 40px 14px; margin: 0 -40px 18px;
  border-bottom: 1px solid var(--reader-line);
  background: var(--reader-bg);
}
.reader-title-wrap { flex: 1; min-width: 0; }
.reader-title {
  font-size: 21px; font-weight: 800; line-height: 1.35;
  letter-spacing: -0.02em; color: var(--reader-ink);
}
.reader-meta { display: block; font-size: 12px; color: var(--reader-muted); margin-top: 3px; }
.reader-tools {
  flex-shrink: 0; display: flex; align-items: center; gap: 4px;
  margin-top: 2px;
}
.reader-tool {
  font-size: 13px; font-weight: 700; color: var(--reader-muted);
  border: 1px solid var(--reader-line); border-radius: 8px;
  padding: 3px 8px; background: transparent; cursor: pointer;
  line-height: 1.2;
}
.reader-tool:hover { color: var(--reader-accent); border-color: var(--reader-accent); }
.reader-tool svg { width: 13px; height: 13px; display: block; }
.reader-origin {
  flex-shrink: 0; font-size: 12px; color: var(--reader-accent);
  font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap; margin-left: 4px;
}
.reader-origin:hover { text-decoration: underline; }
.reader-origin svg { width: 13px; height: 13px; }
/* 正文排版：字体三档（1 小 / 2 中默认 / 3 大） */
.reader-body {
  font-size: 15px; line-height: 1.9; color: var(--reader-ink2);
}
.reader-box[data-font="1"] .reader-body { font-size: 14px; line-height: 1.85; }
.reader-box[data-font="2"] .reader-body { font-size: 15px; line-height: 1.9; }
.reader-box[data-font="3"] .reader-body { font-size: 17px; line-height: 1.95; }
.reader-body p { margin: 0 0 14px; }
.reader-body .reader-h {
  font-size: 1.05em; font-weight: 700; color: var(--reader-ink);
  margin: 18px 0 8px; letter-spacing: -0.01em;
}
.reader-body blockquote {
  margin: 0 0 14px; padding: 8px 16px;
  border-left: 3px solid var(--reader-accent);
  background: color-mix(in srgb, var(--reader-accent) 6%, transparent);
  color: var(--reader-ink2);
}
.reader-body .reader-li {
  padding-left: 1.2em; position: relative; margin-bottom: 8px;
}
.reader-body .reader-li::before {
  content: "•"; position: absolute; left: 0.2em; color: var(--reader-accent);
}
.reader-fig { margin: 0 0 16px; }
.reader-fig img {
  display: block; max-width: 100%; border-radius: 10px;
  box-shadow: var(--shadow-sm); margin-bottom: 6px;
}
.reader-fig figcaption {
  font-size: 12px; color: var(--reader-muted); text-align: center;
}

/* ============ 资讯页 · 移动端适配 ============ */
@media (max-width: 767px) {
  /* 控制区压薄：减小各过滤行间距与字号 */
  .news-filter { margin-top: 10px; gap: 8px; }
  .news-filter-lab { font-size: 11px; }
  .news-note { margin-top: 10px; font-size: 11px; line-height: 1.6; }

  /* 顶部控制行：分类 tab 独占整行横向滚动，操作按钮换行到下方并紧凑 */
  .news-ctl-row { flex-wrap: wrap; }
  .news-ctl-row .tabs.grow { flex-basis: 100%; }
  .news-ctl-row .btn { padding: 5px 10px; font-size: 12px; }

  /* 视图/时间 tab 标签：紧凑 */
  .news-view-tabs .tab, .news-filter .tab { padding: 5px 10px; font-size: 12px; }
  .news-filter #globalQ { font-size: 14px; }

  /* 卡片更紧凑：减小内边距与间距 */
  .news-card { border-radius: var(--radius-sm); }
  .news-body { padding: 11px 12px 12px; gap: 6px; }
  .news-title { font-size: 14px; }
  .news-sum { font-size: 12px; }
  .news-grid { gap: 12px; }
  .news-src-blk { padding: 14px 0; }
  .news-src-head { margin-bottom: 10px; }

  /* 时间混排视图：行高紧凑，隐藏来源列（640 已有，这里补间距） */
  .tl-news { padding: 7px 8px; gap: 8px; }
  .tl-news-date { font-size: 10px; }
  .tl-news-cat { min-width: 34px; font-size: 10px; }

  /* 阅读器浮层：手机上尽量全屏，正文更易读 */
  .reader-mask { padding: 0; }
  .reader-box { max-width: 100%; height: 100vh; border-radius: 0; border: none; }
  .reader-scroll { padding: 22px 18px 36px; }
  .reader-title { font-size: 18px; }
  .reader-body { font-size: 15px; line-height: 1.85; }
  .reader-close { top: 14px; right: 18px; }
}

/* 资讯加载骨架屏 */
.news-skeleton { padding: 6px 0; }
.news-skeleton .sk-line { margin-bottom: 14px; }
.news-skeleton .sk-block { margin-bottom: 14px; }

/* 降级卡：失败/未抓取的源 */
.news-degraded { font-size: 12px; }
.degraded-tt {
  font-weight: 700; font-size: 13px; color: var(--ink);
  margin-bottom: 4px;
}
.degraded-act {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
}
.degraded-act a { color: var(--accent); font-weight: 600; }
.tab-cnt {
  font-weight: 700; font-size: 10px; color: #fff;
  margin-left: 5px; font-family: var(--mono);
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: 1px;
}
[data-theme="dark"] .tab-cnt, [data-theme="midnight"] .tab-cnt { color: #161006; }
/* 当前选中分类的未读徽标：放大强调 */
.tab.on .tab-cnt { box-shadow: 0 0 0 2px color-mix(in srgb, var(--card) 60%, transparent); }
.news-filter { margin-top: 12px; align-items: center; gap: 12px; }
.news-filter-lab {
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.news-unread-tg {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--muted); cursor: pointer; user-select: none;
  margin-left: auto;
}

/* ============ 设置 ============ */
.set-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.set-row:last-child { border-bottom: none; }
.set-row .s-name {
  font-weight: 700; font-size: 13px;
  width: 130px; letter-spacing: -0.005em;
}
.set-row .s-desc {
  font-size: 12px; color: var(--muted); flex-basis: 100%;
  margin-top: -4px; padding-left: 144px; line-height: 1.65;
}
.set-row .s-desc b { color: var(--ink); }
.set-row code {
  font-family: var(--mono); font-size: 11px;
  background: var(--card2); padding: 1px 6px; border-radius: 4px;
}

/* ============ AI 面板 ============ */
/* AI 月报 tab：4 个 KPI + 顶部支出 Top + AI 文本 */
.rpt-ai-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 10px; }
.rpt-ai-kpi { background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px; text-align: center; }
.rpt-ai-kpi .lab { font-size: 11px; color: var(--muted); }
.rpt-ai-kpi .val { font-family: var(--mono); font-size: 22px; font-weight: 800; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.rpt-ai-kpi .sub { font-size: 11px; color: var(--muted); }
.rpt-ai-top { margin-top: 14px; font-size: 12px; color: var(--ink-2); padding: 8px 12px; background: var(--card2); border-radius: var(--radius); }
.rpt-ai-meta { align-self: center; font-size: 12px; color: var(--muted); }
.ai-loading { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .rpt-ai-grid { grid-template-columns: repeat(2, 1fr); } }

.ai-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--card2);
  border-radius: var(--radius);
  font-size: 13px; line-height: 1.7;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.ai-panel::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.ai-panel-tt {
  font-weight: 800; margin-bottom: 6px;
  letter-spacing: -0.01em; color: var(--ink);
}
.ai-panel-body { color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.ai-panel.err {
  background: color-mix(in srgb, var(--danger) 6%, var(--card)); color: var(--danger);
}
.ai-panel.err::before { background: var(--danger); }
.ai-sub { display: block; padding: 4px 0; cursor: pointer; }
.ai-sub input { margin-right: 8px; }

/* ============ 响应式 ============ */
@media (max-width: 1023px) {
  .sidebar { width: 68px; padding: 20px 10px; }
  .brand-txt, .nav a > span:last-child, .theme-btn span { display: none; }
  .nav a, .nav-parent { justify-content: center; padding: 11px 8px; }
  .brand { justify-content: center; padding: 0 0 20px; }
  .brand-ic { width: 36px; height: 36px; }
  /* 窄条模式：隐藏分组标题，子菜单常驻展开，退化为纯图标平铺 */
  .nav-parent { display: none; }
  .nav-sub { grid-template-rows: 1fr !important; }
  .nav-sub-inner { overflow: visible; }
  .nav-sub a { padding-left: 8px; justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .notes-layout { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .main { padding: 28px 30px 80px; }
}
@media (max-width: 1023px) and (min-width: 768px) {
  .chart-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) and (min-width: 768px) {
  /* 窄侧栏/窄桌面区间（768~1100px）：资讯分类 tabs 单行横向滚动，避免溢出屏幕 */
  .news-ctl-row .tabs.grow { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .news-ctl-row .tabs.grow::-webkit-scrollbar { display: none; }
  .news-ctl-row .tabs.grow .tab { flex-shrink: 0; }
}
@media (max-width: 767px) {
  /* —— 防横向溢出：页面只允许纵向滚动，根治左右能拖动的问题 —— */
  html, body { overflow-x: hidden; max-width: 100vw; overscroll-behavior-x: none; }
  .sidebar { display: none; }
  .tabbar { display: flex; }
  .theme-btn.mini { display: inline-flex; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 18px; }
  .hero-greet { font-size: 30px; letter-spacing: -0.03em; }
  .hero-date { margin-bottom: 22px; }
  .gsearch-wrap { max-width: 150px; }
  .gsearch-wrap input { padding: 8px 14px; }
  .chart-grid { grid-template-columns: 1fr; gap: 16px; }
  .chart-grid-2 { grid-template-columns: 1fr; }
  /* 模考录入表单：手机上 7 个控件改两列网格，备注与按钮各占整行 */
  .gk-exam-form { display: grid; grid-template-columns: 1fr 1fr; }
  .gk-exam-form input { width: auto !important; }
  .gk-exam-form .grow, .gk-exam-form button { grid-column: 1 / -1; }
  .stat-grid { gap: 10px; }
  .stat { padding: 16px 17px; }
  .stat .s-val { font-size: 24px; }
  .stat .s-lab { font-size: 10px; margin-bottom: 8px; }
  .cal-cell { min-height: 50px; padding: 5px 6px; }
  .cal-title { font-size: 17px; }
  .tabbar a, .tab-more { font-size: 10px; }
  .news-grid { grid-template-columns: 1fr; }
  .dash-actions { grid-template-columns: 1fr; }
  /* 时间轴：窄屏收窄时间刻度列与脊柱位置 */
  .focus-tl::before { left: 48px; }
  .tl-item { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding-left: 4px; }
  .tl-slot { font-size: 10px; padding: 2px 4px; max-width: 44px; }
  .tl-main { gap: 8px; }
  .card { padding: 16px 14px; border-radius: var(--radius); }
  .topbar { margin-bottom: 18px; gap: 10px; }

  /* —— 输入控件 ≥ 16px：避免 iOS 聚焦时自动放大页面 —— */
  input, select, textarea { font-size: 16px; padding: 10px 13px; }
  .gsearch-wrap input { font-size: 16px; }
  .login-card input { font-size: 16px; }
  .tx-goal-edit input { font-size: 16px; width: 130px; }

  /* —— 表单固定宽度废除：内联 style="width:xxx" 在小屏一律拉伸自适应 —— */
  .row input, .row select { width: auto !important; max-width: 100%; flex: 1 1 140px; min-width: 0; }
  .row input[type="file"] { max-width: 100% !important; flex-basis: 100%; }
  .row .btn, .row .icon-btn, .row .due-quick, .row .tag, .row .badge { flex: 0 0 auto; }
  textarea { font-size: 16px; }

  /* —— 触控目标加大 —— */
  .btn { padding: 10px 18px; }
  .btn.sm { padding: 8px 14px; font-size: 13px; }
  .chk { width: 22px; height: 22px; font-size: 13px; }
  .icon-btn { padding: 8px 10px; font-size: 16px; }
  .tx-acts .icon-btn { width: 34px; height: 34px; font-size: 16px; }
  .tab { padding: 8px 14px; font-size: 13px; }
  .item { padding: 12px 10px; }
  .theme-btn.mini { padding: 8px 12px; }

  /* —— 补充小触控目标加大 —— */
  .heat-cell { aspect-ratio: 1.2; font-size: 12px; }   /* 热力图格子加高，增大点按区 */
  .heat-grid { gap: 5px; }
  .news-fav { padding: 8px 10px; font-size: 17px; }      /* 收藏星热区 */
  .news-read { padding: 8px; }                          /* 站内阅读按钮热区 */
  .file-preview-btn { padding: 8px 12px; font-size: 13px; } /* 网盘预览按钮 */
  .tx-cat-del { padding: 6px 8px; }

  /* —— 分类 tabs：单行横向滑动，不再撑破页面 —— */
  .row .tabs, .tabs.grow { flex: 1 1 100%; min-width: 0; }
  .tabs {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }

  /* —— 设置页：取消桌面对齐缩进，改为堆叠 —— */
  .set-row { gap: 10px; }
  .set-row .s-name { width: 100%; }
  .set-row .s-desc { padding-left: 0; margin-top: 0; }
  .set-row input, .set-row select { width: auto !important; max-width: 100%; flex: 1 1 140px; min-width: 0; }
  .set-row input[type="file"] { flex-basis: 100%; }

  /* —— 网盘：头部搜索框自适应换行（覆盖内联 width/font-size） —— */
  .drive-header, .browser-header { flex-wrap: wrap; gap: 10px; }
  .drive-header > div { flex: 1 1 100%; }
  .drive-header input, .browser-header input {
    width: auto !important; flex: 1 1 auto; min-width: 0;
    margin-left: 0 !important; font-size: 16px !important;
  }
  .drive-grid { grid-template-columns: 1fr; }

  /* —— 横向可滚区域顺滑滚动 —— */
  .md-preview pre { -webkit-overflow-scrolling: touch; }
  .gsearch-panel { max-height: 60vh; }
}

/* 触屏设备：去掉 hover 位移效果，避免点击后卡片“粘住”悬浮态 */
@media (hover: none) {
  .stat:hover, .ql-card:hover, .news-card:hover, .drive-card:hover { border-color: var(--rule); transform: none; }
  .ql-ops { opacity: 1; }
  .ql-card, .news-card, .stat { transform: none !important; }
}

/* 减弱动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== 网盘模块 ========== */
.drive-container {
  padding: 16px 0;
}
.drive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.drive-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.drive-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.drive-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm), var(--card-lit);
  transition: all .2s;
}
.drive-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), var(--card-lit);
}
.drive-icon {
  font-size: 32px;
  line-height: 1;
}
.drive-info {
  flex: 1;
}
.drive-name {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 4px;
}
.drive-status {
  font-size: 12px;
  color: var(--muted);
}
.drive-status.online {
  color: var(--ok);
  font-weight: 700;
}
.drive-status.offline {
  color: var(--danger);
}
.drive-arrow {
  font-size: 20px;
  color: var(--muted);
}
.drive-browser {
  padding: 0;
}
.browser-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.browser-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.browser-path {
  margin-bottom: 16px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm), var(--card-lit);
}
.crumb {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
}
.crumb:hover {
  background: var(--card2);
  color: var(--ink);
}
.crumb.current {
  color: var(--ink);
  font-weight: 700;
  cursor: default;
  background: var(--card2);
}
.crumb-sep {
  color: var(--muted);
  opacity: 0.4;
  font-size: 11px;
}
.back-btn {
  flex-shrink: 0;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .15s;
}
.file-item:hover {
  border-color: var(--accent);
  background: var(--card2);
}
.file-item.dir {
  background: var(--card2);
  border-style: dashed;
}
.file-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}
.file-info {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.file-date {
  opacity: 0.7;
}
.file-preview-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s;
}
.file-preview-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--card2);
}
.set-group {
  margin-bottom: 24px;
}
.set-group h3 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 800;
}

/* 统计报表：习惯进度条 */
.hp-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hp-bar {
  flex: 1; height: 4px; background: var(--card2); border-radius: 2px;
  overflow: hidden;
}
.hp-bar-fill {
  height: 100%; border-radius: 2px; transition: width .3s;
}
.hp-pct {
  font-size: 11px; color: var(--muted); font-family: var(--mono);
  white-space: nowrap;
}

/* 考公：图表标题栏（含筛选下拉）+ 笔记速览可点 + 模考排名/备注 */
.chart-tt-flex { display: flex; justify-content: space-between; align-items: center; }
.gk-note-li { cursor: pointer; }
.exam-rank { color: var(--muted); font-size: 12px; }


/* ================= 登录遮罩：检票口 ================= */
.login-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(255, 122, 77, 0.13), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(224, 85, 63, 0.08), transparent 60%),
    var(--bg);
  padding: 20px;
}
/* display:flex 会覆盖 UA 样式的 [hidden]，必须显式兜底 */
.login-mask[hidden] {
  display: none;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--card-lit);
  position: relative;
  animation: heroIn .4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* 检票口打孔条 */
.login-card::before {
  content: "";
  position: absolute; top: 14px; left: 14px; right: 14px;
  border-top: 2px dashed var(--rule);
  opacity: .55;
}
.login-logo {
  width: 52px;
  height: 52px;
  margin: 10px auto 16px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-a), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px -3px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
[data-theme="dark"] .login-logo, [data-theme="midnight"] .login-logo { background: linear-gradient(135deg, var(--accent-hover), var(--accent)); color: #fff; }
.login-logo svg { width: 24px; height: 24px; }
.login-card h2 {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.login-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 22px;
}
/* 进站口：到发信息装饰条（纯视觉，非交互） */
.login-board {
  margin: -10px 0 18px;
  padding: 8px 14px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}
.login-board .lb-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--muted);
}
.login-board .lb-line b {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.login-board .lb-line .lb-ok { color: var(--ok); }
.login-card input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 11px 14px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}
.login-btn {
  width: 100%;
  padding: 11px 0;
  font-size: 15px;
  margin-top: 2px;
  border-radius: var(--radius-sm);
}
.login-err {
  font-size: 13px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 12px;
}
.login-tip {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.7;
}

/* ============ 考公中心 ============ */
.gk-target-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.gk-target {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm), var(--card-lit);
  transition: all .2s;
}
.gk-target:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), var(--card-lit);
  transform: translateY(-1px);
}
.gk-target.ended {
  opacity: .65;
  background: transparent;
}
.gk-target .icon-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
}
.gk-target:hover .icon-btn { opacity: 1; }
/* 触屏设备没有 hover，删除按钮常显，否则手机上删不了目标 */
@media (hover: none) {
  .gk-target .icon-btn { opacity: 1; }
}
.gk-target-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.gk-target-type {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}
.gk-target-day {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-strong);
  letter-spacing: -0.03em;
  font-family: var(--mono);
}
[data-theme="dark"] .gk-target-day, [data-theme="midnight"] .gk-target-day { color: var(--accent); }
.gk-target.ended .gk-target-day { color: var(--muted); font-size: 22px; }
.gk-target-day small { font-size: 13px; font-weight: 700; margin-left: 2px; }
.gk-target-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  font-family: var(--mono);
}
.gk-habit-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  margin-bottom: 8px;
  transition: all .15s;
}
.gk-habit-card:hover { background: var(--card2); }
.gk-habit-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.gk-habit-info .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gk-habit-info .txt {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  font-size: 13px;
}
.gk-habit-info .streak {
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
  font-family: var(--mono);
  font-weight: 700;
}
.gk-task-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* 考前提醒：≤3 天红边高亮 */
.gk-target.soon {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 10%, transparent);
}
.gk-target.soon .gk-target-day { color: var(--danger); }
.gk-target-warn {
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.gk-target-warn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}

/* 模考分数涨跌 */
.gk-delta {
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
  white-space: nowrap;
}
.gk-delta.flat {
  color: var(--muted);
  font-weight: 500;
}

/* ============ 视图容器 ============ */
.view { min-height: 60vh; }

/* ============ 补充布局：记账双栏 / 筛选行 / 行内数字输入 ============ */
/* 记账：左列明细+统计，右列预算/目标/模板/图表（视觉更轻，首屏先看明细） */
.fin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.92fr);
  gap: 14px;
  align-items: start;
}
.fin-col-left, .fin-col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.fin-col-left .card + .card, .fin-col-right .card + .card { margin-top: 0; }
/* 记账：次级卡默认只露出标题行（右栏模板/日程聚光，不抢占首屏） */
.tx-minor-head { display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none; }
.tx-minor-tt { font-weight:800; font-size: 14px; }
.tx-minor-sum { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.tx-minor-chev { font-size: 12px; color: var(--muted); }
.tx-minor-body { margin-top: 10px; }
.tx-minor-card.is-collapsed .tx-minor-body { display: none; }
.tx-minor-ic { width: 22px; height: 22px; display:inline-flex; align-items:center; justify-content:center; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tx-flat { display: inline-flex; align-items:center; gap:6px; margin-left: 8px; font-size: 12px; color: var(--muted); }
.tx-flat .tag { font-size: 11px; }
.tx-tools { flex-wrap: wrap; }
.tx-actions { flex-wrap: wrap; justify-content: flex-end; }
.tx-filter-chips { display:flex; gap:6px; flex-wrap:wrap; align-items:center; padding-bottom: 6px; color: var(--muted); font-size: 12px; }
.tx-filter-chips .tx-chip-all { font-size: 11px; }
.tx-chip { display:inline-flex; align-items:center; gap:4px; padding: 3px 8px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); font-size: 12px; color: var(--ink); }
.tx-chip i { cursor: pointer; font-style: normal; }
.tx-toolbar { display:flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.tx-date-panel { display:none; gap:6px; align-items:center; flex-wrap: wrap; padding-top: 6px; }
.tx-date-panel.is-open { display: flex; }
.tx-stat-head { display:flex; align-items:center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tx-stat-seg { display:inline-flex; gap: 6px; flex-wrap: wrap; }
.tx-stat-nav { display:inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* 股票：持仓行内编辑数字输入 */
.stk-in {
  width: 110px; padding: 5px 9px; font-size: 12px;
  border-radius: var(--radius-xs);
}
.stk-form { margin-bottom: 8px; }
/* 网盘：文件浏览内容区 */
.browser-content { min-width: 0; }

@media (max-width: 767px) {
  .fin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .gk-target-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gk-target { padding: 14px 10px; }
  .gk-target .icon-btn { opacity: 1; }
  .gk-target-day { font-size: 26px; }
  .gk-habit-card { flex-wrap: wrap; }
}

/* ============================================================
   统计报表页（js/reports.js · 路由 #/reports）· 追加样式
   ------------------------------------------------------------
   说明：本页复用中部既有类 .card/.stat-grid/.chart-grid/
   .chart-grid-2/.chart-box/.chart-tt/.tabs/.tab/.tx-year-sel/
   .tx-year-wrap/.tx-year-table/.item/.pri-dot/.badge/.empty，
   以下仅补充本页私有类。
   ============================================================ */

/* tab 面板内容容器 */
.reports-tab-content {
  padding-top: 16px;
}

/* 图表 canvas 固定显示高度：Chart.js 用 maintainAspectRatio:false
   时按容器高度渲染，而 .chart-box 高度是 auto（由内容撑开），
   会导致「canvas 撑高容器 → 容器变高 → 图表重渲染」循环膨胀
   （实测被撑到上万像素）。!important 压住 Chart.js 写入的内联高度。 */
.reports-tab-content .chart-box canvas {
  height: 180px !important;
}

/* 健康指标统计区（三列：最新 / 平均 / 最大） */
.reports-health-meta {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 10px; text-align: center;
}
/* 单个统计项（文字标签 + 数值） */
.reports-health-meta-item {
  background: var(--card2);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px; color: var(--muted);
}
/* 统计数值 */
.reports-health-meta-val {
  font-size: 18px; font-weight: 800;
  font-family: var(--mono); color: var(--ink);
  margin-top: 4px;
}

/* 优先级分布三列卡 */
.reports-pri-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-top: 16px;
}
/* 单优先级卡 */
.reports-pri-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px; text-align: center;
}
/* 优先级标签（高/中/低，颜色由 JS 内联覆盖） */
.reports-pri-label {
  font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: 0.03em;
}
/* 优先级数字 */
.reports-pri-num {
  font-size: 24px; font-weight: 800;
  font-family: var(--mono); margin: 8px 0;
}
/* 优先级副注 */
.reports-pri-sub {
  font-size: 11px; color: var(--muted);
}
/* 统计页移动端：窄屏三列改单列，避免拥挤 */
@media (max-width: 640px) {
  .reports-health-meta { grid-template-columns: 1fr; gap: 8px; }
  .reports-health-meta-item { padding: 8px; }
  .reports-pri-grid { grid-template-columns: 1fr; gap: 10px; }
  .reports-pri-card { padding: 12px; display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .reports-pri-num { margin: 0; }
}

/* ============================================================
   日历视图页（js/calendar.js · 路由 #/calendar）· 追加样式
   ------------------------------------------------------------
   说明：本页复用中部既有类 .cal-grid/.cal-wd/.cal-cell
   （含 .dim/.today/.sel）/.d-num/.d-dot/.d-more/.pri-dot/
   .badge/.b-danger/.b-warn/.b-primary/.card/.btn/.icon-btn，
   以下仅补充本页私有类；月历整体适配见本区块末尾。
   注意：calendar.js 当前在部分元素上带内联样式（会覆盖同名类），
   这些 CSS 类作为规范定义，内联样式清理后即生效。
   ============================================================ */

/* 月份切换控制栏 */
.cal-ctrl {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
/* 年月标题 */
.cal-ctrl-title {
  font-size: 17px; font-weight: 800; color: var(--ink);
}

/* 本月概览条：打卡/任务/结余/预算进度 */
.cal-overview {
  display: flex; align-items: stretch; gap: 8px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.cal-ov {
  flex: 1; min-width: 110px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-ov-lab { font-size: 11px; color: var(--muted); letter-spacing: 0.03em; }
.cal-ov-val { font-family: var(--mono); font-size: 16px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-ov-bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.cal-ov-bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.cal-ov-tag { font-size: 11px; font-weight: 700; }
.cal-ov-budget.ok .cal-ov-tag { color: var(--ok); }
.cal-ov-budget.warn .cal-ov-tag { color: var(--warn); }
.cal-ov-budget.over { border-color: var(--danger); }
.cal-ov-budget.over .cal-ov-tag { color: var(--danger); }
@media (max-width: 640px) { .cal-ov { min-width: calc(50% - 4px); } }

/* 日期格内任务数徽标（小药丸，默认琥珀底） */
.cal-task-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; line-height: 1;
  background: var(--accent); color: #3a2a1a;
}
/* 暗色下琥珀底改用深墨文字（沿用本文件既有约定，如 .tab.on/.cal-cell.today） */
[data-theme="dark"] .cal-task-badge, [data-theme="midnight"] .cal-task-badge { color: #161006; }
/* 逾期红底 */
.cal-task-badge.overdue { background: var(--danger); }
/* 完成绿底 */
.cal-task-badge.done    { background: var(--ok); }
/* 进行中琥珀底 */
.cal-task-badge.pending { background: var(--accent); }

/* 日期格内支出合计小字（红） */
.cal-tx-sum {
  font-size: 11px; color: var(--danger);
  font-variant-numeric: tabular-nums;
}
/* 收入合计（绿） */
.cal-tx-sum.positive { color: var(--ok); }

/* 日期格内习惯打卡色点容器 */
.cal-habit-dots {
  display: flex; gap: 3px; margin-top: 2px; flex-wrap: wrap;
}

/* 当日详情卡内分区标题 */
.cal-detail-section {
  font-size: 13px; font-weight: 700; color: var(--muted);
  margin: 12px 0 6px;
}
/* 详情内任务行 */
.cal-detail-task {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 13px;
}
.cal-detail-task.done { text-decoration: line-through; color: var(--muted); }
.cal-detail-ok { color: var(--ok); font-weight: 700; flex-shrink: 0; }
.cal-detail-txt { flex: 1; min-width: 0; }
.cal-detail-txt.badge { flex: 0 0 auto; }
/* 详情内流水行 */
.cal-detail-tx {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 0; font-size: 13px;
}
/* 详情内打卡行 */
.cal-detail-habit {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px;
}
/* 详情内当日合计 */
.cal-detail-total {
  font-weight: 800; font-size: 13px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--line);
}
/* 详情卡头部（选中日期） */
.cal-detail-head {
  font-size: 14px; font-weight: 800; margin-bottom: 8px; color: var(--ink);
}

/* ---------- 月历视图适配补充 ----------
   既有 .cal-grid（repeat(7,1fr)）/.cal-cell（min-height:70px）/
   .dim/.today/.sel/.d-num/.d-dot/.d-more 已满足完整月历需求。
   以下仅针对日历页（#view 直接子级 .cal-grid）做两处增强：
   ① 格子加高，容纳「日期 + 任务徽标 + 收支小字 + 习惯色点」并保持整行等高；
   ② 今天的格子（琥珀底）里徽标加一圈描边，避免同色系粘连。
   记账页月历 .cal-grid 在 .card 内，不受此选择器影响。 */
#view > .cal-grid > .cal-cell {
  min-height: 88px;
}
#view > .cal-grid > .cal-cell.today .cal-task-badge {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] #view > .cal-grid > .cal-cell.today .cal-task-badge, [data-theme="midnight"] #view > .cal-grid > .cal-cell.today .cal-task-badge {
  box-shadow: 0 0 0 2px rgba(22, 16, 6, 0.3);
}
@media (max-width: 640px) {
  #view > .cal-grid > .cal-cell { min-height: 64px; padding: 6px 8px; }
}

/* ---------- 灵感速记（quick.js） ---------- */
.quick-fab {
  position: fixed; right: 18px; bottom: 92px; z-index: 90;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 14px; border-radius: var(--radius-pill);
  background: var(--card2); color: var(--accent-strong);
  border: 1px solid var(--line); cursor: pointer;
  font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.2));
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.quick-fab svg { width: 14px; height: 14px; }
.quick-fab:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: var(--shadow-md), 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.quick-panel {
  position: fixed; right: 18px; bottom: 116px; z-index: 91;
  width: 340px; max-width: calc(100vw - 24px);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md), var(--card-lit);
  overflow: hidden;
  animation: focusIn .18s ease-out;
}
.quick-head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.quick-tt { font-size: 14px; font-weight: 800; flex: 1; }
.quick-body { padding: 12px 14px 14px; }
.quick-body textarea {
  width: 100%; resize: vertical; min-height: 64px;
  padding: 9px 11px; font-size: 13px; line-height: 1.6;
  background: var(--card2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; outline: none;
}
.quick-body textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; min-height: 0; }
.quick-tag {
  font-size: 11px; font-family: var(--mono); color: var(--accent);
  background: var(--accent-soft); padding: 1px 7px; border-radius: var(--radius-pill);
}
.quick-acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.quick-list {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  list-style: none; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
}
.quick-empty { font-size: 12px; color: var(--muted); padding: 4px 2px; }
.quick-li { display: flex; flex-direction: column; gap: 3px; padding: 7px 9px; background: var(--card2); border-radius: 8px; }
.quick-li-txt { font-size: 13px; color: var(--ink); word-break: break-word; }
.quick-li-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.quick-li-time { margin-right: auto; }

/* ---------- 自定义提醒（reminders.js） ---------- */
.rm-weekdays { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.rm-dow { padding: 4px 9px; font-size: 12px; border-radius: var(--radius-pill); }
.rm-dow.on { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.rm-title { font-weight: 600; }
.rm-period { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.rm-status { margin-left: auto; display: inline-flex; align-items: center; }

/* ---------- 倒数日·纪念日（anniv.js） ---------- */
.anniv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.anniv-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 13px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s;
}
.anniv-card:hover { border-color: var(--accent); }
.anniv-card.urgent { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.anniv-card.done { opacity: .55; }
.anniv-emoji { font-size: 22px; line-height: 1.2; }
.anniv-body { flex: 1; min-width: 0; }
.anniv-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.anniv-name small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.anniv-date { font-size: 11px; font-family: var(--mono); color: var(--muted); margin-top: 2px; }
.anniv-diff { font-size: 13px; color: var(--accent); font-weight: 700; margin-top: 3px; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.anniv-diff.urgent { color: var(--danger); }
.anniv-diff.muted { color: var(--muted); }
.an-yearly { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .quick-fab { right: 12px; bottom: 138px; padding: 8px 12px; font-size: 12px; }
  .quick-panel { right: 8px; bottom: 106px; width: calc(100vw - 16px); }
  .anniv-grid { grid-template-columns: 1fr; }
}


/* 终端主题：等宽数字带 CRT 微光 */
[data-theme="terminal"] .s-val, [data-theme="terminal"] .dash-gk-day b, [data-theme="terminal"] .anniv-diff {
  text-shadow: 0 0 6px rgba(51, 255, 102, 0.55);
}
[data-theme="terminal"] ::selection { background: #33ff66; color: #050505; }
[data-theme="terminal"] .chk { border-radius: 0; }
[data-theme="terminal"] .item.done .chk { border-radius: 0; }
/* 报纸主题：正文左对齐衬线更报纸味；表格数字保留等宽 */
[data-theme="newsprint"] body { -webkit-font-smoothing: antialiased; }

/* 奶系绿主题覆盖 */
[data-theme="mint"] body, [data-theme="mint-dark"] body {
  background: var(--bg);
  background-image: none;
}
/* 奶系：全局纸纹减弱（卡感更"干净柔"），但保留薄层纹理 */
[data-theme="mint"] body::before, [data-theme="mint-dark"] body::before { mix-blend-mode: multiply; }
[data-theme="mint-dark"] body::before { mix-blend-mode: screen; }
/* 奶系主题：导航激活态用嫩芽绿柔和底，不要琥珀发光 */
[data-theme="mint"] .nav a.active { background: rgba(91, 163, 123, 0.15); box-shadow: inset 3px 0 0 var(--accent), 0 0 18px -10px rgba(91, 163, 123, 0.6); }
[data-theme="mint"] .nav a.active .nic { color: var(--accent); }
[data-theme="mint-dark"] .nav a.active { background: rgba(130, 193, 154, 0.18); box-shadow: inset 3px 0 0 var(--accent), 0 0 18px -10px rgba(130, 193, 154, 0.6); }
[data-theme="mint-dark"] .nav a.active .nic { color: var(--accent); }
/* 奶系：今天日期格子嫩芽绿底（不要琥珀） */
[data-theme="mint"] .cal-cell.today, [data-theme="mint-dark"] .cal-cell.today { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="mint"] .cal-cell.today .d-num, [data-theme="mint-dark"] .cal-cell.today .d-num { color: #fff; }
[data-theme="mint"] .cal-cell.today::after, [data-theme="mint-dark"] .cal-cell.today::after { background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4); }

/* ==========================================================================
   v96：mint 主题记账 App 质感覆盖（替换 v95 的大色卡/插画层）
   核心：米黄纸 + 奶油白卡 + 细描边 + 薄荷绿低饱和 + 留白多。
   ========================================================================== */
/* 侧栏：暖米黄底、墨绿字、白底菜单 + 薄荷绿细描边激活 */
[data-theme="mint"] .sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
  box-shadow: none;
}
[data-theme="mint"] .brand {
  flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 22px 18px 16px;
}
[data-theme="mint"] .brand-ic {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 140, 110, 0.25);
}
[data-theme="mint"] .brand-ic svg { width: 22px; height: 22px; }
[data-theme="mint"] .brand-txt {
  flex-direction: column; gap: 1px;
  font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.005em;
}
[data-theme="mint"] .brand-txt small {
  font-size: 11px; font-weight: 500; color: var(--muted);
  letter-spacing: 0.05em; font-family: var(--sans);
  background: none; padding: 0; margin: 0; border: none;
}
/* 菜单：白底圆角 + 薄荷绿细描边激活 */
[data-theme="mint"] .nav a, [data-theme="mint"] .nav-parent {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 4px;
  padding: 9px 12px; font-weight: 500;
}
[data-theme="mint"] .nav a:hover { background: var(--card); border-color: var(--accent); }
[data-theme="mint"] .nav a.active {
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid var(--accent); border-radius: 12px;
  box-shadow: 0 1px 0 var(--accent-soft);
  font-weight: 700;
}
[data-theme="mint"] .nav a .nic, [data-theme="mint"] .nav-parent .nic { color: var(--accent); }
[data-theme="mint"] .nav-group .nav-sub-inner a {
  background: transparent !important; border: none !important;
  padding-left: 26px; border-radius: 10px !important;
}
[data-theme="mint"] .nav-group .nav-sub-inner a.active {
  background: var(--accent-soft) !important; border: 1px solid var(--accent) !important;
}
/* 主题按钮：薄荷绿描边胶囊 */
[data-theme="mint"] .theme-btn {
  background: var(--card); color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px;
}
[data-theme="mint"] .theme-btn:hover { border-color: var(--accent); color: var(--accent-strong); }

/* 顶栏：透明背景，无阴影 */
[data-theme="mint"] .topbar {
  background: transparent;
  border-bottom: 1px dashed var(--line);
  box-shadow: none;
}
[data-theme="mint"] .page-title { color: var(--ink); font-weight: 800; }

/* 搜索框：白底细描边 */
[data-theme="mint"] .gsearch-wrap #gsInput {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
[data-theme="mint"] .gsearch-wrap #gsInput:focus { border-color: var(--accent); }

/* hero 区：问候大标题 + 日期虚线分隔 */
[data-theme="mint"] .hero-greet { font-size: 32px; font-weight: 800; color: var(--ink); letter-spacing: -0.025em; }
[data-theme="mint"] .hero-greet::after { display: none; }
[data-theme="mint"] .hero-date {
  color: var(--muted); font-size: 13px; margin-bottom: 18px;
  border-bottom: 1.5px dashed var(--line); padding-bottom: 14px;
  background: none; padding-left: 0;
}
[data-theme="mint"] .dh-stats { grid-template-columns: repeat(4, 1fr); gap: 12px; }
[data-theme="mint"] .dh-cell {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s;
}
[data-theme="mint"] .dh-cell:hover { border-color: var(--accent); transform: translateY(-1px); }
[data-theme="mint"] .dh-cell .dh-val { font-size: 22px; font-family: var(--sans); font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
[data-theme="mint"] .dh-cell .dh-lab { color: var(--muted); font-weight: 600; }
[data-theme="mint"] .dh-cell .dh-sub { color: var(--muted); }

/* 卡片：奶油白卡 + 浅米描边 + 柔和投影 */
[data-theme="mint"] .card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
[data-theme="mint"] .card h2 {
  color: var(--ink); font-size: 15px; font-weight: 800;
  border-bottom: 1px solid var(--line); padding-bottom: 12px;
}
[data-theme="mint"] .card h2 .count {
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 999px; font-weight: 600;
}

/* stat 网格：4 列小卡（v96 回到 4 列，不再双列大卡） */
[data-theme="mint"] .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
[data-theme="mint"] .stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
[data-theme="mint"] .stat:hover { border-color: var(--accent); }
[data-theme="mint"] .stat .s-lab { color: var(--muted); font-weight: 600; }
[data-theme="mint"] .stat .s-lab::before { background: var(--accent); border-radius: 50%; transform: none; width: 6px; height: 6px; }
[data-theme="mint"] .stat .s-val { font-size: 26px; font-family: var(--sans); font-weight: 800; color: var(--ink); }
[data-theme="mint"] .stat .s-sub { color: var(--muted); }
[data-theme="mint"] .stat:first-child .s-val { color: var(--accent-strong); }
[data-theme="mint"] .s-ico { display: none; }  /* v96 不再用 emoji 图标 */

/* 横幅：白卡 + 薄荷绿左色条 */
[data-theme="mint"] .dash-gk {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
[data-theme="mint"] .dash-gk:hover { border-color: var(--accent); }
[data-theme="mint"] .dash-gk.urgent { border-left-color: var(--danger); }
[data-theme="mint"] .dash-anniv {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 14px;
}
[data-theme="mint"] .dash-banner {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}

/* 进度条：薄荷绿胶囊 */
[data-theme="mint"] .mini-bar { height: 8px; border-radius: 999px; background: var(--card2); overflow: hidden; }
[data-theme="mint"] .mini-bar i { background: var(--accent); border-radius: 999px; }

/* 按钮：薄荷绿胶囊 */
[data-theme="mint"] .btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: 999px; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
[data-theme="mint"] .btn:hover { background: var(--accent-hover); color: #fff; }
[data-theme="mint"] .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
[data-theme="mint"] .btn.ghost:hover { background: var(--accent-soft); }

/* 输入框：白底细描边 */
[data-theme="mint"] input[type="text"], [data-theme="mint"] input[type="number"], [data-theme="mint"] input[type="date"],
[data-theme="mint"] input:not([type]), [data-theme="mint"] select, [data-theme="mint"] textarea {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px;
}
[data-theme="mint"] input:focus, [data-theme="mint"] select:focus, [data-theme="mint"] textarea:focus { border-color: var(--accent); }

/* Tab：薄荷绿胶囊 */
[data-theme="mint"] .tab { border-radius: 999px; }
[data-theme="mint"] .tab.on { background: var(--accent); color: #fff; }

/* 列表项：白底细描边 */
[data-theme="mint"] .list { gap: 6px; }
[data-theme="mint"] .item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px;
}
[data-theme="mint"] .item:hover { border-color: var(--accent); }
[data-theme="mint"] .item.done { background: transparent; opacity: 0.65; }

/* 日历格：圆角浅米底 */
[data-theme="mint"] .cal-cell { border-radius: 10px; }
[data-theme="mint"] .cal-cell.today { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="mint"] .cal-cell.today .d-num { color: #fff; }

/* 储蓄进度环：薄荷绿 */
[data-theme="mint"] .save-ring .rg-fg { stroke: var(--accent); }

/* 倒计时/提醒卡 */
[data-theme="mint"] .anniv-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
[data-theme="mint"] .anniv-card:hover { border-color: var(--accent); }
[data-theme="mint"] .anniv-card.urgent { border-color: var(--danger); }

/* FAB：白底薄荷绿描边胶囊（区别于琥珀实心） */
[data-theme="mint"] .focus-fab {
  background: var(--card); color: var(--accent-strong);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
[data-theme="mint"] .quick-fab {
  background: var(--card); color: var(--accent-strong);
  border: 1px solid var(--line);
}
/* ==========================================================================
   日常集主题（daily）—— 米黄纸 + 纯黑衬线大标题 + 深紫主卡 + 细线分隔
   形态差异点：全站衬线字体、大标题、2px 粗描边卡片、右上彩色块、
   无圆角（直角报刊风）、列表用细线分隔（无卡片感）
   ========================================================================== */
[data-theme="daily"] {
  --bg:            #F5EFE1;
  --card:          #FFFDF5;
  --card2:         #EFE7D3;
  --ink:           #27211A;
  --ink-2:         #3D362C;
  --muted:         #6E6352;
  --muted-2:       #847869;
  --line:          #D8CDB4;
  --rule:          #B7A98A;
  --accent:        #5B4A8A;
  --accent-strong: #4A3B74;
  --accent-hover:  #6C5AA0;
  --accent-soft:   rgba(91, 74, 138, 0.10);
  --primary:       #27211A;
  --danger:        #B33A32;
  --warn:          #9C6B1F;
  --ok:            #3F6F52;
  --purple:        #5B4A8A;
  --rise:          #B33A32;
  --fall:          #3F6F52;
  --shadow-sm: none;
  --shadow-md: 0 1px 0 rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 2px 0 rgba(0, 0, 0, 0.06);
  --card-lit: none;
  --grain:         0.35;
  --sans: Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --serif: Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}
[data-theme="daily"] body { background-image: none; }
[data-theme="daily"] body::before { mix-blend-mode: multiply; opacity: 0.5; }

/* 大标题：衬线 + 黑墨 + 无装饰 */
[data-theme="daily"] .hero-greet {
  font-size: 34px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.01em; font-family: var(--serif);
}
[data-theme="daily"] .hero-greet::after { display: none; }
[data-theme="daily"] .hero-date { font-size: 12px; color: var(--muted); font-family: var(--serif); }
[data-theme="daily"] .page-title { font-family: var(--serif); font-weight: 700; }
[data-theme="daily"] .page-title::before { display: none; }

/* 双列数字卡：白底 + 2px 粗描边 + 右上小色块 */
[data-theme="daily"] .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
[data-theme="daily"] .stat {
  border: 2px solid var(--rule); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: none; overflow: hidden;
  background: var(--card);
}
[data-theme="daily"] .stat::after {
  content: ""; position: absolute; right: 0; top: 0;
  width: 26px; height: 26px;
  background: var(--accent);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}
[data-theme="daily"] .stat:nth-child(2)::after { background: var(--warn); }
[data-theme="daily"] .stat:nth-child(3)::after { background: var(--ok); }
[data-theme="daily"] .stat:nth-child(4)::after { background: var(--danger); }
[data-theme="daily"] .stat .s-lab { font-family: var(--serif); font-size: 12px; }
[data-theme="daily"] .stat .s-lab::before { background: var(--ink); border-radius: 0; transform: none; width: 8px; height: 2px; }
[data-theme="daily"] .stat .s-val { font-family: var(--serif); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
[data-theme="daily"] .stat .s-sub { font-family: var(--serif); }

/* 卡片：粗描边 + 无阴影，标题下细线 */
[data-theme="daily"] .card {
  border: 2px solid var(--rule); border-radius: var(--radius);
  box-shadow: none; padding: 20px 22px;
}
[data-theme="daily"] .card h2 {
  font-family: var(--serif); font-size: 18px; font-weight: 700;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
[data-theme="daily"] .card h2 .count { border-radius: 4px; border: 1px solid var(--line); background: transparent; }

/* 列表：细线分隔，去卡片感 */
[data-theme="daily"] .list { gap: 0; }
[data-theme="daily"] .item {
  border-radius: 0; border-bottom: 1px dashed var(--line);
  background: transparent;
}
[data-theme="daily"] .item:hover { background: rgba(91, 74, 138, 0.04); }

/* 按钮：墨色或深紫，直角 */
[data-theme="daily"] .btn { border-radius: 6px; background: var(--accent-strong); color: #fff; box-shadow: none; }
[data-theme="daily"] .btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
[data-theme="daily"] .btn:hover { background: var(--accent-hover); color: #fff; }
[data-theme="daily"] .btn.ghost:hover { background: var(--accent-soft); color: var(--accent); }

/* 横幅：粗边框直角 */
[data-theme="daily"] .dash-gk { border: 2px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 6px; box-shadow: none; }
[data-theme="daily"] .dash-banner { border-radius: 6px; border: 1.5px solid var(--rule); }
[data-theme="daily"] .dash-gk-day b { color: var(--accent); }

/* 进度条：细线直角 */
[data-theme="daily"] .mini-bar { height: 8px; border-radius: 0; }
[data-theme="daily"] .mini-bar i { border-radius: 0; background: var(--accent-strong); }

/* 导航：直角 + 深紫激活 */
[data-theme="daily"] .nav a, [data-theme="daily"] .nav-parent { border-radius: 4px; }
[data-theme="daily"] .nav a.active {
  background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent);
  border-radius: 4px;
}
[data-theme="daily"] .nav a.active .nic { color: var(--accent); }

/* 日历/倒计时：直角 */
[data-theme="daily"] .cal-cell { border-radius: 4px; }
[data-theme="daily"] .anniv-card { border-radius: 8px; }
[data-theme="daily"] .tab { border-radius: 6px; }
[data-theme="daily"] .tab.on { background: var(--accent); color: #fff; }

/* 品牌 logo：深紫 */
[data-theme="daily"] .brand-ic { background: linear-gradient(135deg, #6C5AA0, var(--accent-strong)); color: #fff; }
[data-theme="daily"] .login-logo { background: linear-gradient(135deg, #6C5AA0, var(--accent-strong)); color: #fff; }

/* ==========================================================================
   玻璃拟态主题（glass）—— 深蓝灰渐变 + 半透明玻璃卡 + 大圆角 + 多色分类
   形态差异点：卡片玻璃模糊（backdrop-filter）、导航胶囊玻璃、
   数字卡多色渐变块、按钮渐变胶囊、背景顶部色斑
   ========================================================================== */
[data-theme="glass"] {
  color-scheme: dark;
  --bg:            #0E1626;
  --card:          rgba(255, 255, 255, 0.07);
  --card2:         rgba(255, 255, 255, 0.05);
  --ink:           #EAF0FA;
  --ink-2:         #C7D2E4;
  --muted:         #8FA0BB;
  --muted-2:       #74849E;
  --line:          rgba(255, 255, 255, 0.12);
  --rule:          rgba(255, 255, 255, 0.2);
  --accent:        #7C9CFF;
  --accent-strong: #5E7BEE;
  --accent-hover:  #93AFFF;
  --accent-soft:   rgba(124, 156, 255, 0.16);
  --primary:       #EAF0FA;
  --danger:        #FF7A76;
  --warn:          #FFC767;
  --ok:            #5FD3A0;
  --purple:        #B28CFF;
  --rise:          #FF7A76;
  --fall:          #5FD3A0;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --card-lit: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --grain:         0;
  --radius-xs: 12px;
  --radius-sm: 16px;
  --radius:    20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
/* 背景：深蓝渐变 + 顶部色斑（玻璃氛围光） */
[data-theme="glass"] body {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 156, 255, 0.22), transparent 60%),
    radial-gradient(700px 420px at 95% 5%, rgba(178, 140, 255, 0.16), transparent 60%),
    radial-gradient(800px 500px at 60% 110%, rgba(95, 211, 160, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* 卡片：玻璃 + 模糊 + 大圆角 */
[data-theme="glass"] .card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-sm), var(--card-lit);
  padding: 22px 24px;
}
[data-theme="glass"] .card h2 { font-size: 16px; font-weight: 800; }
[data-theme="glass"] .card h2 .count { border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); }

/* 数字卡：双列 + 彩色渐变图标块 */
[data-theme="glass"] .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
[data-theme="glass"] .stat {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px; padding: 20px 22px;
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow-sm), var(--card-lit);
  overflow: hidden;
}
/* 左侧渐变圆点 */
[data-theme="glass"] .stat .s-lab::before {
  width: 10px; height: 10px; border-radius: 50%; transform: none;
  background: linear-gradient(135deg, #7C9CFF, #5E7BEE);
  box-shadow: 0 0 8px rgba(124, 156, 255, 0.5);
}
[data-theme="glass"] .stat:nth-child(2) .s-lab::before { background: linear-gradient(135deg, #B28CFF, #8B5CE6); box-shadow: 0 0 8px rgba(178,140,255,0.5); }
[data-theme="glass"] .stat:nth-child(3) .s-lab::before { background: linear-gradient(135deg, #FFC767, #F59F2E); box-shadow: 0 0 8px rgba(255,199,103,0.5); }
[data-theme="glass"] .stat:nth-child(4) .s-lab::before { background: linear-gradient(135deg, #5FD3A0, #2EAF80); box-shadow: 0 0 8px rgba(95,211,160,0.5); }
[data-theme="glass"] .stat .s-val { font-size: 34px; font-family: var(--sans); color: #fff; text-shadow: 0 0 12px rgba(124,156,255,0.4); }
[data-theme="glass"] .stat .s-sub { color: var(--muted); }

/* 导航：玻璃胶囊菜单 */
[data-theme="glass"] .nav a, [data-theme="glass"] .nav-parent {
  border-radius: 999px;
  margin: 2px 0;
}
[data-theme="glass"] .nav a.active {
  background: rgba(124, 156, 255, 0.18);
  border: 1px solid rgba(124, 156, 255, 0.25);
  box-shadow: 0 0 16px rgba(124, 156, 255, 0.2), var(--card-lit);
}
[data-theme="glass"] .nav a.active .nic { color: #A9C0FF; }

/* 按钮：渐变胶囊 + 玻璃（深字：渐变蓝底配白字仅 3.79:1，深墨字 ≥6:1） */
[data-theme="glass"] .btn {
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0d1830; border: none;
  box-shadow: 0 2px 12px rgba(94, 123, 238, 0.4), var(--card-lit);
}
[data-theme="glass"] .btn:hover { background: linear-gradient(135deg, var(--accent-hover), var(--accent)); color: #0d1830; }
[data-theme="glass"] .btn.ghost { background: rgba(255,255,255,0.06); color: var(--ink); border: 1px solid rgba(255,255,255,0.16); box-shadow: none; }
[data-theme="glass"] .btn.ghost:hover { background: rgba(255,255,255,0.12); color: var(--ink); }
[data-theme="glass"] .btn.danger { background: transparent; border: 1px solid var(--danger); }

/* 横幅：玻璃卡 */
[data-theme="glass"] .dash-gk {
  background: var(--card);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px; box-shadow: var(--shadow-sm);
}
[data-theme="glass"] .dash-banner { border-radius: 16px; }

/* 进度条：圆角发光 */
[data-theme="glass"] .mini-bar { height: 10px; border-radius: 999px; overflow: hidden; }
[data-theme="glass"] .mini-bar i {
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(124,156,255,0.5);
}

/* 列表项：玻璃条 */
[data-theme="glass"] .item {
  border-radius: 14px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
[data-theme="glass"] .item:hover { background: rgba(255,255,255,0.08); }

/* 日历格：圆角玻璃 */
[data-theme="glass"] .cal-cell { border-radius: 12px; }
[data-theme="glass"] .tab { border-radius: 999px; }
[data-theme="glass"] .anniv-card { border-radius: 18px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }

/* 品牌 logo：蓝紫渐变 */
[data-theme="glass"] .brand-ic { background: linear-gradient(135deg, #7C9CFF, #8B5CE6); color: #fff; }
[data-theme="glass"] .login-logo { background: linear-gradient(135deg, #7C9CFF, #8B5CE6); color: #fff; }

/* ==========================================================================
   仪表盘骨架级新组件（全主题基础样式）
   ========================================================================== */
/* hero 区：问候 + 数字条 */
.dash-hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px;
  margin: -4px 0 42px;
}
.dash-hero .dh-head { flex: 1 1 300px; }
.dh-stats {
  flex: 2 1 420px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
}
.dh-cell {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line);
  cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm), var(--card-lit);
}
.dh-cell:hover { border-color: var(--accent); transform: translateY(-1px); }
.dh-lab { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.dh-val { font-size: 23px; font-weight: 800; font-family: var(--mono); font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink); letter-spacing: -0.02em; }
.dh-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* 储蓄进度环（SVG，--p 为 0-100 百分比） */
.save-ring { position: relative; width: 52px; height: 52px; margin-top: 8px; }
.save-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rg-bg { fill: none; stroke: var(--line); stroke-width: 3.2; }
.rg-fg {
  fill: none; stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0));
  transition: stroke-dashoffset .4s ease;
}
.rg-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rg-txt b { font-size: 13px; font-family: var(--mono); color: var(--accent); line-height: 1; }
.rg-txt span { font-size: 9px; color: var(--muted); margin-top: 2px; }

@media (max-width: 640px) {
  .dh-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dash-hero { gap: 16px; }
}

/* ---- 打工小账本：hero 整卡 + 2x2 大数字格 + 大图标 + 大环 ---- */
[data-theme="mint"] .dash-hero {
  background: var(--card); border: 1px solid rgba(91, 163, 123, 0.22);
  border-radius: 24px; padding: 26px 26px 20px; margin: -4px 0 22px;
  box-shadow: var(--shadow-md), var(--card-lit); position: relative; overflow: hidden;
}
[data-theme="mint"] .dash-hero::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
}
[data-theme="mint"] .dash-hero .hero-date { margin-bottom: 6px; padding-bottom: 0; border: none; }
[data-theme="mint"] .dh-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; }
[data-theme="mint"] .dh-cell { background: var(--card2); border: none; border-radius: 16px; padding: 14px 16px; box-shadow: var(--card-lit); }
[data-theme="mint"] .dh-cell .dh-val { font-size: 27px; font-family: var(--sans); }
[data-theme="mint"] .s-ico { font-size: 22px; opacity: 1; top: 16px; right: 16px; }
[data-theme="mint"] .save-ring { width: 68px; height: 68px; margin-top: 2px; }
[data-theme="mint"] .rg-fg { stroke: var(--accent-strong); stroke-width: 4; }
[data-theme="mint"] .rg-txt b { font-size: 16px; }

/* ---- 日常集：报头式 hero + 表格数字条 + 墨色直角环 ---- */
[data-theme="daily"] .dash-hero {
  display: block; border-bottom: 3px double var(--rule);
  padding-bottom: 18px; margin: -4px 0 22px;
}
[data-theme="daily"] .dash-hero .hero-date {
  margin-bottom: 4px; padding-bottom: 0; border: none;
  font-family: var(--serif); font-size: 13px;
}
[data-theme="daily"] .dh-stats {
  grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-top: 18px; border: 1.5px solid var(--rule);
}
[data-theme="daily"] .dh-cell {
  background: transparent; border: none; border-right: 1px dashed var(--line);
  border-radius: 0; padding: 12px 14px; box-shadow: none;
}
[data-theme="daily"] .dh-cell:last-child { border-right: none; }
[data-theme="daily"] .dh-lab { font-family: var(--serif); letter-spacing: 0; }
[data-theme="daily"] .dh-val { font-family: var(--serif); font-weight: 700; font-size: 24px; }
[data-theme="daily"] .dh-sub { font-family: var(--serif); }
[data-theme="daily"] .s-ico { top: 16px; right: 36px; font-size: 15px; opacity: 1; }
[data-theme="daily"] .save-ring { width: 46px; height: 46px; margin-top: 4px; }
[data-theme="daily"] .rg-fg { stroke-linecap: butt; stroke: var(--ink); stroke-width: 4; }
[data-theme="daily"] .rg-bg { stroke: var(--line); }
[data-theme="daily"] .rg-txt b { color: var(--ink); font-family: var(--serif); font-size: 12px; }

/* ---- 玻璃拟态：玻璃整卡 + 2x2 数字格 + 发光图标 + 荧光环 ---- */
[data-theme="glass"] .dash-hero {
  background: var(--card);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 24px;
  padding: 22px 24px 18px; margin: -4px 0 22px;
  box-shadow: var(--shadow-sm), var(--card-lit);
}
[data-theme="glass"] .dash-hero .hero-date { margin-bottom: 6px; padding-bottom: 0; border: none; }
[data-theme="glass"] .dh-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
[data-theme="glass"] .dh-cell { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; box-shadow: none; }
[data-theme="glass"] .dh-cell .dh-val { color: #fff; text-shadow: 0 0 12px rgba(124, 156, 255, 0.4); }
[data-theme="glass"] .s-ico { font-size: 20px; opacity: 1; top: 16px; right: 16px; filter: drop-shadow(0 0 6px rgba(124, 156, 255, 0.5)); }
[data-theme="glass"] .save-ring { width: 60px; height: 60px; margin-top: 4px; }
[data-theme="glass"] .rg-fg { stroke: #A9C0FF; stroke-width: 3.6; filter: drop-shadow(0 0 4px rgba(124, 156, 255, 0.7)); }
[data-theme="glass"] .rg-bg { stroke: rgba(255, 255, 255, 0.15); }
[data-theme="glass"] .rg-txt b { color: #A9C0FF; }


/* ---------- 书影音清单（media.js） ---------- */
.media-li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; }
.m-emoji { font-size: 20px; line-height: 1.3; }
.m-main { flex: 1; min-width: 0; }
.m-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.m-year { font-size: 11px; color: var(--muted); margin-left: 8px; font-family: var(--mono); }
.m-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.m-status { font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.m-status.wish { background: rgba(123, 90, 176, 0.12); color: var(--purple); }
.m-status.doing { background: var(--accent-soft); color: var(--accent); }
.m-status.done { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.m-stars { color: var(--warn); font-size: 12px; letter-spacing: 0.05em; }
.m-rating-num { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.m-done-at { font-size: 11px; color: var(--muted); }
.m-comment { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.55; }
.tabs .tab.sm { padding: 4px 12px; font-size: 12px; }

/* 阅读器移动端：头部换行、留白收紧 */
@media (max-width: 640px) {
  .reader-mask { padding: 0; }
  .reader-box { height: 100vh; max-height: 100vh; border-radius: 0; border: none; }
  .reader-head {
    flex-wrap: wrap; padding: 18px 18px 12px; margin: 0 -18px 14px;
  }
  .reader-tools { width: 100%; justify-content: flex-end; }
  .reader-scroll { padding: 0 22px 36px; }
}

/* ==========================================================================
   PWA 窗口模式适配
   - standalone（安装到桌面后无浏览器地址栏）：顶栏压薄、内容区更紧凑
   - window-controls-overlay（Windows PWA 标题栏覆盖）：侧栏顶部让出标题栏高度
   ========================================================================== */
@media (display-mode: standalone) {
  .topbar { padding-top: 10px; }
  .main { padding-top: 6px; }
  /* 无地址栏后阴影更轻 */
  body { --shadow-sm: 0 1px 2px rgba(84, 60, 20, 0.06); }
}
@media (display-mode: window-controls-overlay) {
  /* 侧栏顶部让出系统标题栏（含窗口按钮），品牌区下移 */
  .sidebar { padding-top: calc(env(titlebar-area-height, 40px) + 10px); }
  /* 顶栏右移避免被窗口按钮遮挡 */
  .topbar { padding-right: calc(env(titlebar-area-width, 0px) + 12px); }
}
/* PWA 安装提示：桌面端已安装时隐藏"添加到主屏幕"类引导 */
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  .install-hint { display: none; }
}

/* ---------- 设置页：主题选择器 ---------- */
.theme-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; flex: 1; max-width: 560px;
}
.tp-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 8px; border-radius: 12px; cursor: pointer;
  background: var(--card2); border: 1.5px solid var(--line);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  font-family: inherit; color: var(--ink);
}
.tp-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.tp-item.on {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
  background: var(--accent-soft);
}
.tp-ic { font-size: 20px; line-height: 1; }
.tp-txt { font-size: 12px; font-weight: 600; }
@media (max-width: 640px) {
  .theme-picker { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   finesse product 精度层：orphan 预防 + 卡片底缘对齐 + 光学补偿
   ========================================================================== */
h1, h2, h3, .hero-greet, .dh-title, .page-title { text-wrap: balance; }
p, .reader-body, .news-sum, .n-comment { text-wrap: pretty; }

/* 光学补偿：icon-btn 内 SVG 视觉居中（1px 下移修正） */
.icon-btn svg { transform: translateY(0.5px); }

/* focus ring：实线 outline（键盘可达性主指示，必须可感知）+ 柔和 tinted 环做装饰 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-radius: var(--radius-sm);
}

/* 输入/按钮圆角锁定到 finesse tiers */
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
input:not([type]), select, textarea {
  border-radius: var(--radius-sm);
}
.btn, .btn.sm { border-radius: var(--radius-sm); }

/* 侧栏 & 顶栏 hairline 化（跟随新 token，无硬边） */
.sidebar { border-right: 1px solid var(--line); }
.topbar { border-bottom: 1px solid var(--line); }

/* 移动端：bento 回退 2 列 */
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   finesse 全局组件升级层（一次覆盖所有页面）
   ========================================================================== */
/* ---- 按钮体系：三变体 + 完整交互态 ---- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.ghost:focus-visible, .btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }

/* 空状态：icon 位 + 说明 + CTA（finesse：composed, not a void）——唯一定义处 */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  padding: 34px 20px; color: var(--muted);
  font-size: 13px; line-height: 1.7;
}
.empty::before {
  content: "🌸"; font-size: 30px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: auto; margin: 0 auto 10px;
  border: none; background: none; box-shadow: none;
}
.empty a { color: var(--accent); font-weight: 600; }
.empty a:hover { text-decoration: underline; }

/* ---- 列表行：hairline + hover 提升 ---- */
.list { gap: 8px; }
.item {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .12s;
}
.item:hover { border-color: var(--line); background: color-mix(in srgb, var(--card2) 45%, transparent); }
.item.done { opacity: .6; }

/* ---- tabs：hairline 底 + 激活 pill ---- */
.tabs {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  background: color-mix(in srgb, var(--card2) 40%, transparent);
  gap: 2px;
}
.tab {
  border: none; background: transparent;
  border-radius: calc(var(--radius-sm) - 2px);
  padding: 6px 14px; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.tab:hover { color: var(--ink); }
.tab.on {
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* ---- badge / tag：tinted chip ---- */
.badge { border-radius: 999px; font-weight: 600; letter-spacing: 0.01em; }
.tag {
  border-radius: 999px; font-size: 11px;
  background: var(--accent-soft); color: var(--accent-strong);
  padding: 2px 9px; font-weight: 600;
}

/* ---- 设置页表单行：label 对齐 + 输入统一 ---- */
.set-row {
  align-items: center; gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: none; }
.s-name {
  min-width: 84px; font-size: 13px; font-weight: 700; color: var(--ink);
  letter-spacing: 0.01em;
}
.s-desc { font-size: 12px; line-height: 1.7; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
input:not([type]), select, textarea {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }

/* ---- 表格数字右对齐 + tabular-nums（finesse 扫描幅度规范） ---- */
.tx-year-table td:not(:first-child), .tx-year-table th:not(:first-child),
.stk-table td:not(:first-child), .stk-table th:not(:first-child),
.tx-item .tx-amt { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- skeleton 加载骨架（替代 spinner-only） ---- */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--card2) 25%, color-mix(in srgb, var(--card2) 60%, var(--card)) 50%, var(--card2) 75%);
  background-size: 200% 100%;
  animation: skShimmer 1.2s ease-in-out infinite;
}
@keyframes skShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- field：label-above 表单（finesse：禁止 placeholder-as-label） ---- */
.field {
  display: flex; flex-direction: column; gap: 5px;
  text-align: left; margin-bottom: 14px;
}
.field > span {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.01em;
}
.field input, .field select, .field textarea { width: 100%; }

/* ---- finesse 表格精修：表头 hairline + 行密度 + hover ---- */
.tx-year-table, .stk-table {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.tx-year-table thead th, .stk-table thead th {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card2) 35%, transparent);
}
.tx-year-table tbody td, .stk-table tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.tx-year-table tbody tr, .stk-table tbody tr { transition: background .12s; }
.tx-year-table tbody tr:hover, .stk-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}
/* 数字列右对齐（第一列名称/日期保持左对齐） */
.tx-year-table td:nth-child(n+2), .tx-year-table th:nth-child(n+2),
.stk-table td:nth-child(n+2), .stk-table th:nth-child(n+2) {
  text-align: right;
}

/* ---- 资讯卡片：hairline + 阴影分层（finesse） ---- */
.news-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .18s, transform .15s;
  overflow: hidden;
}
.news-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.news-body { padding: 14px 16px 16px; }
.news-title {
  font-size: 15px; font-weight: 700; line-height: 1.5;
  letter-spacing: -0.01em;
}
.news-sum { font-size: 12px; color: var(--muted); line-height: 1.65; }

/* ---- 任务看板卡片 ---- */
.kb-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  transition: border-color .15s, transform .12s;
}
.kb-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.kb-card.over { border-color: var(--danger); border-left: 3px solid var(--danger); }

/* ---- 侧栏导航：finesse 激活态（琥珀左条 + tinted 底 + 内描边） ---- */
.nav a {
  transition: background .15s, color .15s, box-shadow .15s;
}
.nav a.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-sm);
}
.nav a:hover { background: rgba(255, 255, 255, 0.04); }

/* ==========================================================================
   finesse floating rounded panel：整个工作台悬浮在更深纸面上的圆角大面板
   （桌面端；移动端保持全宽）
   ========================================================================== */
@media (min-width: 1025px) {
  /* body 分层：页面更深（tinted 更暗一档），面板浮起 */
  body {
    background:
      radial-gradient(1200px 520px at 85% -10%, rgba(255, 106, 61, 0.06), transparent 60%),
      color-mix(in srgb, var(--bg) 82%, var(--ink) 6%);
  }
  .layout {
    max-width: 1440px;
    margin: 22px auto;
    min-height: calc(100vh - 44px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }
  .sidebar {
    height: calc(100vh - 44px);
    position: sticky; top: 22px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  }
  /* 主题按钮吸附面板底部（原来是贴视口底部） */
  .theme-btn { margin-bottom: 0; }
}

/* ---- finesse hero 横幅：问候 + 日期 + 数字条一体 ---- */
.dash-hero {
  position: relative;
  padding: 30px 32px 26px;
  border-radius: var(--radius);
  background:
    radial-gradient(420px 180px at 92% -30%, var(--accent-soft), transparent 60%),
    var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  margin: -8px 0 44px;
}
.hero-greet {
  font-size: clamp(26px, 3.2vw, 34px);
  letter-spacing: -0.03em;
}
.hero-date {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 22px;
  font-size: 13px;
}
.dh-stats { gap: 16px; }
.dh-cell {
  background: color-mix(in srgb, var(--card2) 45%, var(--card));
  border-radius: var(--radius-sm);
}
.dh-cell .dh-val { font-size: 24px; }

/* 移动端 hero 收紧 */
@media (max-width: 640px) {
  .dash-hero { padding: 22px 18px 18px; margin: -4px 0 20px; }
}

/* ==========================================================================
   年轻扁平：浅色侧栏（light 下），活力橙激活态
   ========================================================================== */
[data-theme="light"] .sidebar {
  background: var(--card2);
  color: var(--ink);
  border-right: 1px solid var(--line);
}
[data-theme="light"] .brand-txt { color: var(--ink); }
[data-theme="light"] .brand-txt small { color: var(--muted); }
[data-theme="light"] .brand-ic {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 4px 14px -4px var(--accent-soft);
}
[data-theme="light"] .nav a {
  color: var(--ink-2);
}
[data-theme="light"] .nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
[data-theme="light"] .nav a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 3px 0 0 var(--accent);
}
[data-theme="light"] .nav a .nic { color: var(--muted); }
[data-theme="light"] .nav a.active .nic { color: var(--accent); }
[data-theme="light"] .nav-group .nav-parent { color: var(--ink-2); }
[data-theme="light"] .theme-btn {
  background: var(--card); color: var(--accent-strong);
  border: 1px solid var(--line);
}
[data-theme="light"] .theme-btn:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="light"] .sidebar::after { border-top-color: var(--line); }

/* dark 下侧栏跟随面板（深灰蓝） */
[data-theme="dark"] .sidebar { background: var(--card2); color: var(--ink); }
[data-theme="dark"] .brand-txt { color: var(--ink); }
[data-theme="dark"] .nav a { color: var(--ink-2); }
[data-theme="dark"] .nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
[data-theme="dark"] .nav a.active { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .nav a .nic { color: var(--muted); }
[data-theme="dark"] .nav a.active .nic { color: var(--accent); }

/* ==========================================================================
   年轻扁平 · 页面级精修（全部页面统一到新风格）
   ========================================================================== */
/* 看板：白卡 + 大圆角 + 轻影 */
.kb-col { border-radius: var(--radius); padding: 14px; }
.kb-card { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.kb-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.kb-cnt { background: var(--card2); border-radius: 999px; }

/* 日历格：hover 提升 + 圆角 */
.cal-cell { border-radius: var(--radius-sm); transition: border-color .15s, background .15s; }
.cal-cell:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }

/* 笔记列表行 */
.note-li { border-radius: var(--radius-sm); transition: background .15s, box-shadow .15s; }
.note-li:hover { background: var(--card2); }
.note-li.on { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }

/* 记账汇总卡：白卡圆角 */
.tx-card { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }

/* 任务列表行（item 已全局）补齐：行内编辑态 */
.item.editing { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* 资讯源块、入口卡片、网盘行：hairline 圆角统一 */
.news-src-blk, .link-card, .drive-item, .dl-item { border-radius: var(--radius-sm); }

/* 统计页图表卡 */
.chart-box { border-radius: var(--radius-sm); }
.reports-tab-content .card .chart-tt { font-weight: 700; }

/* 设置页主题选择器：大圆角 + 激活橙 */
.tp-item { border-radius: var(--radius-sm); }
.tp-item.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--accent-soft); }

/* 倒数日 / 提醒 / 书影音卡：白卡圆角 */
.anniv-card, .media-li { border-radius: var(--radius-sm); }

/* ==========================================================================
   年轻扁平 · hero 活力橙渐变横幅（一眼可见的主视觉）
   ========================================================================== */
.dash-hero {
  background:
    radial-gradient(480px 200px at 92% -20%, rgba(214, 155, 114, 0.16), transparent 60%),
    rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
/* 暗色主题统一深色例外：晚期「浅色玻璃」打磨层的白色半透明值只对浅色主题成立，
   5 个暗色主题（dark/midnight/terminal/mint-dark/glass）必须走深色版，
   否则内容区/hero/toast/输入框会被白罩洗白（terminal 的 toast 文字对比度曾低至 1.01） */
[data-theme="dark"] .dash-hero,
[data-theme="midnight"] .dash-hero,
[data-theme="terminal"] .dash-hero,
[data-theme="mint-dark"] .dash-hero,
[data-theme="glass"] .dash-hero {
  background:
    radial-gradient(480px 200px at 92% -20%, rgba(214, 155, 114, 0.16), transparent 60%),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.dash-hero .hero-greet { color: var(--ink); }
.dash-hero .hero-date { color: var(--muted); }
.dash-hero .hero-date b { color: var(--accent); }
.dh-cell {
  background: var(--card2);
  border: 1px solid var(--line);
  box-shadow: none;
}
.dh-cell:hover { border-color: var(--accent); }
.dh-cell .dh-val { color: var(--ink); }
.dh-cell .dh-lab { color: var(--muted); }
.dh-cell .dh-sub { color: var(--muted); }

/* ==========================================================================
   莫兰迪 Soft UI：灰蓝点状纹理 + 柔化拟物细节
   ========================================================================== */
/* 点状纹理（Soft UI 标志性背景）——亮暗两套 */
body {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px),
    radial-gradient(1200px 520px at 85% -10%, rgba(255, 255, 255, 0.08), transparent 60%);
  background-size: 22px 22px, auto;
  background-position: 0 0, 0 0;
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(1200px 520px at 85% -10%, rgba(217, 168, 124, 0.05), transparent 60%);
  background-size: 22px 22px, auto;
}

/* Soft UI 卡片：米白 + 更大圆角 + 轻柔阴影（莫兰迪 tinted） */
.card, .stat, .dh-cell, .anniv-card, .kb-col, .tx-card {
  box-shadow: var(--shadow-sm), var(--card-lit);
}
.card:hover, .stat:hover {
  box-shadow: var(--shadow-md), var(--card-lit);
}

/* 全局 emoji 图标容器：低饱和圆底（Soft UI 图标语言） */
.nic, .s-ico {
  background: var(--accent-soft);
  border-radius: 12px;
}
.nav a .nic { background: transparent; }

/* 按钮：圆润胶囊（Soft UI 默认） */
.btn, .btn.sm, .btn.ghost { border-radius: var(--radius-pill); padding-left: 18px; padding-right: 18px; }

/* 输入框大圆角 */
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
input:not([type]), select, textarea {
  border-radius: var(--radius-sm);
}

/* 表格圆角容器 */
.tx-year-table, .stk-table { border-radius: var(--radius-sm); overflow: hidden; }

/* ---- 莫兰迪微调：侧栏区分度 + 暗色强调对比 + 主题按钮权重 ---- */
[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.5); }  /* 浅玻璃侧栏 */
[data-theme="dark"] .sidebar { background: var(--rail-dark); }   /* dark 侧栏更深 */
[data-theme="dark"] .nav a.active { color: #e8b48a; }   /* 暗色激活文字提亮 */
[data-theme="dark"] .stat:first-child .s-val, [data-theme="dark"] .card h2 .count { color: var(--accent); }
[data-theme="light"] .theme-btn {
  background: #fff; border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm); color: var(--accent-strong); font-weight: 700;
}
[data-theme="dark"] .theme-btn { background: var(--card2); border: 1px solid var(--rule); color: var(--accent); }

/* ==========================================================================
   莫兰迪细节打磨：治愈感 + 柔和交互
   ========================================================================== */

/* 侧栏导航：莫兰迪 hover 过渡 + 激活卡片感 */
.nav a { transition: background .18s, color .18s, box-shadow .18s, transform .12s; }
.nav a:hover { transform: translateX(2px); }

/* 卡片 hover：轻微上浮（Soft UI 呼吸感） */
.card { transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-md), var(--card-lit); }

/* 数字 & 徽标：莫兰迪暖橙强调统一 */
.stat:first-child .s-val, .card h2 .count { color: var(--accent-strong); }

/* hero 内数字格：白字胶囊化 */
.dh-cell { border-radius: var(--radius-sm); }

/* 日期分隔虚线更柔 */
.hero-date { border-bottom-color: rgba(255, 255, 255, 0.3); }

/* 滚动条：莫兰迪细条（WebKit） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(65, 69, 76, 0.15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(65, 69, 76, 0.28); }
::-webkit-scrollbar-track { background: transparent; }

/* 复选框/单选：莫兰迪 accent 胶囊化 */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* ---- 最终微调：对比度与密度 ---- */
/* hero 白字加柔影（提对比度） */
.dash-hero .hero-greet, .dash-hero .hero-date, .dh-cell .dh-val, .dh-cell .dh-lab, .dh-cell .dh-sub {
  text-shadow: 0 1px 2px rgba(120, 70, 30, 0.18);
}
/* 数字格密度：单位字稍大 + 间距 */
.dh-cell .dh-val { font-size: 25px; letter-spacing: -0.01em; }
.dh-cell .dh-sub { font-size: 11px; }
/* 搜索框：白底更突出 */
.gsearch-wrap #gsInput {
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
}
.gsearch-wrap #gsInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ==========================================================================
   触摸目标 ≥44px（finesse G 门）
   ========================================================================== */
/* 移动端：交互元素最小命中区 44px */
@media (max-width: 767px) {
  .icon-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .tab { min-height: 38px; display: inline-flex; align-items: center; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 36px; }
  .chk { width: 26px; height: 26px; }
  .item { padding-top: 10px; padding-bottom: 10px; }
}
/* 桌面侧栏链接：命中区 ≥44px */
.nav a, .nav-parent { min-height: 44px; }

/* ==========================================================================
   动效增强：tab 切换过渡 + 卡片入场统一
   ========================================================================== */
/* tab 切换：内容淡入 */
#view { animation: viewIn .22s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 列表项 hover：soft UI 轻位移（仅 hover 设备） */
@media (hover: hover) and (pointer: fine) {
  .item, .note-li, .anniv-card, .media-li { transition: transform .15s, box-shadow .15s, background .15s, border-color .15s; }
  .item:hover, .note-li:hover, .anniv-card:hover, .media-li:hover { transform: translateY(-1px); }
}

/* Chart.js tooltip 莫兰迪化（圆角胶囊 + 柔和阴影） */
.chart-tt { font-weight: 700; letter-spacing: 0.01em; }

/* skip-to-content（键盘可达，finesse I 门） */
.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 99999;
  background: var(--accent-strong); color: #fff;
  padding: 10px 18px; border-radius: 0 0 12px 12px;
  font-size: 13px; font-weight: 700;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* 顶栏迷你主题按钮：44px 命中区（移动端） */
@media (max-width: 767px) {
  .theme-btn.mini { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

/* 灰蓝底上的直接文字（面板外）：浅色 */
body { color: var(--ink); }
.mode-badge { color: rgba(255, 255, 255, 0.75); }
[data-theme="dark"] .footnote, [data-theme="dark"] .mode-badge { color: var(--muted); }

/* ==========================================================================
   参考图：深灰蓝 + 毛玻璃卡片（Soft UI Glass on Dark）
   ========================================================================== */
/* 卡片毛玻璃 */
/* 性能：大卡片 blur(14px)，高频小元素降为 8px（blur 是滚动卡顿主因） */
.card, .stat, .dash-hero, .kb-col, .tx-card, .anniv-card {
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
}
.item, .note-li, .media-li, .tp-item, .quick-li, .kb-card, .dh-cell {
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
  backdrop-filter: blur(8px) saturate(1.15);
}
/* 浮动面板：半透明深玻璃（透出背景纹理） */
@media (min-width: 1025px) {
  .layout {
    background: rgba(255, 255, 255, 0.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
  }
  .sidebar { background: rgba(255, 255, 255, 0.5); color: var(--ink); }
  [data-theme="dark"] .layout, [data-theme="midnight"] .layout,
  [data-theme="terminal"] .layout, [data-theme="mint-dark"] .layout, [data-theme="glass"] .layout {
    background: rgba(255, 255, 255, 0.04);
  }
  [data-theme="dark"] .sidebar, [data-theme="midnight"] .sidebar,
  [data-theme="terminal"] .sidebar, [data-theme="mint-dark"] .sidebar, [data-theme="glass"] .sidebar {
    background: rgba(255, 255, 255, 0.05);
  }
}
/* 侧栏文字适配（浅色 on 玻璃浅底）——仅 ≥1025 桌面档存在浅玻璃侧栏；
   窄屏时非 light/dark 主题的侧栏回归 var(--ink) 深底，必须用回基础的浅色文字，
   否则 muted 正文对比不足、hover(ink on ink) 直接隐身 */
@media (min-width: 1025px) {
  .nav a, .nav-parent { color: var(--muted); }
  .nav a:hover { color: var(--ink); }
  .brand-txt { color: var(--ink); }
  .brand-txt small { color: var(--muted); }
}
.nav a.active { color: var(--accent); }
[data-theme="light"] .nav a, [data-theme="light"] .nav-parent { color: var(--muted); }
[data-theme="light"] .nav a:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
[data-theme="light"] .nav a.active { color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
[data-theme="light"] .brand-txt { color: var(--ink); }
[data-theme="light"] .brand-txt small { color: var(--muted); }
/* 面板外脚注浅色 */
/* 面板外脚注：跟随主题，避免在亮色背景上变成白字 */
.footnote { color: var(--muted-2); }
/* 顶部栏玻璃 */
.topbar { background: rgba(255, 255, 255, 0.03); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---- 参考图精修：纹理密度 + 文字对比 + 选中态柔化 ---- */
body {
  background-image:
    radial-gradient(rgba(43, 47, 54, 0.08) 1px, transparent 1px),
    radial-gradient(1200px 520px at 85% -10%, rgba(214, 155, 114, 0.10), transparent 60%);
  background-size: 18px 18px, auto;
}
[data-theme="dark"] body, [data-theme="midnight"] body,
[data-theme="terminal"] body, [data-theme="mint-dark"] body, [data-theme="glass"] body {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    radial-gradient(1200px 520px at 85% -10%, rgba(214, 155, 114, 0.08), transparent 60%);
  background-size: 18px 18px, auto;
}
.dh-cell .dh-sub, .stat .s-sub, .dh-cell .dh-lab { font-weight: 600; }
[data-theme="light"] .nav a.active { background: rgba(214, 155, 114, 0.12); box-shadow: inset 3px 0 0 var(--accent); }
[data-theme="light"] .s-ico { background: rgba(214, 155, 114, 0.14); }

/* 侧栏激活态：橙底白字（对比清晰） */
[data-theme="light"] .nav a.active {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 2px 10px -2px rgba(192, 127, 79, 0.5);
}
[data-theme="light"] .nav a.active .nic { color: #fff; }
[data-theme="dark"] .nav a.active { background: var(--accent-strong); color: #fff; }
[data-theme="dark"] .nav a.active .nic { color: #fff; }

/* ==========================================================================
   打磨：toast 玻璃化 + 登录卡 + FAB 统一 + 数字对比
   ========================================================================== */
/* toast：毛玻璃胶囊（柔和） */
.wb-toast {
  border-left: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  font-weight: 600;
}
[data-theme="dark"] .wb-toast, [data-theme="midnight"] .wb-toast,
[data-theme="terminal"] .wb-toast, [data-theme="mint-dark"] .wb-toast, [data-theme="glass"] .wb-toast {
  background: rgba(28, 33, 40, 0.8);
  color: #eef0f3;
}
.wb-toast.success { border-left: 3px solid var(--ok); }
.wb-toast.error   { border-left: 3px solid var(--danger); }
.wb-toast.warning { border-left: 3px solid var(--warn); }

/* 登录卡片：虚线打孔条 → 柔和 hairline */
.login-card::before {
  border-top: 1px solid var(--line);
  opacity: 1;
}

/* FAB 统一暖橙系：专注实心橙 + 速记描边橙 */
.focus-fab { background: var(--accent-strong); color: #fff; }
.focus-fab:hover { box-shadow: 0 4px 14px -4px rgba(192, 127, 79, 0.6); }
.focus-fab.running { background: var(--danger); }
.quick-fab { background: rgba(255, 255, 255, 0.65); color: var(--accent-strong); border: 1.5px solid var(--accent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
[data-theme="dark"] .quick-fab, [data-theme="midnight"] .quick-fab,
[data-theme="terminal"] .quick-fab, [data-theme="mint-dark"] .quick-fab, [data-theme="glass"] .quick-fab {
  background: rgba(28, 33, 40, 0.82);
  color: var(--accent);
}

/* 关键数字对比：金额/统计数字加粗 */
.stat .s-val, .dh-cell .dh-val { font-weight: 800; }
.tx-amt, .stk-table td { font-weight: 600; }

/* 输入框统一：浅玻璃 + 品牌 focus 环 */
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
input:not([type]), select, textarea {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}
[data-theme="dark"] input[type="text"], [data-theme="dark"] input[type="number"], [data-theme="dark"] input[type="date"],
[data-theme="dark"] input:not([type]), [data-theme="dark"] select, [data-theme="dark"] textarea,
[data-theme="midnight"] input[type="text"], [data-theme="midnight"] input[type="number"], [data-theme="midnight"] input[type="date"],
[data-theme="midnight"] input:not([type]), [data-theme="midnight"] select, [data-theme="midnight"] textarea,
[data-theme="terminal"] input[type="text"], [data-theme="terminal"] input[type="number"], [data-theme="terminal"] input[type="date"],
[data-theme="terminal"] input:not([type]), [data-theme="terminal"] select, [data-theme="terminal"] textarea,
[data-theme="mint-dark"] input[type="text"], [data-theme="mint-dark"] input[type="number"], [data-theme="mint-dark"] input[type="date"],
[data-theme="mint-dark"] input:not([type]), [data-theme="mint-dark"] select, [data-theme="mint-dark"] textarea,
[data-theme="glass"] input[type="text"], [data-theme="glass"] input[type="number"], [data-theme="glass"] input[type="date"],
[data-theme="glass"] input:not([type]), [data-theme="glass"] select, [data-theme="glass"] textarea {
  background: rgba(255, 255, 255, 0.06);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

/* 记账页卡片间距 */
.tx-year-wrap + .card, .tx-card + .card { margin-top: 18px; }

/* 次要操作按钮：描边样式（与主操作区分） */
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn.ghost { background: transparent; color: var(--accent-strong); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }

/* 暗色主题下的荧光/浅色按钮底配深字（白字对比不足：terminal 1.98 / mint-dark 3.01） */
[data-theme="terminal"] .btn:not(.ghost):not(.danger) { color: #04140a; }
[data-theme="mint-dark"] .btn:not(.ghost):not(.danger) { color: #0e1f16; }

/* 表单禁用态：原生 input/select/textarea 此前无任何禁用视觉 */
input:disabled, select:disabled, textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

/* 表单元素内边距统一（舒适点击） */
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
input:not([type]), select, textarea {
  padding: 9px 12px;
}
select { padding: 9px 10px; }

/* ==========================================================================
   收尾：hover 过渡平滑 + 微交互细节
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  .btn, .tab, .badge, .nav a, .dh-cell, .stat {
    transition: background .18s ease, color .18s ease, border-color .18s ease,
                box-shadow .18s ease, transform .15s ease;
  }
  .btn:hover { transform: translateY(-1px); }
  .card:hover { transform: translateY(-2px); }
}

/* 数字滚动中禁止选中闪烁 */
.s-val, .dh-val { user-select: none; }

/* 玻璃卡上的分隔线更柔和 */
.card h2 { border-bottom-color: var(--line); }

/* 空状态链接：行内高亮（不打断句子） */
.empty a {
  color: var(--accent-strong); font-weight: 700;
  border-bottom: 1.5px dashed var(--accent);
  padding: 0 1px;
}
.empty a:hover { color: var(--accent); border-bottom-style: solid; text-decoration: none; }

/* ==========================================================================
   对齐修复：表单控件高度统一 + 记账汇总区微调
   ========================================================================== */
/* 控件同高（select/input 底部对齐） */
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
input:not([type]), select, textarea {
  box-sizing: border-box;
  min-height: 38px;
}
select { min-height: 38px; }

/* 记账汇总：结余左对齐与卡片同边距（视觉模型：标题与卡片边距不一致） */
.tx-total { justify-content: flex-start; }
.tx-summary { padding: 18px; }

/* tx 卡数字与说明间距统一 */
.tx-card { gap: 4px; padding: 12px 14px; }
.tx-card b { line-height: 1.3; }

/* 右栏卡片顶部对齐 */
.fin-side .card, .tx-goal-wrap, .tx-budget-wrap { align-self: start; }

/* ==========================================================================
   全页面对齐修复（视觉模型全站审计汇总）
   ========================================================================== */
/* 1) 行内控件与按钮统一高度（底部对齐） */
.row input[type="text"], .row input[type="number"], .row input[type="date"],
.row input[type="password"], .row input:not([type]), .row select {
  min-height: 38px;
}
.row .btn, .set-row .btn, .tx-form .btn, .stk-form .btn, .media-li .btn { min-height: 38px; padding-top: 0; padding-bottom: 0; }

/* 2) 日历月份导航：标题与箭头垂直居中（箭头 icon 按钮） */
.cal-ctrl .icon-btn, .cal-ctrl button { align-self: center; }
.cal-ctrl-title { line-height: 1.2; }

/* 3) 设置/入口表单行：标签与控件基线统一 */
.set-row { align-items: center; }

/* 4) 卡片间距统一节奏 */
.card + .card { margin-top: 16px; }

/* 5) 帮助页内容排版（标题缩进统一） */
.help-content h1, .help-content h2 { margin-left: 0; }
.help-content { padding: 4px 2px; }

/* 6) 书影音/倒数日表单小输入框圆角统一（防直角） */
.media-li input, .anniv-card input, .tp-item input { border-radius: var(--radius-sm); }
input.w-70, input.w-90, input.w-100, input.w-110, input.w-120, input.w-130,
input.w-150, input.w-160, input.w-170, input.w-180, input.w-200 { border-radius: var(--radius-sm); }

/* ==========================================================================
   长数据场景修复（用户反馈：大金额导致卡片内换行拥挤）
   ========================================================================== */
/* 数字卡说明：长文本优雅换行（不截断信息、不挤行） */
.dh-cell .dh-sub {
  line-height: 1.55;
  font-size: 10px;
  overflow-wrap: break-word;
}
/* 统计卡副注同样处理 */
.stat .s-sub { line-height: 1.55; overflow-wrap: break-word; }

/* 数字卡间距透气 */
.dh-stats { gap: 14px; }

/* 侧栏激活色块贴左边缘 */
.nav a { margin-left: 2px; margin-right: 2px; }
.nav a.active { margin-left: 0; margin-right: 0; }
[data-theme="light"] .nav a.active, [data-theme="dark"] .nav a.active {
  box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* 大金额数字：长数值不撑破卡片（不强行任意处换行；字号随单元格宽度自动缩到能装下，溢出截断兜底） */
.dh-cell { container-type: inline-size; min-width: 0; }
.dh-cell .dh-val {
  font-size: clamp(15px, 18cqw, 25px);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 配色收尾：搜索框/输入框在深色下的边界感 ---- */
[data-theme="dark"] .gsearch-wrap #gsInput { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.14); }
[data-theme="dark"] input[type="text"], [data-theme="dark"] input[type="number"], [data-theme="dark"] input[type="date"],
[data-theme="dark"] input:not([type]), [data-theme="dark"] select, [data-theme="dark"] textarea {
  border-color: rgba(255, 255, 255, 0.14);
}

/* ================= 时间轴（人生大事）+ 往年今日 ================= */
.tl-year-group { margin-bottom: 6px; }
.tl-year {
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--line);
  letter-spacing: 1px;
}
.tl-ev {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.tl-ev:last-child { border-bottom: none; }
.tl-ev-date { min-width: 52px; text-align: center; line-height: 1.25; }
.tl-ev-date b { display: block; font-size: 15px; }
.tl-ev-date small { color: var(--muted); font-size: 11px; }
.tl-ev-body { flex: 1; min-width: 0; }
.tl-ev-title { font-weight: 600; font-size: 14px; }
.tl-ev-cat { font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.tl-ev-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; word-break: break-all; }
.tl-ev-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.tl-ev-ops { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.tl-ev:hover .tl-ev-ops { opacity: 1; }
@media (hover: none) { .tl-ev-ops { opacity: 1; } }
.otd-year { margin-bottom: 10px; }
.otd-y-label { font-size: 12px; font-weight: 700; color: var(--accent, var(--primary)); margin-bottom: 4px; }
.otd-item { font-size: 13px; padding: 5px 8px; border-radius: 8px; line-height: 1.5; }
.otd-item:hover { background: var(--line); }

/* ================= 成就系统 ================= */
.ach-banner { padding: 10px 16px; }
.ach-banner-in { font-size: 13px; font-weight: 600; }
.ach-recent { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--line);
  font-weight: 600;
}
.ach-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.ach-row:last-child { border-bottom: none; }
.ach-row.off { opacity: 0.45; }
.ach-ic { font-size: 22px; min-width: 30px; text-align: center; }
.ach-main { flex: 1; min-width: 0; }
.ach-name { font-weight: 600; font-size: 13px; }
.ach-unlock { font-size: 11px; color: var(--ok); margin-left: 8px; font-weight: 400; }
.ach-desc { font-size: 12px; color: var(--muted); margin: 2px 0 5px; }
.ach-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.ach-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--ok));
  transition: width 0.4s ease;
}
.ach-row.done .ach-bar i { background: var(--ok); }
.ach-ops { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.ach-row:hover .ach-ops { opacity: 1; }
@media (hover: none) { .ach-ops { opacity: 1; } }

/* ================= 追踪器 ================= */
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tk-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--card);
  border-top: 3px solid var(--tc, #c9956b);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tk-head { display: flex; align-items: center; gap: 8px; }
.tk-ic { font-size: 18px; }
.tk-name { cursor: pointer; font-size: 14px; }
.tk-name:hover { color: var(--primary); }
.tk-type { margin-left: auto; font-size: 11px; color: var(--muted); }
.tk-today { font-size: 20px; font-weight: 700; }
.tk-today small { font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.tk-quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tk-stats { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.tk-goal { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.tk-goal .ach-bar { flex: 1; }
.tk-heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; margin-top: 4px; }
.tk-heat i { display: block; aspect-ratio: 1; border-radius: 3px; min-width: 8px; }
.tk-heat-title { font-size: 12px; color: var(--muted); margin-top: 12px; }
.tk-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

/* ================= 时间账本 ================= */
.te-timer { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.te-timer.on { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.te-timer-in { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.te-timer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); animation: tePulse 1.6s infinite; flex: none; }
@keyframes tePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.te-timer-in b { font-size: 22px; font-variant-numeric: tabular-nums; }

/* 订阅停用行 */
.set-row.off .s-name, .set-row.off .s-desc { opacity: 0.5; }

/* ================= 联系人 ================= */
.ct-row { border-bottom: 1px solid var(--line); padding: 6px 0; }
.ct-row:last-child { border-bottom: none; }
.ct-main-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ct-rel { font-size: 16px; min-width: 22px; text-align: center; }
.ct-name { font-weight: 600; font-size: 14px; }
.ct-name small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.ct-info { font-size: 12px; color: var(--muted); }
.ct-ops { margin-left: auto; display: flex; gap: 4px; }
.ct-log-box { margin-top: 8px; padding-left: 30px; }

/* ==========================================================================
   导航收敛：置顶区 + 全部功能抽屉 + 设置页导航定制选择器
   ========================================================================== */
.nav-pin-sep { height: 1px; background: var(--line); margin: 10px 14px; }
.nav-pin-picker { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.nav-pin-picker .np-item {
  border: 1px solid var(--line); background: var(--card2); color: var(--muted);
  border-radius: var(--radius-pill); padding: 6px 14px; font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-pin-picker .np-item:hover { border-color: var(--accent); color: var(--ink); }
.nav-pin-picker .np-item.on { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); font-weight: 600; }

/* ==========================================================================
   阶段二：分类预算行 / 账单日历标记 / 储蓄目标桶 / 资产配置饼图
   ========================================================================== */
.cat-budget-row { align-items: center; }
.cat-budget-row .bar { height: 8px; border-radius: var(--radius-pill); overflow: hidden; background: var(--card2); }
.tx-cal-bill { display: block; font-size: 10px; line-height: 1.35; color: var(--warn); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-cal-bill.in { color: var(--ok); }
.goal-bucket { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.goal-bucket:last-of-type { border-bottom: none; }
.goal-bucket .progress-top { margin-bottom: 6px; }
.goal-bucket-amt { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 12px; }
.goal-bucket-ops { display: flex; gap: 8px; margin-top: 6px; }
.asset-pie-row { display: flex; align-items: center; gap: 18px; padding: 12px 0 4px; flex-wrap: wrap; }
.asset-pie-box { width: 132px; height: 132px; flex-shrink: 0; position: relative; }
.asset-pie-legend { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.asset-pie-legend .ap-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.asset-pie-legend .ap-item i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.asset-pie-legend .ap-item span { color: var(--muted); }
.asset-pie-legend .ap-item b { margin-left: auto; font-family: var(--mono, monospace); }
.asset-pie-legend .ap-item em { font-style: normal; color: var(--muted); min-width: 38px; text-align: right; }
@media (max-width: 640px) { .asset-pie-box { width: 104px; height: 104px; } }

/* ==========================================================================
   设置页低频卡片折叠（details）：账号/外观/导航/备份常开，其余收起
   ========================================================================== */
details.set-fold { padding: 0; overflow: hidden; }
details.set-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; padding: 15px 20px; }
details.set-fold > summary::-webkit-details-marker { display: none; }
details.set-fold > summary::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: 12px; transition: transform .18s; }
details.set-fold[open] > summary::after { transform: rotate(180deg); }
details.set-fold > summary h2 { border-bottom: none; padding-bottom: 0; margin: 0; }
details.set-fold > summary:hover h2 { color: var(--accent); }
details.set-fold > .set-fold-body { padding: 2px 20px 18px; }

/* ---------- 消费流水统计 ---------- */
.flow-stat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: start; }
.flow-top-item { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.flow-top-item:last-child { border-bottom: none; }
.flow-top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-top-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.flow-top-meta b { color: var(--ink); }
@media (max-width: 900px) { .flow-stat-grid { grid-template-columns: 1fr; } }

/* ---------- 消费流水列表 ---------- */
.flow-li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.flow-li:last-child { border-bottom: none; }
.flow-main { flex: 1; min-width: 0; }
.flow-party { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-note { color: var(--muted); font-size: 12px; margin-left: 6px; }
.flow-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.flow-badge { font-weight: 500; }
.flow-amt { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
#flowList .icon-btn { opacity: 0.55; }
#flowList .flow-li:hover .icon-btn { opacity: 1; }
.flow-pagebar { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 12px; }
.flow-type-item { padding: 5px 0; }
.flow-type-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.flow-type-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.flow-type-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.flow-kpi { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.flow-kpi span { color: var(--muted); }
.flow-kpi b { font-variant-numeric: tabular-nums; }
.flow-kpi em { color: var(--muted); font-size: 12px; font-style: normal; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-span2 { grid-column: 1 / -1; }
.flow-year-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.flow-year-table th, .flow-year-table td { padding: 7px 8px; text-align: right; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.flow-year-table th:first-child, .flow-year-table td:first-child { text-align: left; }
.flow-year-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.flow-year-table tr.cur td { color: var(--accent); font-weight: 600; }
.flow-year-table tr:last-child td { border-bottom: none; }
.flow-li.editing { padding: 10px 0; }
.flow-edit-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.flow-edit-row { display: flex; align-items: center; gap: 8px; }
.flow-edit-row label { width: 70px; font-size: 13px; color: var(--muted); text-align: right; flex-shrink: 0; }
.flow-edit-row input, .flow-edit-row select { flex: 1; font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-card); color: var(--fg); font-size: 13px; }
.flow-edit-row input:focus, .flow-edit-row select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.flow-edit-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }

/* ---------- 消费流水仪表盘（参考轻记账） ---------- */
.flow-dashboard { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.flow-monthbar {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 10px; background: var(--card2); border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.flow-monthbar button {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  padding: 6px; border-radius: var(--radius-xs); transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.flow-monthbar button:hover { color: var(--ink); background: var(--card); }
.flow-monthbar button svg { width: 18px; height: 18px; }
.flow-monthbar .flow-month-txt {
  font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em;
  min-width: 110px; text-align: center;
}

.flow-sumcards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.flow-sumcard {
  background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-align: center; transition: transform .15s, box-shadow .15s;
}
.flow-sumcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.flow-sumcard .lab { font-size: 12px; color: var(--muted); font-weight: 600; }
.flow-sumcard .val {
  font-size: 22px; font-weight: 800; font-family: var(--mono); margin-top: 6px;
  letter-spacing: -0.02em;
}
.flow-sumcard.income .val { color: var(--ok); }
.flow-sumcard.expense .val { color: var(--danger); }
.flow-sumcard.balance .val { color: var(--accent); }
@media (max-width: 640px) {
  .flow-sumcards { grid-template-columns: 1fr; }
  .flow-sumcard { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
  .flow-sumcard .val { margin-top: 0; font-size: 18px; }
}

.flow-cal-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.flow-cal-hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.flow-cal-hd h3 { margin: 0; font-size: 14px; font-weight: 800; color: var(--ink); }
.flow-cal-hd .sub { font-size: 12px; color: var(--muted); }
.flow-cal-legend { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
.flow-cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.flow-cal-legend i {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block;
}
.flow-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.flow-cal-wd {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 0;
}
.flow-cal-cell {
  aspect-ratio: 1; border-radius: var(--radius-xs); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: var(--card2); border: 1px solid var(--line);
  font-size: 11px; color: var(--muted); transition: all .15s;
}
.flow-cal-cell:hover { border-color: var(--accent); transform: scale(1.04); }
.flow-cal-cell .d { font-weight: 700; font-size: 12px; color: var(--ink); }
.flow-cal-cell .amt { font-size: 10px; font-family: var(--mono); }
.flow-cal-cell.low { background: var(--ok); color: #fff; border-color: var(--ok); }
.flow-cal-cell.low .d, .flow-cal-cell.low .amt { color: #fff; }
.flow-cal-cell.mid { background: var(--warn); color: #fff; border-color: var(--warn); }
.flow-cal-cell.mid .d, .flow-cal-cell.mid .amt { color: #fff; }
.flow-cal-cell.high { background: var(--danger); color: #fff; border-color: var(--danger); }
.flow-cal-cell.high .d, .flow-cal-cell.high .amt { color: #fff; }
.flow-cal-cell.empty { background: transparent; border-color: transparent; pointer-events: none; }

.flow-chart-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.flow-chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.flow-chart-card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 800; color: var(--ink); }
.flow-chart-body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.flow-pie-wrap, .flow-donut-wrap { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.flow-pie-wrap .center-label, .flow-donut-wrap .center-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.flow-donut-wrap .center-label .amt { font-size: 18px; font-weight: 800; font-family: var(--mono); color: var(--ink); }
.flow-donut-wrap .center-label .lab { font-size: 10px; color: var(--muted); }
.flow-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 140px; }
.flow-legend-item {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2);
}
.flow-legend-item .dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.flow-legend-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-legend-item .pct { font-weight: 700; font-family: var(--mono); color: var(--muted); }
.flow-legend-item .sum { color: var(--muted); font-family: var(--mono); white-space: nowrap; }
@media (max-width: 860px) {
  .flow-chart-grid { grid-template-columns: 1fr; }
}

.flow-actions-bar {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 14px; background: var(--card2); border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.flow-actions-bar .btn { min-width: 110px; }
