
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ============ 主题变量: :root 为浅色(现状值), [data-theme=dark/eye] 覆盖 ============
   结构性配色(页面底/文字/容器/边框/输入/语义色)全部走变量, 跟随 data-theme;
   装饰性品牌渐变(topbar/按钮)、模块 accent、优先级色等三套主题保留, 不在此列。 */
:root {
  --bg: #F2F2F7;
  /* 主题表面：跟随全站主题的不透明实色（供全屏内"不透明抽屉/浮层"引用，区别于白磨砂） */
  --surface-global: #fff;
  /* 圆角尺度（唯一事实源）：小=控件 / 中=浮层菜单 / 大=卡片 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  /* 内置背景图（整图层，直接给全屏容器/选择色块复用） */
  --bgimg-default:
    radial-gradient(1000px 600px at 12% -5%, rgba(255,122,89,.15), transparent 55%),
    radial-gradient(900px 550px at 88% 8%, rgba(168,85,247,.12), transparent 55%),
    radial-gradient(1100px 700px at 50% 100%, rgba(59,130,246,.10), transparent 55%), #F2F2F7;
  --bgimg-aurora:
    radial-gradient(720px 480px at 12% -8%, rgba(52,211,153,.30), transparent 62%),
    radial-gradient(620px 480px at 102% 12%, rgba(96,165,250,.26), transparent 60%),
    radial-gradient(720px 560px at 45% 108%, rgba(168,85,247,.22), transparent 66%),
    linear-gradient(180deg,#ecf6f0 0%,#f4f2fb 100%);
  --bgimg-dawn:
    radial-gradient(720px 480px at 18% -8%, rgba(251,146,122,.32), transparent 62%),
    radial-gradient(620px 460px at 96% 8%, rgba(251,191,36,.24), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(244,114,182,.22), transparent 66%),
    linear-gradient(180deg,#fdf0ea 0%,#fbf2f7 100%);
  --bgimg-matcha:
    radial-gradient(720px 480px at 14% -8%, rgba(134,196,135,.30), transparent 62%),
    radial-gradient(620px 470px at 100% 10%, rgba(190,215,140,.24), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(94,170,140,.18), transparent 66%),
    linear-gradient(180deg,#eef6ea 0%,#f2f6ec 100%);
  --bgimg-sea:
    radial-gradient(720px 480px at 14% -8%, rgba(96,165,250,.28), transparent 62%),
    radial-gradient(620px 470px at 100% 10%, rgba(45,212,191,.26), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(125,180,240,.18), transparent 66%),
    linear-gradient(180deg,#ecf4fb 0%,#eef6f7 100%);
  --bgimg-dusk:
    radial-gradient(720px 480px at 88% -8%, rgba(168,85,247,.28), transparent 62%),
    radial-gradient(640px 470px at 10% 6%, rgba(251,113,133,.24), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(217,150,255,.20), transparent 66%),
    linear-gradient(180deg,#f3f0fb 0%,#fbf1f6 100%);
  /* 暗色版背景（仅暗色主题全屏使用；预览样图恒浅色） */
  --bgimg-matcha-dark:
    radial-gradient(700px 460px at 14% -10%, rgba(90,160,100,.16), transparent 60%),
    radial-gradient(640px 440px at 100% 8%, rgba(120,170,90,.10), transparent 58%),
    radial-gradient(720px 540px at 50% 108%, rgba(60,120,90,.10), transparent 64%),
    linear-gradient(180deg,#121b15,#0f1611);
  --bgimg-aurora-dark:
    radial-gradient(700px 460px at 12% -10%, rgba(52,211,180,.16), transparent 60%),
    radial-gradient(640px 440px at 102% 10%, rgba(96,165,250,.13), transparent 58%),
    radial-gradient(720px 540px at 45% 108%, rgba(168,85,247,.12), transparent 64%),
    linear-gradient(180deg,#0d1a18,#0c1316);
  --bgimg-dawn-dark:
    radial-gradient(700px 460px at 18% -10%, rgba(251,140,110,.15), transparent 60%),
    radial-gradient(640px 440px at 96% 8%, rgba(251,170,90,.10), transparent 58%),
    radial-gradient(720px 540px at 50% 108%, rgba(220,120,150,.10), transparent 64%),
    linear-gradient(180deg,#1d1410,#160f0d);
  --bgimg-sea-dark:
    radial-gradient(700px 460px at 14% -10%, rgba(96,160,240,.15), transparent 60%),
    radial-gradient(640px 440px at 100% 8%, rgba(80,180,200,.11), transparent 58%),
    radial-gradient(720px 540px at 50% 108%, rgba(100,150,220,.10), transparent 64%),
    linear-gradient(180deg,#0e1822,#0b1218);
  --bgimg-dusk-dark:
    radial-gradient(700px 460px at 88% -10%, rgba(170,130,240,.17), transparent 60%),
    radial-gradient(640px 440px at 10% 6%, rgba(230,130,180,.11), transparent 58%),
    radial-gradient(720px 540px at 50% 108%, rgba(190,150,255,.11), transparent 64%),
    linear-gradient(180deg,#17101f,#110b18);
  /* 色块专用代表色：整背景含大尺寸光斑，直接缩到 58px 色块时光斑浓缩会偏色，
     故色块用各款主色的小渐变（选项预览性质，三主题取值一致），默认档为纯奶白 */
  --sw-default: linear-gradient(135deg, #fbfaf7 0%, #edeae2 100%);
  --sw-aurora:  linear-gradient(135deg, #6ee7b7 0%, #60a5fa 100%);
  --sw-dawn:    linear-gradient(135deg, #fca088 0%, #f9a8d4 100%);
  --sw-matcha:  linear-gradient(135deg, #9bd49c 0%, #c3dc97 100%);
  --sw-sea:     linear-gradient(135deg, #6ab0f3 0%, #67e0d0 100%);
  --sw-dusk:    linear-gradient(135deg, #b277ff 0%, #fb7f9a 100%);
  /* 手风琴全屏：非默认背景时列表区改半透明磨砂，让背景透出且文字可读 */
  --bg-veil: rgba(255,255,255,.56);
  --text: #1f2329;          /* 主文字/标题 */
  --text-strong: #14141E;   /* 数字/强标题 */
  --label: #6C6C7E;         /* 表单标签/表头/小标题(原 #6C6C7E) */
  --link-dim: #5a6b9a;      /* 可点击次要文字: 操作图标/筛选钮(原 #5a6b9a) */
  --muted: #6f7079;         /* 弱化说明 .muted/关闭钮(原 #999, 提深达 AA) */
  --muted-2: #5b6289;       /* 蓝灰说明 todo-count/note(提深达 AA 4.5+) */
  --faint: #b0b6c8;         /* 完成删除线/最弱 */
  --surface: #fbfbfd;       /* 中性偏冷柔和白(非纯白不刺眼、不带黄): 弹窗/菜单/卡片 */
  --surface-2: #f4f4f8;     /* 次级容器: root 行/面包屑 */
  --surface-3: #f6f6fa;     /* 统计条 */
  --surface-done: #f3f3f7;  /* 已完成卡片底 */
  --card-glass: rgba(255,255,255,.72);   /* 玻璃卡片底 */
  --card-glass-solid: rgba(255,255,255,.92);
  --card-border: rgba(255,255,255,.6);
  --stat-glass: rgba(255,255,255,.55);
  --input-bg: rgba(255,255,255,.75);
  --border: #e9ecf3;        /* 容器/分隔边 */
  --border-strong: #d9dbe3; /* 输入/面板边 */
  --border-input: #E4E1D8;
  --check-ring: #c9cfda;    /* 未勾选圆圈边框(原 #c7ccd6/#d9d9d9) */
  --hover-bg: #f0f2f8;      /* 中性 hover 底 */
  --hover-brand: #f0eafb;   /* 品牌浅 tint hover 底 */
  --scrollbar-thumb: rgba(124,58,237,.30);
  --scrollbar-thumb-hover: rgba(124,58,237,.55);
  --brand-border: #dfe4fb;  /* 品牌浅紫边框(hover/添加框/拖拽) */
  --brand: #A855F7;
  --brand-strong: #7C3AED;  /* 实色/渐变首段: 侧栏 logo(白字对比 5.6:1) */
  --brand-grad: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);  /* 仅品牌时刻: logo/登录/勉励卡 */
  --brand-text: #7C3AED;    /* 文字/链接用品牌色(对比 ≥4.5) */
  --brand-tint: #F3EEFE;    /* 品牌浅紫底(blockquote/标签/按压态) */
  --on-brand: #fff;
  --danger: #cf1322;
  --ok: #34b34a;
  --ok-text: #15803d;       /* 成功语义文字(对比 ≥4.5) */
  --danger-bg: #fff1f0;
  --ok-bg: #f6ffed;
  --warn: #b45309;        /* 临近到期(明天/本周内)琥珀色 */
  --warn-bg: #fdf2e2;
  /* 实心语义底(白字按钮/Toast)与金融涨跌文字: 浅色取值与历史 hex 一致, 暗/护眼另定 */
  --danger-strong: #cf1322;
  --ok-strong: #389e0d;
  --up: #cf1322;
  --down: #389e0d;
  /* child_due「各自截止」模式标识: 品牌浅紫族(与"今天"chip 同语言, 低唤醒), 三主题各自取值 */
  --cd-bg: #F3EEFE;
  --cd-fg: #7C3AED;
  --cd-border: #dfe4fb;
  --th-bg: rgba(20,20,40,.025);
  --th-border: rgba(20,20,40,.06);
  /* 减肥竞赛名次色（金/银/铜，三主题各自取值） */
  --gold: #b8860b; --gold-bg: rgba(212,160,23,.12);
  --silver: #6b7280; --silver-bg: rgba(120,130,145,.14);
  --bronze: #9a5b27; --bronze-bg: rgba(184,115,51,.14);
  --loading-mask: rgba(242,242,247,.65);
  --sticky-th: rgba(242,242,247,.96);
  --code-bg: rgba(127,127,127,.15);
}
[data-theme="dark"] {
  --bg: #17181F;
  --surface-global: #22242e;
  --bgimg-default:
    radial-gradient(1000px 600px at 12% -5%, rgba(255,122,89,.08), transparent 55%),
    radial-gradient(900px 550px at 88% 8%, rgba(168,85,247,.12), transparent 55%),
    radial-gradient(1100px 700px at 50% 100%, rgba(59,130,246,.10), transparent 55%), #17181F;
  --bgimg-aurora:
    radial-gradient(720px 480px at 12% -8%, rgba(52,211,153,.32), transparent 62%),
    radial-gradient(620px 480px at 102% 12%, rgba(96,165,250,.30), transparent 60%),
    radial-gradient(720px 560px at 45% 108%, rgba(168,85,247,.34), transparent 66%),
    linear-gradient(180deg,#0a151f 0%,#0e0d1d 100%);
  --bgimg-dawn:
    radial-gradient(720px 480px at 18% -8%, rgba(251,146,122,.30), transparent 62%),
    radial-gradient(620px 460px at 96% 8%, rgba(244,114,182,.28), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(251,191,36,.14), transparent 66%),
    linear-gradient(180deg,#1c1118 0%,#130e1c 100%);
  --bgimg-matcha:
    radial-gradient(720px 480px at 14% -8%, rgba(110,190,130,.30), transparent 62%),
    radial-gradient(620px 470px at 100% 10%, rgba(170,210,120,.18), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(80,160,150,.22), transparent 66%),
    linear-gradient(180deg,#0b1813 0%,#0c1514 100%);
  --bgimg-sea:
    radial-gradient(720px 480px at 14% -8%, rgba(96,165,250,.30), transparent 62%),
    radial-gradient(620px 470px at 100% 10%, rgba(45,212,191,.26), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(80,140,220,.24), transparent 66%),
    linear-gradient(180deg,#081420 0%,#0a131d 100%);
  --bgimg-dusk:
    radial-gradient(720px 480px at 88% -8%, rgba(168,85,247,.34), transparent 62%),
    radial-gradient(640px 470px at 10% 6%, rgba(251,113,133,.26), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(217,150,255,.22), transparent 66%),
    linear-gradient(180deg,#130e20 0%,#1a0f1e 100%);
  --bg-veil: rgba(14,16,28,.50);
  --text: #dde0ea;
  --text-strong: #e6e9f2;
  --label: #a4abc0;
  --link-dim: #b2bacf;
  --muted: #8a90a6;
  --muted-2: #8890b8;
  --faint: #8288a8;
  --surface: #22242e;
  --surface-2: #292c38;
  --surface-3: #262936;
  --surface-done: #20222d;
  --card-glass: rgba(34,36,46,.72);
  --card-glass-solid: rgba(34,36,46,.94);
  --card-border: rgba(255,255,255,.08);
  --stat-glass: rgba(255,255,255,.04);
  --input-bg: rgba(255,255,255,.06);
  --border: #2e3448;
  --border-strong: #3a4157;
  --border-input: #343b52;
  --check-ring: #5a6280;
  --hover-bg: rgba(255,255,255,.06);
  --hover-brand: rgba(168,85,247,.20);
  --scrollbar-thumb: rgba(192,132,252,.28);
  --scrollbar-thumb-hover: rgba(192,132,252,.5);
  --brand-border: rgba(185,123,255,.45);
  --brand: #b97bff;
  --brand-text: #c084fc;
  --brand-tint: rgba(168,85,247,.18);
  --danger: #ff6b6b;
  --ok: #4ade80;
  --ok-text: #4ade80;
  --danger-bg: rgba(255,107,107,.14);
  --ok-bg: rgba(74,222,128,.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251,191,36,.15);
  --danger-strong: #dc2626;
  --ok-strong: #16a34a;
  --up: #ff6b6b;
  --down: #4ade80;
  --cd-bg: rgba(168,85,247,.18);
  --cd-fg: #b97bff;
  --cd-border: rgba(185,123,255,.45);
  --th-bg: rgba(255,255,255,.04);
  --th-border: rgba(255,255,255,.08);
  --gold: #f5c542; --gold-bg: rgba(245,197,66,.16);
  --silver: #c2c9d4; --silver-bg: rgba(180,190,205,.14);
  --bronze: #e0995e; --bronze-bg: rgba(224,153,94,.16);
  --loading-mask: rgba(10,12,20,.6);
  --sticky-th: rgba(34,36,46,.96);
  --code-bg: rgba(255,255,255,.12);
}
[data-theme="eye"] {
  --bg: #f3eee0;
  --surface-global: #faf6ea;
  --bgimg-default:
    radial-gradient(1000px 600px at 12% -5%, rgba(214,168,90,.14), transparent 55%),
    radial-gradient(900px 550px at 88% 8%, rgba(168,85,247,.10), transparent 55%),
    radial-gradient(1100px 700px at 50% 100%, rgba(90,160,140,.10), transparent 55%), #f3eee0;
  --bgimg-aurora:
    radial-gradient(720px 480px at 12% -8%, rgba(90,170,130,.22), transparent 62%),
    radial-gradient(620px 480px at 102% 12%, rgba(120,150,200,.18), transparent 60%),
    radial-gradient(720px 560px at 45% 108%, rgba(150,110,200,.16), transparent 66%),
    linear-gradient(180deg,#edeada 0%,#ece7d8 100%);
  --bgimg-dawn:
    radial-gradient(720px 480px at 18% -8%, rgba(220,150,110,.22), transparent 62%),
    radial-gradient(620px 460px at 96% 8%, rgba(215,180,110,.18), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(200,130,170,.16), transparent 66%),
    linear-gradient(180deg,#f2ede0 0%,#f0e9dd 100%);
  --bgimg-matcha:
    radial-gradient(720px 480px at 14% -8%, rgba(150,180,110,.22), transparent 62%),
    radial-gradient(620px 470px at 100% 10%, rgba(180,190,130,.16), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(120,165,120,.14), transparent 66%),
    linear-gradient(180deg,#eee9d9 0%,#ece8d6 100%);
  --bgimg-sea:
    radial-gradient(720px 480px at 14% -8%, rgba(120,160,200,.20), transparent 62%),
    radial-gradient(620px 470px at 100% 10%, rgba(110,180,170,.18), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(130,170,200,.13), transparent 66%),
    linear-gradient(180deg,#ede9da 0%,#e9e7d5 100%);
  --bgimg-dusk:
    radial-gradient(720px 480px at 88% -8%, rgba(150,110,200,.20), transparent 62%),
    radial-gradient(640px 470px at 10% 6%, rgba(205,130,150,.18), transparent 60%),
    radial-gradient(700px 560px at 50% 108%, rgba(180,140,200,.14), transparent 66%),
    linear-gradient(180deg,#efeada 0%,#f1e7dd 100%);
  --bg-veil: rgba(250,246,234,.56);
  --text: #4a4030;
  --text-strong: #3a3226;
  --label: #6a5f44;
  --link-dim: #6a5f44;
  --muted: #6b6144;
  --muted-2: #6f654d;
  --faint: #b3a888;
  --surface: #faf6ea;
  --surface-2: #f3eddb;
  --surface-3: #f5f0e0;
  --surface-done: #f5efe0;
  --card-glass: rgba(250,246,234,.72);
  --card-glass-solid: rgba(250,246,234,.94);
  --card-border: rgba(255,255,255,.6);
  --stat-glass: rgba(250,246,234,.55);
  --input-bg: rgba(255,253,246,.8);
  --border: #e3dcc4;
  --border-strong: #d4cbb0;
  --border-input: #ddd3b8;
  --check-ring: #c8bfa8;
  --hover-bg: #efe8d4;
  --hover-brand: #f1e7fb;
  --scrollbar-thumb: rgba(126,34,206,.30);
  --scrollbar-thumb-hover: rgba(126,34,206,.52);
  --brand-border: #d9cdf5;
  --brand: #9333ea;
  --brand-text: #7e22ce;
  --brand-tint: #f0e6f8;
  --danger: #c0392b;
  --ok: #2f9e44;
  --ok-text: #1a7c37;
  --danger-bg: #fbeae7;
  --ok-bg: #e9f5ea;
  --warn: #93611a;
  --warn-bg: #f6ead2;
  --danger-strong: #c0392b;
  --ok-strong: #2f9e44;
  --up: #c0392b;
  --down: #2f9e44;
  --cd-bg: #f0e6f8;
  --cd-fg: #7e22ce;
  --cd-border: #d9cdf5;
  --th-bg: rgba(120,100,50,.05);
  --th-border: rgba(120,100,50,.10);
  --gold: #8a6410; --gold-bg: rgba(160,110,20,.14);
  --silver: #5d6470; --silver-bg: rgba(110,110,100,.14);
  --bronze: #7c4a22; --bronze-bg: rgba(150,95,40,.14);
  --loading-mask: rgba(243,238,224,.65);
  --sticky-th: rgba(243,238,224,.96);
  --code-bg: rgba(120,100,50,.14);
}

/* ============ 待办全屏背景：渐变(命名) / 纯色(solid-*) ============
   背景只作用于 .todo-fullscreen 与背景面板实时预览；内容卡片不透明跟随主题、不随背景变色。
   直接落在背景上的分组头文字与 FAB 通过内容区变量(--onbg/--fab-bg)按实色适配（见下方）。 */

/* —— 渐变背景（浅色；全屏 + 预览） —— */
html[data-bg="aurora"] :is(.todo-fullscreen, .bg-sheet__preview) { background: var(--bgimg-aurora); }
html[data-bg="dawn"]   :is(.todo-fullscreen, .bg-sheet__preview) { background: var(--bgimg-dawn); }
html[data-bg="matcha"] :is(.todo-fullscreen, .bg-sheet__preview) { background: var(--bgimg-matcha); }
html[data-bg="sea"]    :is(.todo-fullscreen, .bg-sheet__preview) { background: var(--bgimg-sea); }
html[data-bg="dusk"]   :is(.todo-fullscreen, .bg-sheet__preview) { background: var(--bgimg-dusk); }

/* —— 纯色背景（浅色；全屏 + 预览） —— */
html[data-bg="solid-indigo"] :is(.todo-fullscreen, .bg-sheet__preview) { background: #4f69c3; }
html[data-bg="solid-steel"]  :is(.todo-fullscreen, .bg-sheet__preview) { background: #407094; }
html[data-bg="solid-teal"]   :is(.todo-fullscreen, .bg-sheet__preview) { background: #2e8c88; }
html[data-bg="solid-green"]  :is(.todo-fullscreen, .bg-sheet__preview) { background: #139364; }
html[data-bg="solid-brown"]  :is(.todo-fullscreen, .bg-sheet__preview) { background: #b07a52; }
html[data-bg="solid-rose"]   :is(.todo-fullscreen, .bg-sheet__preview) { background: #c05678; }
html[data-bg="solid-purple"] :is(.todo-fullscreen, .bg-sheet__preview) { background: #8d6ac2; }
html[data-bg="solid-slate"]  :is(.todo-fullscreen, .bg-sheet__preview) { background: #4a5568; }
html[data-bg="solid-mint"]   :is(.todo-fullscreen, .bg-sheet__preview) { background: #dcefe6; }
html[data-bg="solid-sky"]    :is(.todo-fullscreen, .bg-sheet__preview) { background: #ddeaf6; }

/* —— 暗色主题：全屏背景改用暗色版（预览样图不在此列、恒浅色） —— */
html[data-theme="dark"][data-bg="aurora"] .todo-fullscreen { background: var(--bgimg-aurora-dark); }
html[data-theme="dark"][data-bg="dawn"]   .todo-fullscreen { background: var(--bgimg-dawn-dark); }
html[data-theme="dark"][data-bg="matcha"] .todo-fullscreen { background: var(--bgimg-matcha-dark); }
html[data-theme="dark"][data-bg="sea"]    .todo-fullscreen { background: var(--bgimg-sea-dark); }
html[data-theme="dark"][data-bg="dusk"]   .todo-fullscreen { background: var(--bgimg-dusk-dark); }
html[data-theme="dark"][data-bg="solid-indigo"] .todo-fullscreen { background: #33509a; }
html[data-theme="dark"][data-bg="solid-steel"]  .todo-fullscreen { background: #2f6280; }
html[data-theme="dark"][data-bg="solid-teal"]   .todo-fullscreen { background: #267a76; }
html[data-theme="dark"][data-bg="solid-green"]  .todo-fullscreen { background: #167e58; }
html[data-theme="dark"][data-bg="solid-brown"]  .todo-fullscreen { background: #8a5f40; }
html[data-theme="dark"][data-bg="solid-rose"]   .todo-fullscreen { background: #a04462; }
html[data-theme="dark"][data-bg="solid-purple"] .todo-fullscreen { background: #6c52a0; }
html[data-theme="dark"][data-bg="solid-slate"]  .todo-fullscreen { background: #333d4d; }
html[data-theme="dark"][data-bg="solid-mint"]   .todo-fullscreen { background: #2f4a3e; }
html[data-theme="dark"][data-bg="solid-sky"]    .todo-fullscreen { background: #324a66; }

/* —— 纯色：内容区变量（背景上分组文字 --onbg + FAB --fab-bg 跟随实色） ——
   深色实色=白字+提亮 FAB；浅色(mint/sky)=深字+加深 FAB。渐变/默认不定义、回退主题原值。 */
html[data-bg="solid-indigo"] body.todo-fs-on .todo-fs-main { --onbg:#fff; --onbg-soft:rgba(255,255,255,.72); --onbg-hover:rgba(255,255,255,.14); --hover-bg:rgba(255,255,255,.1); --fab-bg:#6e89de; --rail-line:rgba(255,255,255,.42); --over-fg:#ff6b5e; --today-fg:#c4b5fd; --soon-fg:#fbbf24; --card-border-c:rgba(255,255,255,.32); }
html[data-bg="solid-steel"] body.todo-fs-on .todo-fs-main { --onbg:#fff; --onbg-soft:rgba(255,255,255,.72); --onbg-hover:rgba(255,255,255,.14); --hover-bg:rgba(255,255,255,.1); --fab-bg:#5e8cb0; --rail-line:rgba(255,255,255,.42); --over-fg:#ff6b5e; --today-fg:#c4b5fd; --soon-fg:#fbbf24; --card-border-c:rgba(255,255,255,.32); }
html[data-bg="solid-teal"] body.todo-fs-on .todo-fs-main { --onbg:#fff; --onbg-soft:rgba(255,255,255,.72); --onbg-hover:rgba(255,255,255,.14); --hover-bg:rgba(255,255,255,.1); --fab-bg:#4ea8a3; --rail-line:rgba(255,255,255,.42); --over-fg:#ff6b5e; --today-fg:#c4b5fd; --soon-fg:#fbbf24; --card-border-c:rgba(255,255,255,.32); }
html[data-bg="solid-green"] body.todo-fs-on .todo-fs-main { --onbg:#fff; --onbg-soft:rgba(255,255,255,.72); --onbg-hover:rgba(255,255,255,.14); --hover-bg:rgba(255,255,255,.1); --fab-bg:#33af80; --rail-line:rgba(255,255,255,.42); --over-fg:#ff6b5e; --today-fg:#c4b5fd; --soon-fg:#fbbf24; --card-border-c:rgba(255,255,255,.32); }
html[data-bg="solid-brown"] body.todo-fs-on .todo-fs-main { --onbg:#fff; --onbg-soft:rgba(255,255,255,.72); --onbg-hover:rgba(255,255,255,.14); --hover-bg:rgba(255,255,255,.1); --fab-bg:#c8966e; --rail-line:rgba(255,255,255,.42); --over-fg:#ff6b5e; --today-fg:#c4b5fd; --soon-fg:#fbbf24; --card-border-c:rgba(255,255,255,.32); }
html[data-bg="solid-rose"] body.todo-fs-on .todo-fs-main { --onbg:#fff; --onbg-soft:rgba(255,255,255,.72); --onbg-hover:rgba(255,255,255,.14); --hover-bg:rgba(255,255,255,.1); --fab-bg:#d87494; --rail-line:rgba(255,255,255,.42); --over-fg:#ff6b5e; --today-fg:#c4b5fd; --soon-fg:#fbbf24; --card-border-c:rgba(255,255,255,.32); }
html[data-bg="solid-purple"] body.todo-fs-on .todo-fs-main { --onbg:#fff; --onbg-soft:rgba(255,255,255,.72); --onbg-hover:rgba(255,255,255,.14); --hover-bg:rgba(255,255,255,.1); --fab-bg:#a688d8; --rail-line:rgba(255,255,255,.42); --over-fg:#ff6b5e; --today-fg:#c4b5fd; --soon-fg:#fbbf24; --card-border-c:rgba(255,255,255,.32); }
html[data-bg="solid-slate"] body.todo-fs-on .todo-fs-main { --onbg:#fff; --onbg-soft:rgba(255,255,255,.72); --onbg-hover:rgba(255,255,255,.14); --hover-bg:rgba(255,255,255,.1); --fab-bg:#718096; --rail-line:rgba(255,255,255,.42); --over-fg:#ff6b5e; --today-fg:#c4b5fd; --soon-fg:#fbbf24; --card-border-c:rgba(255,255,255,.32); }
html[data-bg="solid-mint"] body.todo-fs-on .todo-fs-main { --onbg:#2f4a3e; --onbg-soft:#5f7e6e; --onbg-hover:rgba(20,40,60,.08); --hover-bg:rgba(20,40,60,.06); --fab-bg:#8fc8ae; }
html[data-bg="solid-sky"] body.todo-fs-on .todo-fs-main { --onbg:#324a66; --onbg-soft:#6282a0; --onbg-hover:rgba(20,40,60,.08); --hover-bg:rgba(20,40,60,.06); --fab-bg:#8fb4dd; }

/* 卡片描边分离（不用投影）：只覆盖【右、下】两边，保留 border-top(卡片顶色带)/border-left(速览·时间轴左色带) 不被冲掉。
   低对比渐变上白卡也能清晰分张；六视图统一。深色实色覆盖见 --card-border-c。 */
body.todo-fs-on :is(.todo-card,.todo-bandcard,.tl-card,.todo-row,.tl-item,.tl-card-list) {
  border-right-color: var(--card-border-c, rgba(30,40,60,.18));
  border-bottom-color: var(--card-border-c, rgba(30,40,60,.18));
}

/* body 纯色底（光斑仅保留在待办全屏背景内） */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', EmojiSymbols;
  color: var(--text-strong);
  line-height: 1.6;
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--brand-text); text-decoration: none; }
/* ============ 应用外壳：桌面侧边导航 (.app-side) + 手机底部 Tab (.m-tabbar) ============
   仅登录态页面由 renderTopbar 输出；原生 App 壳(appShell)/公开免密页不输出, body:has() 不匹配,
   容器零偏移。断点: ≥1100px 全宽侧栏 232 / 641–1099px 图标栏 64 / ≤640px 隐藏侧栏改底部 Tab。 */
.app-side {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
  width: 232px; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
}
.app-side__brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; color: inherit; }
.app-side__brand:hover:not(:active) { text-decoration: none; }
.app-side__logo {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(124, 58, 237, .30);
}
.app-side__logo svg { width: 19px; height: 19px; display: block; }
.app-side__name { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.app-side__name b { font-size: 14px; font-weight: 800; color: var(--text-strong); letter-spacing: .01em; white-space: nowrap; }
.app-side__name small { font-size: 11px; font-weight: 600; color: var(--brand-text); white-space: nowrap; }
.app-side__clock { padding: 0 20px 10px; font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.app-side__nav { flex: 1; overflow-y: auto; padding: 2px 12px 12px; overscroll-behavior: contain; }
.app-side__grp { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--faint); padding: 12px 10px 4px; white-space: nowrap; }
.app-side__grp:first-child { padding-top: 2px; }
a.app-side__item, button.app-side__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 1px 0; padding: 8px 10px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; font-family: inherit; text-align: left;
  color: var(--label); background: none; border: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
a.app-side__item { text-decoration: none; }
.app-side__item svg { width: 17px; height: 17px; flex-shrink: 0; }
.app-side__item:hover:not(:active) { background: var(--hover-bg); color: var(--text-strong); }
a.app-side__item.active { background: var(--hover-brand); color: var(--brand-text); font-weight: 700; }
a.app-side__item.active:hover:not(:active) { background: var(--hover-brand); color: var(--brand-text); }
.app-side__foot { flex-shrink: 0; border-top: 1px solid var(--border); padding: 8px 12px 12px; }
.app-side__me {
  display: flex; align-items: center; gap: 9px; margin-top: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 11px;
}
.app-side__avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-strong); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.app-side__who { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.app-side__who b { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-side__who .tag { align-self: flex-start; margin-top: 1px; }
/* 内容区给侧栏让位: body 左 padding 留出侧栏宽度(fixed 元素不受影响),
   .container 在右侧工作区内 margin:auto 居中, 宽屏下左右留白对称 */
@media (min-width: 1100px) {
  body:has(.app-side) { padding-left: 232px; }
  body:has(.app-side) .container { max-width: 1180px; margin: 24px auto; }
}
/* 641–1099px: 侧栏收成 64px 图标栏 */
@media (min-width: 641px) and (max-width: 1099px) {
  .app-side { width: 64px; }
  .app-side__brand { justify-content: center; padding: 16px 0 10px; }
  .app-side__name, .app-side__clock { display: none; }
  .app-side__nav { padding: 2px 8px 8px; overflow: hidden; }
  .app-side__grp { height: 10px; padding: 0; text-indent: -999px; overflow: hidden; }
  a.app-side__item, button.app-side__item { justify-content: center; padding: 10px 0; }
  .app-side__item .as-label { display: none; }
  .app-side__foot { padding: 8px 6px 10px; }
  .app-side__foot .app-side__item { justify-content: center; }
  .app-side__me { justify-content: center; padding: 6px 0; border: none; }
  .app-side__who { display: none; }
  body:has(.app-side) { padding-left: 64px; }
  body:has(.app-side) .container { margin: 16px auto; }
}
/* ≤640px: 侧栏隐藏, 改底部 Tab（仅浏览器: App 壳不输出该节点） */
.m-tabbar, .m-fab { display: none; }
@media (max-width: 640px) {
  .app-side { display: none; }
  .m-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 14px rgba(20, 20, 40, .06);
    transition: transform .22s ease;
  }
  .m-tabbar a {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 10.5px; font-weight: 500; color: var(--faint); text-decoration: none;
  }
  .m-tabbar a.on { color: var(--brand-text); font-weight: 700; }
  .m-tabbar a.on::before {
    content: ''; position: absolute; top: 0; width: 24px; height: 2.5px; border-radius: 99px; background: var(--brand);
  }
  .m-tabbar svg { width: 21px; height: 21px; }
  body:has(.m-tabbar) .container { padding-bottom: 80px; }
  /* 新建任务 FAB: 仅待办页(renderTopbar 按 active 输出); 默认态代理 #tAdd, 全屏态代理 #tAddFs
     (renderTopbar 的内联脚本按 body.todo-fs-on 自动选择)。App 壳无 .m-tabbar 时贴底 20px。 */
  .m-fab {
    position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 1003;
    width: 54px; height: 54px; border-radius: 18px;
    border: 1px solid rgba(255,255,255,.18); cursor: pointer;
    background: var(--fab-bg, var(--brand-strong)); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 22px rgba(124,58,237,.32);
    transition: transform .22s ease, opacity .2s ease, background .15s ease;
  }
  body:has(.m-tabbar) .m-fab { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  .m-fab:active { transform: scale(.94); }
  .m-fab svg { width: 26px; height: 26px; }
  .m-tabbar { z-index: 1002; }
  /* FAB 隐藏场景: 卡片详情态(添加走子任务入口) / 抽屉打开 / 弹窗打开 / 键盘弹起 */
  body.todo-detail .m-fab,
  body:has(.todo-drawer.open) .m-fab,
  body:has(#modalMask.show) .m-fab { transform: scale(.4); opacity: 0; pointer-events: none; }
  body.kb-on .m-tabbar, body.kb-on .m-fab {
    transform: translateY(130%); opacity: 0; pointer-events: none;
  }
  /* 覆盖式(App/部分浏览器): 系统不压缩 layout, 底部留白=键盘高;
     压缩式浏览器(kb-resize): 系统已把容器缩到键盘上方, 只留小呼吸, 不双倍留白 */
  body.kb-on .todo-fs-main { padding-bottom: calc(12px + var(--kb-inset, 0px)); }
  body.kb-resize .todo-fs-main { padding-bottom: 14px; }
  /* 手机待办树(完整树/卡片进入的子任务详情): 操作收进「⋯」弹层, 行内只留更多钮;
   标题保留完整显示；备注仍单行截断，完整内容点详情查看 */
  body .todo-tree .todo-ops { opacity: 1; gap: 0; }
  body .todo-tree .todo-ops .todo-op:not(.todo-more) { display: none; }
  body .todo-tree .todo-op.todo-more { display: inline-flex; }
  body .todo-tree .todo-ops .todo-op.todo-fold { display: inline-flex; }
  body:not(.todo-detail) .todo-tree .todo-title { white-space: pre-wrap; overflow: visible; text-overflow: clip; }
  /* 基金页策略浮层在底栏之上的避让规则写在 .strat-* 原媒体块旁(该处带 !important) */
}
/* 手机完整树「⋯」操作弹层(桌面 ⋯ 隐藏, 弹层也不会被触发) */
.todo-op.todo-more { display: none; }
.todo-op-menu {
  position: absolute; right: 4px; top: calc(100% - 4px); z-index: 300; min-width: 162px;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 5px;
  box-shadow: 0 12px 32px rgba(20,20,40,.18), 0 2px 8px rgba(20,20,40,.08);
  animation: fabMenuIn .15s cubic-bezier(.2,.9,.3,1);
}
.todo-op-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; color: var(--text); font-family: inherit; font-size: 13.5px;
  text-align: left; padding: 9px 11px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.todo-op-menu__item svg { width: 16px; height: 16px; color: var(--link-dim); flex: none; }
.todo-op-menu__item.danger { color: var(--danger); }
.todo-op-menu__item.danger svg { color: var(--danger); }
.todo-op-menu__item:active { background: var(--surface-2); }
.todo-op-menu--fixed {
  position: fixed; right: auto; z-index: 2000;
  max-width: calc(100vw - 16px);
}
/* 打开菜单的行与整个任务节点一起抬层, 避免后续兄弟行/子行的白底盖住弹层 */
.todo-node:has(> .todo-row.op-menu-open) { position: relative; z-index: 200; }
.todo-row.op-menu-open { z-index: 210; }
/* 菜单展开期间收起右下 FAB, 避免遮住最后几行的弹层 */
body.todo-opmenu .m-fab { transform: scale(.4); opacity: 0; pointer-events: none; }
/* FAB 加号弹出菜单: 两个竖排卡片按钮(任务/备忘录), 定位由 JS 按锚点按钮写 top/bottom+right */
.fab-menu {
  position: fixed; z-index: 1004;
  display: flex; flex-direction: column; gap: 6px;
  width: max-content;
  animation: fabMenuIn .16s cubic-bezier(.2,.9,.3,1);
}
@keyframes fabMenuIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.fab-menu__item {
  display: flex; align-items: center; gap: 8px; min-height: 40px; text-align: left;
  padding: 6px 12px; border-radius: 10px; font-family: inherit; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(20,20,40,.16), 0 2px 8px rgba(20,20,40,.08);
  transition: transform .12s ease, border-color .12s ease;
}
.fab-menu__item:active { transform: scale(.97); border-color: var(--brand-border); }
.fab-menu__ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand-text); }
.fab-menu__ic svg { width: 15px; height: 15px; }
.fab-menu__t { font-size: 14px; font-weight: 600; line-height: 1.3; }
.fab-menu__mark { margin-left: auto; color: var(--brand-text); font-size: 15px; font-weight: 700; min-width: 14px; text-align: right; }
@media (prefers-reduced-motion: reduce) { .fab-menu { animation: none; } }

/* ============ 待办主列表：按到期日分组（S2 日历方块组头） ============ */
.todo-due-groups { display: flex; flex-direction: column; }
.todo-due-group__head {
  display: flex; align-items: center; gap: 10px;
  margin: 15px 2px 1px; cursor: pointer; user-select: none;
}
.todo-due-group__head:first-child { margin-top: 2px; }
/* 日历方块：日号+星期；状态色 逾期红 / 今天紫 / 临近琥珀 / 未来·未安排灰 */
.todo-due-group__cal {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; position: relative;
}
/* 逾期角标: 日历右上角实色红底白字「逾」, 与浅红日历底拉开 */
.todo-due-group__overflag {
  position: absolute; top: -5px; right: -6px;
  font-style: normal; font-size: 9px; font-weight: 800; line-height: 1;
  color: #fff; background: var(--danger);
  border-radius: 7px; padding: 2px 3.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.todo-due-group__cal b { font-size: 17px; font-weight: 800; }
.todo-due-group__cal small { font-size: 9px; margin-top: 2px; opacity: .8; }
/* 配色与卡片 .todo-chip.due 完全同源（日历即从主任务卡提到组头） */
.todo-due-group__cal--overdue { background: var(--danger-bg); color: var(--danger); }
.todo-due-group__cal--today { background: var(--brand-strong); color: #fff; }
.todo-due-group__cal--soon { background: var(--warn-bg); color: var(--warn); }
.todo-due-group__cal--future,
.todo-due-group__cal--none { background: var(--surface-2); color: var(--link-dim); }
.todo-due-group__name { font-size: 14.5px; font-weight: 700; color: var(--onbg, var(--text)); white-space: nowrap; }
.todo-due-group__name small {
  display: block; font-size: 11.5px; font-weight: 400; color: var(--onbg-soft, var(--faint)); margin-top: 1px;
}
.todo-due-group__count {
  flex: none; margin-left: auto; font-size: 12px; color: var(--onbg-soft, var(--muted-2)); white-space: nowrap;
}
.todo-due-group__caret {
  flex: none; color: var(--onbg-soft, var(--faint)); font-size: 10px; transition: transform .18s;
}
.todo-due-group__head.is-collapsed .todo-due-group__caret { transform: rotate(-90deg); }
/* 折叠态摘要：仅组头折叠时显示，单行截断 */
.todo-due-group__summary {
  display: none; margin: 4px 4px 0; font-size: 12px; line-height: 1.6; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.todo-due-group__head.is-collapsed + .todo-due-group__summary { display: block; }
/* 分组模式：组内各行不重复显示到期 chip，组头自身豁免 */
.todo-due-groups .todo-chip.due { display: none; }
/* 豁免只需给非 none 值：用 inline（chip 默认 display），
   不要 inline-flex——flex 下日历 svg 的 vertical-align 失效会与文字错行 */
.todo-due-groups .todo-due-group__head .todo-chip.due { display: inline; }
/* 各自截止（child_due）任务：子任务日期各异，完整树/手风琴/速览下
   根行与全部子任务行都显示各自到期日。卡片视图是两层级，不适用（整卡继续隐藏）。 */
.todo-due-groups .todo-tree .cd-on .todo-chip.due,
.todo-due-groups .todo-acc .cd-on .todo-chip.due,
.todo-due-groups .flat-view .cd-on .todo-chip.due { display: inline; }
/* 卡片视图逾期标签: 文案含「逾期 N 天」天数(组头只有「逾」字+日期), 分组内保留;
   今天/未来 chip 仍隐藏, 与组头日期重复 */
.todo-due-groups .todo-cards .todo-chip.due.overdue { display: inline; }
.impersonate-banner { background: #fff3cd; color: #856404; padding: 10px 24px; font-size: 14px; text-align: center; border-bottom: 1px solid #ffe58f; }
.impersonate-banner a { color: var(--danger); font-weight: 600; margin-left: 8px; }
/* 全站公告强制阅读弹窗：独立遮罩，层级高于 #globalLoading(10500)，无关闭叉、点空白不关闭 */
.announce-modal { z-index: 10600; }
.announce-modal .modal-box { width: 100%; max-width: 560px; }
.announce-modal .announce-md { max-height: 56vh; overflow-y: auto; font-size: 14px; line-height: 1.7; }
.announce-modal .announce-md > :first-child { margin-top: 0; }
.announce-modal .announce-md > :last-child { margin-bottom: 0; }
.announce-modal .announce-md img { max-width: 100%; }
.container { max-width: 1000px; margin: 24px auto; padding: 0 16px; }
/* 实色卡片（demo 分组语言）: 表面色 + 大圆角，无描边无阴影，靠页面底色与表面色明度差分层；
   护眼主题底色与卡面明度差弱，在下方单独保留 1px 描边防糊连 */
.card {
  background: var(--surface);
  border: none;
  border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 18px;
  /* card 统一 position:relative + z-index 参与堆叠排序, 否则内部绝对定位弹窗(.mp-menu)
     溢出到下方 card 会被后者遮住; :has 打开弹窗时再提升整卡 */
  position: relative;
  z-index: 1;
}
/* 护眼主题：暖纸底(#f3eee0)与卡面(#faf6ea)明度差弱，无描边会糊连，保留轻边界 */
[data-theme="eye"] .card { border: 1px solid var(--border); }
/* 当前打开多选弹窗 / 操作下拉菜单的 card 提升到最上层, 弹窗才能压过后续 card */
.card:has(.mp-menu.show),
.card:has(.dropdown-menu.show) { z-index: 100; }
.card h2 { font-size: 16px; margin-bottom: 14px; color: var(--text-strong); }
/* Admin 页分段 Tab: pill 导航, 非当前段卡片隐藏 */
.adm-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.adm-tab {
  padding: 7px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--label);
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.adm-tab:hover:not(:active) { border-color: var(--brand-border); color: var(--text); }
.adm-tab.is-on { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.adm-tab.is-on:hover:not(:active) { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; filter: brightness(1.08); }
.adm-pane:not(.is-on) { display: none; }
/* 推送配置折叠卡: 低频设置默认收起, 不占页面主流程; 内部 id/class 全部保留, JS 零感知 */
.card.push-card { padding: 0; overflow: hidden; }
/* 多选下拉打开时放开裁切: 否则 .mp-menu 向下溢出卡片的部分（24 个小时选项的下半段）被
   overflow:hidden 切掉; 层叠顺序由上方 .card:has(.mp-menu.show){z-index:100} 保证 */
.card.push-card:has(.mp-menu.show) { overflow: visible; }
.push-card > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; font-size: 15px; font-weight: 700; color: var(--text-strong);
}
.push-card > summary::-webkit-details-marker { display: none; }
.push-card__icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--brand-tint); color: var(--brand-text);
  display: flex; align-items: center; justify-content: center;
}
.push-card__icon svg { width: 16px; height: 16px; }
.push-card__chev { margin-left: auto; width: 17px; height: 17px; color: var(--faint); transition: transform .2s; flex-shrink: 0; }
.push-card[open] .push-card__chev { transform: rotate(180deg); }
.push-card__body { padding: 2px 20px 18px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .push-card > summary { padding: 13px 15px; }
  .push-card__body { padding: 2px 15px 15px; }
}
/* 仅手机显示(桌面侧栏已含全部入口): 设置页"功能入口"卡 */
.m-only { display: none; }
@media (max-width: 640px) { .m-only { display: block; } }
.m-entry { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-entry a {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.m-entry a svg { color: var(--brand-text); flex-shrink: 0; }
.m-entry a:hover:not(:active) { border-color: var(--brand-border); background: var(--hover-brand); text-decoration: none; }
/* 退出登录（仅手机浏览器功能入口卡；App 壳不输出该项，登出走原生「我的」） */
.m-entry a.m-entry__logout { color: var(--danger); }
.m-entry a.m-entry__logout svg { color: var(--danger); }
.m-entry a.m-entry__logout:hover:not(:active) { border-color: rgba(207,19,34,.35); background: rgba(207,19,34,.06); }
/* 仪表盘 KPI 语义数字 */
#kpiToday { color: var(--brand-text); }
#kpiOverdue.num:not(:empty) { color: var(--danger); }
/* 仪表盘今日待办行 */
.dash-todo .dash-row {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--th-border); font-size: 14px;
}
.dash-todo .dash-row:last-child { border-bottom: none; }
.dash-row .d-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--brand); }
.dash-row .d-dot.od { background: var(--danger); }
.dash-row a { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row a:hover:not(:active) { color: var(--brand-text); }
/* 整行都是链接热区：伪元素铺满行（含圆点/日期标签），点哪都直达该任务详情 /todo?root=id */
.dash-row a::after { content: ''; position: absolute; inset: 0; }
.dash-row .d-tag { font-size: 11.5px; color: var(--muted-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.dash-row .d-tag.od { color: var(--danger); font-weight: 600; }
/* 仪表盘今日待办：手风琴行（圆点主任务行 + 就地展开子任务勾选行，行间细分隔线，无卡片框） */
.dash-todo .dash-groups { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; padding: 2px 0; }
.dash-todo .dash-acc { border-bottom: 1px solid var(--th-border); }
.dash-todo .dash-acc:last-child { border-bottom: none; }
.dash-todo .dash-arow { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 2px; }
.dash-todo .dash-adot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--brand); }
.dash-todo .dash-adot.od { background: var(--danger); }
.dash-todo .dash-aname {
  flex: 1; min-width: 0; font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-todo .dash-aname:hover:not(:active) { color: var(--brand-text); }
/* 主标题链接热区铺满整行；折叠箭头/日期靠 z-index 独立点击 */
.dash-todo .dash-aname::after { content: ''; position: absolute; inset: 0; }
.dash-todo .dash-aarrow {
  flex: none; width: 22px; height: 22px; padding: 0; border: 0; background: transparent;
  color: var(--muted); font-size: 10px; cursor: pointer; border-radius: 5px; z-index: 1;
  transition: transform .18s;
}
.dash-todo .dash-aarrow:hover:not(:active) { color: var(--brand-text); }
.dash-todo .dash-acc.collapsed .dash-aarrow { transform: rotate(-90deg); }
.dash-todo .dash-atag { flex: none; font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; z-index: 1; }
.dash-todo .dash-atag.od { color: var(--danger); font-weight: 600; }
.dash-todo .dash-akids { padding: 0 2px 7px 19px; }
.dash-todo .dash-acc.collapsed .dash-akids { display: none; }
.dash-todo .dash-achild { display: flex; align-items: flex-start; gap: 9px; padding: 5px 2px; }
/* 勾选圆复用待办页 .todo-card__check，尺寸收紧 */
.dash-todo .dash-achild .todo-card__check { width: 20px; height: 20px; flex: none; z-index: 1; }
.dash-todo .dash-achild .todo-card__check::after { font-size: 12px; }
.dash-todo .dash-actitle {
  flex: 1; min-width: 0; font-size: 13.5px; color: var(--text);
  word-break: break-word;
}
/* 多行标题时勾选圆/日期与首行文字对齐 */
.dash-todo .dash-achild .todo-card__check { margin-top: 1px; }
.dash-todo .dash-acdate { margin-top: 3px; }
.dash-todo .dash-actitle:hover:not(:active) { color: var(--brand-text); }
.dash-todo .dash-acdate { flex: none; font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.dash-todo .dash-acdate.od { color: var(--danger); font-weight: 600; }
/* 手机端适配：限高收缩、触控热区放大、缩进收紧 */
@media (max-width: 640px) {
  .dash-todo .dash-groups { max-height: 300px; -webkit-overflow-scrolling: touch; }
  .dash-todo .dash-arow { gap: 8px; padding: 11px 2px; }
  .dash-todo .dash-aarrow { width: 30px; height: 30px; }
  .dash-todo .dash-akids { padding: 0 2px 8px 16px; }
  .dash-todo .dash-achild { gap: 10px; padding: 6px 2px; }
  .dash-todo .dash-actitle { font-size: 14px; }
}

/* ============ 仪表盘双栏（2026-11）：KPI 网格 + 左主右辅，颜色/圆角全走变量 ============ */
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.dash-kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; min-width: 0;
}
.dash-kpi__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.dash-kpi__num {
  font-size: 26px; font-weight: 800; color: var(--text-strong);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-kpi--danger .dash-kpi__num { color: var(--danger); }
.dash-kpi__num--money { font-size: 21px; padding-top: 3px; }
.dash-kpi__sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; min-height: 15px; font-variant-numeric: tabular-nums; }
.dash-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.dash-main, .dash-side { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
/* 功能分区标题（待办/体重/资产/工具）：弱于卡片 h2 的小号灰字，贴近其下卡片成组 */
.dash-sec-h {
  font-size: 13px; font-weight: 600; color: var(--muted);
  letter-spacing: .01em; margin: 0 0 -6px;
}
.dash-sec-h:first-child { margin-top: 0; }
/* grid/flex 的 gap 统一接管纵向间距，清掉 .card 自带 margin-bottom 避免叠加 */
.dash-layout .card { margin-bottom: 0; }
.dash-more { float: right; font-size: 13px; font-weight: 500; }
.dash-card-hint { float: right; font-size: 12px; color: var(--muted); font-weight: 400; }
.dash-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 36px 12px; }
/* Chart.js responsive 画布：外层固定高度 + maintainAspectRatio:false */
.dash-chart { position: relative; height: 220px; margin-top: 10px; }
.dash-chart--sm { height: 180px; }
.dash-donut {
  position: relative; width: 100%; max-width: 200px; height: 200px; margin: 8px auto 4px;
  display: flex; align-items: center; justify-content: center;
}
.dash-donut .chart-fs-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.dash-donut canvas { display: block; margin: 0 auto; }
.dash-donut__center { position: absolute; inset: 36px; z-index: 1; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; box-shadow: 0 0 0 1px var(--th-border); pointer-events: none; }
.dash-donut__center strong { display: block; color: var(--text-strong); font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.dash-legend { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.dash-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--label); }
.dash-legend-row i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dash-legend-row b { margin-left: auto; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.dash-side-line {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--muted); margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--th-border);
}
.dash-side-line b { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700; }
/* 精简功能入口：2 列小卡，主模块不重复（侧栏/底栏已承载） */
.dash-entry { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-entry a {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-size: 13px; font-weight: 600;
}
.dash-entry a svg { width: 17px; height: 17px; color: var(--brand-text); flex: none; }
.dash-entry a:hover:not(:active) { border-color: var(--brand-border); background: var(--hover-brand); text-decoration: none; }
/* 中宽屏：右栏收窄 */
@media (max-width: 1099px) {
  .dash-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; }
  .dash-main, .dash-side { gap: 14px; }
}
/* 窄屏塌缩单列，顺序：待办 → 基金 → 资产 → 体重 → 入口 */
@media (max-width: 860px) {
  .dash-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-kpi { padding: 12px 13px; }
  .dash-kpi__num { font-size: 22px; }
  .dash-kpi__num--money { font-size: 18px; }
  /* 底栏 5 Tab + 「我的」已覆盖全部入口，手机端不展示入口卡 */
  .dash-entry-card { display: none; }
  .dash-chart { height: 200px; }
}

/* ============ 体重看板改版（2026-11）：Hero 大数字 + 紧凑录入 + 双栏布局 ============ */
.weight-container { max-width: 1200px; margin: 20px auto; }
.weight-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px;
}
.weight-topbar__members { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
/* 成员胶囊：彩底首字头像 + 名字，圆角 999 */
.weight-topbar__members .tag.user { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; }
.w-member-avatar {
  width: 26px; height: 26px; border-radius: 50%; color: #fff; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; line-height: 1;
}
.w-member-avatar.is-off { opacity: .55; }
.weight-topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; }
.weight-topbar__actions .btn {
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; flex-shrink: 0; height: 32px; padding: 0 12px; margin: 0;
  line-height: 1;
}

/* Hero 看板 */
.weight-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 22px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--brand-strong);
  border-radius: var(--r-lg);
}
.weight-hero__main { flex: 1; min-width: 0; }
.weight-hero__meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.weight-hero__val {
  font-size: 42px; font-weight: 850; letter-spacing: -.03em; color: var(--text-strong);
  line-height: 1.12; font-variant-numeric: tabular-nums; margin: 4px 0 8px;
}
.weight-hero__val small { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.weight-hero__deltas { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.weight-delta-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px;
  border-radius: 999px; background: var(--surface-2);
  font-size: 12px; font-weight: 600; color: var(--label);
}
.weight-delta-pill b { font-variant-numeric: tabular-nums; color: var(--text); }
.weight-delta-pill.down b { color: var(--ok-text); }
.weight-delta-pill.up b { color: var(--danger); }
.weight-hero__spark { flex: 0 0 260px; height: 76px; }
.weight-hero__spark svg { width: 100%; height: 100%; overflow: visible; }

/* 紧凑快速录入条：浅灰 inset 填充（无描边），与白卡形成明度分层 */
.weight-quick-bar { padding: 14px 18px; margin-bottom: 16px; background: var(--surface-2); }
.weight-quick-bar__form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.weight-qf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.weight-qf label { font-size: 12px; color: var(--muted); font-weight: 600; }
.weight-qf input, .weight-qf select {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 8px 10px; font-size: 13.5px; background: var(--surface); color: var(--text);
  font-family: inherit; margin: 0;
}
/* 成员/日期/体重三个输入项均等三等分，保存按钮自适应宽度 */
.weight-qf--member, .weight-qf--date, .weight-qf--val { flex: 1 1 0; }
.weight-qf--btn { flex: 0 0 auto; }
.weight-qf--btn .btn { height: 37px; padding: 0 20px; font-weight: 700; white-space: nowrap; }
.weight-quick-bar__tip { font-size: 11.5px; color: var(--faint); margin-top: 6px; }

/* 单位切换：分段控件（斤/公斤），select 视觉隐藏仅作值载体；挂在顶部成员条 actions 内 */
.weight-topbar__actions .w-unit-seg { margin-left: 4px; }
.w-unit-seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; }
.w-unit-seg button {
  border: none; background: none; cursor: pointer; font-family: inherit;
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; border-radius: 7px;
  color: var(--muted); line-height: 1; white-space: nowrap;
}
.w-unit-seg button.on { background: var(--surface); color: var(--brand-text); box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.w-unit-native {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
  border: 0; padding: 0; margin: 0;
}

/* 双栏布局 */
.weight-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.weight-main, .weight-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.weight-layout .card { margin-bottom: 0; }
.weight-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.weight-card-head h2 { font-size: 15px; font-weight: 800; color: var(--text-strong); margin: 0; }
.weight-card-head .btn { margin: 0; flex-shrink: 0; }
/* 筛选工具条：跟在标题行下方；PC 端下拉只占内容宽度不拉伸 */
.weight-chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; margin-bottom: 10px; }
.weight-chart-tools select, .weight-chart-tools input {
  padding: 5px 8px; font-size: 12.5px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-family: inherit; margin: 0; flex-shrink: 0;
  width: auto; min-width: 0;
}
.weight-date-input { width: 132px; }
.weight-chart-wrap { position: relative; min-height: 240px; }
.weight-scroll-box { max-height: 380px; }

/* 侧栏历史表紧凑化（仅桌面端）：自然列宽不截断、不定宽，长成员名自行换行；手机端走全站 table→卡片规则 */
@media (min-width: 641px) {
  .weight-table { font-size: 12.5px; }
  .weight-table th, .weight-table td { padding: 7px 6px; }
  .weight-table th:nth-child(3), .weight-table td:nth-child(3) { text-align: right; }
  .weight-table th:nth-child(4), .weight-table td:nth-child(4) { text-align: center; }
  .weight-table th:nth-child(5), .weight-table td:nth-child(5) { text-align: center; }
  .weight-table td:nth-child(5) .btn.sm { padding: 2px 7px; font-size: 11px; margin: 0 1px; }
}

/* 智能分析标题行内的排行榜入口：PC 用侧栏竞赛卡，此按钮仅手机显示 */
.jn-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jn-title-row h3 { margin: 0; }
.jn-race-btn {
  display: none; border: 1px solid var(--brand-border); background: var(--brand-tint);
  color: var(--brand-text); border-radius: 999px; padding: 4px 12px; font-size: 12px;
  font-weight: 700; font-family: inherit; cursor: pointer; white-space: nowrap; margin-left: auto;
}

/* 减肥竞赛小卡：暖色渐变 + 白色图标块（三主题均取语义变量） */
.weight-race-card { background: linear-gradient(135deg, var(--warn-bg), var(--surface-2)); }
.weight-race-content { display: flex; align-items: center; gap: 12px; }
.weight-race__ic {
  flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--surface);
  display: grid; place-items: center; color: var(--warn); box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.weight-race__ic svg { margin: 0 !important; width: 18px; height: 18px; }
.weight-race__txt { flex: 1; min-width: 0; }
.weight-race__txt h3 { font-size: 14px; font-weight: 700; margin: 0; }
.weight-race__txt p { font-size: 12px; color: var(--muted); margin: 1px 0 0; }

/* 中屏与窄屏响应式 */
@media (max-width: 1023px) {
  .weight-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .weight-container { margin: 14px auto; }
  .weight-topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .weight-topbar__members { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 2px; }
  .weight-topbar__members::-webkit-scrollbar { display: none; }
  .weight-topbar__members > * { flex-shrink: 0; }
  .weight-topbar__actions { justify-content: flex-end; flex-wrap: wrap; row-gap: 8px; }
  .weight-topbar__actions .w-unit-seg { margin-left: 0; }
  .weight-hero { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; margin-bottom: 10px; }
  .weight-hero__val { font-size: 34px; }
  .weight-hero__spark { flex: none; width: 100%; height: 60px; }
  .weight-quick-bar { padding: 12px; margin-bottom: 10px; }
  .weight-quick-bar__form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  /* 2×2：成员|日期 / 体重|保存——体重框与保存按钮同行，聚焦弹键盘时按钮不被遮挡 */
  .weight-qf--member, .weight-qf--date, .weight-qf--val, .weight-qf--btn { grid-column: span 1; width: 100%; }
  .weight-qf input, .weight-qf select, .weight-qf--btn .btn { height: 40px; border-radius: 10px; }
  .weight-qf--btn .btn { width: 100%; }
  .weight-qf__ghost-label { display: none; }
  /* 筛选条手机端：胶囊条占整行，开始/结束日期并排两列 */
  .weight-chart-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
  .weight-chart-tools .m-range-chips { grid-column: 1 / -1; }
  .weight-date-input { width: 100%; flex: none; }
  .weight-chart-wrap { min-height: 180px; }
  /* 收紧双栏间距与智能分析留白 */
  .weight-layout { gap: 10px; }
  .weight-main, .weight-side { gap: 10px; }
  .weight-container .jn { margin-top: 8px; padding-top: 8px; }
  .weight-container .jn-hero { margin: 6px 0 4px; }
  .weight-container .jn-deltas { margin-top: 8px; }
  .weight-container .jn-metrics { margin-top: 8px; }
  /* 侧栏竞赛卡手机隐藏，入口收进智能分析标题行 */
  #wRaceBox { display: none !important; }
  .jn-race-btn { display: inline-flex; align-items: center; }
}

/* ========== 基金资产看板（方案A：Hero 大数字 + 双栏，对齐体重看板设计语言）========== */
.fund-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px;
}
.fund-topbar__intro { flex: 1; min-width: 0; }
.fund-topbar__title { font-size: 16px; font-weight: 850; color: var(--text-strong); }
.fund-topbar__sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.fund-topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; }
.fund-topbar__actions .btn {
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; flex-shrink: 0; height: 32px; padding: 0 12px; margin: 0; line-height: 1;
}

/* Hero 资产看板 */
.fund-hero {
  display: flex; align-items: center; gap: 24px;
  padding: 18px 22px; margin-bottom: 14px;
  background: var(--surface); border: 0; border-radius: var(--r-lg);
}
.fund-hero__main { flex: 1; min-width: 0; }
.fund-hero__meta { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fund-hero__val { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.fund-hero__num { font-size: 42px; font-weight: 850; line-height: 1.15; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.fund-hero__rate {
  font-size: 14px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 0; font-variant-numeric: tabular-nums;
}
.fund-hero__pills { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.fund-pill { background: var(--surface-2); border: 0; border-radius: var(--r-md); padding: 8px 14px; min-width: 120px; }
.fund-pill__l { font-size: 11.5px; color: var(--muted); }
.fund-pill__v { font-size: 16px; font-weight: 800; color: var(--text-strong); margin-top: 1px; font-variant-numeric: tabular-nums; }
/* 环图左 + 自定义 legend 右（对齐 demo，避免 Chart bottom legend 在窄容器内竖排挤压、手机被裁）*/
.fund-hero__donut { flex: none; display: flex; align-items: center; gap: 14px; min-width: 0; }
.fund-donut-wrap { width: 128px; height: 128px; flex: none; position: relative; }
.fund-donut-side { min-width: 0; max-width: 190px; }
.fund-donut-cap { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.fund-donut-legend { display: flex; flex-direction: column; gap: 5px; font-size: 12px; max-height: 128px; overflow: auto; }
.fund-donut-legend .lg-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fund-donut-legend .lg-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.fund-donut-legend .lg-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fund-donut-legend .lg-pct { color: var(--muted); margin-left: auto; padding-left: 6px; flex: none; font-variant-numeric: tabular-nums; }
.fund-donut-wrap[data-empty="1"] { display: flex; align-items: center; justify-content: center; }
.fund-donut-wrap[data-empty="1"] canvas { display: none; }
.fund-donut-wrap[data-empty="1"]::after { content: '暂无持仓分布'; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* 双栏 */
.fund-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.fund-main, .fund-side { min-width: 0; display: flex; flex-direction: column; }
.fund-main .card, .fund-side .card { margin-bottom: 16px; }
.fund-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fund-card-head h2 { flex: 1; font-size: 15px; font-weight: 800; color: var(--text-strong); margin: 0; }
.fund-chart-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fund-chart-tools select {
  padding: 5px 8px; font-size: 12.5px; border: 0; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text); font-family: inherit; width: auto; flex-shrink: 0; margin: 0;
}
.fund-subhead { margin: 18px 0 8px; font-size: 14px; font-weight: 700; color: var(--text-strong); }

/* 持仓行式列表（替代旧 8 列宽表，信息零丢失：份额/成本/本金收进卡片第三行）；
   去描边小卡改同卡发丝线分隔（iOS 列表语言），封存弱化仍走 is-archived 文字色 */
.fund-hold-list { display: flex; flex-direction: column; }
.fund-hold { border: 0; border-radius: 0; padding: 14px 4px; background: transparent; }
.fund-hold + .fund-hold { border-top: 1px solid var(--th-border); }
/* 封存行弱化沿用旧 tr.row-archived 手法：只改文字色，不用 opacity（会创建堆叠上下文压住操作下拉）*/
.fund-hold.is-archived .fund-hold__name,
.fund-hold.is-archived .fund-hold__pv,
.fund-hold.is-archived .fund-hold__val { color: var(--muted); }
.fund-hold__row1 { display: flex; align-items: flex-start; gap: 8px; }
.fund-hold__name { font-weight: 750; color: var(--text-strong); font-size: 13.5px; flex: 1; min-width: 0; }
.fund-hold__code { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.fund-hold__more { padding: 2px 9px; }
.fund-hold__row2 { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 6px; }
.fund-hold__val { font-size: 17px; font-weight: 850; font-variant-numeric: tabular-nums; }
.fund-hold__sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.fund-hold__right { text-align: right; }
.fund-hold__pv { font-size: 15px; font-weight: 800; color: var(--text-strong); text-align: right; font-variant-numeric: tabular-nums; }
.fund-hold__row3 {
  font-size: 11.5px; color: var(--muted); margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.fund-hold-tip { font-size: 11.5px; margin: 8px 0 0; }

/* 工具 Tab（持仓分析 / 情景测算合并卡）*/
.fund-tool-tabs {
  display: inline-flex; background: var(--surface-2); border: 0;
  border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 12px;
}
.fund-tool-tabs button {
  border: none; background: none; cursor: pointer; font-family: inherit;
  padding: 6px 14px; font-size: 12.5px; font-weight: 700; border-radius: 7px;
  color: var(--muted); line-height: 1; white-space: nowrap;
}
.fund-tool-tabs button.is-on { background: var(--surface); color: var(--brand-text); box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.fund-tool-pane { display: none; }
.fund-tool-pane.is-on { display: block; }
/* 340px 窄侧栏内多列表单必然拥挤，工具卡内 .row 统一纵向：label 在上、输入框整宽，PC/手机同构 */
.fund-tool-pane .row { flex-direction: column; gap: 10px; }
.fund-tool-pane .row > * { min-width: 0; }

/* 投资策略入口统一顶栏：旧悬浮 FAB 与首次引导 CTA 隐藏（DOM 与拖拽逻辑保留，不报错）*/
#stratFab, #stratSetup { display: none !important; }

@media (max-width: 1023px) {
  .fund-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .fund-topbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; margin-bottom: 10px; }
  .fund-topbar__actions { justify-content: flex-end; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .fund-topbar__actions::-webkit-scrollbar { display: none; }
  .fund-hero { flex-direction: column; align-items: stretch; gap: 14px; padding: 14px; margin-bottom: 10px; }
  .fund-hero__num { font-size: 34px; }
  .fund-hero__donut { width: 100%; justify-content: center; }
  .fund-donut-side { max-width: 200px; }
  .fund-layout { gap: 10px; }
  /* 手机端顺序：持仓明细(1) → 每日总收益曲线(2) → 每日推送(3) → 分析测算(4) */
  .fund-main, .fund-side { display: contents; }
  .fund-side > .card:first-child { order: 1; }
  .fund-main > .card:first-child { order: 2; }
  .fund-side > .push-card { order: 3; }
  .fund-side > .card:last-child { order: 4; }
  .fund-layout > * > .card, .fund-layout > * > details { margin-bottom: 0; }
  /* 持仓 ⋯ 菜单保持右对齐：全局手机规则 .dropdown-menu{left:0} 会让右侧按钮的菜单向右冲出视口 */
  .fund-hold .dropdown-menu { left: auto; right: 0; }
}

/* ========== 资产报表看板（净资产 Hero 化 + 双栏，对齐基金/体重看板设计语言）========== */
/* 顶部标题条：手机也保持单行（仅标题信息，新建按钮在钱包卡标题处）*/
.as-topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; }
.as-topbar__intro { flex: 1; min-width: 0; }
.as-topbar__title { font-size: 16px; font-weight: 850; color: var(--text-strong); }
.as-topbar__sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* Hero 净资产看板：白卡无描边（背景随 .card），靠大数字紫色承担品牌感 */
.as-hero {
  display: flex; align-items: center; gap: 24px;
  padding: 18px 22px; margin-bottom: 14px;
  border-radius: var(--r-lg);
}
.as-hero__main { flex: 1; min-width: 0; }
.as-hero__meta { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.as-hero__val { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.as-hero__num { font-size: 42px; font-weight: 850; line-height: 1.15; letter-spacing: -.5px; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.as-hero__change { display: inline-flex; align-items: baseline; gap: 5px; background: var(--surface-2); border-radius: 999px; padding: 4px 11px; }
.as-hero__chg { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.as-hero__chg-label { font-size: 11.5px; color: var(--muted); }
.as-hero__chg.is-up { color: var(--ok-text); }
.as-hero__chg.is-down { color: var(--danger); }
.as-hero__chg.is-flat { color: var(--muted); }
.as-hero__pills { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.as-pill { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 14px; min-width: 120px; }
.as-pill__l { font-size: 11.5px; color: var(--muted); }
.as-pill__v { font-size: 16px; font-weight: 800; color: var(--text-strong); margin-top: 1px; font-variant-numeric: tabular-nums; }
.as-pill__v--assets { color: #f97316; }
.as-pill__v--debt { color: var(--danger); }

/* 年度目标：环形进度（环在上、标题居中、三格在下）；asset-metric--goal 保留供 JS closest 绑定点击 */
.as-goal { flex: none; width: 268px; border-left: 1px solid var(--th-border); padding-left: 24px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.as-goal__ring { position: relative; width: 108px; height: 108px; flex: none; }
.as-goal__svg { width: 108px; height: 108px; transform: rotate(-90deg); display: block; }
.as-goal__track { fill: none; stroke: var(--brand-border); stroke-width: 9; }
.as-goal__fill { fill: none; stroke: var(--brand-strong); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; transition: stroke-dashoffset .5s ease; }
.as-goal__ring.is-achieved .as-goal__fill { stroke: var(--ok); }
.as-goal__center { position: absolute; inset: 0; display: grid; place-items: center; }
.as-goal__center b { font-size: 20px; font-weight: 850; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.as-goal__edit { font-size: 12.5px; color: var(--muted); font-weight: 600; cursor: pointer; }
.as-goal__edit:hover:not(:active) { color: var(--brand-strong); }
.as-goal__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 6px; font-size: 11px; width: 100%; text-align: center; }
.as-goal__grid span { color: var(--muted); display: block; line-height: 1.3; }
.as-goal__grid b { display: block; color: var(--text-strong); font-size: 12.5px; margin-top: 2px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; word-break: break-word; }

/* 类型合计：桌面 3 列大格（demo 网格），手机 2 列（双 class 提特异性覆盖后段旧 .asset-type-pills，否则同特异性被反压）*/
.as-type-pills.asset-type-pills { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }

/* 双栏 */
.as-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; margin-bottom: 18px; }
.as-main, .as-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.as-layout .card, .as-layout section.card { margin-bottom: 0; }
.as-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.as-card-head h2 { flex: 1; font-size: 15px; font-weight: 800; color: var(--text-strong); margin: 0; }
.as-card-head .btn { flex-shrink: 0; }
.as-chart-tools { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.as-chart-tools > div { flex: 1; min-width: 120px; }
.as-chart-tools select, .as-chart-tools input { width: 100%; margin: 0; }

/* 窄侧栏内构成图纵堆（覆盖旧 220px+1fr 横排；双 class 提特异性，否则同特异性被后段 .asset-composition 反压）*/
.as-composition.asset-composition { grid-template-columns: 1fr; gap: 14px; justify-items: center; }
.as-composition .asset-donut { width: 160px; height: 160px; }
.as-composition .asset-legend-list { width: 100%; }

/* 低频表 Tab 合并卡 */
.as-tabs { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.as-tabs button { border: none; background: none; cursor: pointer; font-family: inherit; padding: 6px 14px; font-size: 12.5px; font-weight: 700; border-radius: 7px; color: var(--muted); line-height: 1; white-space: nowrap; }
.as-tabs button.is-on { background: var(--surface); color: var(--brand-text); box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.as-pane { display: none; }
.as-pane.is-on { display: block; }

@media (max-width: 1023px) {
  .as-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .as-topbar { padding: 10px 14px; margin-bottom: 10px; }
  .as-hero { flex-direction: column; align-items: stretch; gap: 14px; padding: 14px; margin-bottom: 10px; }
  .as-hero__num { font-size: 34px; }
  /* 手机端目标区：圆环在左，标题与「目标/还差/最新月份」三列在右（左对齐） */
  .as-goal {
    width: 100%; border-left: 0; border-top: 1px solid var(--th-border);
    padding-left: 0; padding-top: 12px;
    display: grid; grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: auto auto; column-gap: 14px; row-gap: 6px;
    align-items: center;
  }
  .as-goal__ring { grid-column: 1; grid-row: 1 / 3; justify-self: center; }
  .as-goal__ring, .as-goal__svg { width: 68px; height: 68px; }
  .as-goal__center b { font-size: 14px; }
  .as-goal__edit { grid-column: 2; grid-row: 1; justify-self: start; text-align: left; }
  .as-goal__grid {
    grid-column: 2; grid-row: 2; width: 100%; text-align: left;
    grid-template-columns: 1fr; gap: 4px;
  }
  .as-goal__grid > div {
    display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  }
  .as-goal__grid b { margin-top: 0; white-space: nowrap; }
  .as-type-pills.asset-type-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  /* 两列后卡宽足够金额完整展示：解除省略号裁剪，保留 nowrap 避免金额断行 */
  .as-type-pills .asset-type-pill__num { overflow: visible; text-overflow: clip; }
  /* 手机窄两列：类型 cell 图标与间距收窄，占比弱化防挤 */
  .as-type-pills .asset-type-cell { gap: 8px; padding: 10px; }
  .as-type-pills .asset-type-ic { width: 32px; height: 32px; border-radius: 9px; }
  .as-type-pills .asset-type-ic svg { width: 15px; height: 15px; }
  .as-type-pills .asset-type-cell__v { font-size: 15px; }
  .as-type-pills .asset-type-cell__p { display: none; }
  .as-layout { gap: 10px; margin-bottom: 10px; }
  .as-main, .as-side { gap: 10px; }
  .as-chart-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
  .as-chart-tools > div { width: 100%; min-width: 0; }
  .as-chart-tools > div:first-child { grid-column: 1 / -1; }
  .as-composition .asset-donut { width: 150px; height: 150px; }
  /* 钱包卡标题行手机保持一行，按钮不被挤下 */
  .as-card-head { flex-wrap: nowrap; }
  .as-card-head .btn { white-space: nowrap; }
}

/* ========== 待办看板外壳（2026-11）：topbar + Hero + 全宽清单。
   仅作用于登录态 /todo 普通页外层；任务行/全屏模式/免密页 class 不重叠，零竞争 ========== */
.todo-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px;
}
.todo-topbar__intro { flex: 1; min-width: 0; }
.todo-topbar__title { font-size: 16px; font-weight: 850; color: var(--text-strong); }
.todo-topbar__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.todo-topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.todo-topbar__actions .btn { margin-bottom: 0; white-space: nowrap; }

.todo-hero {
  display: flex; align-items: center; gap: 24px;
  padding: 18px 22px; margin-bottom: 14px;
  background: var(--surface); border: 0; border-radius: var(--r-lg);
}
.todo-hero__main { flex: 1; min-width: 0; }
.todo-hero__meta { font-size: 12.5px; color: var(--muted); font-weight: 600; }
/* PC：数字与副标纵向（num 在上、hint 在下）；手机媒体查询改同行底部对齐 */
.todo-hero__numline { display: flex; flex-direction: column; align-items: flex-start; }
.todo-hero__num {
  font-size: 42px; font-weight: 850; line-height: 1.15; letter-spacing: -.5px;
  color: var(--brand-strong); font-variant-numeric: tabular-nums;
}
.todo-hero__hint { font-size: 12.5px; color: var(--muted-2); font-weight: 600; margin-top: 6px; }
.todo-hero__hint em { font-style: normal; color: var(--danger); font-weight: 800; }
.todo-hero__dot { font-style: normal; color: var(--border-strong); margin: 0 6px; }
/* 副标三段：今天品牌紫、未来灰（回落基础色）、逾期红走 em */
.todo-hero__seg { color: var(--muted-2); font-weight: 600; }
.todo-hero__seg--today { color: var(--brand-text); font-weight: 800; }
.todo-hero__pills { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.todo-kpi {
  background: var(--surface-2); border: 0; border-radius: var(--r-md);
  padding: 8px 16px; min-width: 104px; text-align: center;
}
.todo-kpi__l { font-size: 11.5px; color: var(--muted); }
.todo-kpi__v { font-size: 20px; font-weight: 850; margin-top: 2px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.todo-kpi__v--danger { color: var(--danger); }
.todo-kpi__v--ok { color: var(--ok-text); }

/* 清单卡头：标题 + 筛选口径灰字（#statsHint 从旧概览卡迁入）*/
.todo-list-card__head { margin-bottom: 6px; }
.todo-list-card__head h2 { font-size: 15px; font-weight: 800; color: var(--text-strong); margin: 0 0 2px; }
.todo-list-card__hint { font-size: 12px; margin: 0; }

@media (max-width: 640px) {
  .todo-topbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 14px; margin-bottom: 10px; }
  /* 操作区手机横向滑动（沿用旧 todo-card-head__bar-scroll 成熟模式），滚动条透明 */
  .todo-topbar__actions {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 2px;
  }
  .todo-topbar__actions::-webkit-scrollbar { display: none; }
  .todo-topbar__actions > * { flex-shrink: 0; }
  .todo-hero { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; margin-bottom: 10px; }
  /* 手机：大数字与副标同一行、底部对齐（副标略抬升贴合数字视觉基线）*/
  .todo-hero__numline { flex-direction: row; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
  .todo-hero__num { font-size: 34px; }
  .todo-hero__hint { margin: 0 0 5px; font-size: 11.5px; line-height: 1.4; }
  .todo-hero__pills { margin-left: 0; justify-content: stretch; }
  .todo-kpi { flex: 1; min-width: 0; padding: 8px 6px; }
  .todo-kpi__v { font-size: 17px; }
}

/* ========== 定时任务（监控）轻量管理外壳（2026-11）：topbar + KPI 条 + 任务表。
   监控是低频配置页不套大 Hero；mon- 为独立前缀，与旧表格/tag/push-card 零重叠 ========== */
.mon-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px;
}
.mon-topbar__intro { flex: 1; min-width: 0; }
.mon-topbar__title { font-size: 16px; font-weight: 850; color: var(--text-strong); }
.mon-topbar__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mon-topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mon-topbar__actions .btn { margin-bottom: 0; white-space: nowrap; }

.mon-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.mon-kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.mon-kpi__l { font-size: 12.5px; color: var(--muted-2); font-weight: 600; display: inline-flex; align-items: center; }
.mon-kpi__v { font-size: 24px; font-weight: 850; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.mon-kpi__v--ok { color: var(--ok-text); }
.mon-kpi__v--muted { color: var(--muted); }
.mon-kpi__dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; display: inline-block; }
.mon-kpi__dot--ok { background: var(--ok-text); }
.mon-kpi__dot--off { background: var(--faint); }

.mon-table-card { padding: 16px 18px; }
.mon-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mon-card-head h2 { flex: 1; font-size: 15px; font-weight: 800; color: var(--text-strong); margin: 0; }

/* 执行日志分页条（logBox 内，前端切片最近 50 条）*/
.mon-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.mon-pager__info { font-size: 12.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.mon-pager .btn[disabled] { opacity: .5; cursor: not-allowed; }

@media (max-width: 640px) {
  .mon-topbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 14px; margin-bottom: 10px; }
  .mon-topbar__actions { flex-wrap: wrap; }
  .mon-topbar__actions .btn { flex: 1; justify-content: center; }
  .mon-kpis { gap: 8px; margin-bottom: 10px; }
  .mon-kpi { flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; }
  .mon-kpi__v { font-size: 19px; }
  .mon-table-card { padding: 13px 12px; }
  .mon-pager { gap: 8px; margin-top: 12px; }
  .mon-pager__info { width: 100%; text-align: center; order: 3; }
}

/* 手机视图：所有滚动条强制透明隐藏（触屏滑动不受影响）。
   !important 必须保留——自定义滚动条全局规则在本文件后段, 同特异性会反覆盖此规则 */
@media (max-width: 640px) {
  * { scrollbar-width: none !important; -ms-overflow-style: none !important; }
  *::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
}
/* 主按钮: 品牌实色, hover 加深底色, 无渐变/涟漪/彩色投影 */
.btn {
  display: inline-block; padding: 8px 16px; border: none; border-radius: var(--r-sm);
  background: var(--brand-strong);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: filter .15s ease;
}
.btn:hover:not(:active) { filter: brightness(1.08); }
.btn:active { filter: brightness(.95); }
/* 危险实心底走主题变量: 暗色/护眼下不再钉死浅色主题的红; hover 继承基类 brightness */
.btn.danger { background: var(--danger-strong); font-weight: 600; }
.btn.gray { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); font-weight: 600; }
/* hover 底色仅真实鼠标设备，避免触摸点击后灰背景粘住 */
@media (hover: hover) {
  .btn.gray:hover:not(:active) { background: var(--hover-bg); border-color: var(--border-strong); }
}
.btn.sm { padding: 4px 10px; font-size: 12px; }
/* select 复用 .btn 样式时(如 profitRange/unitSel), select 本身是灰底白字,
   但原生 <option> 展开层由浏览器接管、白底继承 color:#fff 会出现"白底白字看不清";
   显式给 option 打回深色文字 + 白底 */
select.btn option { color: var(--text-strong); background: var(--surface); }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border-input); border-radius: 8px; font-size: 14px; margin-bottom: 12px; font-family: inherit; background: var(--input-bg); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 3px rgba(168, 85, 247, .14); background: var(--surface); }
/* 键盘焦点环: 鼠标点击不出现, Tab/读屏导航时所有可交互元素可见 */
:where(a, button, select, input, textarea, [tabindex]):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
label { display: block; font-size: 13px; color: var(--label); margin-bottom: 5px; }
.todo-priority {
  display: flex; gap: 4px; padding: 3px; margin: 0 0 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.todo-priority label {
  flex: 1; min-width: 0; min-height: 34px; margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.todo-priority label:hover:not(:active) { color: var(--text); background: var(--hover-bg); }
.todo-priority input {
  position: absolute; width: 1px; height: 1px; margin: 0;
  opacity: 0; pointer-events: none;
}
.todo-priority-dot { width: 8px; height: 8px; border-radius: 50%; background: #b4bccb; }
.todo-priority-dot.pri-2 { background: #e5484d; }
.todo-priority-dot.pri-1 { background: #e8a317; }
.todo-priority-dot.pri-0 { background: #b4bccb; }
/* 「无优先级」图标：空心圆环，跟随 chip 文字色（未选中中性、选中品牌紫），不固定染色 */
.todo-pri-none-ic {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  border: 1.8px solid currentColor; background: transparent;
  margin-right: 6px; flex: none; box-sizing: border-box;
}
.todo-priority label.is-checked,
.todo-priority label:has(input:checked) {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 1px 3px rgba(15, 23, 42, .08);
}
.todo-priority label.is-checked[data-priority="2"],
.todo-priority label:has(input[value="2"]:checked) { color: #e5484d; }
.todo-priority label.is-checked[data-priority="1"],
.todo-priority label:has(input[value="1"]:checked) { color: #d97706; }
.todo-priority label.is-checked[data-priority="0"],
.todo-priority label:has(input[value="0"]:checked) { color: #6b7280; }
.todo-priority label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--th-border); }
th { color: var(--label); font-weight: 600; background: var(--th-bg); }
/* tag: 语义底色全部走主题 token, 亮/暗/护眼自动适配, 不再硬编码浅色系 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; border: 1px solid transparent; font-weight: 500; }
.tag.admin, .tag.fail { background: var(--danger-bg); color: var(--danger); }
.tag.user { background: var(--hover-brand); color: var(--brand-text); }
.tag.active, .tag.ok { background: var(--ok-bg); color: var(--ok-text); }
.tag.disabled { background: var(--surface-2); color: var(--muted); }
/* debt: 负债/欠款专用, 与 fail 同红系但加描边+粗体如账单, 与 disabled(停用灰) 语义拉开 */
.tag.debt { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); font-weight: 700; letter-spacing: .3px; }
/* scroll-box: 历史/记录表格外壳, 固定高度, 表头 sticky, 避免记录多了撑爆页面 */
.scroll-box { max-height: 360px; overflow-y: auto; border: 1px solid var(--th-border); border-radius: 10px; }
.scroll-box > table { border-collapse: separate; border-spacing: 0; }
.scroll-box > table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--sticky-th);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
/* 移动端表格转卡片模式下, sticky thead 已被 display:none, 高度也放宽避免拥挤 */
@media (max-width: 640px) { .scroll-box { max-height: 60vh; } }
.login-wrap { max-width: 360px; margin: 80px auto; }
.login-wrap .card { padding: 30px; }
.login-wrap h1 { text-align: center; margin-bottom: 20px; font-size: 22px; color: var(--brand-text); }
/* ===== 登录页：斜对角全屏流动 ===== */
.lg-fs { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 120% at 25% 15%, #1a1f4a 0%, #0d1130 45%, #070a1f 100%); display: flex; align-items: center; justify-content: space-between; gap: clamp(24px, 4vw, 64px); padding: 0 clamp(20px, 7vw, 120px); }
/* 左侧文案区暗化层：压暗穿过文字的词墙 chips，保证 slogan 可读性 */
.lg-fs::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(56% 70% at 20% 50%, rgba(7,10,31,.62), transparent 68%); }
.lg-field { position: absolute; top: 50%; left: 50%; width: 170vw; height: 190vh; transform: translate(-50%, -50%) rotate(-18deg); display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 2.4vh, 26px); pointer-events: none; opacity: .55; }
.lg-row { display: flex; gap: 16px; white-space: nowrap; will-change: transform; }
.lg-row.a { animation: lgDriftL 42s linear infinite; }
.lg-row.b { animation: lgDriftR 52s linear infinite; }
.lg-row.c { animation: lgDriftL 62s linear infinite; }
.lg-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: 999px; font-size: clamp(15px, 1.7vw, 22px); font-weight: 600; letter-spacing: .2px; color: rgba(226, 231, 255, .5); border: 1px solid rgba(146, 160, 255, .18); background: rgba(120, 130, 220, .05); }
.lg-chip.hot { color: #0a0e27; border-color: transparent; background: linear-gradient(120deg, #a5b4fc, #7dd3fc); }
.lg-chip.glow { color: #38f0d4; border-color: rgba(56, 240, 212, .35); }
@keyframes lgDriftL { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes lgDriftR { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.lg-brand { position: relative; z-index: 2; flex: 1 1 0; min-width: 0; max-width: 560px; }
.lg-logo { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: .5px; color: #c7d0ff; background: rgba(146, 160, 255, .12); border: 1px solid rgba(146, 160, 255, .22); margin-bottom: 22px; }
.lg-title { font-size: clamp(28px, 4vw, 54px); font-weight: 800; line-height: 1.1; letter-spacing: -1.5px; text-shadow: 0 4px 26px rgba(7,10,31,.45); background: linear-gradient(118deg, #a5b4fc 0%, #e0aaff 48%, #7dd3fc 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-title em { font-style: normal; background: linear-gradient(120deg, #38f0d4, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* 两句主 slogan 之间留出明显段距，避免多行大标题粘连 */
.lg-title + .lg-title { margin-top: clamp(14px, 2.4vh, 26px); }
.lg-sub { margin-top: 20px; font-size: clamp(14px, 1.4vw, 17px); line-height: 1.65; color: rgba(214, 220, 255, .72); text-shadow: 0 2px 16px rgba(7,10,31,.85); }
.lg-panel { position: relative; z-index: 3; width: 384px; max-width: 92vw; background: rgba(255, 255, 255, .94); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid rgba(255, 255, 255, .55); border-radius: 20px; padding: 32px 30px; box-shadow: 0 30px 90px rgba(4, 7, 30, .55); }
.lg-panel h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.lg-panel .lg-hint { font-size: 13px; color: var(--muted-2); margin-bottom: 18px; }
.lg-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.lg-tabs .btn { flex: 1; }
/* 登录/注册切换标签：分段控制器样式（激活=白底主色字，非激活=浅灰底灰字），
   与表单底部紫色实心提交按钮区分，避免两个"登录"按钮撞样式导致误点 */
.lg-panel .lg-tabs .btn,
.lg-panel .lg-tabs .btn.gray,
.lg-panel .lg-tabs .btn:not(.gray):not(.danger) {
  background: rgba(136,144,184,.14);
  color: #8a90a6;
  border: 1px solid transparent;
  box-shadow: none;
}
.lg-panel .lg-tabs .btn:not(.gray) {
  background: #ffffff;
  color: #4F63E8;
  border-color: rgba(79,99,232,.45);
  box-shadow: 0 2px 10px rgba(79,99,232,.20);
  font-weight: 700;
}
.lg-panel .lg-tabs .btn:hover:not(:active),
.lg-panel .lg-tabs .btn.gray:hover:not(:active) {
  background-position: 0% 50%;
  background-color: rgba(136,144,184,.24);
  box-shadow: none;
}
.lg-panel .lg-tabs .btn:not(.gray):hover:not(:active) {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(79,99,232,.20);
}
@media (max-width: 860px) { .lg-fs { justify-content: center; padding: 0 16px; } .lg-brand { display: none; } .lg-fs::before { display: none; } .lg-field { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .lg-row { animation: none; } }
.msg { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; display: none; }
.msg.err { background: var(--danger-bg); color: var(--danger); display: block; }
.msg.ok { background: var(--ok-bg); color: var(--ok-text); display: block; }
/* 顶部 Toast（showToast 动态挂载）: 布局样式常驻, 语义底色按 is-ok/is-err 走主题变量 */
#appToast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 10002; max-width: 92vw;
  padding: 10px 20px; border-radius: 10px; color: #fff; font-size: 14px; line-height: 1.5; text-align: center;
  word-break: break-all; box-shadow: 0 6px 20px rgba(0,0,0,.2); opacity: 0; transition: opacity .25s; pointer-events: none;
}
#appToast.is-ok { background: var(--ok-strong); }
#appToast.is-err { background: var(--danger-strong); }
/* WebDAV 启用开关（switch）：原生 checkbox 隐藏，轨道+圆点纯 CSS 控制 */
.wb-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.wb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.wb-switch .wb-switch-track {
  position: relative; width: 42px; height: 24px; flex: 0 0 auto;
  border-radius: 999px; background: var(--check-ring);
  transition: background .18s ease;
}
.wb-switch .wb-switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.wb-switch input:checked + .wb-switch-track { background: var(--brand); }
.wb-switch input:checked + .wb-switch-track::after { transform: translateX(18px); }
.wb-switch input:focus-visible + .wb-switch-track { box-shadow: 0 0 0 3px var(--brand-tint); }
/* 登录面板底部 APP 下载入口：品牌浅紫描边卡，与主按钮区分 */
.lg-dl-link { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 4px; padding: 9px 0; font-size: 13px; font-weight: 600; color: var(--brand-strong); border: 1.5px solid var(--brand-border); border-radius: 8px; background: var(--brand-tint); }
.lg-dl-link:hover:not(:active) { text-decoration: none; filter: brightness(.97); }
.md-body { font-size: 14px; line-height: 1.6; word-break: break-word; }
/* 两张图片左右并排（旧格式，保留兼容已插入内容）：<div class="img-row"> 包两个 <img> */
.img-row { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.img-row img { flex: 1 1 0; min-width: 0; max-width: 100%; height: auto; border-radius: 8px; }
/* 分栏选择小气泡：工具栏图标下方出现，不走弹窗系统 */
.mde-pop { position: fixed; z-index: 10003; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(20,20,40,.16); padding: 8px; }
.mde-pop__grp { display: flex; align-items: center; gap: 4px; padding: 3px; }
.mde-pop__grp + .mde-pop__grp { border-top: 1px solid var(--border); margin-top: 2px; padding-top: 5px; }
.mde-pop__lb { font-size: 12px; color: var(--muted); width: 56px; flex: none; }
.mde-pop__grp button { border: 1px solid var(--border); background: var(--surface); color: var(--label); font-size: 12px; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-family: inherit; }
.mde-pop__grp button:hover:not(:active) { background: var(--brand-tint); border-color: var(--brand-border); color: var(--brand-strong); }
/* 通用分栏布局：格子内图片/文字/链接任意，格子超出列数自动换到下一排 */
.ly-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 10px 0; }
.ly-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ly-grid--4 { grid-template-columns: repeat(4, 1fr); }
.ly-cell { min-width: 0; }
.ly-cell img { max-width: 100%; height: auto; border-radius: 8px; display: block; }
/* 窄屏：3/4 列先降为 2 列（默认 2 列保持，手机也要能并排看图）；
   含文字格子（任一格内无 img）的分栏进一步变单列，纯图片分栏保持并排 */
@media (max-width: 699px) {
  .ly-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .ly-grid--4:has(.ly-cell:not(:has(img))) { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .ly-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .ly-grid:has(.ly-cell:not(:has(img))) { grid-template-columns: 1fr; }
}
.md-body > p { margin: 8px 0; }
.md-body > h3 { margin: 12px 0 6px; font-size: 16px; }
.md-body > h4 { margin: 10px 0 4px; font-size: 14px; }
.md-body > ul, .md-body > ol { margin: 6px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.md-body a { color: var(--brand-text); text-decoration: underline; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.muted { color: var(--muted); font-size: 13px; }
/* APP 下载页：标题与编辑钮两端对齐；空状态虚线卡 */
.dl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dl-head h2 { margin-bottom: 0; }
.dl-meta { margin-top: 6px; }
.dl-empty { margin-top: 14px; padding: 34px 16px; border: 1.5px dashed var(--border-strong); border-radius: 12px; text-align: center; color: var(--muted); }
.dl-empty .btn { margin-top: 14px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
/* stat: 实色面 + hairline, 数字深墨黑 + tabular-nums; 不可点卡不浮起 */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; text-align: center;
}
/* 数字统一: 深墨黑, tabular-nums 让千分位数字等宽对齐 */
.stat .num {
  font-size: 28px; font-weight: 700; color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
/* 图标态: SVG 图标居中在浅面圆角方块里, 尺寸/颜色由 accent 规则控制 */
.stat .num.num--icon {
  color: var(--label); font-size: 32px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 16px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  font-variant-numeric: normal;
  transition: background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.stat .num.num--icon svg { width: 28px; height: 28px; display: block; }
/* 功能入口各自 accent 色: hover 只染图标底/卡片边, 不位移(Operate 型工具克制) */
.stat-nav .stat { transition: box-shadow .2s ease, border-color .2s ease; }
.stat-nav .stat[data-nav="monitor"] .num--icon { color: #3b82f6; }
.stat-nav .stat[data-nav="monitor"]:hover:not(:active) { box-shadow: 0 6px 18px rgba(59,130,246,.14); border-color: rgba(59,130,246,.35); }
.stat-nav .stat[data-nav="monitor"]:hover:not(:active) .num--icon { background-color: rgba(59,130,246,.12); color: #3b82f6; }
.stat-nav .stat[data-nav="fund"] .num--icon { color: var(--brand-text); }
.stat-nav .stat[data-nav="fund"]:hover:not(:active) { box-shadow: 0 6px 18px rgba(168,85,247,.14); border-color: var(--brand-border); }
.stat-nav .stat[data-nav="fund"]:hover:not(:active) .num--icon { background-color: var(--hover-brand); color: var(--brand-text); }
.stat-nav .stat[data-nav="asset"] .num--icon { color: #f97316; }
.stat-nav .stat[data-nav="asset"]:hover:not(:active) { box-shadow: 0 6px 18px rgba(249,115,22,.15); border-color: rgba(249,115,22,.35); }
.stat-nav .stat[data-nav="asset"]:hover:not(:active) .num--icon { background-color: rgba(249,115,22,.12); color: #f97316; }
.stat-nav .stat[data-nav="weight"] .num--icon { color: #10b981; }
.stat-nav .stat[data-nav="weight"]:hover:not(:active) { box-shadow: 0 6px 18px rgba(16,185,129,.14); border-color: rgba(16,185,129,.35); }
.stat-nav .stat[data-nav="weight"]:hover:not(:active) .num--icon { background-color: rgba(16,185,129,.12); color: #10b981; }
.stat-nav .stat[data-nav="todo"] .num--icon { color: #f59e0b; }
.stat-nav .stat[data-nav="todo"]:hover:not(:active) { box-shadow: 0 6px 18px rgba(245,158,11,.15); border-color: rgba(245,158,11,.35); }
.stat-nav .stat[data-nav="todo"]:hover:not(:active) .num--icon { background-color: rgba(245,158,11,.12); color: #d97706; }
.stat-nav .stat[data-nav="admin"] .num--icon { color: #ec4899; }
.stat-nav .stat[data-nav="admin"]:hover:not(:active) { box-shadow: 0 6px 18px rgba(236,72,153,.14); border-color: rgba(236,72,153,.35); }
.stat-nav .stat[data-nav="admin"]:hover:not(:active) .num--icon { background-color: rgba(236,72,153,.12); color: #ec4899; }
.stat-nav .stat[data-nav="download"] .num--icon { color: var(--brand-text); }
.stat-nav .stat[data-nav="download"]:hover:not(:active) { box-shadow: 0 6px 18px rgba(124,58,237,.14); border-color: var(--brand-border); }
.stat-nav .stat[data-nav="download"]:hover:not(:active) .num--icon { background-color: var(--hover-brand); color: var(--brand-text); }
.stat .lbl { font-size: 13px; color: var(--label); margin-top: 4px; }
.asset-title { font-size: 19px; margin-bottom: 6px; }
.asset-small { font-size: 12px; color: var(--muted); font-weight: 400; }
/* 标题年份补充：跟在标题后的淡灰小字「· 2026」，纯文字最轻量、不抢月份主体；空内容不占位 */
.asset-title-year {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--faint);
  white-space: nowrap;
}
.asset-title-year::before { content: '·'; margin-right: 5px; }
.asset-title-year:empty { display: none; }
.asset-title__btn { float: right; margin-top: 2px; }
.asset-desc { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.asset-summary-stats { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.asset-summary-stats .stat { padding: 13px; border-radius: 14px; background: var(--surface-3); min-width: 0; }
.asset-summary-stats .num { font-size: clamp(20px, 2.6vw, 27px); font-weight: 800; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-summary-stats .lbl { color: var(--muted); font-size: 12px; margin-top: 3px; }
.asset-stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.asset-summary-stats #sAssets { color: #f97316; }
.asset-summary-stats #sDebt { color: var(--danger); }
.asset-summary-stats #sNet { color: var(--brand-strong); }
.asset-summary-stats .num.is-up, .asset-status-number.is-up, .asset-metric__value.is-up, .asset-delta.is-up { color: var(--ok-text); }
.asset-summary-stats .num.is-down, .asset-status-number.is-down, .asset-metric__value.is-down, .asset-delta.is-down, .asset-money.is-down, .asset-type-pill__num.is-down { color: var(--danger); }
.asset-summary-stats .num.is-flat, .asset-status-number.is-flat, .asset-metric__value.is-flat, .asset-delta.is-flat { color: var(--muted); }
/* 封存行弱化：只改文字色，不用 opacity（opacity<1 会创建堆叠上下文压住行内下拉菜单，且子菜单被迫半透明）；
   单元格内联颜色（涨跌红绿）与 .btn 自身配色不受影响 */
tr.row-archived td { color: var(--muted); }
/* 表格行内下拉打开时提升整行（同 .card:has(.dropdown-menu.show) 先例） */
tr:has(.dropdown-menu.show) { position: relative; z-index: 60; }
.asset-progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 10px 0 8px; }
.asset-progress.is-achieved { background: var(--ok-bg); }
.asset-progress__fill { width: 0; height: 100%; border-radius: 999px; background: var(--brand-strong); }
.asset-progress.is-achieved .asset-progress__fill { background: var(--ok); box-shadow: 0 0 16px rgba(52,179,74,.28); }
.asset-goal-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.asset-metric { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--th-border); font-size: 14px; }
.asset-metric:last-child { padding-bottom: 0; border-bottom: 0; }
.asset-metric span { color: var(--muted); min-width: 0; }
.asset-metric b { text-align: right; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.asset-metric--goal { cursor: pointer; }
.asset-goal-edit { cursor: pointer; }
.asset-metric--goal:hover:not(:active) .asset-goal-edit, .asset-goal-edit:hover:not(:active) { color: var(--brand-strong); }
.asset-type-pills { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.asset-type-pill { border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; padding: 11px; min-width: 0; }
.asset-type-pill__num { display: block; color: var(--text-strong); font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-type-pill span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
/* 类型合计新版：彩底图标 + 名称/数值 + 右侧占比（demo type-cell） */
.asset-type-cell { display: flex; align-items: center; gap: 11px; background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; min-width: 0; }
.asset-type-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.asset-type-ic svg { display: block; }
.asset-type-ic--sm { display: inline-grid; width: 30px; height: 30px; border-radius: 9px; vertical-align: middle; }
.asset-type-ic--sm svg { width: 14px; height: 14px; }
/* 类型名作为整体容器包住图标+文字：手机 table→flex 卡片时二者不会被 space-between 拆开 */
.asset-w-type__label { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; }
.asset-type-cell__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.asset-type-cell__n { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-type-cell__v { font-size: 17px; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-type-cell__v.is-down { color: var(--danger); }
.asset-type-cell__p { flex: none; font-size: 11.5px; color: var(--faint); font-weight: 700; font-variant-numeric: tabular-nums; }
.asset-grid { display: grid; gap: 14px; margin-bottom: 18px; }
.asset-grid--84 { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.asset-grid--75 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.asset-grid > .card { margin-bottom: 0; min-width: 0; }
.asset-notice { border-radius: var(--r-md); padding: 11px 13px; font-size: 13px; color: var(--brand-strong); background: var(--brand-tint); }
.asset-notice.warn { color: var(--warn); background: var(--warn-bg); }
.asset-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.asset-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.asset-chart { display: block; width: 100%; height: 270px; max-height: 270px; }
.asset-status-number { font-size: 32px; font-weight: 850; line-height: 1.2; margin: 10px 0 4px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.asset-status-text { color: var(--muted); font-size: 13px; }
.asset-metric-list { display: grid; gap: 10px; margin-top: 12px; }
.asset-metric-list .asset-metric:last-child { border-bottom: 0; padding-bottom: 0; }
.asset-composition { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 20px; align-items: center; }
.asset-donut { width: 210px; height: 210px; border-radius: 50%; margin: auto; position: relative; background: var(--surface-2); }
.asset-donut canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.asset-donut__center { position: absolute; inset: 38px; z-index: 1; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; box-shadow: 0 0 0 1px var(--th-border); pointer-events: none; }
.asset-donut__center strong { display: block; color: var(--text-strong); font-size: 15px; margin-top: 2px; }
.asset-legend-list { display: grid; gap: 9px; }
.asset-legend-row { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; gap: 9px; align-items: center; font-size: 13px; }
.asset-legend-row i { width: 10px; height: 10px; border-radius: 50%; }
.asset-legend-row span { min-width: 0; }
.asset-legend-row b { text-align: right; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.asset-table-wrap { overflow-x: auto; border: 1px solid var(--th-border); border-radius: 14px; }
.asset-table { font-size: 13px; }
.asset-table th, .asset-table td { padding: 10px 9px; text-align: right; white-space: nowrap; }
.asset-table th:first-child, .asset-table td:first-child { text-align: left; }
.asset-table th { color: var(--muted); background: var(--th-bg); font-weight: 600; }
.asset-table tr:last-child td { border-bottom: 0; }
.asset-table .asset-table__total td { background: var(--brand-tint); font-weight: 700; color: var(--text-strong); }
.asset-table .btn.sm { margin-right: 4px; }
.asset-table .btn.sm:last-child { margin-right: 0; }
.btn.asset-btn--secondary { background: var(--brand-tint); color: var(--brand-strong); box-shadow: none; }
.btn.asset-btn--secondary:hover:not(:active) { filter: none; box-shadow: 0 4px 12px rgba(124,58,237,.16); }

/* 钱包表保持标准表格列布局：桌面端各列独立、整列居中，类型列（首列）左对齐（手机端 ≤640 走全站 table→data-label 卡片，本块不生效）*/
@media (min-width: 641px) {
  .asset-table-wrap .asset-table th,
  .asset-table-wrap .asset-table td { text-align: center; }
  .asset-table-wrap .asset-table th:first-child,
  .asset-table-wrap .asset-table td:first-child { text-align: left; }
}
.asset-record-admin { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 900px) {
  .asset-grid--84, .asset-grid--75 { grid-template-columns: 1fr; }
}

/* 全局 loading: 双环反向旋转 (珊瑚 + 蓝) + 玻璃遮罩; z-index 高于 modal, 保证 modal 内提交时用户能看到进度 */
#globalLoading { display: none; position: fixed; inset: 0; background: var(--loading-mask); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 10500; align-items: center; justify-content: center; }
/* 启动阶段: display:flex 但 opacity:0, 300ms 后 fade in. 快请求 (JS 就绪 + 首屏 api <300ms 完成) 全程 opacity=0 → 无感 */
#globalLoading.boot-visible { opacity: 0; animation: bootLoadingFadeIn .2s ease-out 300ms forwards; }
@keyframes bootLoadingFadeIn { to { opacity: 1; } }
#globalLoading .spinner {
  position: relative; width: 52px; height: 52px; margin: 0 auto;
}
#globalLoading .spinner::before,
#globalLoading .spinner::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent;
}
#globalLoading .spinner::before {
  border-top-color: #FF7A59; border-right-color: #FF7A59;
  animation: spin 1.1s cubic-bezier(.5,.1,.5,.9) infinite;
}
#globalLoading .spinner::after {
  inset: 8px;
  border-bottom-color: #3B82F6; border-left-color: #3B82F6;
  animation: spinRev .9s cubic-bezier(.5,.1,.5,.9) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* loading 慢请求兜底进度条 (仅 ≥3s 请求显示): 3px 品牌渐变, 从 0% 匀速爬到 90%, 完成时同步消失.
   出现方式: opacity 0→1 fade-in 150ms, 避免"突兀弹出" */
#globalLoading .loading-bar { width: 200px; height: 3px; margin: 14px auto 0; background: rgba(168, 85, 247, .15); border-radius: 2px; overflow: hidden; opacity: 0; transition: opacity .15s ease; }
#globalLoading .loading-bar.show { opacity: 1; }
#globalLoading .loading-bar .lb-fill { width: 0; height: 100%; background: linear-gradient(90deg, #FF7A59, #A855F7, #3B82F6); border-radius: 2px; transition: width .12s linear; }
@keyframes spinRev { to { transform: rotate(-360deg); } }

/* 弹窗 modal */
/* 短内容居中、长内容顶部对齐可滚：靠 .modal-box 的 margin:auto 自适应 */
/* touch-action: pan-y —— body.no-scroll 锁背景滚动时祖先 touch-action:none 会连带禁掉后代滚动容器
   的触摸平移(手机上长弹窗表单会卡死), 在遮罩自身显式放行纵向手势; overscroll-behavior:contain 防止滚到边连锁背景 */
/* 键盘避让: 短弹窗保持垂直居中不动布局, JS(assets.js liftFocused)按当前聚焦框算最小位移
   translateY 上移(带过渡), 键盘贴在当前输入框下面; 弹窗放不进键盘上方可视区时 JS 加 .kb-tall
   切"靠顶+遮罩整体滚动", 卡片保持【自然完整高度不裁切】(不设 max-height), 键盘下方字段滚动可达。 */
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10000; padding: 40px 16px; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.modal-mask.show { display: flex; }
/* 键盘弹出·短弹窗(.kb-on 非 .kb-tall): 布局仍居中, 弹窗整体 translateY 最小位移
   (JS 写 transform: 聚焦框底边送到键盘上沿-GAP, 顶边不低于 40px), 这里只负责平滑过渡 */
.modal-mask.kb-on .modal-box { transition: transform .18s ease; }
/* 键盘弹出·长弹窗(JS 加 .kb-tall): 弹窗【靠顶部】排列(不是居中、不缩放位移); 卡片不设限高、
   保持自然完整高度, 内容超出键盘上方区域时由遮罩(.modal-mask 自身 overflow-y:auto)整体滚动——不裁切字段。
   padding-bottom=键盘高让滚到底时最后一个字段也能停在键盘上沿。
   resize 模式(手机浏览器) inset=0, 100vh 已被系统压缩, 形态两端一致 */
.modal-mask.kb-tall { padding: 0 16px var(--kb-inset, 0px); align-items: flex-start; }
.modal-mask.kb-tall .modal-box { margin: 40px auto 0; }
/* 全局滚动锁: body.no-scroll 由 JS 在打开弹窗(modal / mp-menu)时加, 关闭时移除.
   position:fixed + width:100% 兼容 iOS Safari, 单纯 overflow:hidden 在 iOS 上仍能滑动.
   同时锁 <html> 的 overflow, 阻止 Android Chrome / 微信 X5 在 body:fixed 时仍能滚动根滚动容器的行为.
   :has() + JS 加 .no-scroll 双重覆盖, 兼容不支持 :has() 的老内核 (如部分微信 X5).
   注意: 此处【不能】加 touch-action:none —— 祖先的 touch-action 会连带禁掉后代滚动容器(弹窗/全屏区)
   的触摸平移, 手机上长表单弹窗反而卡死无法滚动; 需要放行的滚动容器自行声明 pan-y(.modal-mask/.todo-fs-main) */
html:has(body.no-scroll), html.no-scroll { overflow: hidden; height: 100%; }
body.no-scroll { overflow: hidden; position: fixed; width: 100%; overscroll-behavior: none; }
/* 启动阶段: body.booting 提供纯 CSS 滚动锁, 早于任何 JS. JS 就绪后由 lockBodyScroll 接管, 会移除此类 */
html:has(body.booting) { overflow: hidden; height: 100%; }
body.booting { overflow: hidden; position: fixed; width: 100%; touch-action: none; overscroll-behavior: none; }
/* 遮罩自身也要阻止触摸手势: 兜底覆盖 body.no-scroll 未生效的手机浏览器 (如某些微信内核) */
#globalLoading { touch-action: none; overscroll-behavior: contain; }
.modal-box { background: var(--surface); border-radius: 10px; width: 100%; max-width: 440px; margin: auto; box-shadow: 0 10px 40px rgba(0,0,0,.2); animation: modalIn .2s ease; }
/* 大弹窗：分析面板（热力图 + 曲线） */
.modal-mask--lg .modal-box { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 600; }
#modalClose { cursor: pointer; font-size: 24px; line-height: 1; color: var(--muted); }
#modalClose:hover:not(:active) { color: var(--text); }
.modal-body { padding: 20px; }
@keyframes modalIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============ 现代化日期选择器(自动接管 input[type=date]) ============ */
.dp-pop {
  display: none; position: fixed; z-index: 10002; width: 296px; max-width: calc(100vw - 16px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 44px rgba(20,20,40,.22); padding: 12px;
  animation: modalIn .16s ease;
}
.dp-quick { display: flex; gap: 8px; margin-bottom: 10px; }
.dp-chip {
  flex: 1; border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 10px;
  padding: 7px 2px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  gap: 2px; line-height: 1.25; transition: background .12s, border-color .12s;
}
.dp-chip span { font-size: 13px; font-weight: 600; color: var(--text); }
.dp-chip small { font-size: 11px; color: var(--muted-2); }
.dp-chip:hover:not(:active) { border-color: var(--brand-border); background: var(--hover-brand); }
.dp-chip.active { background: var(--brand-strong); border-color: var(--brand-strong); }
.dp-chip.active span, .dp-chip.active small { color: #fff; }
.dp-chip.active:hover:not(:active) { background: var(--brand-strong); border-color: var(--brand-strong); filter: brightness(1.08); }
.dp-chip.dis, .dp-cell.dis { opacity: .35; cursor: default; }
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 6px; }
.dp-ym { font-size: 14px; font-weight: 700; color: var(--text); }
.dp-navb { border: none; background: var(--surface-2); border-radius: 8px; width: 30px; height: 28px; font-size: 17px; line-height: 1; cursor: pointer; color: var(--link-dim); }
.dp-navb:hover:not(:active) { background: var(--hover-bg); }
.dp-wd, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd span { text-align: center; font-size: 11px; color: var(--muted-2); padding: 3px 0; }
.dp-cell {
  border: none; background: none; border-radius: 8px; height: 34px; font-size: 13px;
  cursor: pointer; color: var(--text); display: flex; align-items: center; justify-content: center;
}
.dp-cell:hover:not(:active):not(.mute):not(.dis) { background: var(--hover-brand); }
.dp-cell.mute { color: var(--faint); cursor: default; }
.dp-cell.today { box-shadow: inset 0 0 0 1.5px var(--brand); color: var(--brand-text); font-weight: 700; }
.dp-cell.sel { background: var(--brand-strong); color: #fff; font-weight: 700; }
.dp-cell.sel.today { box-shadow: none; }
.dp-cell.sel:hover:not(:active) { background: var(--brand-strong); filter: brightness(1.08); }
/* 月/年快选视图: 4 列网格; 标题可点(进下一级) */
.dp-grid--mon { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.dp-cell--mon { height: 40px; font-weight: 600; }
.dp-ym { cursor: pointer; padding: 2px 10px; border-radius: 6px; }
.dp-ym[data-goto]:hover:not(:active) { background: var(--hover-brand); color: var(--brand-text); }
input[type="date"], input[type="month"] { cursor: pointer; }

/* 操作下拉菜单 */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { display: none; position: absolute; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); min-width: 120px; z-index: 50; overflow: hidden; }
.dropdown-menu.show { display: block; }
/* 底部空间不足时 JS 加此修饰向上展开（避开视口底沿与手机 fixed 底栏） */
.dropdown-menu.dropdown-menu--up { top: auto; bottom: 100%; margin-bottom: 4px; }
.dropdown-menu button { display: block; width: 100%; text-align: left; padding: 9px 14px; border: none; background: none; font-size: 14px; cursor: pointer; color: var(--text); }
.dropdown-menu button:hover:not(:active) { background: var(--hover-brand); }
.dropdown-menu button.danger { color: var(--danger); }
/* 投资策略: 悬浮按钮 + 可拖拽/可缩放悬浮框 */
.strat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 998;
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--brand-strong); color: #fff;
  font-size: 24px; cursor: pointer; box-shadow: 0 6px 18px rgba(20,20,40,.22);
  transition: transform .15s ease, box-shadow .15s ease;
  touch-action: none;
}
.strat-fab:hover:not(:active) { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(20,20,40,.28); }
/* 圆钮内 SVG 图标: 覆盖 ICO 常量的 14px/右外边距, 居中且尺寸对齐原 emoji */
.strat-fab svg { width: 24px; height: 24px; margin: 0; vertical-align: middle; }
/* 桌面: 面板本身 resize: both, 右下角可拖拉调尺寸; 位置由 JS 拖动标题栏改 left/top */
.strat-panel {
  position: fixed; right: 24px; bottom: 88px; z-index: 999;
  width: 380px; height: 460px;
  min-width: 280px; min-height: 240px;
  max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  background: var(--surface); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border);
  resize: both;
}
.strat-head {
  padding: 10px 14px; background: var(--brand-strong);
  color: #fff; cursor: move; user-select: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  touch-action: none;
}
.strat-title { font-size: 14px; font-weight: 600; white-space: nowrap; }
.strat-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.strat-actions .btn.sm { padding: 4px 10px; font-size: 12px; }
.strat-close { cursor: pointer; font-size: 20px; line-height: 1; padding: 0 4px; }
.strat-close:hover:not(:active) { opacity: .75; }
/* body 撑满剩余空间, 内部滚动 */
.strat-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; }
.strat-view { font-size: 14px; line-height: 1.7; color: var(--text); word-break: break-word; }
.strat-view h1, .strat-view h2, .strat-view h3 { margin: 10px 0 6px; font-weight: 600; }
.strat-view h1 { font-size: 18px; }
.strat-view h2 { font-size: 16px; }
.strat-view h3 { font-size: 15px; }
.strat-view p { margin: 6px 0; }
.strat-view ul, .strat-view ol { margin: 6px 0; padding-left: 22px; }
.strat-view li { margin: 3px 0; }
.strat-view code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.strat-view pre { background: var(--surface-2); padding: 10px; border-radius: 6px; overflow-x: auto; margin: 8px 0; }
.strat-view pre code { background: none; padding: 0; }
.strat-view blockquote { border-left: 3px solid var(--border-strong); padding-left: 10px; color: var(--label); margin: 6px 0; }
.strat-view a { color: var(--brand-text); text-decoration: none; }
.strat-view a:hover:not(:active) { text-decoration: underline; }
.strat-view hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.strat-view strong { font-weight: 600; }
/* editor: 面板尺寸变时撑满剩余; 关掉 textarea 自身 resize, 由面板整体 resize 控制 */
.strat-editor {
  width: 100%; flex: 1 1 auto; min-height: 160px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 8px; resize: none;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6;
}
/* 手机: 贴底大浮层, 禁 resize/位置拖动, 高度稳定 */
@media (max-width: 640px) {
  .strat-panel {
    left: 8px !important; right: 8px !important;
    top: auto !important; bottom: calc(8px + var(--kb-inset, 0px)) !important;
    width: auto !important; height: 75vh !important;
    /* 键盘弹起(--kb-inset): 面板随底边上抬, max-height 同步压缩, 标题栏不飞出屏顶 */
    max-height: calc(100vh - 16px - var(--kb-inset, 0px)); min-width: 0; min-height: 0;
    resize: none; border-radius: 14px;
  }
  .strat-head { cursor: default; padding: 12px 14px; }
  .strat-title { font-size: 15px; }
  .strat-actions .btn.sm { padding: 6px 12px; font-size: 13px; }
  .strat-close { font-size: 24px; padding: 0 6px; }
  .strat-body { padding: 12px 14px; }
  .strat-fab { right: 16px; bottom: 16px; width: 48px; height: 48px; font-size: 22px; }
  /* 浏览器(有底部 Tab)抬到 Tab 之上; App 壳无 .m-tabbar 保持 16px 原位 */
  body:has(.m-tabbar) .strat-fab { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  body:has(.m-tabbar) .strat-panel {
    bottom: calc(78px + var(--kb-inset, 0px)) !important;
    max-height: calc(100vh - 92px - var(--kb-inset, 0px));
  }
  #stratSetup { right: 12px !important; left: 12px !important; bottom: 16px !important; width: auto; }
  /* 浏览器(有底部 Tab)与 .strat-fab/.strat-panel 同口径抬到 Tab 之上, 避免 CTA 被遮挡; App 壳保持 16px */
  body:has(.m-tabbar) #stratSetup { bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ============ 基金建仓：按份额 / 按金额 分段切换（仅新建弹窗） ============ */
.fund-mode-seg {
  display: flex; gap: 4px; padding: 3px; margin: 0 0 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.fund-mode-btn {
  flex: 1; min-width: 0; padding: 7px 8px; border: none; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.fund-mode-btn:hover:not(:active) { color: var(--text); }
.fund-mode-btn.is-on {
  background: var(--surface); color: var(--brand-text);
  box-shadow: 0 1px 2px rgba(15,23,42,.12), 0 1px 3px rgba(15,23,42,.08);
}
/* 面板切换：display 切换会重播一次淡入+短横移动画 */
.fund-mode-pane { display: none; }
.fund-mode-pane.is-on { display: block; animation: fundPaneIn .18s ease; }
@keyframes fundPaneIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fund-mode-pane.is-on { animation: none; } }

/* 设置→共享：免密链接卡（完整链接为主，裸 report_token 折进「高级」） */
.share-link-card { margin-bottom: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.share-link-card__name { font-weight: 600; font-size: 14px; }
.share-link-card__desc { font-size: 12px; margin: 2px 0 8px; }
.share-link-card__row { display: flex; gap: 8px; align-items: center; }
.share-link-card__row input { flex: 1; min-width: 0; margin: 0; font-size: 12px; }
.share-link-card__row .btn { flex: none; }
.share-link-card__adv { margin-top: 8px; }
.share-link-card__adv summary { font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }

.multi-pick { position: relative; display: inline-block; width: 100%; }
/* 已选值显示按钮: 允许多行, 长文本自动换行 */
.mp-btn {
  width: 100%; text-align: left; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
  font-size: 14px; cursor: pointer; color: var(--text); min-height: 38px;
  white-space: normal; word-break: break-all; line-height: 1.5;
}
.mp-menu { display: none; position: absolute; left: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 60; padding: 6px; max-height: 240px; overflow-y: auto; display: none; }
.mp-menu.show { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; min-width: 220px; }
.mp-item { display: flex; align-items: center; gap: 4px; padding: 5px 8px; font-size: 13px; cursor: pointer; border-radius: 6px; white-space: nowrap; }
.mp-item:hover:not(:active) { background: var(--hover-brand); }
.mp-item input { width: auto; margin: 0; }
/* "完成"按钮: 仅窄屏可见, 桌面下拉隐藏 */
.mp-done { display: none; }

/* ============ 待办树（signature） ============ */
/* 层级缩进靠 --depth 变量驱动；每个节点一行，左侧优先级色带 + 圆形勾选框 */
.todo-tree { margin-top: 4px; }
.todo-empty { text-align: center; color: var(--muted); padding: 40px 12px; font-size: 14px; }
.todo-node { position: relative; }
.todo-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 4px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  margin-left: calc(var(--depth, 0) * 26px);
  transition: box-shadow .18s, border-color .18s, transform .18s;
  /* 长按整行拖拽: 禁止长按弹出系统菜单/文字选择放大镜(行内无输入控件, 不影响使用) */
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.todo-row:hover:not(:active) { box-shadow: 0 3px 14px rgba(168,85,247,.10); border-color: var(--brand-border); transform: translateX(1px); }
/* 优先级：标题前一枚小圆点（克制点缀，不占左色带）。红=高 琥珀=中 灰=低 */
.todo-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: #b4bccb; }
.todo-dot.pri-2 { background: #e5484d; }
.todo-dot.pri-1 { background: #e8a317; }
.todo-dot.pri-0 { background: #b4bccb; }
/* 层级连接线：非顶层节点左侧竖向引导线。
   伪元素挂 .todo-node 而非 .todo-row：行 hover(translateX)/拖拽(scale)的 transform 会让
   绝对定位伪元素改以行为包含块，整根线向右错位钻进任务行；挂节点后定位恒定相对节点，
   定位值沿用原口径（行 static 时包含块即节点），手风琴/速览/根卡按既有口径排除 */
.todo-node[data-depth]:not([data-depth="0"]):not(.todo-acc):not(.flat-group):not(.todo-bandcard)::before {
  content: ''; position: absolute; left: calc(var(--depth, 0) * 26px - 13px); top: -4px; bottom: 50%;
  border-left: 1.5px solid var(--border); border-bottom: 1.5px solid var(--border);
  width: 12px; border-bottom-left-radius: 8px;
}
/* 圆形勾选框: 视觉 22px, ::before 透明热区扩到约 44px(手机最高频操作防误触);
   伪元素事件 target 仍是 button, assets.js 行点击/长按的 closest('.todo-check') 守卫自洽,
   故不可加 pointer-events:none */
.todo-check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--check-ring); background: var(--surface); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  transition: background .18s, border-color .18s; padding: 0;
}
.todo-check::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
}
.todo-check:hover:not(:active) { border-color: var(--brand-text); }
.todo-check::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 700; opacity: 0; transform: scale(.4); transition: .18s; }
.todo-check.done { background: linear-gradient(135deg, #52c41a, #34b34a); border-color: #34b34a; }
.todo-check.done::after { opacity: 1; transform: scale(1); }
/* 折叠三角 */
.todo-caret {
  flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; color: var(--faint);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
  transition: transform .18s, color .18s; user-select: none;
}
.todo-caret:hover:not(:active) { color: var(--brand-text); }
.todo-caret.collapsed { transform: rotate(-90deg); }
.todo-caret.leaf { visibility: hidden; }
/* 完整树根主任务: 折叠钮在右侧操作区, chevron 随状态旋转(与左侧三角同视觉语言) */
.todo-fold svg { transition: transform .2s cubic-bezier(.4,0,.2,1); }
.todo-fold.is-collapsed svg { transform: rotate(-90deg); }
/* 标题与元信息 */
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; color: var(--text); word-break: break-word; transition: color .2s; }
.todo-row.is-done .todo-title { color: var(--faint); text-decoration: line-through; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
/* 按截止日分组（容器 .todo-due-groups）：完整树/速览的标签内联到标题后，不另占一行。
   标题与 meta 横向排列、不换行；chip 过多横向裁掉，行高紧凑。仅分组模式生效。 */
/* 标题不省略、可自动换行；chip 作为内联项跟在标题后（允许随标题一起换行），不另占独立 meta 行 */
.todo-due-groups .todo-main { display:flex; align-items:flex-start; gap:8px; min-width:0; flex-wrap:wrap; }
.todo-due-groups .todo-title { flex:1 1 auto; min-width:0; }
.todo-due-groups .todo-meta { flex:0 0 auto; flex-wrap:nowrap; margin-top:2px; }
.todo-due-groups .tl-item__main { display:flex; align-items:flex-start; gap:8px; min-width:0; flex-wrap:wrap; }
.todo-due-groups .tl-item__title { flex:1 1 auto; min-width:0; }
.todo-due-groups .tl-item__meta { flex:0 0 auto; flex-wrap:nowrap; margin-top:2px; }
.todo-chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; line-height: 1.6; }
.todo-chip.cat { background: var(--hover-brand); color: var(--brand-text); }
.todo-chip.due { background: var(--surface-2); color: var(--link-dim); }
.todo-chip.due svg { width: 12px; height: 12px; }
.todo-chip.due.overdue { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.todo-chip.due.today { background: var(--brand-strong); color: #fff; font-weight: 700; }
/* "今天"统一浅紫语言(柔和但保留今日特殊感): 面包屑主任务日期 / 眼睛详情弹窗 /
   完整树与详情子树(根行+子任务行) */
.todo-crumb .todo-chip.due.today,
.td-sub .todo-chip.due.today,
.todo-tree .todo-chip.due.today,
.td-chip.td-chip--today { background: var(--brand-tint); color: var(--brand-strong); font-weight: 600; }
/* 完整树(非详情视图)根行"今天"保持深紫实色白字, 与卡片视图根卡一致; 子任务行仍为浅紫 */
body:not(.todo-detail) .todo-tree .todo-row.is-root .todo-chip.due.today {
  background: var(--brand-strong); color: #fff; font-weight: 700;
}
/* 弹窗顶部日期 chip 本体是描边中性样式, 浅紫态换品牌浅紫边 */
.td-chip.td-chip--today { border-color: var(--brand-border); }
/* 暗色下根级深紫在浅紫底上对比不足, 换用主题亮紫(dark 未定义 --brand-strong, 会回退根值) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .todo-crumb .todo-chip.due.today,
  :root:not([data-theme="light"]) .td-sub .todo-chip.due.today,
  :root:not([data-theme="light"]) .todo-tree .todo-chip.due.today,
  :root:not([data-theme="light"]) .td-chip.td-chip--today { color: var(--brand-text); }
}
[data-theme="dark"] .todo-crumb .todo-chip.due.today,
[data-theme="dark"] .td-sub .todo-chip.due.today,
[data-theme="dark"] .todo-tree .todo-chip.due.today,
[data-theme="dark"] .td-chip.td-chip--today { color: var(--brand-text); }
.todo-crumb .todo-chip { flex: none; }
.todo-crumb .todo-cat-chip { flex: none; }
.todo-chip.due.soon { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.todo-chip.due.future { background: var(--surface-2); color: var(--link-dim); }
.todo-chip.due .due-days { opacity: .72; font-weight: 500; }
/* 闹钟标签: 中性灰胶囊, 配色同源 due.future(语义不同于日期, 不挂 due 类) */
.todo-chip.alarm { background: var(--surface-2); color: var(--link-dim); }
.todo-chip.alarm svg { width: 12px; height: 12px; }
/* child_due「子任务各自设置截止日期」模式标识 —— 鼠尾草绿低唤醒语言(浅底深字细边, 无渐变白字块):
   主任务(根)=浅绿底贴(卡片右上角贴/树行尾贴/面包屑/详情信息行); 中间层子分组=透明底描边胶囊 */
.todo-cd-ribbon {
  position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; gap: 3px;
  background: var(--cd-bg); color: var(--cd-fg);
  border-left: 1px solid var(--cd-border); border-bottom: 1px solid var(--cd-border);
  font-size: 10.5px; font-weight: 600;
  padding: 3px 9px 4px 10px; border-bottom-left-radius: 10px;
}
.todo-cd-ribbon svg { width: 11px; height: 11px; display: block; }
/* 标识紧贴 3px 顶带(色带现为 border-top, ribbon 在 padding box 内不遮盖它) */
.todo-card .todo-cd-ribbon { top: 0; }
/* 角贴避让标题, 防长标题钻到角贴下 */
.todo-card.cd-on .todo-card__head { padding-right: 88px; }
/* 根行尾/面包屑/详情行内贴 */
.todo-cd-tag {
  flex: none; align-self: center; display: inline-flex; align-items: center; gap: 3px;
  background: var(--cd-bg); color: var(--cd-fg); border: 1px solid var(--cd-border);
  font-size: 10.5px; font-weight: 600;
  padding: 1px 7px; border-radius: 6px; line-height: 1.6;
}
.todo-cd-tag svg { width: 10px; height: 10px; display: block; }
/* 中间层子分组: 透明底描边胶囊(比根贴再弱一级), 置于该行 meta 最前 */
.todo-chip.cd-sub {
  display: inline-flex; align-items: center; gap: 3px;
  background: transparent; color: var(--cd-fg); border: 1px solid var(--cd-border); font-weight: 600;
}
.todo-chip.cd-sub svg { width: 11px; height: 11px; display: block; }
/* 行内操作按钮：默认略淡，hover 行时显现；SVG 图标走 currentColor, 移动端常显 */
.todo-ops { display: flex; gap: 2px; opacity: .7; transition: opacity .18s; flex-shrink: 0; }
.todo-row:hover:not(:active) .todo-ops { opacity: 1; }
.todo-op { border: none; background: none; cursor: pointer; font-size: 15px; padding: 5px 6px; border-radius: 6px; line-height: 1; color: var(--link-dim); display: inline-flex; align-items: center; justify-content: center; }
.todo-op:hover:not(:active) { background: var(--hover-bg); color: var(--brand-text); }
.todo-op.danger { color: var(--danger); }
.todo-op.danger:hover:not(:active) { background: var(--danger-bg); color: var(--danger); }
.todo-op svg { width: 16px; height: 16px; display: block; pointer-events: none; }
/* 拖拽手柄：按住即可拖动排序；touch-action:none 抑制移动端触摸滚动争抢 */
.todo-drag { cursor: grab; color: var(--faint); touch-action: none; }
.todo-drag:active { cursor: grabbing; }
.todo-children.collapsed { display: none; }
/* 顶层任务栏：作为分组头。浅灰底 + 左侧品牌蓝分组条表"这是一组"，与优先级圆点分属不同通道 */
.todo-row.is-root { background: var(--surface-2); border-color: var(--border); border-left: 4px solid var(--brand); padding-left: 12px; }
.todo-row.is-root .todo-title { font-weight: 700; font-size: 15px; }
.todo-count { font-size: 12px; color: var(--muted-2); margin-left: 6px; }
/* ============ 手风琴视图（accordion：Things 风留白行，无行间分隔线，悬停浮现操作组） ============ */
.todo-acc__row {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 9px; border-bottom: 1px solid var(--th-border);
  transition: background .13s;
}
.todo-acc__row:hover:not(:active) { background: var(--hover-bg); }
.todo-acc__caret {
  flex: none; width: 18px; height: 20px; padding: 0; border: 0; background: transparent;
  color: var(--faint); cursor: pointer; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, background .13s;
}
.todo-acc__caret svg { width: 12px; height: 12px; display: block; transition: transform .2s cubic-bezier(.4,0,.2,1); }
.todo-acc__caret:hover:not(:active) { color: var(--brand-text); background: var(--brand-tint); }
.todo-acc__caret.leaf { cursor: default; font-size: 10px; }
.todo-acc__caret.leaf:hover:not(:active) { color: var(--faint); background: transparent; }
/* 状态圆点编码优先级（同 .todo-dot 配色） */
.todo-acc__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.todo-acc__dot.pri-2 { background: #e5484d; }
.todo-acc__dot.pri-1 { background: #e8a317; }
.todo-acc__dot.pri-0 { background: #b4bccb; }
.todo-acc__name {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text-strong);
  word-break: break-word; cursor: pointer;
}
.todo-acc__name:hover:not(:active) { color: var(--brand-text); }
/* 顶层主任务：更大更粗 + 圆点略大，与中间层分组行区分（中间层=14px/600） */
.todo-acc__row--root { padding-top: 9px; padding-bottom: 8px; }
.todo-acc__row--root .todo-acc__name { font-size: 15px; font-weight: 700; }
.todo-acc__row--root .todo-acc__dot { width: 9px; height: 9px; }
/* 「各自截止」标识小图标（child_due） */
.todo-acc__cdmark {
  flex: none; width: 16px; height: 16px; color: var(--muted-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.todo-acc__cdmark svg { width: 15px; height: 15px; display: block; }
.todo-acc__cdmark:hover:not(:active) { color: var(--brand-text); }
.todo-acc__date { flex: none; font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.todo-acc__date.od { color: var(--danger); font-weight: 600; }
.todo-acc__kids { padding-left: 22px; }
/* 叶子行：标题自然换行 */
.todo-acc__leafrow {
  display: flex; align-items: flex-start; gap: 9px; padding: 6px 10px;
  border-radius: 9px; border-bottom: 1px solid var(--th-border); transition: background .13s;
}
.todo-acc__leafrow:hover:not(:active) { background: var(--hover-bg); }
.todo-acc__leafrow .todo-check { margin-top: 1px; }
.todo-acc__leafname {
  flex: 1; min-width: 0; font-size: 13.5px; color: var(--text);
  word-break: break-word; cursor: pointer; align-self: center;
}
.todo-acc__leafname:hover:not(:active) { color: var(--brand-text); }
.todo-acc__leafrow.done .todo-acc__leafname { color: var(--muted); text-decoration: line-through; }
.todo-acc__leafrow .todo-chip.due { align-self: center; }
.todo-acc__leafrow .todo-chip.alarm { align-self: center; }
.todo-acc__leafrow .todo-acc__dot { align-self: center; }
/* 桌面：操作组绝对定位贴右（不占流，标题空间最大化），平时透明，悬停行才浮现 */
@media (min-width: 641px) {
  .todo-acc .todo-ops {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: var(--surface); padding: 2px; border-radius: 9px;
    box-shadow: 0 2px 12px rgba(16,24,40,.10);
  }
}
.todo-acc .todo-ops { opacity: 0; }
.todo-acc__leafrow .todo-ops { align-self: center; }
.todo-acc__row:hover:not(:active) .todo-ops,
.todo-acc__leafrow:hover:not(:active) .todo-ops { opacity: 1; }
/* 桌面悬停：右侧日期让位淡出，避免与浮起的操作组重叠（手机日期保留）。
   必须同时 pointer-events:none——opacity:0 会让 chip 形成层叠上下文、按 DOM 序压在
   绝对定位的 .todo-ops 之上，透明却劫持点击，导致点眼睛/分享/删除落到整行误进详情。 */
@media (min-width: 641px) {
  .todo-acc__row:hover:not(:active) .todo-chip.due,
  .todo-acc__leafrow:hover:not(:active) .todo-chip.due,
  .todo-acc__row:hover:not(:active) .todo-chip.alarm,
  .todo-acc__leafrow:hover:not(:active) .todo-chip.alarm { opacity: 0; pointer-events: none; }
}
/* 拖拽浮起（对齐老树 .todo-node.dragging > .todo-row） */
.todo-node.dragging > .todo-acc__row,
.todo-node.dragging > .todo-acc__leafrow {
  border-radius: 10px; border-bottom-color: transparent;
  box-shadow: 0 22px 44px rgba(31,35,41,.26), 0 8px 18px rgba(168,85,247,.26), 0 0 0 2px rgba(168,85,247,.28);
}
/* 折叠态：箭头旋转 + 子树隐藏 */
.todo-acc__caret.is-collapsed svg { transform: rotate(-90deg); }
.todo-acc__kids.collapsed { display: none; }
/* 手机「⋯」弹层打开时抬层（行 class 由 todoOpMenuToggle 添加） */
.todo-node:has(> .todo-acc__row.op-menu-open),
.todo-node:has(> .todo-acc__leafrow.op-menu-open) { position: relative; z-index: 200; }
.todo-acc__row.op-menu-open, .todo-acc__leafrow.op-menu-open { z-index: 210; }
@media (max-width: 640px) {
  .todo-acc__kids { padding-left: 14px; }
  /* 手机：操作组只留「⋯」，与老树 .todo-tree 同口径 */
  body .todo-acc .todo-ops { opacity: 1; gap: 0; }
  body .todo-acc .todo-ops .todo-op:not(.todo-more) { display: none; }
  body .todo-acc .todo-op.todo-more { display: inline-flex; }
  /* 主列表分组（非详情）：添加子任务走⋯菜单，隐藏组内常驻占位行 */
  body .todo-acc:has(.todo-op.todo-more) .todo-detail-adder .todo-detail-adder__placeholder,
  body:not(.todo-detail) .todo-tree:has(.todo-op.todo-more) .todo-detail-adder .todo-detail-adder__placeholder,
  /* 全屏详情：树内各层级节点的添加框也收进各自⋯、占位隐藏（否则每层都冒出一个）。
     只留详情根级一个——它是 .todo-tree 的直接子节点、不在 .todo-node 内，默认 flex 常显 */
  body.todo-detail .todo-node .todo-detail-adder .todo-detail-adder__placeholder { display: none; }
}
/* ============ 速览/手风琴：顶层主任务卡片化（A 方案，与卡片视图同源：3px 等级色带封边） ============ */
.todo-bandcard {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; margin: 0 0 11px;
  transition: box-shadow .18s, border-color .18s, transform .18s ease;
  --pri-band: #C9CCD6;
}
.todo-bandcard:hover:not(:active) {
  box-shadow: 0 12px 26px rgba(124,58,237,.16);
  border-right-color: var(--brand-border);
  border-bottom-color: var(--brand-border);
  border-left-color: var(--brand-border);
  transform: translateY(-2px);
}
/* 顶色带直接用 3px border-top（贴外缘、随 hover transform 一体，同卡片视图） */
.todo-bandcard.pri-2, .todo-bandcard.pri-1, .todo-bandcard.pri-0 { border-top: 3px solid var(--pri-band); }
.todo-bandcard.pri-2 { --pri-band: #E0453E; }
.todo-bandcard.pri-1 { --pri-band: #E5A113; }
.todo-bandcard.pri-0 { --pri-band: #C9CCD6; }
/* band 子元素隐藏: 顶带已由 border-top 承担(边框与卡片同层, 滚动无缝) */
/* 后代选择器：右滑包裹后 band 不再是直接子元素，仍需隐藏（灰 band 复活会盖住彩色 ::before） */
.todo-bandcard .todo-card__band { display: none; }
/* 卡内主任务行：去边框/灰底/左紫条，透明融入白卡 */
.todo-bandcard > .todo-row.is-root {
  background: transparent; border: 0; border-radius: 0; margin: 0;
  padding: 10px 14px 6px;
}
.todo-bandcard > .todo-row.is-root:hover:not(:active) { box-shadow: none; transform: none; }
/* 卡内子任务行：去行卡片框，保留 depth 缩进与层级引导线 */
.todo-bandcard .todo-row { background: transparent; border: 0; }
.todo-bandcard .todo-row:hover:not(:active) { box-shadow: none; transform: none; }
.todo-bandcard > .todo-children { padding: 0 10px 5px; }
/* 手风琴卡内：主行与叶子区收紧 */
.todo-bandcard > .todo-acc__row--root { padding: 10px 10px 4px; }
.todo-bandcard > .todo-acc__row--root:hover:not(:active) { background: transparent; }
.todo-bandcard > .todo-acc__kids { padding-right: 10px; padding-bottom: 6px; }
/* 速览（flat）卡内：组 padding 归零、组头去底部分隔线，叶子与底部添加行横向对齐 */
.todo-bandcard.flat-group { padding: 0; }
.todo-bandcard .flat-group__head { border-bottom: 0; padding: 9px 12px 5px; }
.todo-bandcard .flat-group__head:hover:not(:active) { background: transparent; }
.todo-bandcard .flat-item { padding-left: 12px; padding-right: 12px; }
.todo-bandcard > .todo-detail-adder { margin-left: 12px; margin-right: 12px; }
/* ============ 速览视图（flat-view：叶子拍平 + 祖先面包屑，与桌面小组件同源） ============ */
.flat-group { position: relative; padding: 8px 0 2px; }
/* solo 组（无子任务的顶层主任务）：收紧组头与叶子、组与组之间的空隙 */
.flat-group--solo { padding-bottom: 0; }
.flat-group--solo .flat-group__head { padding-bottom: 2px; }
.flat-group--solo .flat-item { padding-top: 3px; }
.flat-group__head {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 9px;
  border-bottom: 1px solid var(--th-border);
  transition: background .13s;
}
.flat-group__head:hover:not(:active) { background: var(--hover-bg); }
.flat-group__title { font-size: 15px; font-weight: 700; color: var(--text-strong); cursor: pointer; }
.flat-group__title:hover:not(:active) { color: var(--brand-text); }
.flat-group__count { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.flat-group__repeat { font-size: 11px; line-height: 1; }
/* 「各自截止」标识（child_due），样式与手风琴 .todo-acc__cdmark 一致 */
.flat-group__cdmark {
  flex: none; width: 16px; height: 16px; color: var(--muted-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.flat-group__cdmark svg { width: 15px; height: 15px; display: block; }
.flat-group__cdmark:hover:not(:active) { color: var(--brand-text); }
/* 叶子行：勾选圆 + 文本列（面包屑/标题）+ 日期 */
.flat-item {
  position: relative; display: flex; align-items: flex-start; gap: 9px;
  padding: 6px 10px; border-radius: 9px;
  transition: background .13s;
}
.flat-item:hover:not(:active) { background: var(--hover-bg); }
.flat-item .todo-check { margin-top: 1px; }
.flat-text { flex: 1; min-width: 0; }
.flat-crumb {
  font-size: 11.5px; color: var(--faint); line-height: 1.35; margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flat-title { font-size: 13.5px; color: var(--text); word-break: break-word; cursor: pointer; }
.flat-title:hover:not(:active) { color: var(--brand-text); }
.flat-item.done .flat-title { color: var(--muted-2); text-decoration: line-through; }
.flat-item .todo-chip.due { align-self: center; }
/* 操作组：平时透明，悬停行才浮现 */
.flat-group .todo-ops, .flat-item .todo-ops { opacity: 0; transition: opacity .13s; }
.flat-item .todo-ops { align-self: center; }
.flat-group__head:hover:not(:active) .todo-ops, .flat-item:hover:not(:active) .todo-ops { opacity: 1; }
/* 桌面：操作组绝对定位贴右浮起（不占流）；悬停时日期让位淡出（手机日期保留） */
@media (min-width: 641px) {
  .flat-group .todo-ops, .flat-item .todo-ops {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: var(--surface); padding: 2px; border-radius: 9px;
    box-shadow: 0 2px 12px rgba(16,24,40,.10);
  }
  .flat-group__head:hover:not(:active) .todo-chip.due,
  .flat-item:hover:not(:active) .todo-chip.due { opacity: 0; }
}
/* 手机「⋯」弹层打开时抬层（class 由 todoOpMenuToggle 添加） */
.todo-node:has(> .flat-group__head.op-menu-open),
.flat-item.op-menu-open { position: relative; z-index: 200; }
/* 已完成拍平沉底区（全视图统一） */
.todo-donezone { margin-top: 14px; border-top: 2px dashed var(--border); padding-top: 4px; }
.todo-cards .todo-donezone { margin-top: 2px; } /* 卡片容器自带 gap:12，收紧叠加间距 */
.todo-donezone__head { display: flex; align-items: center; gap: 8px; padding: 8px 6px; font-weight: 700; color: var(--muted); font-size: 13px; }
.todo-donezone__tag { font-size: 10.5px; font-weight: 700; color: var(--brand-text); background: var(--brand-tint); border: 1px solid var(--brand-border); border-radius: 6px; padding: 1px 7px; }
.flat-donewhen { flex: none; align-self: center; font-size: 12px; color: var(--muted); }
/* 已完成区直接落在全屏背景上（白卡之外）：标题/面包屑/日期/区头跟随背景 --onbg，
   深实色变白、浅实色变深；无背景回退原色。速览白卡内的行不在 .todo-donezone、不受影响。 */
/* 标题：选择器提到 .flat-item.done 同级特异性，压过基础 .flat-item.done .flat-title 的 muted-2 */
.todo-donezone .flat-item.done .flat-title { color: var(--onbg, var(--muted-2)); }
.todo-donezone .flat-crumb { color: var(--onbg-soft, var(--faint)); opacity: .9; }
.todo-donezone .flat-donewhen { color: var(--onbg-soft, var(--muted)); }
.todo-donezone__head { color: var(--onbg, var(--muted)); }
/* 深实色/暗色背景：已完成项退一档（标题60%白、面包屑50%白）——清晰可读但不与未完成亮白争焦点 */
html[data-theme="dark"] .todo-donezone .flat-crumb,
:is(html[data-bg="solid-indigo"],html[data-bg="solid-steel"],html[data-bg="solid-teal"],html[data-bg="solid-green"],html[data-bg="solid-brown"],html[data-bg="solid-rose"],html[data-bg="solid-purple"],html[data-bg="solid-slate"]) .todo-donezone .flat-crumb {
  color: rgba(255,255,255,.5);
}
:is(html[data-bg="solid-indigo"],html[data-bg="solid-steel"],html[data-bg="solid-teal"],html[data-bg="solid-green"],html[data-bg="solid-brown"],html[data-bg="solid-rose"],html[data-bg="solid-purple"],html[data-bg="solid-slate"]) .todo-donezone .flat-item.done .flat-title {
  color: rgba(255,255,255,.6);
}
/* 随上级完成、叶子自身未勾选：勾选圆绿，但标题不划线；颜色随所在环境（donezone 走 --onbg，白卡内走 --text） */
.flat-item.done.via-parent .flat-title { text-decoration: none; }
/* 任务详情弹窗：层级面包屑 + 创建/完成时间 */
.td-crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.td-times { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 16px 0 2px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.flat-group__head.op-menu-open { z-index: 210; }
@media (max-width: 640px) {
  /* 操作组只留「⋯」 */
  body .flat-group .todo-ops, body .flat-item .todo-ops { opacity: 1; gap: 0; }
  body .flat-group .todo-op:not(.todo-more),
  body .flat-item .todo-op:not(.todo-more) { display: none; }
  body .flat-group .todo-op.todo-more,
  body .flat-item .todo-op.todo-more { display: inline-flex; }
  body .flat-item, body .flat-group__head { padding-left: 8px; padding-right: 8px; }
  /* 无面包屑的单行叶子：行高随内容收紧，避免与两行（面包屑+标题）同高显得空 */
  /* 无面包屑单行叶子：最小行高贴近两行(面包屑)行、内容居中，避免过矮显局促 */
  body .flat-item--nocrumb {
    min-height: 40px; align-items: center; padding-top: 2px; padding-bottom: 2px;
  }
  body .flat-item--nocrumb .todo-check { margin-top: 0; }
  /* 组间距收紧；添加子任务走 ⋯ 菜单：手机端收起组底占位行，⋯ 菜单点开后 adder 进入 editing 放行 */
  body .flat-group { padding: 5px 0 1px; }
  body .flat-group--solo { padding-top: 3px; padding-bottom: 0; }
  body .flat-group .todo-detail-adder { display: none; }
  body .flat-group .todo-detail-adder.editing { display: block; }
}
/* ============ 时间轴视图（timeline：竖轴挂日期，右侧子任务卡） ============ */
.timeline-view { margin-top: 6px; }
/* 速览卡片流（无轴，同款卡片纯拍平） */
.tl-card-list { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
/* 日期行：日期标签 74px / 轴 24px / 卡片 1fr；第三列 minmax(0,1fr) 允许收缩，
   否则长内容会把 grid 列撑出屏幕、卡片横向溢出 */
.tl-day { display: grid; grid-template-columns: 74px 24px minmax(0,1fr); break-inside: avoid; }
.tl-day__label { padding-top: 2px; padding-right: 10px; text-align: right; font-size: 12px; color: var(--onbg-soft, var(--muted-2)); line-height: 1.35; white-space: nowrap; }
.tl-day__label b { display: block; font-size: 13.5px; color: var(--onbg, var(--text-strong)); }
.tl-day.is-over .tl-day__label b { color: var(--over-fg, var(--danger)); }
.tl-day.is-today .tl-day__label b { color: var(--today-fg, var(--brand-text)); }
.tl-day.is-soon .tl-day__label b { color: var(--soon-fg, var(--warn)); }
.tl-day.is-empty .tl-day__label { opacity: 1; }
.tl-day.is-empty .tl-day__label b { font-size: 12.5px; font-weight: 500; color: var(--onbg-soft, var(--muted-2)); }
/* 轴竖线 + 节点圆点（中线对齐） */
.tl-day__rail { position: relative; }
.tl-day__rail::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: var(--rail-line, var(--border)); }
.timeline-view .tl-day:first-child .tl-day__rail::before { top: 50%; }
.timeline-view .tl-day:last-child .tl-day__rail::before { bottom: 50%; }
.tl-dot { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--brand); z-index: 2; }
.tl-day.is-over .tl-dot { border-color: var(--danger); }
.tl-day.is-today .tl-dot { width: 15px; height: 15px; top: 3px; background: var(--brand); border-color: transparent; box-shadow: 0 0 0 4px var(--brand-tint); }
.tl-day.is-soon .tl-dot { width: 14px; height: 14px; top: 3.5px; background: var(--warn); border-color: transparent; box-shadow: 0 0 0 4px var(--warn-bg); }
.tl-day.is-empty .tl-dot { width: 8px; height: 8px; top: 7px; border-width: 2px; border-color: var(--faint); }
.tl-day__cards { display: flex; flex-direction: column; gap: 11px; padding: 0 0 11px 14px; }
.tl-day.is-empty .tl-day__cards { padding-bottom: 11px; }
.timeline-view .tl-day:last-child .tl-day__cards { padding-bottom: 4px; }
/* 子任务卡：优先级左条 + 面包屑 + 内容 */
.tl-item {
  position: relative; background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20,20,40,.04);
  --pri-band: #C9CCD6; /* 左带色: 仅 .pri-0/1/2 用 border-left 画 3px; 无(-1)不画, 不被面包屑栏遮挡 */
}
/* 左条位于边框内侧(overflow 裁在 padding box), 完整宽度不被裁细 */
/* 左色带直接用 3px border-left：贴卡片最外缘、随 hover transform 一体（不用绝对定位色条——
   绝对定位从 border 内侧起、与外缘差 1px，会显得"没紧贴左侧"）。.tl-item__priband 元素隐藏。 */
.tl-item.pri-2, .tl-item.pri-1, .tl-item.pri-0 { border-left: 3px solid var(--pri-band); }
.tl-item__priband { display: none; }
.tl-item.pri-2 { --pri-band: #E0453E; }
.tl-item.pri-1 { --pri-band: #E5A113; }
.tl-item.pri-0 { --pri-band: #C9CCD6; }
.tl-item.is-done { background: var(--surface-done); }
.tl-item.is-done .tl-item__title { color: var(--faint); text-decoration: line-through; }
/* 层级面包屑按钮（点击进主任务详情） */
.tl-crumb { display: flex; align-items: center; gap: 5px; width: 100%; padding: 6px 12px; border: 0; border-bottom: 1px solid var(--th-border); background: var(--surface-2); color: var(--brand-text); font-size: 11.5px; font-family: inherit; text-align: left; cursor: pointer; transition: background .13s; }
.tl-crumb:hover:not(:active) { background: var(--brand-tint); }
.tl-crumb__ic { display: inline-flex; flex: none; }
.tl-crumb__ic svg { width: 13px; height: 13px; display: block; }
.tl-crumb__path { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-crumb__path .sep { color: var(--faint); margin: 0 3px; font-weight: 400; }
.tl-crumb__go { flex: none; color: var(--faint); font-size: 14px; }
.tl-crumb:hover:not(:active) .tl-crumb__go { color: var(--brand-text); }
.tl-item__body { display: flex; align-items: flex-start; gap: 10px; padding: 10px 13px 9px 15px; }
.tl-item__body.is-clickable { cursor: pointer; }
.tl-item__body.is-clickable .tl-item__title:hover:not(:active) { color: var(--brand-text); }
.tl-item__body .todo-check { margin-top: 1px; }
.tl-item__main { flex: 1; min-width: 0; }
.tl-item__title { font-size: 14px; font-weight: 600; line-height: 1.42; color: var(--text); word-break: break-word; overflow-wrap: anywhere; }
.tl-item__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
/* 未安排：虚线轴 + 虚框圆点 */
.tl-day--none .tl-day__rail::before { background: repeating-linear-gradient(to bottom, var(--faint) 0 4px, transparent 4px 9px); }
.tl-day--none .tl-dot { border-style: dashed; border-color: var(--faint); }
@media (max-width: 640px) {
  .tl-card-list { gap: 8px; }
  .tl-day { grid-template-columns: 62px 20px minmax(0,1fr); }
  .tl-day__label { font-size: 11px; padding-right: 7px; }
  .tl-day__label b { font-size: 12.5px; }
  .tl-day__cards { gap: 8px; padding-left: 10px; padding-bottom: 8px; }
  .tl-crumb { padding: 5px 10px; font-size: 11px; }
  .tl-item__body { padding: 9px 10px 8px 13px; gap: 8px; }
  .tl-item__title { font-size: 13.5px; }
}

/* ============ 五视图手机端优化（对齐 todo-5views-demo：仅 ≤640px 生效，PC 像素不变） ============ */
/* 新增 DOM 在 PC 默认隐藏；.flat-sec 在 PC 抹平为无盒容器，速览仍是连续卡片流 */
.todo-card__prog, .todo-card__subs, .todo-acc-bar, .flat-sec__head, .tl-tools { display: none; }
@media (min-width: 641px) {
  .flat-sec { display: contents; }
}
@media (max-width: 640px) {
  /* —— 1. 卡片视图：进度条 + 最多 2 行子任务预览 —— */
  .todo-card, .todo-bandcard { border-radius: 16px; }
  .todo-card__prog {
    display: block; height: 4px; border-radius: 99px;
    background: var(--surface-2); margin: 8px 0 2px; overflow: hidden;
  }
  .todo-card__prog-fill { height: 100%; border-radius: 99px; background: var(--brand); }
  .todo-card__subs { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; }
  .todo-card__sub { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; color: var(--muted); }
  .todo-card__sub-mark {
    flex: none; width: 14px; height: 14px; border-radius: 50%;
    border: 1.6px solid var(--check-ring);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .todo-card__sub-mark.is-done { background: var(--brand); border-color: var(--brand); }
  .todo-card__sub-mark.is-done::after { content: '✓'; color: #fff; font-size: 9.5px; font-weight: 700; }
  .todo-card__sub-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* —— 2. 手风琴：快捷工具条 —— */
  .todo-acc-bar { display: flex; gap: 8px; margin: 2px 0 10px; }
  /* 按日分组时工具条挂在 .todo-due-groups 顶部：压缩其与首个日期组头的间距；
     原 .todo-due-group__head:first-child 因工具条前置而失效，用相邻兄弟选择器补回紧凑度 */
  .todo-due-groups > .todo-acc-bar { margin-bottom: 4px; }
  .todo-due-groups > .todo-acc-bar + .todo-due-group__head { margin-top: 6px; }
  .todo-acc-bar__btn {
    padding: 6px 12px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text);
    font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  }
  .todo-acc-bar__btn:active { background: var(--surface-2); }

  /* —— 3. 速览：四段语义分组（段头落背景走 --onbg）+ 段内合并单张白卡 —— */
  .flat-sec + .flat-sec { margin-top: 14px; }
  .flat-sec__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 2px 4px; margin-bottom: 6px;
    font-size: 12px; font-weight: 700;
  }
  .flat-sec__name, .flat-sec__head { color: var(--onbg, var(--muted)); }
  .flat-sec--overdue .flat-sec__name { color: var(--over-fg, var(--danger)); }
  .flat-sec--today .flat-sec__name { color: var(--today-fg, var(--brand-text)); }
  .flat-sec__count { font-weight: 600; color: var(--onbg-soft, var(--muted-2)); }
  .flat-view .tl-card-list {
    gap: 0; margin-top: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden;
  }
  /* 行间发丝线；保留左/顶优先级色带，只收掉单卡描边、投影与圆角 */
  .flat-view .tl-card-list .tl-item {
    border-top: 0; border-right: 0; border-radius: 0; box-shadow: none;
    border-bottom: 1px solid var(--th-border);
  }
  .flat-view .tl-card-list .tl-item:last-child { border-bottom: 0; }
  /* 面包屑整条灰栏压成小胶囊（点击进主任务详情保留） */
  .flat-view .tl-crumb {
    width: auto; margin: 7px 10px 0; padding: 4px 9px;
    border-radius: 8px; border-bottom: 0;
  }
  .flat-view .tl-crumb__go { display: none; }

  /* —— 4. 完整树：第 3 层起缩进减半、d4 封顶 40px（引导线与添加框三条规则同步） —— */
  .todo-tree .todo-node[data-depth="2"] > .todo-row { margin-left: 24px; }
  .todo-tree .todo-node[data-depth="3"] > .todo-row { margin-left: 32px; }
  .todo-tree .todo-node[data-depth="4"] > .todo-row,
  .todo-tree .todo-node[data-depth="5"] > .todo-row,
  .todo-tree .todo-node[data-depth="6"] > .todo-row,
  .todo-tree .todo-node[data-depth="7"] > .todo-row,
  .todo-tree .todo-node[data-depth="8"] > .todo-row { margin-left: 40px; }
  .todo-tree .todo-node[data-depth="2"]::before { left: 15px; }
  .todo-tree .todo-node[data-depth="3"]::before { left: 23px; }
  .todo-tree .todo-node[data-depth="4"]::before,
  .todo-tree .todo-node[data-depth="5"]::before,
  .todo-tree .todo-node[data-depth="6"]::before,
  .todo-tree .todo-node[data-depth="7"]::before,
  .todo-tree .todo-node[data-depth="8"]::before { left: 31px; }
  .todo-tree .todo-node[data-depth="1"] > .todo-children > .todo-detail-adder { margin-left: 24px; }
  .todo-tree .todo-node[data-depth="2"] > .todo-children > .todo-detail-adder { margin-left: 32px; }
  .todo-tree .todo-node[data-depth="3"] > .todo-children > .todo-detail-adder,
  .todo-tree .todo-node[data-depth="4"] > .todo-children > .todo-detail-adder,
  .todo-tree .todo-node[data-depth="5"] > .todo-children > .todo-detail-adder,
  .todo-tree .todo-node[data-depth="6"] > .todo-children > .todo-detail-adder,
  .todo-tree .todo-node[data-depth="7"] > .todo-children > .todo-detail-adder { margin-left: 40px; }
  .todo-tree .todo-node[data-depth="2"] > .todo-detail-adder { margin-left: 24px; }
  .todo-tree .todo-node[data-depth="3"] > .todo-detail-adder { margin-left: 32px; }
  .todo-tree .todo-node[data-depth="4"] > .todo-detail-adder,
  .todo-tree .todo-node[data-depth="5"] > .todo-detail-adder,
  .todo-tree .todo-node[data-depth="6"] > .todo-detail-adder,
  .todo-tree .todo-node[data-depth="7"] > .todo-detail-adder,
  .todo-tree .todo-node[data-depth="8"] > .todo-detail-adder { margin-left: 40px; }

  /* —— 5. 时间轴：轴贴边两列布局 + 日期白 pill 吸顶 + 定位今天工具条 —— */
  .tl-tools { display: flex; align-items: center; margin: 2px 0 8px; }
  .tl-locate-btn {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--brand-border); background: var(--surface);
    color: var(--brand-text); font-family: inherit; font-size: 12px; font-weight: 600;
    padding: 6px 12px; border-radius: 99px; cursor: pointer;
  }
  .tl-locate-btn svg { width: 14px; height: 14px; }
  .tl-locate-btn:active { background: var(--brand-tint); }
  .tl-locate-btn:disabled { opacity: .45; cursor: default; }
  .timeline-view:not(.tl-legacy) .tl-day {
    grid-template-columns: 18px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 8px;
  }
  .timeline-view:not(.tl-legacy) .tl-day__rail { grid-area: 1 / 1 / 3 / 2; }
  .timeline-view:not(.tl-legacy) .tl-day__label {
    grid-area: 1 / 2;
    justify-self: start;
    display: inline-flex; align-items: center; gap: 6px;
    width: auto; margin: 0 0 2px; padding: 3px 11px;
    text-align: left; white-space: nowrap;
    background: var(--surface); border: 1px solid var(--border); border-radius: 99px;
    color: var(--text-strong);
  }
  .timeline-view:not(.tl-legacy) .tl-day__label b { display: inline; font-size: 12.5px; color: var(--text-strong); }
  /* pill 是白底：强制回退实色，不能用深背景专用的 --over-fg/--today-fg/--soon-fg */
  .timeline-view:not(.tl-legacy) .tl-day.is-over .tl-day__label b { color: var(--danger); }
  .timeline-view:not(.tl-legacy) .tl-day.is-today .tl-day__label b { color: var(--brand-text); }
  .timeline-view:not(.tl-legacy) .tl-day.is-soon .tl-day__label b { color: var(--warn); }
  .timeline-view:not(.tl-legacy) .tl-day.is-empty .tl-day__label b { color: var(--muted-2); font-weight: 500; }
  /* 标签内第三行倒计时（无 class 的 span）在胶囊内隐藏，避免撑坏单行 pill */
  .timeline-view:not(.tl-legacy) .tl-day__label > span { display: none; }
  .timeline-view:not(.tl-legacy) .tl-day__cards {
    grid-area: 2 / 2;
    gap: 8px; padding: 0 0 10px;
  }
}
/* 速览深层叶子行后动态挂载的添加框：平时整体隐藏，点该行「添加子任务」进入 editing 才出现（PC/手机一致） */
.flat-leaf-adder-holder .todo-detail-adder:not(.editing) { display: none; }
.flat-leaf-adder-holder .todo-detail-adder.editing { display: block; }
/* 概览统计条 */
.todo-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.todo-stat { flex: 1; min-width: 90px; background: var(--surface-3); border-radius: 10px; padding: 12px 14px; text-align: center; }
.todo-stat .n { font-size: 24px; font-weight: 700; color: var(--brand-text); }
.todo-stat.overdue .n { color: var(--danger); }
.todo-stat.done .n { color: var(--ok-text); }
.todo-stat .l { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
/* 标题支持换行长文本；备注次级灰字 */
.todo-title { white-space: pre-wrap; }
.todo-note { font-size: 13px; color: var(--muted-2); margin-top: 4px; white-space: pre-wrap; line-height: 1.5; }
/* 备注单行截断（完整树/详情子任务同卡片口径），全文进任务详情查看 */
.todo-note--clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Markdown 备注渲染（任务详情/编辑器预览） */
.md-body { font-size: 14px; line-height: 1.7; color: var(--text); word-break: break-word; }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-body p { margin: 6px 0; }
.md-body h1, .md-body h2, .md-body h3 { margin: 12px 0 6px; line-height: 1.35; color: var(--text-strong); }
.md-body h1 { font-size: 19px; } .md-body h2 { font-size: 17px; } .md-body h3 { font-size: 15.5px; }
.md-body ul, .md-body ol { margin: 6px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body ul.md-tasks { list-style: none; padding-left: 2px; }
.md-body li.md-task { display: flex; align-items: flex-start; gap: 8px; }
.md-body .tk { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-strong); flex: none; margin-top: 4px; display: grid; place-items: center; font-size: 10px; color: #fff; }
.md-body .tk.on { background: var(--ok); border-color: var(--ok-text); }
.md-body li.done > *:last-child { color: var(--faint); text-decoration: line-through; }
.md-body blockquote { border-left: 3px solid var(--brand); background: var(--brand-tint); border-radius: 0 8px 8px 0; padding: 6px 12px; margin: 8px 0; color: var(--text); }
.md-body code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; background: var(--code-bg); border-radius: 4px; padding: 1px 5px; }
.md-body pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.md-body pre code { background: transparent; padding: 0; }
.md-body a { color: var(--brand-text); }
.md-body img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); margin: 8px 0; display: block; }
.md-body hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.md-body table { border-collapse: collapse; margin: 8px 0; display: block; overflow-x: auto; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 5px 10px; font-size: 13px; }
/* md 图片与附件缩略图可点击（手机端走灯箱而非新标签） */
.md-body img, .td-att-img { cursor: zoom-in; }
/* 图片灯箱：层级高于 modal(10000)，黑底居中，点击任意处关闭 */
.img-lightbox { display: none; position: fixed; inset: 0; z-index: 20000; background: rgba(0,0,0,.88); padding: 24px; align-items: center; justify-content: center; }
/* touch-action:none：灯箱打开期间双指手势全部交给图片缩放，不允许缩放/滚动整个页面 */
.img-lightbox.show { display: flex; touch-action: none; }
.img-lightbox .img-lb-pic { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 50px rgba(0,0,0,.5); transform-origin: center center; will-change: transform; user-select: none; -webkit-user-drag: none; }
.img-lightbox .img-lb-x { position: absolute; top: 14px; right: 22px; color: #fff; font-size: 32px; line-height: 1; opacity: .8; cursor: pointer; }
/* 附件存储页手机端全选：桌面端用表头 checkbox，此标签仅窄屏显示 */
.fm-mobile-sel { display: none; align-items: center; gap: 6px; font-size: 13px; color: var(--label); }
/* 任务详情弹窗 */
#tdEditBtn { float: right; margin: 2px 0 8px 10px; position: relative; z-index: 1; }
#tdEditBtn svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.td-title { font-size: 17px; font-weight: 700; color: var(--text-strong); margin-bottom: 10px; padding-right: 8px; }
.td-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.td-chip { font-size: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--label); border-radius: 999px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 4px; }
.td-chip svg { width: 12px; height: 12px; }
/* 过期闹钟: 淡化弱化与待响区分(仅任务详情弹窗含过期展示; 卡片/树等视图仍只显示待响) */
.td-chip.td-chip--overdue { opacity: .55; }
/* 任务详情弹窗: 第一子层级预览(普通主任务)/最近到期(child_due 主任务) */
.td-subs { margin: 4px 0 2px; }
.td-subs__head { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 2px 7px; }
.td-subs__head span { font-weight: 500; }
.td-sub { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; }
.td-sub:hover:not(:active) { background: var(--surface-2); }
.td-sub__t { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); white-space: normal; overflow: visible; text-overflow: clip; word-break: break-word; }
.td-sub .todo-check { width: 19px; height: 19px; border-width: 1.7px; }
.td-sub .todo-check.readonly { cursor: default; }
.td-sub .todo-check.readonly:hover:not(:active) { border-color: var(--check-ring); }
.td-sub--next, .td-sub--next:hover:not(:active) { background: var(--surface-2); }
.td-sub--next.is-over, .td-sub--next.is-over:hover:not(:active) { background: var(--danger-bg); }
.td-sub--next.is-today, .td-sub--next.is-today:hover:not(:active) { background: var(--brand-tint); }
.td-sub-empty { font-size: 13px; color: var(--muted); padding: 4px 2px; }
.td-att-title { font-size: 13px; font-weight: 600; color: var(--label); margin: 18px 0 8px; }
.td-att-list { display: flex; flex-direction: column; gap: 8px; }
a.td-att { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; text-decoration: none; color: var(--text); }
.td-att-img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; border: 1px solid var(--border); }
.td-att-ph { width: 44px; height: 44px; border-radius: 8px; background: var(--brand-tint); color: var(--brand-text); display: grid; place-items: center; flex: none; }
.td-att-ph svg { width: 18px; height: 18px; }
.td-att-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.td-att-sz { font-size: 11.5px; }
/* Markdown 编辑器（形态 A：写/预览） */
.mde { border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.mde-seg { display: flex; gap: 3px; padding: 5px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mde-seg button { flex: 1; border: 0; background: transparent; color: var(--label); font-size: 13px; padding: 6px 0; border-radius: 7px; cursor: pointer; font-family: inherit; }
.mde-seg button.on { background: var(--surface); color: var(--text-strong); font-weight: 600; box-shadow: 0 1px 3px rgba(20,20,40,.1); }
.mde-bar { display: flex; gap: 4px; align-items: center; padding: 7px 9px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.mde-btn { width: 32px; height: 30px; flex: none; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--label); display: grid; place-items: center; cursor: pointer; font-size: 13px; }
.mde-btn:active { background: var(--brand-tint); border-color: var(--brand-border); }
.mde-sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; flex: none; }
.mde-write, .mde-preview { display: none; }
.mde[data-mode="write"] .mde-write { display: block; }
.mde[data-mode="preview"] .mde-preview { display: block; }
.mde-text { width: 100%; border: 0; outline: none; resize: vertical; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.7; background: var(--surface); color: var(--text); min-height: 150px; max-height: 46vh; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mde-preview { padding: 10px 12px; min-height: 150px; max-height: 46vh; overflow-y: auto; background: var(--surface); touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mde-chips { display: flex; gap: 7px; flex-wrap: wrap; padding: 8px 10px; border-top: 1px solid var(--border); }
.mde-chips:empty { display: none; padding: 0; }
.mde-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 6px; color: var(--label); max-width: 100%; }
.mde-chip img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.mde-chip-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mde-chip-ok { color: var(--ok-text); }
.mde-chip-st { color: var(--muted); }
/* 编辑器全屏按钮（写/预览分段右侧；特异性压过 .mde-seg button 的 flex:1） */
.mde-seg .mde-seg-fs { flex: none; width: 42px; border: 0; background: transparent; color: var(--label); border-radius: 7px; cursor: pointer; display: grid; place-items: center; font-family: inherit; }
.mde-seg .mde-seg-fs:hover:not(:active) { background: var(--surface); color: var(--brand-text); }
/* 编辑器全屏：铺满视口，写/预览面板撑满；z-index 高于所在弹窗(10000)，低于全局 loading(10500)与图片灯箱(20000) */
.mde.mde--fullscreen { position: fixed; inset: 0; z-index: 10001; border-radius: 0; display: flex; flex-direction: column; }
.mde.mde--fullscreen .mde-panes { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mde.mde--fullscreen .mde-write,
.mde.mde--fullscreen .mde-preview { flex: 1 1 auto; min-height: 0; max-height: none; }
.mde.mde--fullscreen .mde-text { height: 100%; max-height: none; min-height: 0; resize: none; }
/* 全屏态压过 PC 大弹窗的左右分栏规则（正常大弹窗下分段行被隐藏，此为兜底） */
.mde.mde--fullscreen .mde-panes { grid-template-columns: none; height: auto; }
.mde.mde--fullscreen .mde-write { border-right: 0; overflow: hidden; }
/* Markdown 只读查看器：默认居中窗口（手机也留边距），.md-fs--full 才铺满；
   层级高于弹窗(10000)/图表全屏(10010)，低于全局 loading(10500)与图片灯箱(20000) */
.md-fs-mask { position: fixed; inset: 0; z-index: 10020; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.md-fs-box { background: var(--surface); width: 100%; max-width: 720px; max-height: 86vh; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.md-fs-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.md-fs-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-fs-actions { flex: none; display: flex; gap: 8px; }
.md-fs-max, .md-fs-close { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 7px; display: grid; place-items: center; }
.md-fs-max svg { display: block; }
.md-fs-max:hover:not(:active), .md-fs-close:hover:not(:active) { background: var(--surface-2); color: var(--text); }
.md-fs-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.md-fs-mask.md-fs--full { padding: 0; background: var(--surface); }
.md-fs-mask.md-fs--full .md-fs-box { max-width: none; max-height: none; height: 100%; border-radius: 0; }
/* 资产月度复盘：历史卡片墙（固定宽高、底部渐隐，点卡片进全屏详情） */
.aa-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.aa-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; cursor: pointer; }
.aa-card:hover:not(:active), .aa-card:focus-visible { border-color: var(--brand-border); box-shadow: 0 6px 18px rgba(80,90,130,.12); outline: none; }
.aa-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 8px 11px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.aa-card-b { height: 132px; padding: 9px 11px; position: relative; overflow: hidden; font-size: 12px; line-height: 1.7; color: var(--text); pointer-events: none; }
.aa-card-b::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.aa-card-b p { margin: 3px 0; }
.aa-card-b h1, .aa-card-b h2, .aa-card-b h3, .aa-card-b h4 { margin: 4px 0; font-size: 13px; }
.aa-card-b ul, .aa-card-b ol { margin: 3px 0; padding-left: 18px; }
.aa-card-b img { max-height: 60px; }
/* PC 大弹窗：左右分栏，写/预览分段隐藏；选择器需压过 [data-mode] 的单栏显隐规则 */
@media (min-width: 640px) {
  .modal-mask--lg .mde-panes { display: grid; grid-template-columns: 1fr 1fr; height: 62vh; }
  .modal-mask--lg .mde[data-mode] .mde-write,
  .modal-mask--lg .mde[data-mode] .mde-preview { display: block; min-width: 0; min-height: 0; }
  .modal-mask--lg .mde-seg { display: none; }
  .modal-mask--lg .mde-write { border-right: 1px solid var(--border); overflow: hidden; }
  /* 两栏同高：panes 固定 62vh，textarea 与预览各自填满、内部滚动（压过基础类的 46vh/150px） */
  .modal-mask--lg .mde-text { height: 100%; min-height: 0; max-height: none; resize: none; }
  .modal-mask--lg .mde-preview { height: 100%; min-height: 0; max-height: none; }
}
/* 图表卡片头部 + 区间选择 */
.todo-chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.todo-range { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.todo-range button { border: 0; background: var(--surface-2); color: var(--link-dim); font-size: 13px; padding: 6px 13px; border-radius: 999px; cursor: pointer; transition: .15s; }
.todo-range button:hover:not(:active) { color: var(--brand-text); }
.todo-range button.active { background: var(--brand-tint); color: var(--brand-strong); }
.todo-range button.active:hover:not(:active) { background: var(--brand-tint); color: var(--brand-strong); }
/* 筛选 tab：复用 range pill 样式，与列表间留白 */
.todo-filter { margin: 4px 0 12px; }
/* 标题行「分析」小按钮：与 h2 文字垂直对齐 */
.todo-analyze-btn { vertical-align: middle; margin: 0 2px; }
/* 趋势图标题行的刷新按钮: 纯蓝色图标无背景, hover 淡蓝底(压掉 .btn 的渐变/光晕/涟漪) */
.btn.todo-chart-refresh { background: none; color: var(--link-dim); padding: 5px 9px; line-height: 0; box-shadow: none; }
.btn.todo-chart-refresh::after { display: none; }
.btn.todo-chart-refresh:hover:not(:active),
.btn.todo-chart-refresh:active { background: var(--hover-brand); box-shadow: none; filter: none; transform: none; }
.btn.todo-chart-refresh:disabled { opacity: .6; }
.todo-chart-refresh.loading svg { animation: todo-spin .8s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes todo-spin { to { transform: rotate(360deg); } }
/* 任务分析弹窗：区块标题 */
.ta-h { font-size: 14px; font-weight: 600; color: var(--label); margin: 18px 0 10px; }
.ta-h-first { margin-top: 0; }
.ta-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ta-head .ta-h { margin: 0; }
/* 任务分析弹窗：指标卡 */
.ta-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.ta-stat { flex: 1; min-width: 120px; background: var(--surface-3); border-radius: 10px; padding: 10px 12px; text-align: center; }
.ta-stat .n { font-size: 20px; font-weight: 700; color: var(--text-strong); white-space: nowrap; line-height: 1.3; }
.ta-stat .n small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.ta-stat .l { font-size: 13px; color: var(--text); margin-top: 1px; }
.ta-stat .s { font-size: 11px; color: var(--muted); margin-top: 1px; min-height: 14px; }
.ta-stat.good .n { color: var(--ok-text); }
.ta-stat.bad .n { color: var(--danger); }
/* 精简版任务分析弹窗 */
.ta-top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ta-hero-card { background: var(--surface-2); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.ta-hero-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ta-hero-big { font-size: 32px; font-weight: 850; line-height: 1.1; color: var(--ok-text); font-variant-numeric: tabular-nums; }
.ta-hero-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface); color: var(--text); }
.ta-hero-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.ta-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.ta-kpi { background: var(--surface); border-radius: 10px; padding: 8px 10px; }
.ta-kpi b { display: block; font-size: 15px; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.ta-kpi span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ta-kpi.is-good b { color: var(--ok-text); }
.ta-kpi.is-bad b { color: var(--danger); }
/* 指标卡上的圆形「?」说明按钮：弱描边，不抢数字视觉 */
.ta-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; padding: 0; margin-left: 4px;
  border: 1px solid var(--muted); border-radius: 50%;
  background: transparent; color: var(--muted);
  font-size: 10px; font-weight: 600; line-height: 1; cursor: pointer;
  vertical-align: middle;
}
.ta-help:active { background: var(--surface-3); }
/* 7 列日历热力图（周一起始）：整块居中，格子等宽方形，格内显示日期 */
.ta-heat-wrap { max-width: 380px; margin: 0 auto; }
.ta-dow, .ta-heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.ta-dow { margin-bottom: 5px; }
.ta-dow span { font-size: 11px; color: var(--muted); text-align: center; line-height: 16px; }
.ta-cell { aspect-ratio: 1; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; cursor: pointer; transition: transform .12s; }
.ta-cell:hover:not(:active) { transform: scale(1.12); position: relative; z-index: 1; }
.ta-cell.win { background: var(--ok); border-color: transparent; color: #fff; }
.ta-cell.fail { background: var(--danger); border-color: transparent; color: #fff; }
.ta-cell.pending { background: var(--surface); border: 1px dashed var(--brand); color: var(--brand-text); }
.ta-cell.idle { background: var(--surface-2); }
/* 暗色主题下绿/红底变亮，日期字改用深色保对比 */
[data-theme="dark"] .ta-cell.win { color: #10230f; }
[data-theme="dark"] .ta-cell.fail { color: #2c0d0d; }
/* 日历方块当日明细浮层：摘要下默认折叠的任务列表 */
.ta-day-details { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.ta-day-details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-text); list-style: none; }
.ta-day-details summary::-webkit-details-marker { display: none; }
.ta-day-details summary::after { content: '▸'; float: right; color: var(--muted); font-size: 11px; transition: transform .15s; }
.ta-day-details[open] summary::after { transform: rotate(90deg); }
.ta-day-details ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ta-day-details li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; }
.ta-day-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--muted); }
.ta-day-title { flex: 1; min-width: 0; word-break: break-word; }
.ta-day-path { color: var(--muted); font-size: 12px; }
.ta-day-state { flex: none; font-size: 12px; color: var(--muted); }
.ta-day-details li.is-ok .ta-day-dot { background: var(--ok); }
.ta-day-details li.is-ok .ta-day-state { color: var(--ok); }
.ta-day-details li.is-late .ta-day-dot { background: var(--danger); }
.ta-day-details li.is-late .ta-day-state { color: var(--danger); }
.ta-day-details li.is-open .ta-day-dot { background: var(--danger); }
.ta-day-details li.is-open .ta-day-state { color: var(--danger); }
.ta-legend { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.ta-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--border); box-sizing: border-box; }
.ta-legend .lg-win { background: var(--ok); border-color: transparent; }
.ta-legend .lg-fail { background: var(--danger); border-color: transparent; }
.ta-legend .lg-idle { background: var(--surface-2); }
.ta-legend .lg-pending { background: var(--surface); border: 1px dashed var(--brand); }
@media (max-width: 480px) {
  .ta-heat-wrap { max-width: none; }
}

/* ============ 智能分析（报告视图：待办分析/基金/体重共用） ============ */
/* 图多解读少：各模块曲线图下方统一的「当前值 vs 所选区间平均值」分析卡，基准=当前所选区间的平均值 */
.jn { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--border); }
.jn-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.jn-head h3 { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.jn-head .jn-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
/* 成员切换 chip（体重多成员） */
.jn-members { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.jn-members button { border: 0; background: var(--surface); color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 6px 14px; min-height: 34px; border-radius: 999px; cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s; }
.jn-members button.on { background: var(--brand-tint); color: var(--brand-strong); }
/* hero：当前值 − 区间均值 */
.jn-hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.jn-hero__num { font-size: 32px; font-weight: 850; line-height: 1.2; color: var(--text-strong);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.jn-hero__num small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.jn-hero__calc { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 一句话判断：状态底 + 状态点（不使用 color-mix，兼容微信 X5） */
.jn-note { display: flex; gap: 9px; align-items: flex-start; border-radius: 10px; padding: 10px 13px; margin-top: 10px;
  font-size: 13.5px; line-height: 1.75; background: var(--surface-2); border: 1px solid var(--border); }
.jn-note::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--brand); }
.jn-note.good { background: var(--ok-bg); }
.jn-note.good::before { background: var(--ok); }
.jn-note.bad { background: var(--danger-bg); }
.jn-note.bad::before { background: var(--danger); }
.jn-note.flat::before { background: var(--faint); }
/* 周期对比三格 */
.jn-deltas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.jn-delta { background: var(--surface-3); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.jn-delta__l { font-size: 12px; color: var(--muted); }
.jn-delta__v { font-size: 17px; font-weight: 700; color: var(--text-strong); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.jn-delta__v .ar { font-size: 12px; font-weight: 700; margin-right: 2px; }
.jn-delta__v.is-up { color: var(--ok-text); }
.jn-delta__v.is-down { color: var(--danger); }
.jn-delta__v.is-money-pos { color: var(--danger); }   /* 基金红涨 */
.jn-delta__v.is-money-neg { color: var(--ok-text); }       /* 基金绿跌 */
.jn-delta__s { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.jn-delta.is-off { opacity: .6; }
.jn-delta.is-off .jn-delta__v { color: var(--faint); font-size: 13.5px; font-weight: 600; padding: 2px 0; }
/* 基准指标行（与 .asset-metric 同语言） */
.jn-metrics { display: grid; gap: 9px; margin-top: 14px; }
.jn-metric { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px;
  border-bottom: 1px solid var(--th-border); font-size: 13.5px; }
.jn-metric:last-child { padding-bottom: 0; border-bottom: 0; }
.jn-metric span { color: var(--muted); }
.jn-metric b { text-align: right; color: var(--text-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
/* 基准行：橙色虚线段落标识（与曲线图均值线同色，沿用资产页 #f97316） */
.jn-metric--base span { color: var(--text); font-weight: 600; }
.jn-metric--base span::before { content: ''; display: inline-block; width: 14px; border-top: 2px dashed #f97316;
  margin-right: 7px; vertical-align: 3px; }
/* 曲线图图例：数据线 + 均值基准线 */
/* clear:both 防御 h2 内 float:right 控件（select/button）高度伸出标题区，把 BFC 容器挤窄 */
.jn-chart-legend { display: flex; gap: 16px; flex-wrap: wrap; clear: both; font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.jn-chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.jn-chart-legend i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid #667eea; border-radius: 2px; }
.jn-chart-legend i.avg { border-top: 2px dashed #f97316; }
.jn-chart-legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 智能分析统一摘要骨架：基金/体重用灰壳（嵌白卡内），资产白卡内用 .jn-sm--bare 裸壳。
   骨架=标题行 + hero(核心差值大数字+语义结论芯片) + 模块可视化(双条/周期格) + 一句辅助；
   完整 hero/周期对比/基准指标仍收进「查看更多」弹窗。颜色语义跟随各模块约定（基金红涨绿跌、体重中性、资产绿好红差）。*/
.jn-sm { margin-top: 16px; background: var(--surface-2); border-radius: var(--r-md); padding: 14px 16px; }
.jn-sm--bare { background: none; border-radius: 0; padding: 0; margin-top: 12px; }
.jn-sm__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.jn-sm__title { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--text-strong); }
.jn-sm__title svg { color: var(--brand-text); flex: none; margin-right: 0 !important; }
.jn-sm__more { border: 0; background: none; padding: 2px; font-family: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--brand-text); cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.jn-sm__more:hover:not(:active) { text-decoration: underline; }
.jn-sm__acts { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* hero：核心差值大数字 + 语义结论芯片 */
.jn-sm__hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 11px; }
.jn-sm__num { font-size: 30px; font-weight: 850; letter-spacing: -.01em; line-height: 1.1;
  color: var(--text-strong); font-variant-numeric: tabular-nums; }
.jn-sm__num small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.jn-sm__num.is-up { color: var(--ok-text); }
.jn-sm__num.is-down { color: var(--danger); }
.jn-sm__num.is-flat { color: var(--muted); }
.jn-sm__num.is-money-pos { color: var(--danger); }   /* 基金红涨 */
.jn-sm__num.is-money-neg { color: var(--ok-text); }   /* 基金绿跌 */
.jn-sm__chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.jn-sm__chip--pos { background: var(--danger-bg); color: var(--danger); }
.jn-sm__chip--neg { background: var(--ok-bg); color: var(--ok-text); }
.jn-sm__chip--flat { background: var(--surface); color: var(--muted); }
.jn-sm--bare .jn-sm__chip--flat { background: var(--surface-2); }
/* 双条对比（基金/资产）：当前值 vs 基准均值，均值轨带 2px 基准刻度 */
.jn-sm__bars { display: grid; gap: 11px; margin-top: 14px; }
/* 单轨对比：两行数值标签 + 一条轨道（紫条=当前值，橙刻度=均值，越界即差距） */
.jn-sm__bars--single { gap: 4px 0; }
.jn-sm__bars--single .jn-sm-bar__track { margin-top: 4px; }
.jn-sm-bar__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; }
.jn-sm-bar__top .l { color: var(--muted); }
.jn-sm-bar__top .v { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.jn-sm-bar__track { position: relative; height: 6px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.jn-sm--bare .jn-sm-bar__track { background: var(--surface-2); }
.jn-sm-bar__track--ref { overflow: visible; }
.jn-sm-bar__fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 99px; }
.jn-sm-bar__fill--cur { background: linear-gradient(90deg, var(--brand), var(--brand-strong)); }
/* 均值刻度：以定位点居中，描一圈卡面色保证压在紫条/灰轨上都可辨 */
.jn-sm-bar__tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--warn); border-radius: 2px;
  transform: translateX(-1px); box-shadow: 0 0 0 1px var(--surface); }
/* 周期三格（体重：基数大日变小，等比双条失效，用方向格） */
.jn-sm__deltas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.jn-sm-delta { background: var(--surface); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.jn-sm--bare .jn-sm-delta { background: var(--surface-2); }
.jn-sm-delta__l { display: flex; justify-content: space-between; align-items: baseline; gap: 4px;
  font-size: 11px; color: var(--muted); }
.jn-sm-delta__d { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jn-sm-delta__v { font-size: 16px; font-weight: 800; margin-top: 2px; color: var(--text-strong);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jn-sm-delta__v .ar { color: var(--muted); font-size: 12px; margin-right: 2px; }
.jn-sm-delta.is-off { opacity: .65; }
.jn-sm-delta.is-off .jn-sm-delta__v { color: var(--faint); font-size: 12.5px; font-weight: 600; }
.jn-sm__p { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin: 11px 0 0; }
.jn-sm .jn-members { margin-top: 12px; }
@media (max-width: 640px) {
  .jn-sm { padding: 12px 13px; }
  .jn-sm__num { font-size: 26px; }
  .jn-sm__deltas { gap: 6px; }
  .jn-sm-delta { padding: 8px 9px; }
  .jn-sm-delta__v { font-size: 14px; }
}
/* 完整分析在弹窗内呈现：去掉卡片态的虚线顶边与顶部留白 */
.modal-body .jn { margin-top: 0; padding-top: 0; border-top: 0; }

/* ===== 减肥竞赛弹窗（体重页 🏆 竞赛结果 · 名次卡/单项冠军/领奖台/胖行榜）===== */
.rc-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-controls .rc-spacer { flex: 1 1 auto; }
.rc-help { width: 26px; height: 26px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--surface-2); color: var(--muted);
  border-radius: 50%; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0; }
.rc-help:hover:not(:active) { color: var(--brand-text); }
.rc-dates { display: none; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.rc-dates.show { display: inline-flex; }
.rc-dates input { width: auto; padding: 4px 6px; font-size: 12px; }
.rc-sub { font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
.rc-sub b { color: var(--text); font-weight: 600; }
.rc-avatar { border-radius: 50%; background: var(--hover-brand); color: var(--brand-text);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.rc-tag { display: inline-block; font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 6px;
  vertical-align: 1px; margin-left: 3px; background: var(--surface-3); color: var(--muted); border: 0; }
.rc-tag--friend { background: var(--hover-brand); color: var(--brand-text); border-color: transparent; }
.rc-down { color: var(--ok-text); }
.rc-up { color: var(--danger); }
.rc-flat { color: var(--muted); font-weight: 700; }
/* 我的名次：紧凑横条（未入榜灰态），不抢领奖台焦点 */
.rc-me { display: flex; align-items: center; gap: 11px; background: var(--surface-2);
  border-radius: var(--r-md); padding: 11px 13px; margin-bottom: 18px; }
.rc-me__rank { font-size: 22px; font-weight: 850; color: var(--brand-text); line-height: 1;
  font-variant-numeric: tabular-nums; flex: none; }
.rc-me__rank small { font-size: 11px; font-weight: 700; color: var(--muted); }
.rc-me__mid { flex: 1; min-width: 0; }
.rc-me__name { font-size: 13px; font-weight: 700; color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-me__bar { height: 3px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.rc-me__bar i { display: block; height: 100%; background: var(--brand-strong); border-radius: 99px; }
.rc-me__stats { display: flex; gap: 12px; flex: none; text-align: right; }
.rc-me__stats .v { font-size: 14px; font-weight: 800; color: var(--text-strong); line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.rc-me__stats .l { font-size: 10px; color: var(--muted); margin-top: 1px; }
.rc-me.is-off { opacity: .7; }
.rc-me.is-off .rc-me__rank { color: var(--faint); }
/* 分区小标题 */
.rc-sec { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 0 2px 8px; }
/* 总榜前三领奖台：CSS 渐变金属环 + 头像名次角标（替代 emoji 奖牌），冠军恒在中间且突出 */
.rc-podium { display: flex; align-items: flex-end; gap: 10px; }
.rc-pcol { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.rc-pcol__ring { position: relative; display: grid; place-items: center; border-radius: 50%; padding: 3px; }
.rc-pcol--1 .rc-pcol__ring { width: 74px; height: 74px;
  background: conic-gradient(from 210deg, #f6d47a, #d9a520, #b8860b, #f2c94c, #d9a520); }
.rc-pcol--2 .rc-pcol__ring { width: 58px; height: 58px;
  background: conic-gradient(from 210deg, #eef1f5, #c6ccd6, #9aa3b2, #e6eaf0, #c6ccd6); }
.rc-pcol--3 .rc-pcol__ring { width: 58px; height: 58px;
  background: conic-gradient(from 210deg, #e9b98d, #c08454, #9a5b27, #dd9a5f, #c08454); }
.rc-pcol__av { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: var(--hover-brand); color: var(--brand-text); font-weight: 800; font-size: 18px;
  box-shadow: inset 0 0 0 2px var(--surface); }
.rc-pcol--1 .rc-pcol__av { font-size: 24px; }
.rc-pcol__badge { position: absolute; right: -2px; bottom: -2px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff;
  border: 2px solid var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.rc-pcol--1 .rc-pcol__badge { background: linear-gradient(135deg, #e7b93b, #b8860b); }
.rc-pcol--2 .rc-pcol__badge { background: linear-gradient(135deg, #aeb6c2, #7a828f); }
.rc-pcol--3 .rc-pcol__badge { background: linear-gradient(135deg, #cf9468, #9a5b27); }
.rc-pcol__crown { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 11px solid #e7b93b; }
.rc-pcol__name { font-size: 13px; font-weight: 800; margin-top: 9px; color: var(--text-strong);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.rc-pcol--1 .rc-pcol__name { color: var(--gold); }
.rc-pcol--2 .rc-pcol__name { color: var(--silver); }
.rc-pcol--3 .rc-pcol__name { color: var(--bronze); }
.rc-pcol__delta { font-size: 12.5px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rc-pcol__days { font-size: 10px; color: var(--muted); margin-top: 1px; }
.rc-pcol__base { margin-top: 9px; width: 100%; border-radius: 10px 10px 0 0; display: grid; place-items: center;
  padding: 6px 0 5px; background: var(--silver-bg); border: 1px solid rgba(120,130,145,.30); border-bottom: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.rc-pcol__base b { font-size: 15px; font-weight: 850; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.rc-pcol__base span { font-size: 9.5px; color: var(--muted); letter-spacing: .04em; }
.rc-pcol--1 .rc-pcol__base { height: 52px; background: var(--gold-bg);
  border-color: rgba(184,134,11,.42); box-shadow: inset 0 2px 0 rgba(184,134,11,.22); }
.rc-pcol--2 .rc-pcol__base { height: 38px; }
.rc-pcol--3 .rc-pcol__base { height: 26px; background: var(--bronze-bg); border-color: rgba(154,91,39,.30); }
html[data-theme="dark"] .rc-pcol__base { box-shadow: none; border-color: rgba(255,255,255,.14); }
html[data-theme="dark"] .rc-pcol--1 .rc-pcol__base { box-shadow: inset 0 2px 0 rgba(245,197,66,.25); border-color: rgba(245,197,66,.38); }
html[data-theme="eye"] .rc-pcol--1 .rc-pcol__base { box-shadow: inset 0 2px 0 rgba(138,100,16,.20); border-color: rgba(138,100,16,.38); }
.rc-podium-note { font-size: 11px; color: var(--muted); text-align: center; margin: 10px 0 0; }
/* 单项冠军：发丝线三格（与完整榜同一语言，弱化第三层信息） */
.rc-wins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 2px 0 4px; }
.rc-win { padding: 9px 12px; min-width: 0; }
.rc-win + .rc-win { border-left: 1px solid var(--th-border); }
.rc-win__l { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rc-win__l svg { color: var(--muted); flex: none; }
.rc-win__v { font-size: 16px; font-weight: 800; color: var(--text-strong); margin: 3px 0 1px;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-win__v small { font-size: 10.5px; font-weight: 700; color: var(--muted); margin-left: 1px; }
.rc-win__n { font-size: 11.5px; font-weight: 700; color: var(--brand-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-win--off .rc-win__v { color: var(--faint); font-size: 13px; }
.rc-win--off .rc-win__n { color: var(--faint); font-weight: 600; }
/* 完整榜单：iOS 发丝线列表（与基金持仓行同语言），去胖行卡与绝对定位进度条 */
.rc-list { margin-top: 6px; }
.rc-row { position: relative; display: flex; align-items: center; gap: 11px; padding: 11px 0; }
.rc-row + .rc-row::before { content: ''; position: absolute; top: 0; left: 44px; right: 0;
  border-top: 1px solid var(--th-border); }
.rc-rank { width: 22px; flex: none; text-align: center; font-size: 13px; font-weight: 850; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.rc-rank--1 { color: var(--gold); }
.rc-rank--2 { color: var(--silver); }
.rc-rank--3 { color: var(--bronze); }
.rc-row .rc-avatar { width: 32px; height: 32px; font-size: 13px; }
.rc-row__who { flex: 1; min-width: 0; }
.rc-row__name { font-size: 13.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-row__meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.rc-row__delta { font-size: 13px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-row__score { font-size: 14px; font-weight: 850; color: var(--brand-text);
  width: 24px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.rc-row.is-me .rc-row__name { color: var(--brand-text); }
.rc-row.is-top1 { background: rgba(245, 158, 11, 0.07); border-radius: 12px; padding: 11px 10px; }
.rc-award {
  display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700; background: var(--brand-soft); color: var(--brand-text);
  margin-left: 5px; vertical-align: middle;
}
.rc-award.is-warn { background: #FEF3C7; color: #B45309; }
[data-theme="dark"] .rc-award.is-warn { background: rgba(251, 191, 36, 0.16); color: #FBBF24; }
@media (max-width: 640px) {
  .rc-me { flex-wrap: wrap; gap: 8px; }
  .rc-me__stats { width: 100%; justify-content: space-between; text-align: left; padding-left: 33px; }
  .rc-pcol--1 .rc-pcol__ring { width: 64px; height: 64px; }
  .rc-pcol--2 .rc-pcol__ring, .rc-pcol--3 .rc-pcol__ring { width: 50px; height: 50px; }
  .rc-pcol__av { font-size: 15px; }
  .rc-pcol--1 .rc-pcol__av { font-size: 20px; }
}
/* 数据不足 / 空态 / 规则页 */
.rc-note { font-size: 11.5px; color: var(--muted); line-height: 1.7; padding: 9px 12px;
  background: var(--surface-2); border-radius: var(--r-md); }
.rc-note b { color: var(--text); font-weight: 700; }
.rc-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 12px; line-height: 1.9; }
.rc-rules h3 { font-size: 14px; font-weight: 800; color: var(--text-strong); margin: 14px 0 4px; }
.rc-rules h3:first-of-type { margin-top: 12px; }
.rc-rules p, .rc-rules li { font-size: 13px; color: var(--text); line-height: 1.75; margin: 0; }
.rc-rules ul { margin: 4px 0 0; padding-left: 18px; }
.rc-rules .formula { background: var(--surface-2); border-radius: 6px; padding: 1px 7px;
  font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .jn-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .jn-members { width: 100%; }
  .jn-members button { flex: 1 1 auto; padding: 8px 10px; }
  .jn-hero__num { font-size: 28px; }
  .jn-hero__calc { flex: 1 1 100%; }
  /* 周期对比：三张卡片 → 三行（与基准指标同一语言，窄屏数字永不截断） */
  .jn-deltas { grid-template-columns: 1fr; gap: 0; margin-top: 12px; }
  .jn-delta { display: grid; grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "l v" "s v"; align-items: center; gap: 1px 12px;
    background: none; border-radius: 0; padding: 10px 0; border-bottom: 1px solid var(--th-border); }
  .jn-delta:last-child { border-bottom: 0; }
  .jn-delta__l { grid-area: l; margin-top: 0; }
  .jn-delta__v { grid-area: v; margin-top: 0; font-size: 15px; white-space: normal; text-align: right; }
  .jn-delta__s { grid-area: s; margin-top: 1px; }
  .jn-delta.is-off .jn-delta__v { font-size: 13px; }
  .jn-metric { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .todo-row, .todo-check, .todo-check::after, .todo-caret { transition: none; } }
/* 子任务长按拖拽：拖动中的节点浮起，拖动期间全局禁选中并显示抓取光标 */
/* 长按拖起: 整行"浮离"列表 —— 多层阴影(环境投影 + 品牌色晕 + 2px 光环描边, 光环用 shadow 不占布局避免位移),
   轻微放大+倾斜模拟抓在手里; .todo-row 自带 transform .18s 过渡, 加 class 瞬间有"抬起"动画 */
.todo-node.dragging { opacity: .96; }
.todo-node.dragging > .todo-row {
  background: var(--surface); cursor: grabbing; position: relative; z-index: 8;
  border-color: var(--brand-border);
  transform: scale(1.02) rotate(-.5deg);
  box-shadow: 0 14px 30px rgba(31,35,41,.18), 0 4px 12px rgba(168,85,247,.20), 0 0 0 2px rgba(168,85,247,.22);
}
body.todo-dragging { user-select: none; -webkit-user-select: none; touch-action: none; cursor: grabbing; }
@media (prefers-reduced-motion: reduce) { .todo-node.dragging > .todo-row { transform: none; } }

/* ============ 待办卡片视图 ============ */
/* 卡片网格容器：一列排列，宽屏保持单列（避免顶层任务被切碎） */
.todo-cards { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
/* 单张顶层卡片：顶部色带 + 内容区 + 底部操作 */
.todo-card {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; transition: box-shadow .18s, border-color .18s, transform .18s ease;
  cursor: default;
  --pri-band: #C9CCD6; /* 顶带色: 仅 .pri-0/1/2 用 border-top 画 3px; 无(-1)无 .pri 类, 不显色带只留 1px 边框 */
}
.todo-card.clickable { cursor: pointer; }
.todo-card.clickable:hover:not(:active) {
  box-shadow: 0 10px 24px rgba(124,58,237,.16);
  border-right-color: var(--brand-border);
  border-bottom-color: var(--brand-border);
  border-left-color: var(--brand-border);
  transform: translateY(-2px);
}
/* band 元素在卡片/手风琴均已隐藏, 色带改由 .pri-N 的 border-top 承担; 此基础规则仅占位, 正常不可见 */
.todo-card__band { height: 3px; background: #C9CCD6; margin: 0; }
/* 有优先级(低/中/高)才画 3px 顶带; 无(-1)无 .pri 类, 不画 */
/* 顶色带直接用 3px border-top：贴卡片最外缘、随 hover transform 一体（不用 ::before 错位） */
.todo-card.pri-2, .todo-card.pri-1, .todo-card.pri-0 { border-top: 3px solid var(--pri-band); }
.todo-card.pri-2 { --pri-band: #E0453E; }
.todo-card.pri-1 { --pri-band: #E5A113; }
.todo-card.pri-0 { --pri-band: #C9CCD6; }
/* 卡片内独立 band 隐藏: 色带已由上方 inset 内阴影承担。
   手风琴 .todo-bandcard 的 band 父元素不同, 不被此规则命中, 仍照常显示 */
.todo-card .todo-card__band { display: none; }
.todo-card.is-done { opacity: .78; background: var(--surface-done); }
.todo-card__body { padding: 12px 14px 9px; }
.todo-card__head { display: flex; align-items: flex-start; gap: 11px; }
.todo-card__title {
  flex: 1; min-width: 0; font-size: 16px; font-weight: 700; color: var(--text);
  line-height: 1.42; word-break: break-word;
}
.todo-card.is-done .todo-card__title { color: var(--faint); text-decoration: line-through; }
.todo-card__check {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--check-ring); background: var(--surface); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: border-color .18s, background .18s;
}
.todo-card__check::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
}
.todo-card__check:hover:not(:active) { border-color: var(--brand-text); }
.todo-card__check.done { background: linear-gradient(135deg, #52c41a, #34b34a); border-color: #34b34a; }
.todo-card__check::after { content: '✓'; color: #fff; font-size: 14px; font-weight: 700; opacity: 0; transform: scale(.4); transition: .18s; }
.todo-card__check.done::after { opacity: 1; transform: scale(1); }
.todo-card__meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 6px; align-items: center; }
.todo-metatxt { font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
/* 分类胶囊（方案A）：透明底 + 细描边 + 柔和灰字，弱于日期 chip、不抢任务焦点；深浅背景适配 */
.todo-cat-chip {
  padding: 1px 10px; border-radius: 99px; border: 1px solid var(--cat-chip-line, rgba(30,40,60,.18));
  color: var(--cat-chip-fg, #7a808c);
}
[data-theme="dark"] .todo-cat-chip {
  --cat-chip-line: rgba(255,255,255,.22);
  --cat-chip-fg: rgba(255,255,255,.62);
}
.todo-card__note { margin-top: 6px; font-size: 13px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 底部操作条：入口位置保持不变, 视觉收紧到 42px 高, 图标钮 36px 触控 */
.todo-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px 5px 6px; background: var(--surface-done); border-top: 1px solid var(--border);
}
.todo-card__ops { display: flex; gap: 1px; }
.todo-card__ops .todo-op { font-size: 16px; padding: 0; width: 38px; height: 36px; }
.todo-card__ops .todo-op svg { width: 18px; height: 18px; }
.todo-card__enter { color: var(--brand-text); font-size: 13px; font-weight: 700; user-select: none; padding: 7px 8px; border-radius: 9px; }
.todo-card__count { background: var(--hover-brand); color: var(--brand-text); font-weight: 600; }
.todo-card__count.done { background: var(--ok-bg); color: var(--ok-text); }

/* ===== 手机：卡片第二行右侧低调小图标 + 行右滑操作 ===== */
.todo-card__quick-spacer, .todo-card__quick { display: none; }
/* acts 默认不可见：滑动中/打开时才显示（不依赖 main 是否有底色） */
.todo-swipe__acts { display: none; }
@media (max-width: 640px) {
  /* 间距对齐速览视图（8px） */
  .todo-cards { gap: 8px; }
  .todo-bandcard { margin-bottom: 8px; }
  /* 第三行操作条移除（PC 不变） */
  .todo-card__foot { display: none; }
  /* ＋ / 👁 固定卡片右缘：无底色灰图标，按下才显色 */
  /* 无 chip 时 +/眼睛挂在标题行(.head)，给 head 定位上下文让按钮垂直居中 */
  .todo-card__head { position: relative; }
  /* 第二行：chips 内层横滑；meta 本身不滚，+ /眼睛作为常规流固定在右缘、所有卡片对齐 */
  .todo-card__meta { flex-wrap: nowrap; align-items: center; }
  .todo-card__meta-scroll {
    flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; gap: 5px 10px;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  }
  .todo-card__meta-scroll::-webkit-scrollbar { display: none; }
  .todo-card__meta-scroll > * { flex: 0 0 auto; white-space: nowrap; }
  .todo-card__quick-spacer { display: none; }
  .todo-card__quick {
    flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
    background: var(--surface); color: var(--faint); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; margin-left: 2px;
  }
  .todo-card__quick svg { width: 17px; height: 17px; pointer-events: none; }
  .todo-card__quick:active { background: var(--hover-bg); color: var(--brand-text); }
  /* 行右滑容器：acts 固定在右侧底层灰底，圆形彩钮；main 原内容平移 */
  .todo-swipe { position: relative; }
  .todo-swipe__acts {
    position: absolute; right: 0; top: 0; bottom: 0; z-index: 0;
    visibility: hidden;
    display: flex; align-items: center; gap: 10px; padding: 0 12px;
    background: var(--surface-2);
  }
  .todo-swipe.swiping .todo-swipe__acts,
  .todo-swipe.is-open .todo-swipe__acts { visibility: visible; }
  .todo-swipe__btn {
    flex: none; width: 54px; padding: 0; border: 0; background: none; color: var(--brand-text);
    cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  }
  .todo-swipe__btn__c {
    flex: none; width: 52px; height: 52px; border-radius: 50%;
    background: var(--brand-strong); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .todo-swipe__btn__c svg { width: 20px; height: 20px; pointer-events: none; }
  .todo-swipe__btn__t { font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; }
  .todo-swipe__btn.danger { color: #e5484d; }
  .todo-swipe__btn.danger .todo-swipe__btn__c { background: #e5484d; }
  .todo-swipe__main {
    position: relative; z-index: 1; min-width: 0;
    /* pan-y：水平手势交给 JS，浏览器不接管（防误触发下拉刷新）；垂直滚动正常 */
    touch-action: pan-y;
    transition: transform .24s cubic-bezier(.25,.8,.3,1);
  }
  .todo-swipe__main.no-anim { transition: none; }
  .todo-swipe.is-open { z-index: 60; }
}

/* 内联子任务添加行: 卡片视图挂在卡片下方; 完整树视图挂在该行下方 */
.todo-inline-add {
  background: var(--surface); border: 1px solid var(--brand-border); border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 4px 16px rgba(168,85,247,.08);
  animation: todoInlineAddIn .18s ease-out;
}
@keyframes todoInlineAddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* textarea 自身 min-height 由 JS autoGrowTextarea 控制(默认 44px), 这里不设 min-height 避免重复叠加 */
.todo-inline-add__title, .todo-inline-add__note {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 14px; font-family: inherit; resize: vertical;
  line-height: 1.5;
}
.todo-inline-add__title { font-weight: 600; }
.todo-inline-add__title:focus, .todo-inline-add__note:focus { outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 2px rgba(168,85,247,.12); }
.todo-inline-add__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.todo-inline-add__actions .btn.sm { padding: 6px 16px; min-height: 34px; }
.todo-inline-add__hint { font-size: 12px; margin-left: auto; }

/* 详情页底部常驻"+ 添加子任务"行(MS To Do 风格): 折叠时是占位按钮, 展开时是内联输入 */
/* 详情页底部常驻"+ 添加子任务"占位行: 点击就地展开为紫边小卡片(在内容流中, 非悬浮) */
.todo-detail-adder { margin-top: 8px; }
.todo-detail-adder__placeholder {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 12px 14px; background: transparent;
  color: var(--brand-text);
  border: 1px dashed var(--brand-border); border-radius: 8px; cursor: pointer;
  font-size: 14px; text-align: left; transition: background .18s, border-color .18s;
  min-height: 44px;
}
/* 该占位始终在不透明白卡内部，用品牌紫色，不跟随直接落背景的 --onbg（否则深色实色下变白隐形） */
.todo-detail-adder__placeholder:hover:not(:active) {
  background: rgba(168,85,247,.08);
  border-color: var(--brand-text);
}
/* 全屏内 #todoTree 是透明容器：其中所有「添加子任务」占位（详情根级 + 各节点级，PC 节点级也显示）
   都直接落在全屏背景上，统一跟随 --onbg（深实色变白/浅实色变深/无背景回退品牌紫）。
   modal 任务详情的占位在 .modal-mask 白卡内、不在 #todoTree，保持品牌紫不受影响。 */
body.todo-fs-on #todoTree .todo-detail-adder__placeholder {
  color: var(--onbg, var(--brand-text));
  border-color: var(--onbg-soft, var(--brand-border));
}
body.todo-fs-on #todoTree .todo-detail-adder__placeholder:hover:not(:active) {
  background: var(--onbg-hover, rgba(168,85,247,.08));
  border-color: var(--onbg, var(--brand-text));
}
/* 例外: 完整树/手风琴/速览的顶层节点是不透明白卡(.todo-bandcard), 挂在卡内的节点级 adder
   不跟随 --onbg(深实色背景下白字落白底会隐形), 一律用品牌紫; 根级(直接落全屏背景)仍走上一条规则 */
body.todo-fs-on #todoTree .todo-bandcard .todo-detail-adder__placeholder {
  color: var(--brand-text);
  border-color: var(--brand-border);
}
body.todo-fs-on #todoTree .todo-bandcard .todo-detail-adder__placeholder:hover:not(:active) {
  background: rgba(168,85,247,.08);
  border-color: var(--brand-text);
}
.todo-detail-adder__plus { font-weight: 700; font-size: 18px; line-height: 1; }
.todo-detail-adder.editing .todo-detail-adder__placeholder { display: none; }
.todo-detail-adder__editor { display: none; }
.todo-detail-adder.editing .todo-detail-adder__editor {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--brand); border-radius: 8px;
  padding: 10px 12px; box-shadow: 0 4px 16px rgba(168,85,247,.08);
  animation: todoInlineAddIn .18s ease-out;
}
/* "添加到：xxx"面包屑: 行内卡片(.todo-inline-add)与主任务底部卡片(.todo-detail-adder)共用 */
.todo-add-crumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  font-size: 12.5px; color: var(--muted-2);
}
.todo-add-crumb > span { flex-shrink: 0; white-space: nowrap; }
.todo-add-crumb b { color: var(--brand-text); font-weight: 600; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-add-crumb__reset {
  margin-left: auto; flex: 0 0 auto; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted-2);
  border-radius: 999px; font-size: 12px; padding: 1px 10px; line-height: 1.7;
  display: inline-flex; align-items: center; gap: 4px;
}
.todo-add-crumb__reset-x { flex-shrink: 0; }
.todo-add-crumb__reset-text { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
/* 标题过长: JS 检测溢出后加 is-compact, 按钮文字整体隐藏只留 ✕(避免出现半截文字) */
.todo-add-crumb.is-compact .todo-add-crumb__reset-text { display: none; }
.todo-add-crumb__reset:hover:not(:active) { border-color: var(--brand-text); color: var(--brand-text); }
.todo-detail-adder__title, .todo-detail-adder__note {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 14px; font-family: inherit; resize: vertical;
  line-height: 1.5;
}
.todo-detail-adder__title { font-weight: 600; }
.todo-detail-adder__title:focus, .todo-detail-adder__note:focus {
  outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 2px rgba(168,85,247,.12);
}
.todo-detail-adder__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.todo-detail-adder__row .btn.sm { padding: 6px 16px; min-height: 34px; }
.todo-detail-adder__hint { font-size: 12px; margin-left: auto; }
/* 完整树视图: 缩进在 .todo-row 的 margin-left 上、.todo-children 容器本身不缩进,
   挂在其内的添加框需补同级子行的缩进, 否则卡片向左突出(手风琴 .todo-acc__kids 自带 padding 无此问题);
   叶子首次添加动态挂到 wrap, 与叶子行对齐。排除手风琴/速览/根 bandcard(各自已有缩进规则) */
.todo-children > .todo-detail-adder { margin-left: calc((var(--depth, 0) + 1) * 26px); }
.todo-node:not(.todo-acc):not(.flat-group):not(.todo-bandcard) > .todo-detail-adder { margin-left: calc(var(--depth, 0) * 26px); }

/* 手机窄屏(≤640px): 按钮撑满一行更易点; 提示文单独一行不挤按钮 */
@media (max-width: 640px) {
  .todo-inline-add__actions,
  .todo-detail-adder__row {
    gap: 6px;
  }
  .todo-inline-add__actions .btn.sm,
  .todo-detail-adder__row .btn.sm {
    flex: 1 1 40%; padding: 10px 12px; min-height: 40px; font-size: 14px;
  }
  .todo-inline-add__hint,
  .todo-detail-adder__hint {
    flex: 1 0 100%; margin-left: 0; text-align: center; order: 99;
  }
}

/* ============ 面包屑（子任务详情页顶栏） ============ */
.todo-crumb {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 12px;
  padding: 8px 12px; background: var(--surface-2); border-radius: 8px;
}
/* 面包屑左色带: 随主任务代表优先级(todoRootPri), 无优先级不显示; 配色同卡片顶带 */
.todo-crumb.pri-2, .todo-crumb.pri-1, .todo-crumb.pri-0 { border-left: 4px solid var(--pri-band); }
.todo-crumb.pri-2 { --pri-band: #E0453E; }
.todo-crumb.pri-1 { --pri-band: #E5A113; }
.todo-crumb.pri-0 { --pri-band: #C9CCD6; }
/* 详情·各自截止: 有自身截止日期的子任务才在本行挂左色带(自身优先级), 配色同卡片顶带 */
.todo-row--priband.pri-2, .todo-row--priband.pri-1, .todo-row--priband.pri-0 { border-left: 3px solid var(--pri-band); }
.todo-row--priband.pri-2 { --pri-band: #E0453E; }
.todo-row--priband.pri-1 { --pri-band: #E5A113; }
.todo-row--priband.pri-0 { --pri-band: #C9CCD6; }
.todo-crumb__back {
  border: 1px solid var(--border); background: var(--surface); color: var(--brand-text); cursor: pointer;
  padding: 5px 12px; border-radius: 999px; font-size: 13px;
}
.todo-crumb__back:hover:not(:active) { background: var(--hover-brand); }
.todo-crumb__title { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 按钮 busy 状态（点击后立即禁用防重） ============ */
/* opacity + wait 光标; 文字由 JS 换成"处理中…" 已足够明显, 不再叠加 ::after */
button[data-busy] { opacity: .55; cursor: wait; pointer-events: none; }

/* ============ 待办全屏模式（三态循环：default → 卡片全屏 → 完整树全屏） ============ */
/* 全屏容器：默认 display:none, 由 JS 根据 _todoView 决定显隐 */
.todo-fullscreen {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  flex-direction: row;
}
/* body 加 todo-fs-on 时：隐藏 topbar 与页面所有 .card, 显示全屏容器 */
body.todo-fs-on { overflow: hidden; }
body.todo-fs-on .app-side,
body.todo-fs-on .impersonate-banner { display: none !important; }
body.todo-fs-on .container > .card { display: none !important; }
body.todo-fs-on .todo-fullscreen { display: flex; }

/* ============ 全屏首屏 loading（结构见 pages.js TODO_FS_LOADING_HTML） ============
   boot 纸飞机环: HTML 直出即自启动(200ms CSS 延迟淡入, 快请求在淡入前被 is-done 摘除→无感);
   冷启动期间 body.todo-fs-boot 隐藏全局遮罩, 由全屏内动画承接。
   状态切换: is-skel=卡片骨架 / is-fail=失败态 / is-done=终态隐藏（assets.js todoFsBoot*）。 */
body.todo-fs-boot #globalLoading { display: none !important; }
.todo-fs-main { position: relative; }
.todo-fs-main {
  --fs-ring-from: #7C5CFF; --fs-ring-to: #FF7A59;
  --fs-ring-dot: #FF7A59; --fs-dot-glow: rgba(255,122,89,.55);
  --fs-plane-fill: #fff; --fs-plane-stroke: #7C5CFF;
  --fs-bar-track: rgba(124,92,255,.16);
}
[data-theme="dark"] .todo-fs-main {
  --fs-ring-from: #b18cff; --fs-ring-to: #ff9f85;
  --fs-ring-dot: #ff8a6b; --fs-dot-glow: rgba(255,138,107,.45);
  --fs-plane-fill: #22242e; --fs-plane-stroke: #e9e4ff;
  --fs-bar-track: rgba(255,255,255,.14);
}
/* 深实色背景: 环转白、晨光点转暖白; 白机配深色半透描边(压在白环上时仍可分)。
   mint/sky 是浅实色, 沿用默认品牌紫环。 */
html[data-bg="solid-indigo"] body.todo-fs-on .todo-fs-main,
html[data-bg="solid-steel"] body.todo-fs-on .todo-fs-main,
html[data-bg="solid-teal"] body.todo-fs-on .todo-fs-main,
html[data-bg="solid-green"] body.todo-fs-on .todo-fs-main,
html[data-bg="solid-brown"] body.todo-fs-on .todo-fs-main,
html[data-bg="solid-rose"] body.todo-fs-on .todo-fs-main,
html[data-bg="solid-purple"] body.todo-fs-on .todo-fs-main,
html[data-bg="solid-slate"] body.todo-fs-on .todo-fs-main {
  --fs-ring-from: #fff; --fs-ring-to: rgba(255,255,255,.45);
  --fs-ring-dot: #ffd2c2; --fs-dot-glow: rgba(255,190,160,.7);
  --fs-plane-fill: #fff; --fs-plane-stroke: rgba(30,20,60,.28);
  --fs-bar-track: rgba(255,255,255,.28);
}
/* loading 层: 盖在 fs-top 以下的主区; #todoTree 由 applyTodoView append 在后, z-index 保证 loading 在上 */
.todo-fs-loading { position: absolute; z-index: 6; left: 0; right: 0; top: 62px; bottom: 0; padding: 0 16px; }
.todo-fs-loading.is-done { display: none; }
.fs-load-boot, .fs-load-skel, .fs-load-fail { display: none; }
/* boot 纸飞机环: 居中, 200ms 后才淡入（快请求无感）, SMIL 飞行由 SVG 自驱动 */
.todo-fs-loading .fs-load-boot {
  display: flex; position: absolute; inset: 0; flex-direction: column;
  align-items: center; justify-content: center; padding-bottom: 12vh;
  opacity: 0; animation: fsBootIn .18s ease-out .2s forwards;
}
@keyframes fsBootIn { to { opacity: 1; } }
.fs-orbit-dot { filter: drop-shadow(0 0 6px var(--fs-dot-glow)); }
.fs-boot-text { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--onbg, var(--muted)); }
/* 慢网(≥3s)兜底进度条: 纯 CSS 延时, is-done 时随层一起消失 */
.fs-boot-bar {
  width: 132px; height: 3px; margin-top: 16px; border-radius: 2px; overflow: hidden;
  background: var(--fs-bar-track); opacity: 0; animation: fsBarShow .2s ease 3s forwards;
}
.fs-boot-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #FF7A59, #A855F7, #3B82F6); border-radius: 2px;
  animation: fsBarCrawl 2.6s cubic-bezier(.25,.7,.35,1) 3s forwards;
}
@keyframes fsBarShow { to { opacity: 1; } }
@keyframes fsBarCrawl { 0% { width: 0; } 70% { width: 72%; } 100% { width: 90%; } }
/* skel 卡片骨架: 同卡宽同圆角的低承诺预告, 品牌紫微光斜扫 */
.todo-fs-loading.is-skel .fs-load-skel { display: block; opacity: 1; }
.fs-load-skel { opacity: 0; transition: opacity .18s ease-out; }
.todo-fs-loading.is-skel .fs-load-boot,
.todo-fs-loading.is-fail .fs-load-boot,
.todo-fs-loading.is-fail .fs-load-skel { display: none; }
.fs-skel-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px; margin-bottom: 10px; position: relative; overflow: hidden;
  box-shadow: 0 1px 3px rgba(20,16,50,.06);
}
.fs-skel-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 38%, rgba(124,92,255,.09) 50%, transparent 62%);
  transform: translateX(-100%); animation: fsSkelSweep 1.7s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes fsSkelSweep { 0% { transform: translateX(-100%); } 55%,100% { transform: translateX(100%); } }
.fs-skel-line { height: 11px; border-radius: 6px; background: var(--surface-2); }
.fs-skel-line + .fs-skel-line { margin-top: 11px; }
.fs-skel-line.w40 { width: 40%; } .fs-skel-line.w60 { width: 60%; } .fs-skel-line.w90 { width: 90%; }
.fs-skel-chips { display: flex; gap: 6px; margin-top: 13px; }
.fs-skel-chips span { height: 22px; width: 72px; border-radius: 8px; background: var(--surface-2); }
.fs-skel-chips span:last-child { width: 88px; }
/* fail 失败态 */
.todo-fs-loading.is-fail .fs-load-fail {
  display: flex; position: absolute; inset: 0; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}
.fs-fail-msg { color: var(--muted); font-size: 14px; text-align: center; padding: 0 24px; }
/* 列表首帧错峰落位: 仅前 6 个直接子节点, 由 todoFsBootFinish 挂类一次 */
#todoTree.fs-boot-in > *:nth-child(-n+6) { animation: fsCardIn .34s cubic-bezier(.16,1,.3,1) both; }
#todoTree.fs-boot-in > *:nth-child(2) { animation-delay: 55ms; }
#todoTree.fs-boot-in > *:nth-child(3) { animation-delay: 110ms; }
#todoTree.fs-boot-in > *:nth-child(4) { animation-delay: 165ms; }
#todoTree.fs-boot-in > *:nth-child(5) { animation-delay: 220ms; }
#todoTree.fs-boot-in > *:nth-child(6) { animation-delay: 275ms; }
@keyframes fsCardIn { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* 普通文档流页面(登录/系统设置/体重/资产公开填写等非弹窗表单): 键盘弹起时底部预留键盘高度,
   短表单也能把输入框滚到键盘上方。弹窗(.modal-mask 由 JS 几何对齐)与待办全屏(.todo-fs-main
   自身 padding)另有避让; 弹窗打开时 body.no-scroll 为 position:fixed, 此项不影响弹窗布局。
   PC/无键盘时 --kb-inset 为 0, 无副作用。 */
body { padding-bottom: var(--kb-inset, 0px); }
/* 主区域：右侧填满 */
/* touch-action: pan-y 显式放行纵向触摸滚动: 弹窗打开期间 body.no-scroll 生效,
   祖先 touch-action 会连带禁用后代滚动容器的手势, 这里显式声明保证卡片/树列表始终可上下滑动 */
.todo-fs-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  /* 底部 padding 随软键盘高度(--kb-inset, JS 据 visualViewport 写入)增大, 内联添加框不被键盘盖住 */
  padding: 12px 16px calc(16px + var(--kb-inset, 0px));
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
/* 主区域顶部一行：抽屉按钮 + 标题 + 视图切换按钮 */
/* transition + 背景色: 为手机端 sticky 时的过渡隐藏做铺垫; PC 无影响 */
/* 手风琴/速览主区不铺底、不磨砂（透明）：与卡片/完整树/时间轴一致，卡片间隙露出统一全屏背景。
   内容都在不透明卡片内（手风琴 .todo-bandcard、速览 .tl-card-list 独立卡），无需主区白面/磨砂。 */
.todo-fs-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
  transition: transform .22s ease, opacity .22s ease;
}
/* 选背景时顶栏仍为不透明柔和白（不做半透磨砂），无背景同样 */
.todo-fs-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
/* 全屏顶栏一行: 目录 / 视图切换 / 隐藏已完成 / 退出（公开页在目录后多一个 ＋ 图标钮） */
.todo-fs-hide { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--label); font-weight: normal; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.todo-fs-hide input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--brand-text); }
.fs-iconbtn {
  width: 38px; height: 38px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--label);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.fs-iconbtn svg { width: 18px; height: 18px; }
/* 视图切换：带文字的图标按钮，底色/边框/圆角与分类/添加钮同款；
   当前视图图标 + 当前视图名，点击在循环内前进一步 */
.fs-segbtn {
  height: 38px; padding: 0 12px; flex: 1; min-width: 0;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--label);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; gap: 5px;
}
/* hover 反馈仅真实鼠标设备：触摸点击后 :hover 会粘住、灰背景残留 */
@media (hover: hover) {
  .fs-segbtn:hover:not(:active) { background: var(--hover-bg); border-color: var(--border-strong); }
}
.fs-segbtn svg { width: 18px; height: 18px; flex: none; }
.fs-segbtn-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fs-exitbtn {
  height: 36px; padding: 0 12px; flex-shrink: 0;
  border: 1px solid var(--danger); border-radius: 10px;
  background: var(--surface); color: var(--danger);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.fs-exitbtn:hover:not(:active) { background: var(--danger-bg); }

/* 手机端详情→清单：详情卡片右滑退出、清单自左滑入（PC 无动画，瞬时切换） */
@keyframes todoExitRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(28%); opacity: .15; }
}
@keyframes todoEnterFromLeft {
  from { transform: translateX(-12%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@media (max-width: 640px) {
  .todo-view-exit { animation: todoExitRight .24s ease forwards; }
  .todo-view-enter { animation: todoEnterFromLeft .26s ease; }
}

/* 清单→详情转场：先播一帧旧列表退出再同步重建、重建完详情进入，消除点击整卡后"无反馈卡顿"。
   PC 轻淡入淡出；手机带方向滑动，与详情→清单的返回动画(todoExitRight/todoEnterFromLeft)对称。 */
@keyframes todoPushOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-12%); opacity: .2; }
}
@keyframes todoPushIn {
  from { transform: translateX(16%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes todoDetailFadeOut {
  from { opacity: 1; }
  to { opacity: .35; }
}
@keyframes todoDetailFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.todo-detail-push-out { animation: todoDetailFadeOut .14s ease forwards; }
.todo-detail-push-in { animation: todoDetailFadeIn .18s ease; }
@media (max-width: 640px) {
  .todo-detail-push-out { animation: todoPushOut .2s ease forwards; }
  .todo-detail-push-in { animation: todoPushIn .24s ease; }
}

/* ============ 滴答风格待办新建 sheet ============ */
.tform { font-size: 14px; color: var(--text); }
.tform-title {
  width: 100%; resize: none;
  font-size: 15px; font-weight: 400; line-height: 1.5;
  margin-bottom: 5px; /* 覆盖全局 textarea margin-bottom:12px；padding/border/background 走全局普通输入框 */
}
.tform-title::placeholder { color: var(--faint, var(--muted)); font-weight: 400; }
.tform-desc {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--label); font-size: 15px; font-family: inherit; padding: 1px 0; cursor: pointer;
}
/* 展开/已填备注：同为深灰，加粗提示有内容，与任务正文（--text）明确区分 */
.tform-desc.is-on, .tform-desc.has { color: var(--label); font-weight: 600; }
.tform-descwrap { margin-bottom: 4px; }
.tform-descwrap textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; resize: vertical; min-height: 72px; font-family: inherit; font-size: 14px; line-height: 1.6;
  margin-bottom: 0; /* 覆盖全局 textarea margin-bottom:12px */
  color: var(--label); /* 备注文字灰色，焦点态也保持，与任务正文区分 */
}
.tform-descwrap textarea::placeholder { color: var(--muted); }
/* 值载体原生控件：视觉隐藏但仍可被 JS 赋值/触发 */
.tform-native {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
  overflow: hidden; clip: rect(0 0 0 0);
}
/* 底部栏外壳：通宽 hairline 分隔；保存钮固定在壳右侧，不随图标滑动 */
.tform-barwrap {
  display: flex; align-items: center; gap: 9px;
  margin: 5px -16px 0; padding: 5px 16px 2px;
  border-top: 1px solid var(--border);
}
/* 图标滚动区：占满左侧、横向滑动、无滚动条；PC 鼠标按住拖拽（grab 光标，按钮自身仍 pointer） */
.tform-bar {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none; cursor: grab;
}
.tform-bar.dragging { cursor: grabbing; user-select: none; }
.tform-bar::-webkit-scrollbar { display: none; }
.tf-ic {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 8px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted-2, var(--muted));
  font-family: inherit; cursor: pointer;
}
.tf-ic svg { width: 20px; height: 20px; }
.tf-ic__t { font-size: 13px; white-space: nowrap; }
.tf-ic.is-on { color: var(--brand-text); background: var(--hover-brand); }
.tf-ic.is-disabled { opacity: .3; pointer-events: none; }
/* 闹钟清除小叉：仅设置闹钟后出现 */
.tf-alarm-x {
  flex: 0 0 auto; display: none; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface-2);
  color: var(--muted); font-size: 10px; line-height: 1;
  align-items: center; justify-content: center; cursor: pointer;
}
.tf-alarm-x.show { display: inline-flex; }
.tf-alarm-x:active { color: var(--danger); background: var(--hover-brand); }
/* 各自截止：勾选框形式（真 checkbox 隐藏在 label 内，box 为视觉载体） */
.tf-cd {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 10px 0 8px; border-radius: 9px;
  color: var(--muted-2, var(--muted)); cursor: pointer;
}
.tf-cd__box {
  width: 21px; height: 21px; border: 1.8px solid currentColor; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.tf-cd__box svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.tf-cd.is-on { color: var(--brand-text); background: var(--hover-brand); }
.tf-cd.is-on .tf-cd__box { background: var(--brand); border-color: var(--brand-text); }
.tf-cd.is-on .tf-cd__box svg { opacity: 1; }
.tf-cd__t { font-size: 13px; white-space: nowrap; }
/* 图标设置条：横向滑动 chips，负 margin 通宽 */
.tf-strip {
  display: none; align-items: center; gap: 8px; overflow-x: auto;
  margin: 10px -16px 0; padding: 0 16px 2px; scrollbar-width: none; cursor: grab;
}
.tf-strip.dragging { cursor: grabbing; user-select: none; }
.tf-strip.show { display: flex; }
.tf-strip::-webkit-scrollbar { display: none; }
.tf-strip-label { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.tf-strip-sep { flex: 0 0 auto; width: 1px; height: 18px; background: var(--border); margin: 0 3px; }
.tf-chip2 {
  flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-family: inherit; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.tf-chip2.is-on { border-color: var(--brand-text); color: var(--brand-text); background: var(--hover-brand); }
/* 重复自定义：搬到 strip 末尾内联显示，不再独占整行 */
#tfRecurCustomRow { flex: 0 0 auto; display: none; }
#tfRecurCustomRow.show { display: inline-flex; }
/* 分类 chips：宽度随内容，由父 strip 统一横滑（不嵌套滚动） */
#tfCatChips { display: inline-flex; gap: 8px; flex: 0 0 auto; }
/* 新建分类：原地输入 chip */
.tf-catnew { display: none; align-items: center; gap: 6px; flex: 0 0 auto; }
.tf-catnew.show { display: inline-flex; }
.tf-catnew input {
  width: 12ch; min-width: 12ch; border: 1px solid var(--brand); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; outline: none; font-family: inherit;
  height: auto; box-sizing: border-box; margin: 0;
}
/* 新建分类输入框旁的圆形 ＋ 确认钮（与回车等效） */
.tf-catnew-ok {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 999px;
  border: 0; padding: 0; margin: 0;
  background: var(--brand-strong); color: #fff; font-size: 17px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tf-catnew-ok:active { transform: scale(.92); }
/* 优先级 chip 内颜色点（i 默认 inline 不生效尺寸，须 inline-block） */
.tf-chip2 .todo-priority-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: -1px; flex: none;
}
/* 新建按钮/输入框同位切换容器（须垂直居中，否则输入框与按钮错位上移） */
.tf-catswitch { flex: 0 0 auto; display: inline-flex; align-items: center; }
/* 勾选各自截止：日期与闹钟图标隐藏，后续图标自动补位 */
.tform.cd-on .tf-dueitem { display: none; }
/* 保存钮：文字按钮，品牌填充，固定在底部栏外壳最右（不随图标滚动） */
.tf-save {
  flex: 0 0 auto;
  height: 34px; padding: 0 18px;
  border: 0; border-radius: 9px;
  background: var(--brand-strong); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tf-save:active { transform: scale(.96); }
/* ============ 日期选择器（独立浮层，叠在弹窗之上：手机底部 sheet / PC 居中） ============ */
.tdp-mask {
  position: fixed; inset: 0; z-index: 10030;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; padding: 40px 16px;
  animation: tdpFade .18s ease;
}
.tdp-box {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 320px;
  box-shadow: 0 12px 44px rgba(0,0,0,.24); overflow: hidden;
  animation: tdpIn .2s ease;
}
.tdp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 600; color: var(--text);
}
.tdp-x {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--muted); font-size: 22px; line-height: 1; font-family: inherit;
}
.tdp-body { padding: 12px 14px 14px; }
@keyframes tdpFade { from { opacity: 0; } }
@keyframes tdpIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.tdp-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 0 10px; }
.tdp-nav__btn {
  flex: none; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-size: 17px; line-height: 1; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.tdp-nav__btn:hover:not(:active) { background: var(--hover-brand); }
.tdp-nav__title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text); min-width: 0; }
.tdp-today-now {
  flex: none; border: 1px solid var(--brand); border-radius: 999px; padding: 2px 9px;
  background: var(--surface); color: var(--brand-text);
  font-size: 12px; line-height: 1.4; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.tdp-today-now:hover:not(:active) { background: var(--hover-brand); }
.tdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tdp-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0 6px; }
/* 标题年/月：可点切换到对应选择视图 */
.tdp-nav__pick {
  border: none; background: none; padding: 2px 7px; margin: 0; border-radius: 8px;
  color: inherit; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.4; cursor: pointer;
}
.tdp-nav__pick:hover:not(:active) { background: var(--hover-brand); color: var(--brand-text); }
/* 月/年选择：4 列宽格，不沿用圆形日格 */
.tdp-mgrid, .tdp-ygrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tdp-mgrid .tdp-cell, .tdp-ygrid .tdp-cell {
  aspect-ratio: 1.9; border-radius: 10px; font-size: 13.5px;
}
.tdp-cell {
  aspect-ratio: 1; width: 100%; padding: 0;
  border: none; border-radius: 50%; background: transparent;
  color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tdp-cell:hover:not(:active) { background: var(--hover-brand); }
.tdp-cell.is-out { color: var(--muted); opacity: .4; }
.tdp-cell.is-today { color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand); }
.tdp-cell.is-today:hover:not(:active) { background: var(--hover-brand); }
.tdp-cell.is-sel { background: var(--brand-strong); color: #fff; }
.tdp-cell.is-sel.is-today { color: #fff; box-shadow: none; }
.tdp-cell.is-sel:hover:not(:active) { background: var(--brand-strong); filter: brightness(1.08); }
.tdp-foot { display: flex; gap: 8px; padding: 12px 0 2px; }
.tdp-quick {
  flex: 1; min-width: 0; padding: 8px 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 13.5px; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.tdp-quick:hover:not(:active) { border-color: var(--brand-text); color: var(--brand-text); }
@media (max-width: 767px) {
  .tdp-mask { align-items: flex-end; padding: 0; animation: tdpFade .28s ease; }
  .tdp-box { max-width: 100%; border-radius: 18px 18px 0 0; animation: tdpSheetUp .34s cubic-bezier(.16,1,.3,1); }
  .tdp-mask.tdp-closing { animation: tdpFadeOut .26s ease; }
  .tdp-mask.tdp-closing .tdp-box { animation: tdpSheetOut .26s cubic-bezier(.4,0,1,1); }
  .tdp-body { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
}
@keyframes tdpSheetUp { from { transform: translateY(100%); } }
@keyframes tdpSheetOut { to { transform: translateY(100%); } }
@keyframes tdpFadeOut { to { opacity: 0; } }
@media (min-width: 641px) {
  /* PC 居中弹窗 body padding 20px：负 margin 归零，分隔线不溢出卡片 */
  .tform-barwrap { margin: 8px 0 0; }
  .tf-strip { margin: 10px 0 0; padding: 0 0 2px; }
}
/* ============ 编辑弹窗折叠区（三角两态常驻，展开不消失） ============ */
.tfedit-more { border-top: 1px solid var(--border); margin-top: 12px; }
.tfedit-more > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 2px; color: var(--muted); font-size: 13.5px;
}
.tfedit-more > summary::-webkit-details-marker { display: none; }
.tfedit-more__caret { display: inline-flex; color: var(--muted); transition: transform .2s ease; }
.tfedit-more__caret svg { width: 15px; height: 15px; }
.tfedit-more[open] .tfedit-more__caret { transform: rotate(90deg); }
.tfedit-more__body { padding-bottom: 8px; }
.tfedit-more__body > label, .tfedit-more__body .todo-priority { margin-bottom: 10px; }
/* 折叠区优先级/分类/归属块包裹后（备忘录隐藏用），间距改挂在包裹层上 */
.tfedit-more__body .tfedit-pri, .tfedit-more__body .tfedit-cat,
.tfedit-more__body .tfedit-parent { margin-bottom: 10px; }
.tfedit-more__body .tfedit-pri .todo-priority { margin-bottom: 0; }
.tfedit-pri > label, .tfedit-cat > label, .tfedit-parent > label { display: block; margin-bottom: 6px; }
/* 归属级联折叠框：每层一张可折叠卡片，summary 即面包屑，点开逐层选择 */
#tfParentCascade { display: flex; flex-direction: column; gap: 6px; }
.tf-cas-lvl { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.tf-cas-lvl__sum {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; font-size: 13.5px;
}
.tf-cas-lvl__sum::-webkit-details-marker { display: none; }
.tf-cas-lvl__t { flex: none; color: var(--muted); }
.tf-cas-lvl__v {
  flex: 1; min-width: 0; text-align: right; color: var(--text); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tf-cas-lvl__v.is-ph { color: var(--muted); font-weight: 400; }
.tf-cas-lvl__c { flex: none; display: inline-flex; color: var(--muted); transition: transform .2s ease; }
.tf-cas-lvl__c svg { width: 15px; height: 15px; }
.tf-cas-lvl[open] .tf-cas-lvl__c { transform: rotate(90deg); }
.tf-cas-opts { display: flex; flex-direction: column; padding: 0 6px 7px; }
.tf-cas-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: none; border-radius: 7px; background: transparent;
  font-size: 13.5px; line-height: 1.3; color: var(--text); text-align: left; cursor: pointer;
}
.tf-cas-opt__t { flex: 1; min-width: 0; }
.tf-cas-opt__go { flex: none; color: var(--muted); font-size: 16px; line-height: 1; }
.tf-cas-opt:hover:not(:active) { background: var(--muted-bg); }
.tf-cas-opt.is-on { background: var(--hover-brand); color: var(--brand-text); font-weight: 600; }
.tf-cas-opt.is-self { color: var(--muted); }
/* 日期框内清空钮：absolute 定位在原生日历 glyph 左侧。
   关键：input 全局有 margin-bottom:12px，在 flex 包裹层内会把包裹层撑高 12px，
   导致绝对居中的 ✕ 比日历 glyph 低约 6px——必须在包裹层内把该 margin 清零，
   与下方区块的 12px 节奏改由 .tf-due-rel 的 margin-bottom 承担 */
.tf-due-rel { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.tf-due-inputwrap { position: relative; flex: 1; min-width: 0; display: flex; }
.tf-due-inputwrap > input { flex: 1; min-width: 0; margin-bottom: 0; }
.tf-due-inputwrap.is-clearable > input { padding-right: 3.4em; }
.tf-due-clear {
  position: absolute; right: 1.9em; top: 0; bottom: 0;
  width: 1.4em; padding: 0; border: none; border-radius: 6px;
  background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tf-due-clear svg { width: .78em; height: .78em; display: block; }
.tf-due-clear:hover:not(:active) { background: var(--muted-bg); color: var(--text); }
.tf-due-clear:disabled { cursor: default; background: transparent; color: var(--muted); }
/* 隐藏日期框原生清除钮：清空必须走自定义 ✕ 的二次确认（会转备忘录） */
.tf-due-rel input::-webkit-clear-button { display: none; }
/* 清空日期的内联二次确认条（不用弹窗：确认后需留在编辑表单） */
.tf-due-confirm {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--muted-bg);
}
.tf-due-confirm__msg { flex: 1; min-width: 150px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
/* 备忘录态（打开即备忘录 / 编辑中点清空）：日期/闹钟/重复/各自截止/优先级隐藏；分类保留 */
.tfedit.is-memo #tfDueRow,
.tfedit.is-memo #tfRecurWrap,
.tfedit.is-memo #tfChildDueRow,
.tfedit.is-memo .tfedit-pri { display: none; }

/* 默认视图"待办清单"卡片头: 始终一行。宽屏标题 flex:1 占满左侧、控件靠右;
   窄屏(≤640px, App/手机浏览器)标题固定在左、"隐藏已完成"固定在右, 中间"卡片视图/新建任务/
   共享分类"为一条横向滑动区(共享分类在最后, 默认被裁), 两端有内容裁切时出现箭头滑出 */
.todo-card-head { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; }
.todo-card-head__title { flex: 1 1 auto; min-width: 0; }
.todo-card-head__hide { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: normal; color: var(--label); white-space: nowrap; cursor: pointer; flex-shrink: 0; }
.todo-card-head__hide input[type="checkbox"] { width: auto; margin: 0; }
.todo-card-head__bar { position: relative; display: inline-flex; align-items: center; min-width: 0; flex-shrink: 0; }
.todo-card-head__bar-scroll { display: inline-flex; align-items: center; gap: 8px; }
.todo-card-head__bar-scroll .btn.sm { white-space: nowrap; margin-bottom: 0; flex-shrink: 0; }
@media (max-width: 640px) {
  .todo-card-head { gap: 6px; }
  /* 标题固定不缩(内容宽), 把剩余空间让给中间滑动区 */
  .todo-card-head__title { flex: 0 0 auto; }
  .todo-card-head__bar { flex: 1 1 auto; }
  .todo-card-head__bar-scroll {
    width: 100%; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding: 3px 2px;
  }
  .todo-card-head__bar-scroll::-webkit-scrollbar { display: none; }
  .todo-card-head__bar-scroll > * { flex-shrink: 0; }
  /* 「显示」按钮窄屏只留图标, 避免文字挤占横向滑动区; SVG 的 margin-right 是内联样式, 需 !important 覆盖 */
  #displayOpts .todo-display-btn__txt { display: none; }
  #displayOpts svg { margin-right: 0 !important; }
}

/* ============ 侧边抽屉（分类目录） ============ */
.todo-drawer {
  width: 240px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.todo-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 10px; font-size: 14px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.todo-drawer__close {
  border: none; background: none; cursor: pointer; font-size: 18px; color: var(--muted-2);
  padding: 2px 6px; border-radius: 6px;
}
.todo-drawer__close:hover:not(:active) { background: var(--hover-bg); color: var(--text); }
.todo-drawer__list { flex: 1; overflow-y: auto; padding: 6px 0; }
.todo-drawer__item {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  cursor: pointer; font-size: 14px; color: var(--text);
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}
.todo-drawer__item:hover:not(:active) { background: var(--surface-2); }
.todo-drawer__item.active { background: var(--hover-brand); border-left-color: var(--brand-text); color: var(--brand-text); font-weight: 600; }
.todo-drawer__item.active:hover:not(:active) { background: var(--hover-brand); color: var(--brand-text); }
.todo-drawer__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-drawer__count { color: var(--muted-2); font-size: 12px; }
.todo-drawer__item.active .todo-drawer__count { color: var(--brand-text); }
.todo-drawer__section { padding: 6px 0; border-bottom: 1px solid var(--border); }
.todo-drawer__section:last-child { border-bottom: none; }
.todo-drawer__section-title { padding: 8px 14px 4px; font-size: 12px; color: var(--muted-2); font-weight: 600; letter-spacing: .5px; }
.todo-drawer__item--hide { cursor: pointer; }
.todo-drawer__foot { padding: 8px 14px; font-size: 12px; color: var(--muted-2); border-top: 1px solid var(--border); text-align: center; }
/* 个人分类项的改名 ✎ / 删除 ✕: 默认低调, hover 分别转主题紫 / 红; 点击 stopPropagation 不触发分类过滤 */
.todo-drawer__del, .todo-drawer__edit {
  border: none; background: none; cursor: pointer; flex-shrink: 0;
  color: var(--faint); font-size: 12px; line-height: 1;
  padding: 3px 6px; border-radius: 5px;
}
.todo-drawer__edit:hover:not(:active) { background: var(--hover-brand); color: var(--brand-text); }
.todo-drawer__del:hover:not(:active) { background: #fdecec; color: #e5484d; }
/* 抽屉收起：主区域独占 */
.todo-drawer.closed { display: none; }
/* 抽屉遮罩（仅手机使用）; touch-action:none 阻止遮罩上的触摸手势穿透/连锁滚动 */
.todo-drawer-mask { display: none; touch-action: none; }

/* ============ 分类下拉：新建输入框 ============ */
/* 弹窗内 #tfCatNew 的 margin-top，与 select 拉开距离；样式复用现有 input */
#tfCatNew { margin-top: 6px; }

/* ============ 图表横屏全屏查看 ============ */
/* 紧贴图表的相对定位容器：按钮以此为锚，落在图表区右上角而非整张卡片 */
.chart-fs-wrap { position: relative; }
/* 图表右上角的全屏按钮：淡显，hover 卡片时显现 */
.chart-fs-btn {
  position: absolute; top: 4px; right: 4px; z-index: 5;
  width: 28px; height: 28px; padding: 0; line-height: 1;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card-glass-solid);
  color: var(--label); font-size: 14px; cursor: pointer; opacity: .3; transition: opacity .18s, background .18s;
}
.card:hover:not(:active) .chart-fs-btn { opacity: 1; }
.chart-fs-btn:hover:not(:active) { background: var(--hover-brand); color: var(--brand-text); }
/* 弹窗内的图表无卡片悬停可借, 放大按钮常态清晰可见 */
.modal-mask.show .chart-fs-btn { opacity: .85; }
/* 手机端普通卡片: 放大按钮同样常显, 不靠 hover 发现 */
@media (max-width: 640px) {
  .card .chart-fs-btn { opacity: .85; }
}
/* 全屏遮罩层：半透明底 + 居中舞台。横屏(PC/平板)直接放大；竖屏(手机)旋转 90° 铺满 */
/* z-index 须高于 .modal-mask(10000)/指标说明浮层(10001)/toast(10002): 弹窗内(如任务分析)打开全屏图时要盖在最上; 低于 #globalLoading(10500) */
.chart-fs-mask { position: fixed; inset: 0; z-index: 10010; background: rgba(0,0,0,.55); overflow: hidden; touch-action: none; }
.chart-fs-stage {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface); border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,.35);
  padding: 24px; box-sizing: border-box;
}
/* 横屏(PC/宽屏)：大弹窗，取视口九成，不旋转 */
@media (orientation: landscape) {
  .chart-fs-stage { width: 90vw; height: 88vh; }
}
/* 竖屏(手机)：舞台取视口对调后旋转 90°，铺满成横向大图 */
@media (orientation: portrait) {
  .chart-fs-mask { background: var(--surface); }
  .chart-fs-stage {
    width: 100vh; height: 100vw; border-radius: 0; box-shadow: none; padding: 16px 44px 16px 16px;
    transform: translate(-50%, -50%) rotate(90deg);
  }
}
/* 全屏时图表填满舞台：关掉宽高比后由 Chart.js 按容器 100% 铺满 */
.chart-fs-stage canvas { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; display: block; }
/* 关闭按钮：圆形图标钮 */
.chart-fs-close {
  position: fixed; top: 12px; right: 12px; z-index: 9999;
  width: 40px; height: 40px; padding: 0; line-height: 1;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--label);
  font-size: 17px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.chart-fs-close:hover:not(:active) { background: var(--hover-brand); color: var(--brand-text); }
/* 竖屏(手机)：旋转后图的 Y 轴刻度落在物理右上，故关闭钮挪到物理右下角避开 */
@media (orientation: portrait) {
  .chart-fs-close { top: auto; bottom: 14px; right: 14px; }
}
@media (prefers-reduced-motion: reduce) { .chart-fs-btn { transition: none; } }


/* ============ 自定义滚动条 (静态半透明品牌色, 跟随主题) ============ */
/* scrollbar-gutter: stable 让页面始终预留槽位, 消除滚动条出现/消失的横向抖动 */
html { scrollbar-gutter: stable; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--scrollbar-thumb);
}
::-webkit-scrollbar-thumb:hover:not(:active) { background: var(--scrollbar-thumb-hover); }
::-webkit-scrollbar-corner { background: transparent; }
/* 细窄容器 (下拉/抽屉/多选面板/modal): 收窄到 4px, 更贴合小尺寸 */
.mp-menu::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
.todo-drawer__list::-webkit-scrollbar,
.modal-body::-webkit-scrollbar { width: 4px; height: 4px; }
/* 深色底容器 (登录页/图表全屏遮罩): 覆盖为半透明白 */
.lg-fs::-webkit-scrollbar-thumb,
.chart-fs-mask::-webkit-scrollbar-thumb { background: rgba(255,255,255,.32); }
.lg-fs::-webkit-scrollbar-thumb:hover:not(:active),
.chart-fs-mask::-webkit-scrollbar-thumb:hover:not(:active) { background: rgba(255,255,255,.5); }
.lg-fs, .chart-fs-mask { scrollbar-color: rgba(255,255,255,.32) transparent; }
@media (prefers-reduced-motion: reduce) {
  .app-side__logo { animation: none; }
}

/* ============ reduced-motion 覆盖 ============ */
@media (prefers-reduced-motion: reduce) {
  .card, .stat, .btn, .m-tabbar, .m-fab { transition: none; }
  .btn::after { display: none; }
  #globalLoading .spinner::before,
  #globalLoading .spinner::after { animation: none; }
  /* 全屏 loading: 扫光/飞行(SMIL 由 JS pause)/进度条停止, 只保留淡入与淡入式落位 */
  .fs-skel-card::after { animation: none; }
  .fs-load-boot { animation: fsBootIn .01ms linear .1s forwards; }
  .fs-boot-bar { animation: none; opacity: 0; }
  .fs-boot-bar i { animation: none; }
  #todoTree.fs-boot-in > *:nth-child(-n+6) { animation: fsCardInRM .2s ease both; animation-delay: 0ms !important; }
  /* 弹窗/日期选择器: 全部瞬时显隐(JS 侧 matchMedia 同步瞬时收尾, 不靠兜底定时器, 无迟滞) */
  .modal-mask, .modal-mask *, .tdp-mask, .tdp-mask * { animation: none !important; }
}
@keyframes fsCardInRM { from { opacity: 0; } to { opacity: 1; } }


/* ============ 移动端适配 (<=640px) ============ */
/* 窄屏范围胶囊条：PC 隐藏，<=640px 替换原生 select */
.m-range-chips { display: none; }
@media (max-width: 640px) {
  .m-range-select--enhanced { display: none !important; }
  .m-range-chips {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding: 2px 0;
  }
  .m-range-chips::-webkit-scrollbar { display: none; }
  .m-range-chip {
    flex-shrink: 0; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--muted); font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all .15s; font-family: inherit;
  }
  .m-range-chip.is-on {
    background: var(--brand-strong); border-color: var(--brand-strong); color: #fff;
  }
  /* 旧顶栏已由 .app-side(隐藏)/.m-tabbar 取代, 无 topbar 移动样式 */
  .container { margin: 14px auto; padding: 0 12px; }
  body:has(.m-tabbar) .container { padding-bottom: 80px; }
  .card { padding: 15px; border-radius: 16px; }
  /* 小按钮保持自然高度(与 PC 一致), 避免标题行内被撑成大方块; 需要大触控热区的场景(如待办内联添加钮)各自补 min-height */
  .btn.sm { display: inline-flex; align-items: center; }
  /* 待办筛选/图表区间 8 个胶囊: 单行横滑不换行, 项目不缩减; JS 筛选语义不变 */
  .todo-range { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; display: flex; }
  .todo-range::-webkit-scrollbar { display: none; }
  .todo-range button { flex-shrink: 0; }
  .row { flex-direction: column; gap: 0; }
  .row > * { min-width: 0; }

  /* 表格转卡片式：表头隐藏，每行成卡片，单元格纵向排列并用 data-label 标注列名 */
  table thead { display: none; }
  table, table tbody, table tr, table td { display: block; width: 100%; }
  table tr { background: var(--surface-done); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; padding: 6px 10px; }
  table td { border: none; padding: 6px 0; text-align: right; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  table td::before { content: attr(data-label); color: var(--label); font-size: 13px; font-weight: 600; text-align: left; flex-shrink: 0; }
  table td[data-label="操作"] { flex-wrap: wrap; justify-content: flex-start; }
  table td[data-label="操作"]::before { width: 100%; margin-bottom: 4px; }
  .btn.sm { margin-bottom: 4px; }
  /* 汇总统计卡在窄屏两列 */
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .asset-summary-stats, .asset-goal-metrics, .asset-type-pills { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .asset-summary-stats .num { font-size: 20px; }
  .asset-status-number { font-size: 28px; }
  .asset-stat-sub { min-height: 0; }
  .asset-title__btn { float: right; margin-top: 0; }
  .asset-grid--84, .asset-grid--75 { grid-template-columns: 1fr; }
  .asset-composition { grid-template-columns: 1fr; }
  .asset-donut { width: 190px; height: 190px; }
  .asset-chart { height: 240px; max-height: 240px; }
  .asset-table th, .asset-table td { white-space: normal; }
  .asset-metric { font-size: 13px; }
  /* 表头窄屏隐藏后，全选改在工具栏显示 */
  .fm-mobile-sel { display: inline-flex; }
  /* 空态单元格窄屏 flex 布局下保持居中（默认 space-between 会把无 data-label 的文本顶到左侧） */
  table td.cell-empty { justify-content: center; text-align: center; }
  /* 登录/加仓等居中容器留边距 */
  .login-wrap { margin: 40px auto; padding: 0 12px; }
  /* 窄屏下拉菜单左对齐, modal 内边距收小 */
  .dropdown-menu { right: auto; left: 0; }
  .modal-mask { padding: 16px 10px; }
  /* 灵感动效仅窄屏: 遮罩淡入淡出（PC 居中弹窗保持硬切, 由 JS matchMedia 同步控制是否挂 closing） */
  .modal-mask.show { animation: modalMaskIn .28s ease; }
  .modal-mask.closing { animation: modalMaskOut .26s ease; }
  @keyframes modalMaskIn { from { opacity: 0; } }
  @keyframes modalMaskOut { to { opacity: 0; } }
  /* 窄屏通用弹窗默认 BottomSheet 化（长弹窗键盘态 .kb-tall 保留顶部对齐滚动，避免裁切） */
  .modal-mask:not(.kb-tall):not(.modal-mask--sheet) { padding: 0; align-items: flex-end; }
  .modal-mask:not(.kb-tall):not(.modal-mask--sheet) .modal-box {
    width: 100%; max-width: 100%; margin: 0;
    border-radius: 20px 20px 0 0; max-height: 88vh;
    display: flex; flex-direction: column;
    animation: modalSheetIn .34s cubic-bezier(.16,1,.3,1);
  }
  .modal-mask:not(.kb-tall):not(.modal-mask--sheet).closing .modal-box { animation: modalSheetOut .26s cubic-bezier(.4,0,1,1); }
  .modal-mask:not(.kb-tall):not(.modal-mask--sheet) .modal-head {
    position: relative; padding: 16px 16px 12px; flex: none;
  }
  .modal-mask:not(.kb-tall):not(.modal-mask--sheet) .modal-head::before {
    content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 99px; background: var(--border);
  }
  .modal-mask:not(.kb-tall):not(.modal-mask--sheet) .modal-body { overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  /* 键盘弹起·长弹窗: 弹窗靠顶部, 遮罩整体滚动、卡片不裁切(见 .modal-mask.kb-tall 主规则) */
  .modal-mask.kb-tall { padding: 0 10px var(--kb-inset, 0px); }
  /* 滴答清单式待办表单：贴底 sheet。box 绝对定位 bottom 直接跟随 --kb-inset，
     键盘上沿无缝贴合（PC 仍居中，由基础规则负责） */
  .modal-mask--sheet { padding: 0; background: rgba(0,0,0,.35); }
  /* 盖掉通用 kb-tall 的 padding，避免与 box bottom:inset 双倍抬升 */
  .modal-mask--sheet.kb-tall { padding: 0; }
  .modal-mask--sheet .modal-box {
    position: absolute; left: 0; right: 0; bottom: var(--kb-inset, 0);
    display: flex; flex-direction: column;
    max-width: 100%; width: 100%; margin: 0;
    max-height: calc(100% - var(--kb-inset, 0));
    border-radius: 18px 18px 0 0; animation: modalSheetIn .34s cubic-bezier(.16,1,.3,1);
  }
  .modal-mask--sheet.closing .modal-box { animation: modalSheetOut .26s cubic-bezier(.4,0,1,1); }
  .modal-mask--sheet .modal-head { padding: 12px 16px; flex: none; }
  .modal-mask--sheet .modal-body { padding: 10px 16px 5px; overflow-y: auto; }
  @keyframes modalSheetIn { from { transform: translateY(100%); } }
  @keyframes modalSheetOut { to { transform: translateY(100%); } }
  /* 内容级联进场: 只作用 modal-body 直接子级, 延迟经变量分档、第 5 个起封顶; both 仅压住 delay 期起始帧。
     待办表单 sheet 豁免(打开即聚焦+键盘避让, 不能让输入框参与位移动画); closing 时整体随 sheet 退出, 级联立即停在终态。
     仅窄屏生效, PC 弹窗内容不做级联 */
  .modal-mask.show .modal-body > * {
    animation: modalRise .34s cubic-bezier(.16,1,.3,1) both;
    animation-delay: var(--rise-d, .24s);
  }
  .modal-mask.show .modal-body > *:nth-child(1) { --rise-d: .06s; }
  .modal-mask.show .modal-body > *:nth-child(2) { --rise-d: .11s; }
  .modal-mask.show .modal-body > *:nth-child(3) { --rise-d: .16s; }
  .modal-mask.show .modal-body > *:nth-child(4) { --rise-d: .21s; }
  .modal-mask--sheet.show .modal-body > *,
  .modal-mask.closing .modal-body > * { animation: none; }
  @keyframes modalRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  /* 多选面板窄屏: 改为居中 modal 弹窗 (JS 侧已把 .mp-menu 移到 body 末尾, 彻底脱离 card 堆叠上下文,
     否则 .card 的 z-index/backdrop-filter 会封印内部 fixed 元素, 导致遮罩必然盖住面板)
     居中显示、大触点、显式"完成"按钮, 比底部弹出更好操作 */
  .mp-menu {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    margin: 0; width: 92vw; max-width: 400px; max-height: 78vh;
    border-radius: 14px;
    padding: 16px 14px 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
    z-index: 1200;
  }
  .mp-menu.show { grid-template-columns: repeat(4, 1fr); gap: 6px; min-width: 0; animation: mpModalIn .34s cubic-bezier(.16,1,.3,1); }
  /* 渠道等自定义文本长度不定, 窄屏收成 1 列 + 允许换行, 避免撑爆 400px 容器出现横向滚动条 */
  .mp-menu-list.show { grid-template-columns: 1fr; }
  .mp-menu-list .mp-item { justify-content: flex-start; white-space: normal; word-break: break-all; text-align: left; }
  /* 加大触点与字号, 方便手指操作 */
  .mp-item { padding: 12px 6px; font-size: 15px; justify-content: center; background: var(--surface-3); }
  .mp-item input { width: 18px; height: 18px; }
  /* "完成"按钮: 铺满底部, 品牌色 */
  .mp-done {
    display: block; grid-column: 1 / -1;
    margin-top: 8px; padding: 12px; font-size: 15px; font-weight: 600;
    color: #fff; background: var(--brand-strong);
    border: none; border-radius: 10px; cursor: pointer;
  }
  /* 半透明遮罩: :has() 老浏览器降级为无遮罩不影响功能 */
  body:has(.mp-menu.show)::before {
    content: ''; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 1100;
    animation: mpMaskIn .28s ease;
  }
}
@keyframes mpModalIn { from { transform: translate(-50%, -50%) scale(.92); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes mpMaskIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 640px) {
  /* 长列表窄屏限高滚动: 让分页按钮始终在屏内, 避免用户长滑找不到"下一页"
     max-height 用 vh 而非固定 px, 适应不同屏幕. 底部渐隐提示还有内容可滚 */
  .table-scroll-mobile { max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; position: relative; }
  /* 待办树：缩进收窄, 操作按钮常显 */
  .todo-row { margin-left: calc(var(--depth, 0) * 16px); gap: 8px; padding: 8px 10px; }
  .todo-node[data-depth]:not([data-depth="0"]):not(.todo-acc):not(.flat-group):not(.todo-bandcard)::before { left: calc(var(--depth, 0) * 16px - 9px); width: 8px; }
  /* 完整树添加框缩进同步窄屏系数(同外层 26px 口径两条规则) */
  .todo-children > .todo-detail-adder { margin-left: calc((var(--depth, 0) + 1) * 16px); }
  .todo-node:not(.todo-acc):not(.flat-group):not(.todo-bandcard) > .todo-detail-adder { margin-left: calc(var(--depth, 0) * 16px); }
  .todo-ops { opacity: 1; }
  /* 详情子任务行第二行(chips): 不换行, 超宽左右滑动(同卡片视图第二行);
     ⋯ 操作钮是 .todo-row 直接子级不随滚; 完成沉底行是 .flat-item 不含 .todo-meta 不受影响 */
  body.todo-detail .todo-meta {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  body.todo-detail .todo-meta::-webkit-scrollbar { display: none; }
  body.todo-detail .todo-meta > * { flex: 0 0 auto; white-space: nowrap; }
  /* 行内操作钮热区从约 28px 补到约 38px */
  .todo-op { padding: 9px 10px; }
  /* 手机端拖拽手柄隐藏: 改为长按整行拖拽(见 todoBindDrag), 操作区少一个小按钮防误触 */
  .todo-drag { display: none !important; }
  /* 长按拖起时手机上"浮起"更强: 放大更多 + 倾斜 + 大投影, 明确区别于普通按压 */
  .todo-node.dragging > .todo-row {
    transform: scale(1.045) rotate(-.8deg);
    box-shadow: 0 22px 44px rgba(31,35,41,.26), 0 8px 18px rgba(168,85,247,.26), 0 0 0 2px rgba(168,85,247,.28);
  }
  /* 概览统计卡强制单行: 4 卡(含备忘录)不再掉到第二行; 去掉最小宽度并收紧字号/内边距 */
  .todo-stats { flex-wrap: nowrap; gap: 6px; }
  .todo-stat { min-width: 0; flex: 1 1 0; padding: 10px 4px; }
  .todo-stat .n { font-size: 20px; }
  .todo-stat .l { font-size: 11px; }
  /* 卡片视图窄屏收小内边距 */
  .todo-card__body { padding: 12px 14px 8px; }
  .todo-card__title { font-size: 16px; }
  .todo-card__foot { padding: 5px 8px; }
  /* 详情面包屑: 窄屏允许换行, 标题独占一行避免按钮把它挤没; 按钮成对紧凑排列 */
  .todo-crumb { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .todo-crumb__title { flex: 1 0 100%; order: -1; font-size: 15px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
  .todo-crumb .btn.sm { padding: 5px 10px; font-size: 12px; }
  /* 全屏模式下, 抽屉浮层覆盖: 从左侧滑入, 半透明遮罩 */
  .todo-fullscreen { flex-direction: row; }
  .todo-drawer {
    /* App 壳(无 .m-tabbar, 原生底栏已裁掉 WebView 高度)贴底; 浏览器才给网页底栏让位 */
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1001;
    transform: translateX(-100%);
    box-shadow: 2px 0 20px rgba(0,0,0,.15);
  }
  body:has(.m-tabbar) .todo-drawer { bottom: 60px; }
  .todo-drawer.closed { display: flex; transform: translateX(-100%); }
  .todo-drawer.open { transform: translateX(0); }
  .todo-drawer-mask {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.35);
  }
  body.todo-fs-on .todo-drawer-mask.show { display: block; }
  /* 手机端全屏顶栏 sticky + 滚动方向隐藏/显示; PC 端不生效 */
  /* 把 fs-main 的 padding-top 移到 fs-top 自身, 让 sticky 到 top:0 时无空隙;
     底部给常驻 Tab(60px)留位, 键盘弹起时随 --kb-inset 上抬 */
  /* 底部统一留 74px: 浏览器给网页底栏(60px)、App 壳给悬浮 FAB(bottom20+54)让位;
     键盘弹起由 kb-on 规则收紧为 12px + 键盘高度(底栏/FAB 此时已隐藏) */
  .todo-fs-main { padding: 0 12px calc(74px + var(--kb-inset, 0px)); }
  .todo-fs-top {
    position: sticky; top: 0; z-index: 5;
    padding-top: 12px; margin-left: -12px; margin-right: -12px;
    padding-left: 12px; padding-right: 12px;
    /* 手机贴边全宽：去掉 PC 的圆角外框 */
    border: none; border-radius: 0; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    /* 收紧间距，三个同款按钮(第三个带当前视图名)放得下（不与"隐藏已完成"重叠） */
    gap: 6px;
  }
  .fs-segbtn { padding-left: 8px; padding-right: 8px; gap: 4px; font-size: 12.5px; }
  .fs-exitbtn { padding-left: 10px; padding-right: 10px; }
  .todo-fs-top--hidden { transform: translateY(-110%); opacity: 0; pointer-events: none; }
  /* 手机 fs-top 贴边全高约 60px、fs-main 左右 12px, loading 层对齐 */
  .todo-fs-loading { top: 60px; padding: 0 12px; }
}

/* ============ 每日勉励卡（用户私有；全屏弹层，自有配色不跟随面板主题） ============
   两种风格：a=极光能量（默认，深色潮流）/ c=手账打气（暖色便签治愈）。
   DOM 仅在用户已填写 motto 时直出；.is-on 控制当天自动展示，设置页可用 __mottoPreview() 手动唤出。
   层级 10300：高于 modal(10000)，低于 #globalLoading(10500)，开场加载遮罩退后自然显现。 */
.motto-overlay {
  display: none; position: fixed; inset: 0; z-index: 10300; overflow: hidden;
  flex-direction: column;
  opacity: 0; transition: opacity .3s ease;
}
.motto-overlay.is-on { display: flex; opacity: 1; }
.motto-overlay.is-closing { opacity: 0; }
.motto-quote { white-space: pre-wrap; word-break: break-word; font-weight: 800; line-height: 1.62; }
.motto-x {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background .15s ease;
}
.motto-x:hover:not(:active) { transform: rotate(90deg); }

/* —— A 极光能量 —— */
.motto-overlay.is-a { background: #0A0A13; color: #F4F5FF; padding: 30px 28px; }
.motto-a__aurora { position: absolute; inset: -20%; z-index: 0; filter: blur(70px); }
.motto-a__aurora span { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.motto-a__aurora span:nth-child(1) { width: 52%; aspect-ratio: 1; left: -8%; top: -14%;
  background: radial-gradient(circle, #8B5CF6, transparent 65%); animation: mottoDrift 14s ease-in-out infinite alternate; }
.motto-a__aurora span:nth-child(2) { width: 46%; aspect-ratio: 1; right: -10%; top: 8%;
  background: radial-gradient(circle, #22D3EE, transparent 65%); opacity: .7;
  animation: mottoDrift 18s ease-in-out -6s infinite alternate; }
.motto-a__aurora span:nth-child(3) { width: 56%; aspect-ratio: 1; left: 18%; bottom: -26%;
  background: radial-gradient(circle, #EC4899, transparent 62%); opacity: .55;
  animation: mottoDrift 16s ease-in-out -3s infinite alternate; }
@keyframes mottoDrift { from { transform: translate3d(-3%,-2%,0) scale(1); }
  to { transform: translate3d(4%,5%,0) scale(1.12); } }
.motto-a__veil { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(8,8,16,.55) 100%); }
.motto-overlay.is-a .motto-x { background: rgba(255,255,255,.08); color: rgba(255,255,255,.75); }
.motto-overlay.is-a .motto-x:hover:not(:active) { background: rgba(255,255,255,.18); }
.motto-a__top { position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; }
.motto-a__badge { font-size: 10.5px; font-weight: 800; letter-spacing: .22em; text-indent: .22em;
  border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 4px 11px; color: #CFCBFF; }
.motto-a__date { font-size: 11.5px; color: rgba(255,255,255,.5); font-variant-numeric: tabular-nums; }
.motto-a__mid { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.motto-overlay.is-a .motto-quote { text-shadow: 0 2px 30px rgba(139,92,246,.35); }
.motto-a__cta { position: relative; z-index: 2; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 9px;
  background: #fff; color: #12121C; border: 0; border-radius: 99px;
  font: inherit; font-size: 14px; font-weight: 700; padding: 13px 26px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(139,92,246,.35); transition: transform .15s ease; }
.motto-a__cta:hover:not(:active) { transform: translateY(-2px); }
.motto-a__cta svg { width: 15px; height: 15px; }
.motto-a__again { position: relative; z-index: 2; margin-top: 13px; font-size: 11px; color: rgba(255,255,255,.4); }
.motto-overlay.is-a .motto-quote[data-len="s"] { font-size: 34px; }
.motto-overlay.is-a .motto-quote[data-len="m"] { font-size: 27px; }
.motto-overlay.is-a .motto-quote[data-len="l"] { font-size: 21px; }

/* —— C 手账打气 —— */
.motto-overlay.is-c { background: #F0E7D2; color: #4A4030; padding: 34px 26px;
  align-items: center; justify-content: center; }
.motto-overlay.is-c .motto-x { background: rgba(74,64,48,.08); color: #7C705A; }
.motto-overlay.is-c .motto-x:hover:not(:active) { background: rgba(74,64,48,.18); }
.motto-c__tape { position: absolute; z-index: 6; width: 92px; height: 27px; opacity: .72;
  box-shadow: 0 1px 3px rgba(90,70,30,.18); }
.motto-c__tape.t1 { top: 26px; left: 50%; margin-left: -70px; transform: rotate(-5deg);
  background: repeating-linear-gradient(-45deg, rgba(159,201,232,.9) 0 7px, rgba(140,186,220,.9) 7px 14px); }
.motto-c__tape.t2 { top: 44px; right: 34px; width: 66px; transform: rotate(9deg);
  background: repeating-linear-gradient(-45deg, rgba(242,181,200,.9) 0 7px, rgba(232,158,186,.9) 7px 14px); }
.motto-c__sticker { position: absolute; z-index: 1; }
.motto-c__sticker.s1 { left: 30px; bottom: 120px; width: 26px; color: #E8A24B; transform: rotate(-14deg); }
.motto-c__sticker.s2 { right: 34px; top: 110px; width: 21px; color: #E06B8A; transform: rotate(16deg); }
.motto-c__sticker.s3 { left: 44px; top: 120px; width: 19px; color: #6FA8DC; transform: rotate(10deg); }
.motto-c__note { position: relative; z-index: 5; width: 100%; max-width: 330px;
  background: #FFFDF3; border: 1px solid #EADFC0; border-radius: 8px;
  padding: 30px 24px 24px; transform: rotate(-1.4deg);
  box-shadow: 0 22px 44px rgba(110,84,40,.22), 0 3px 8px rgba(110,84,40,.12);
  background-image: repeating-linear-gradient(transparent 0 33px, rgba(120,100,60,.08) 33px 34px); }
.motto-c__head { display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: "Yuanti SC", "YouYuan", "幼圆", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; color: #8A7350; margin-bottom: 12px; }
.motto-c__head svg { width: 20px; height: 20px; color: #E8A24B; }
.motto-overlay.is-c .motto-quote {
  font-family: "Yuanti SC", "YouYuan", "幼圆", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.75; color: #453B28; text-align: center; }
.motto-overlay.is-c .motto-quote[data-len="s"] { font-size: 27px; }
.motto-overlay.is-c .motto-quote[data-len="m"] { font-size: 23px; }
.motto-overlay.is-c .motto-quote[data-len="l"] { font-size: 19px; }
.motto-c__wave { display: block; margin: 10px auto 0; width: 110px; color: #E06B8A; }
.motto-c__cta { position: relative; z-index: 5; margin-top: 26px;
  background: #3F3626; color: #FFFDF3; border: 0; border-radius: 99px;
  font-family: "Yuanti SC", "YouYuan", "幼圆", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px; letter-spacing: .06em; padding: 11px 32px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(70,55,30,.28); transition: transform .15s ease; }
.motto-c__cta:hover:not(:active) { transform: translateY(-2px) rotate(-.5deg); }

/* —— 入场动画：.is-on 时各元素错峰浮入 —— */
.motto-overlay.is-on [data-rise] { animation: mottoRise .7s cubic-bezier(.22,.8,.26,1) both; }
@keyframes mottoRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.motto-overlay.is-c.is-on .motto-c__note { animation: mottoPop .75s cubic-bezier(.2,1.4,.36,1) .12s both; }
@keyframes mottoPop { from { opacity: 0; transform: rotate(-4deg) scale(.85) translateY(24px); }
  to { opacity: 1; transform: rotate(-1.4deg) scale(1) translateY(0); } }

/* —— 手机端收紧 —— */
@media (max-width: 640px) {
  .motto-overlay.is-a { padding: 24px 22px; }
  .motto-overlay.is-a .motto-quote[data-len="s"] { font-size: 29px; }
  .motto-overlay.is-a .motto-quote[data-len="m"] { font-size: 23px; }
  .motto-overlay.is-a .motto-quote[data-len="l"] { font-size: 18px; }
  .motto-overlay.is-c .motto-quote[data-len="s"] { font-size: 24px; }
  .motto-overlay.is-c .motto-quote[data-len="m"] { font-size: 20px; }
  .motto-overlay.is-c .motto-quote[data-len="l"] { font-size: 17px; }
  .motto-c__note { padding: 26px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .motto-overlay, .motto-overlay * { animation: none !important; transition: none !important; }
}

/* —— H1 战书令（黑红粗野，针对意志力薄弱的"狠话叫醒"） —— */
.motto-overlay.is-h1 { background: #0A0A0C; color: #F4F2EE; padding: 30px 28px; }
.motto-h1__hazard { position: absolute; left: 0; right: 0; height: 10px; z-index: 5;
  background: repeating-linear-gradient(-45deg, #E11D2E 0 12px, #0A0A0C 12px 24px); }
.motto-h1__hazard.top { top: 0; }
.motto-h1__hazard.bot { bottom: 0; }
.motto-overlay.is-h1 .motto-x { background: rgba(255,255,255,.07); color: rgba(255,255,255,.75); }
.motto-overlay.is-h1 .motto-x:hover:not(:active) { background: rgba(255,255,255,.16); }
.motto-h1__frame { position: relative; z-index: 6; flex: 1; display: flex; flex-direction: column;
  width: 100%; max-width: 620px; margin-block: 10px; margin-inline: auto;
  border: 2px solid rgba(255,255,255,.85); padding: 24px 22px; }
.motto-h1__frame::before { content: ''; position: absolute; inset: 5px;
  border: 1px solid rgba(225,29,46,.55); pointer-events: none; }
.motto-h1__top { display: flex; justify-content: space-between; align-items: flex-start; }
.motto-h1__writ { font-size: 11px; font-weight: 900; letter-spacing: .3em; color: #E11D2E;
  border: 2px solid #E11D2E; padding: 4px 9px; transform: rotate(-3deg); }
.motto-h1__no { font-size: 11px; color: rgba(255,255,255,.45); font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.motto-h1__mid { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.motto-h1__kick { font-size: 12.5px; font-weight: 800; color: rgba(255,255,255,.55);
  letter-spacing: .14em; margin-bottom: 14px; }
.motto-overlay.is-h1 .motto-quote { text-shadow: 0 0 40px rgba(225,29,46,.35); }
.motto-h1__sign { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; }
.motto-h1__stamp { font-size: 12px; font-weight: 900; color: #E11D2E; border: 2.5px solid #E11D2E;
  padding: 6px 10px; letter-spacing: .22em; transform: rotate(6deg); opacity: .92;
  font-family: "Songti SC", "STSong", "SimSun", serif; }
.motto-h1__date { font-size: 11px; color: rgba(255,255,255,.4); font-variant-numeric: tabular-nums; }
.motto-h1__actions { position: relative; z-index: 10; display: flex; flex-direction: column;
  align-items: center; width: 100%; max-width: 620px; margin-inline: auto; }
.motto-h1__btn { display: inline-flex; align-items: center; gap: 9px;
  background: #E11D2E; color: #fff; border: 0; border-radius: 0;
  font: inherit; font-size: 15px; font-weight: 900; letter-spacing: .08em; padding: 14px 30px; cursor: pointer;
  box-shadow: 7px 7px 0 rgba(225,29,46,.25); transition: transform .12s ease, box-shadow .12s ease; }
.motto-h1__btn:hover:not(:active) { transform: translate(-2px,-2px); box-shadow: 10px 10px 0 rgba(225,29,46,.3); }
.motto-h1__tip { margin-top: 12px; font-size: 11px; letter-spacing: .12em; color: rgba(255,255,255,.38); text-align: center; }
.motto-overlay.is-h1 .motto-quote[data-len="s"] { font-size: 37px; }
.motto-overlay.is-h1 .motto-quote[data-len="m"] { font-size: 28px; }
.motto-overlay.is-h1 .motto-quote[data-len="l"] { font-size: 21px; }
.motto-overlay.is-h1.is-on .motto-quote { animation: mottoSlam .55s cubic-bezier(.16,1,.3,1) .25s both; }
@keyframes mottoSlam { 0% { opacity: 0; transform: translateY(26px) scale(.985); }
  60% { transform: translateY(-3px) scale(1.005); } 100% { opacity: 1; transform: none; } }
.motto-overlay.is-h1.is-on .motto-h1__stamp { animation: mottoH1Stamp .4s cubic-bezier(.2,1.8,.4,1) .9s both; }
@keyframes mottoH1Stamp { 0% { opacity: 0; transform: rotate(24deg) scale(2.4); }
  100% { opacity: .92; transform: rotate(6deg) scale(1); } }

/* —— H2 最后通牒（实时倒计时，针对"再等会儿"型拖延） —— */
.motto-overlay.is-h2 { background: #0E0F14; color: #F2F3F8; padding: 30px 28px;
  background-image: radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px); background-size: 20px 20px; }
.motto-h2__glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 50% at 50% 0%, rgba(225,29,46,.2), transparent 70%); }
.motto-overlay.is-h2 .motto-x { background: rgba(255,255,255,.07); color: rgba(255,255,255,.72); }
.motto-overlay.is-h2 .motto-x:hover:not(:active) { background: rgba(255,255,255,.16); }
.motto-h2__inner { position: relative; z-index: 5; width: 100%; max-width: 620px; margin-inline: auto;
  flex: 1; display: flex; flex-direction: column; }
.motto-h2__warn { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 900;
  letter-spacing: .26em; color: #FF6B6B; }
.motto-h2__dot { width: 8px; height: 8px; border-radius: 50%; background: #FF3B3B;
  animation: mottoPulse 1.4s infinite; }
@keyframes mottoPulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,59,.6); }
  70% { box-shadow: 0 0 0 11px rgba(255,59,59,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); } }
.motto-h2__clock { margin: 14px 0 4px; }
.motto-h2__clock .lab { font-size: 12px; color: rgba(255,255,255,.45); letter-spacing: .16em; margin-bottom: 2px; }
.motto-h2__time { font-size: 58px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  background: linear-gradient(180deg, #FFF 20%, #FF8A6B 100%); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.motto-h2__dayleft { font-size: 12.5px; color: rgba(255,255,255,.5); font-variant-numeric: tabular-nums; }
.motto-h2__dayleft b { color: #FF9080; font-weight: 900; }
.motto-h2__rule { height: 1px; background: linear-gradient(90deg, rgba(225,29,46,.7), transparent); margin: 16px 0; }
.motto-h2__mid { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.motto-h2__before { font-size: 12px; font-weight: 800; color: rgba(255,255,255,.45);
  letter-spacing: .2em; margin-bottom: 10px; }
.motto-overlay.is-h2 .motto-quote { line-height: 1.55; }
.motto-h2__btn { display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(100deg, #E11D2E, #FF5A2D);
  color: #fff; border: 0; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 900;
  letter-spacing: .08em; padding: 15px 30px; cursor: pointer;
  box-shadow: 0 12px 34px rgba(225,29,46,.35);
  transition: transform .15s ease, filter .15s ease; }
.motto-h2__btn:hover:not(:active) { transform: translateY(-2px); filter: brightness(1.1); }
.motto-h2__tip { margin-top: 11px; font-size: 11px; color: rgba(255,255,255,.36); letter-spacing: .08em; }
.motto-overlay.is-h2 .motto-quote[data-len="s"] { font-size: 33px; }
.motto-overlay.is-h2 .motto-quote[data-len="m"] { font-size: 25px; }
.motto-overlay.is-h2 .motto-quote[data-len="l"] { font-size: 20px; }
.motto-overlay.is-h2.is-on .motto-h2__time { animation: mottoClockIn .8s .15s both; }
@keyframes mottoClockIn { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }

@media (max-width: 640px) {
  .motto-overlay.is-h1 { padding: 24px 20px; }
  .motto-overlay.is-h1 .motto-quote[data-len="s"] { font-size: 29px; }
  .motto-overlay.is-h1 .motto-quote[data-len="m"] { font-size: 23px; }
  .motto-overlay.is-h1 .motto-quote[data-len="l"] { font-size: 18px; }
  .motto-overlay.is-h2 { padding: 24px 20px; }
  .motto-overlay.is-h2 .motto-h2__time { font-size: 44px; }
  .motto-overlay.is-h2 .motto-quote[data-len="s"] { font-size: 27px; }
  .motto-overlay.is-h2 .motto-quote[data-len="m"] { font-size: 21px; }
  .motto-overlay.is-h2 .motto-quote[data-len="l"] { font-size: 17px; }
}

/* —— 座右铭行内标记（用户在设置页工具栏插入；解析见 mottoInlineMd） ——
   **粗** ~~删~~ __下划线__ ~波浪~ ++放大++ [f:y]快乐体[/f]；装饰一律 currentColor 适配四种卡片底 */
@font-face {
  font-family: 'MottoKuaiLe';
  src: url('/s/motto-kuaile.woff2') format('woff2');
  font-display: swap;
  /* 站酷快乐体 OFL，已子集到 GB2312 一级 3755 字 + ASCII/常用标点；缺字自动走 fallback 链 */
}
.motto-quote .mi-b { font-weight: 900; }
.motto-quote .mi-s { text-decoration: line-through currentColor; opacity: .6; }
.motto-quote .mi-u { text-decoration: underline currentColor; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.motto-quote .mi-w { text-decoration: underline wavy currentColor; text-underline-offset: 5px; }
.motto-quote .mi-big { font-size: 1.28em; }
.motto-quote .mi-y { font-family: 'MottoKuaiLe', "Yuanti SC", "YouYuan", "幼圆", "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 400; }

/* —— 设置页：座右铭工具栏 —— */
.motto-tb { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px; }
.motto-tb button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--label);
  border-radius: 7px; font: inherit; font-size: 12px; padding: 3px 11px; cursor: pointer;
  transition: border-color .15s, color .15s; }
.motto-tb button:hover:not(:active) { border-color: var(--brand-text); color: var(--brand-strong); }
.motto-tb button[data-tag="font"] { color: var(--brand-strong); border-color: var(--brand-border); background: var(--brand-tint); }

/* —— 设置页：每日勉励风格选择缩略卡 —— */
.motto-input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
  padding: 9px 11px; resize: vertical;
}
.motto-input:focus { outline: none; border-color: var(--brand-text); }
@media (max-width: 640px) {
  /* 手机端输入框随内容自动增高（JS 按 scrollHeight 设 height），去掉拉伸手柄避免打架 */
  .motto-input { resize: none; }
}
.motto-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.motto-style {
  flex: 1; border: 1.5px solid var(--border-strong); border-radius: 10px; overflow: hidden;
  background: var(--surface); color: var(--text); font: inherit; padding: 0; cursor: pointer;
  text-align: left; transition: border-color .15s ease;
}
.motto-style .ms-prev {
  height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800; letter-spacing: .04em;
}
.motto-style[data-style="a"] .ms-prev { color: #F4F5FF;
  background:
    radial-gradient(circle at 18% 20%, rgba(139,92,246,.85), transparent 60%),
    radial-gradient(circle at 85% 30%, rgba(34,211,238,.55), transparent 60%),
    radial-gradient(circle at 60% 110%, rgba(236,72,153,.6), transparent 62%), #0A0A13;
}
.motto-style[data-style="c"] .ms-prev { color: #4A4030; background: #F0E7D2;
  font-family: "Yuanti SC", "YouYuan", "幼圆", "PingFang SC", "Microsoft YaHei", sans-serif; }
.motto-style[data-style="h1"] .ms-prev { color: #F4F2EE; background: #0A0A0C; position: relative;
  overflow: hidden; font-weight: 900; letter-spacing: .12em; }
.motto-style[data-style="h1"] .ms-prev::before { content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 5px; background: repeating-linear-gradient(-45deg, #E11D2E 0 6px, #0A0A0C 6px 12px); }
.motto-style[data-style="h2"] .ms-prev { color: #FF8A6B; background: #0E0F14;
  font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .04em; gap: 6px; }
.motto-style[data-style="h2"] .ms-prev::before { content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #FF3B3B; box-shadow: 0 0 6px #FF3B3B; flex-shrink: 0; }
.motto-style .ms-prev i { display: block; width: 58%; height: 26px; border-radius: 5px; background: #FFFDF3;
  box-shadow: 0 3px 8px rgba(110,84,40,.25); transform: rotate(-1.5deg); }
.motto-style .ms-name { display: block; padding: 7px 10px; font-size: 13px; }
.motto-style .ms-name small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.motto-style.on { border-color: var(--brand-text); box-shadow: 0 0 0 1px var(--brand); }

/* ============ 界面背景选择面板（底部弹层：实时预览 + 横向滚动色块） ============ */
.bg-sheet-mask {
  display: none; position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.35); align-items: flex-end; justify-content: center;
}
.bg-sheet-mask.on { display: flex; }
.bg-sheet {
  width: 100%; max-width: 460px;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 48px rgba(0,0,0,.22);
  animation: bgSheetIn .24s ease;
}
@keyframes bgSheetIn { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.bg-sheet__handle { width: 40px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 4px auto 12px; }

/* 实时预览卡片：背景随所选色块（与 .todo-fullscreen 同选择器），内部 mock 手风琴磨砂随 --bg-veil */
.bg-sheet__preview {
  height: 218px; border-radius: 18px; overflow: hidden;
  background: var(--bgimg-default); border: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 10px;
}
.bg-sp-top {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 6px 10px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--label); font-weight: 600; margin-bottom: 8px;
}
.bg-sp-top .bg-sp-seg { flex: 1; text-align: center; }
.bg-sp-inner {
  flex: 1; border-radius: 13px; padding: 4px 8px; overflow: hidden;
  background: var(--bg-veil); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
/* 默认背景（data-bg 空）时 --bg-veil 未定义，退回主题容器色 */
.bg-sp-inner { background: var(--surface); }
html[data-bg]:not([data-bg=""]) .bg-sp-inner { background: var(--bg-veil); }
.bg-sp-row { display: flex; align-items: center; font-size: 12.5px; color: var(--text); padding: 5px 4px; }
.bg-sp-row.root { font-weight: 700; border-left: 3px solid var(--brand); padding-left: 8px; }
.bg-sp-row.root i { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); }
.bg-sp-row.child { padding-left: 20px; opacity: .9; font-size: 12px; }
.bg-sp-row.child.done { opacity: .45; text-decoration: line-through; }
/* 选了非空（浅色）背景时，预览样图恒显浅色——暗色主题下也模拟浅色全屏，不跟随主题 */
html[data-bg]:not([data-bg=""]) .bg-sp-top { background: #fff; color: #5f6470; border-color: #e9ecf3; }
html[data-bg]:not([data-bg=""]) .bg-sp-inner { background: #fbfbfd; }
html[data-bg]:not([data-bg=""]) .bg-sp-row { color: #333a44; }
html[data-bg]:not([data-bg=""]) .bg-sp-row.root { border-left-color: #8b5cf6; }

.bg-sheet__label { font-size: 13px; color: var(--label); margin: 14px 2px 9px; }
/* 分类 tabs（无 / 颜色 / 渐变） */
.bg-cattabs { display:flex; gap:6px; background:var(--surface-2); border-radius:13px; padding:4px; margin-bottom:14px; }
.bg-cattab { flex:1; border:0; border-radius:10px; padding:8px; font-size:13.5px; font-weight:700;
  font-family:inherit; cursor:pointer; background:transparent; color:var(--label); transition:background .15s,color .15s; }
.bg-cattab.on { background:var(--surface); color:var(--text-strong); box-shadow:0 1px 4px rgba(20,20,40,.1); }
/* 色块组：仅当前分类显示；单行横向排列，PC 鼠标按住拖拽、手机触摸滑动（JS 见 assets） */
.bg-swgroup { display:none; flex-wrap:nowrap; gap:12px; overflow-x:auto;
  padding:2px 2px 10px; scrollbar-width:none; cursor:grab; }
.bg-swgroup.show { display:flex; }
.bg-swgroup::-webkit-scrollbar { display:none; }
.bg-swgroup.dragging { cursor:grabbing; }
/* 色块 */
.bg-sw { position:relative; flex-shrink:0; width:56px; height:56px; border-radius:16px;
  border:2px solid transparent; padding:0; cursor:pointer; }
.bg-sw.on { border-color:var(--brand-text); }
.bg-sw::after {
  content:'\2713'; position:absolute; right:-5px; bottom:-5px; width:22px; height:22px;
  border-radius:50%; background:var(--brand); color:#fff; font-size:13px; display:none; place-items:center;
  border:2px solid var(--surface);
}
.bg-sw.on::after { display:grid; }
/* 色块底色：无=缩略，渐变=背景，纯色=实色（始终展示代表色） */
.bg-sw[data-bg=""] { background:var(--sw-default); }
.bg-sw[data-bg="aurora"] { background:var(--bgimg-aurora); }
.bg-sw[data-bg="dawn"]   { background:var(--bgimg-dawn); }
.bg-sw[data-bg="matcha"] { background:var(--bgimg-matcha); }
.bg-sw[data-bg="sea"]    { background:var(--bgimg-sea); }
.bg-sw[data-bg="dusk"]   { background:var(--bgimg-dusk); }
.bg-sw[data-bg="solid-indigo"] { background:#4f69c3; }
.bg-sw[data-bg="solid-steel"]  { background:#407094; }
.bg-sw[data-bg="solid-teal"]   { background:#2e8c88; }
.bg-sw[data-bg="solid-green"]  { background:#139364; }
.bg-sw[data-bg="solid-brown"]  { background:#b07a52; }
.bg-sw[data-bg="solid-rose"]   { background:#c05678; }
.bg-sw[data-bg="solid-purple"] { background:#8d6ac2; }
.bg-sw[data-bg="solid-slate"]  { background:#4a5568; }
.bg-sw[data-bg="solid-mint"]   { background:#dcefe6; }
.bg-sw[data-bg="solid-sky"]    { background:#ddeaf6; }
.bg-sheet__actions { display: flex; gap: 10px; margin-top: 16px; }
.bg-sheet__actions .btn { flex: 1; }
/* 手机浏览器: .m-tabbar(z-index 1002) 层叠高于全屏层(1000), 贴底弹出的背景 sheet 底部按钮会被
   Tab 栏盖住; 有 tabbar 时遮罩底边抬到 Tab 栏之上, sheet 限高内部可滚保证保存按钮可达。
   App 壳不输出 .m-tabbar, 本规则不生效(对齐 .todo-drawer 的处理) */
@media (max-width: 640px) {
  body:has(.m-tabbar) .bg-sheet-mask { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  body:has(.m-tabbar) .bg-sheet {
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 设置页「界面背景」入口行 */
.bg-pick-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.bg-pick-thumb {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  background: var(--bgimg-default); border: 1px solid var(--border);
}
.bg-pick-thumb[data-bg="aurora"] { background: var(--bgimg-aurora); }
.bg-pick-thumb[data-bg="dawn"]   { background: var(--bgimg-dawn); }
.bg-pick-thumb[data-bg="matcha"] { background: var(--bgimg-matcha); }
.bg-pick-thumb[data-bg="sea"]    { background: var(--bgimg-sea); }
.bg-pick-thumb[data-bg="dusk"]   { background: var(--bgimg-dusk); }
.bg-pick-thumb[data-bg="solid-indigo"] { background:#4f69c3; }
.bg-pick-thumb[data-bg="solid-steel"]  { background:#407094; }
.bg-pick-thumb[data-bg="solid-teal"]   { background:#2e8c88; }
.bg-pick-thumb[data-bg="solid-green"]  { background:#139364; }
.bg-pick-thumb[data-bg="solid-brown"]  { background:#b07a52; }
.bg-pick-thumb[data-bg="solid-rose"]   { background:#c05678; }
.bg-pick-thumb[data-bg="solid-purple"] { background:#8d6ac2; }
.bg-pick-thumb[data-bg="solid-slate"]  { background:#4a5568; }
.bg-pick-thumb[data-bg="solid-mint"]   { background:#dcefe6; }
.bg-pick-thumb[data-bg="solid-sky"]    { background:#ddeaf6; }
