/* ============ 个人IP工作台 样式 ============ */

/* ====== 主题：浅色（默认） ====== */
:root,
[data-theme="light"] {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e6eaf0;
  --text: #111827;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-weak: #eff6ff;
  --danger: #ef4444;
  --sidebar: #0f172a;
  --sidebar-2: #1e293b;
  --sidebar-text: #9ca3af;
  --sidebar-active: #2563eb;
  --shadow: 0 4px 20px rgba(15,23,42,.06);
  --radius: 16px;
  --brand-grad-1: #3b82f6;
  --brand-grad-2: #8b5cf6;
  --card-a: #2563eb;
  --card-b: #10b981;
  --card-c: #f59e0b;
  --card-d: #ec4899;
  --heat-1: #bfdbfe;
  --heat-2: #60a5fa;
  --heat-3: #2563eb;
}

/* ====== 主题：深色 ====== */
[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #0f172a;
  --border: #1f2937;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --primary: #60a5fa;
  --primary-weak: #1e3a8a;
  --danger: #f87171;
  --sidebar: #0b1120;
  --sidebar-2: #111827;
  --sidebar-text: #94a3b8;
  --sidebar-active: #2563eb;
  --shadow: 0 4px 20px rgba(0,0,0,.35);
  --brand-grad-1: #60a5fa;
  --brand-grad-2: #a78bfa;
  --card-a: #60a5fa;
  --card-b: #34d399;
  --card-c: #fbbf24;
  --card-d: #f472b6;
  --heat-1: #1e3a8a;
  --heat-2: #3b82f6;
  --heat-3: #60a5fa;
}

/* ====== 主题：海洋蓝 ====== */
[data-theme="ocean"] {
  --bg: #eef4f8;
  --surface: #ffffff;
  --surface-2: #f0f7ff;
  --border: #c8dbeb;
  --text: #0c2d48;
  --text-muted: #5a7a94;
  --primary: #0284c7;
  --primary-weak: #e0f2fe;
  --danger: #ef4444;
  --sidebar: #0c2d48;
  --sidebar-2: #14425f;
  --sidebar-text: #94c5e8;
  --sidebar-active: #0284c7;
  --shadow: 0 1px 3px rgba(2,45,72,.08), 0 1px 2px rgba(2,45,72,.04);
  --brand-grad-1: #0284c7;
  --brand-grad-2: #06b6d4;
  --card-a: #0284c7;
  --card-b: #10b981;
  --card-c: #f59e0b;
  --card-d: #ec4899;
  --heat-1: #bae6fd;
  --heat-2: #38bdf8;
  --heat-3: #0284c7;
}

/* ====== 主题：森林绿 ====== */
[data-theme="forest"] {
  --bg: #f0f7f0;
  --surface: #ffffff;
  --surface-2: #f5faf5;
  --border: #cde0cd;
  --text: #0d2818;
  --text-muted: #5a7a5a;
  --primary: #059669;
  --primary-weak: #d1fae5;
  --danger: #ef4444;
  --sidebar: #0d2818;
  --sidebar-2: #1a3d28;
  --sidebar-text: #8fc9a8;
  --sidebar-active: #059669;
  --shadow: 0 1px 3px rgba(5,40,24,.08), 0 1px 2px rgba(5,40,24,.04);
  --brand-grad-1: #059669;
  --brand-grad-2: #10b981;
  --card-a: #059669;
  --card-b: #0d9488;
  --card-c: #f59e0b;
  --card-d: #ec4899;
  --heat-1: #a7f3d0;
  --heat-2: #34d399;
  --heat-3: #059669;
}

/* ====== 主题：暖夕阳 ====== */
[data-theme="sunset"] {
  --bg: #fdf6f0;
  --surface: #ffffff;
  --surface-2: #fff8f0;
  --border: #f0dcc8;
  --text: #451a03;
  --text-muted: #9a7a5a;
  --primary: #ea580c;
  --primary-weak: #ffedd5;
  --danger: #dc2626;
  --sidebar: #451a03;
  --sidebar-2: #5c2e0c;
  --sidebar-text: #f0c8a0;
  --sidebar-active: #ea580c;
  --shadow: 0 1px 3px rgba(69,26,3,.08), 0 1px 2px rgba(69,26,3,.04);
  --brand-grad-1: #ea580c;
  --brand-grad-2: #f59e0b;
  --card-a: #ea580c;
  --card-b: #10b981;
  --card-c: #eab308;
  --card-d: #ec4899;
  --heat-1: #fed7aa;
  --heat-2: #fb923c;
  --heat-3: #ea580c;
}

/* ====== 主题：玫瑰粉 ====== */
[data-theme="rose"] {
  --bg: #fdf2f6;
  --surface: #ffffff;
  --surface-2: #fef5f9;
  --border: #f0d4de;
  --text: #4a0d2a;
  --text-muted: #9a5a78;
  --primary: #e11d48;
  --primary-weak: #ffe4e6;
  --danger: #ef4444;
  --sidebar: #4a0d2a;
  --sidebar-2: #6b1840;
  --sidebar-text: #f0b8cc;
  --sidebar-active: #e11d48;
  --shadow: 0 1px 3px rgba(74,13,42,.08), 0 1px 2px rgba(74,13,42,.04);
  --brand-grad-1: #e11d48;
  --brand-grad-2: #ec4899;
  --card-a: #e11d48;
  --card-b: #10b981;
  --card-c: #f59e0b;
  --card-d: #be185d;
  --heat-1: #fecdd3;
  --heat-2: #fb7185;
  --heat-3: #e11d48;
}

/* ====== 主题：薄荷青 ====== */
[data-theme="mint"] {
  --bg: #f0faf8;
  --surface: #ffffff;
  --surface-2: #f0f7f5;
  --border: #c4e8e0;
  --text: #0a2e28;
  --text-muted: #5a8a7a;
  --primary: #0d9488;
  --primary-weak: #ccfbf1;
  --danger: #ef4444;
  --sidebar: #0a2e28;
  --sidebar-2: #144038;
  --sidebar-text: #8fcac0;
  --sidebar-active: #0d9488;
  --shadow: 0 1px 3px rgba(10,46,40,.08), 0 1px 2px rgba(10,46,40,.04);
  --brand-grad-1: #0d9488;
  --brand-grad-2: #14b8a6;
  --card-a: #0d9488;
  --card-b: #10b981;
  --card-c: #f59e0b;
  --card-d: #ec4899;
  --heat-1: #99f6e4;
  --heat-2: #2dd4bf;
  --heat-3: #0d9488;
}

/* ====== 主题：极地蓝（Nord 风） ====== */
[data-theme="nord"] {
  --bg: #e8edf2;
  --surface: #f5f8fa;
  --surface-2: #ecf0f4;
  --border: #d4dde5;
  --text: #2a3441;
  --text-muted: #6a7a8a;
  --primary: #5e81ac;
  --primary-weak: #e5eaf0;
  --danger: #bf616a;
  --sidebar: #2a3441;
  --sidebar-2: #3a4451;
  --sidebar-text: #a8bccd;
  --sidebar-active: #5e81ac;
  --shadow: 0 1px 3px rgba(42,52,65,.08), 0 1px 2px rgba(42,52,65,.04);
  --brand-grad-1: #5e81ac;
  --brand-grad-2: #88c0d0;
  --card-a: #5e81ac;
  --card-b: #a3be8c;
  --card-c: #ebcb8b;
  --card-d: #bf616a;
  --heat-1: #d8dee9;
  --heat-2: #81a1c1;
  --heat-3: #5e81ac;
}

/* ====== 主题：午夜紫 ====== */
[data-theme="midnight"] {
  --bg: #130a1f;
  --surface: #1e1330;
  --surface-2: #1a1028;
  --border: #2d1b4d;
  --text: #e0d0f0;
  --text-muted: #9888b8;
  --primary: #a855f7;
  --primary-weak: #2d1b4d;
  --danger: #f87171;
  --sidebar: #0d0617;
  --sidebar-2: #1a1028;
  --sidebar-text: #9888b8;
  --sidebar-active: #7c3aed;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --brand-grad-1: #7c3aed;
  --brand-grad-2: #a855f7;
  --card-a: #a855f7;
  --card-b: #34d399;
  --card-c: #fbbf24;
  --card-d: #f472b6;
  --heat-1: #4c1d95;
  --heat-2: #7c3aed;
  --heat-3: #a855f7;
}

/* ====== 主题：咖啡棕 ====== */
[data-theme="coffee"] {
  --bg: #1a1410;
  --surface: #2a201a;
  --surface-2: #231a15;
  --border: #3a2e25;
  --text: #e8dcc8;
  --text-muted: #a89878;
  --primary: #d4a056;
  --primary-weak: #3a2e1a;
  --danger: #f87171;
  --sidebar: #1a1410;
  --sidebar-2: #2a201a;
  --sidebar-text: #a89878;
  --sidebar-active: #c4914a;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --brand-grad-1: #c4914a;
  --brand-grad-2: #d4a056;
  --card-a: #d4a056;
  --card-b: #84cc16;
  --card-c: #fbbf24;
  --card-d: #f472b6;
  --heat-1: #3a2e1a;
  --heat-2: #6b5230;
  --heat-3: #c4914a;
}

/* ====== 主题：熊猫（黑白 + 竹叶绿） ====== */
[data-theme="panda"] {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --border: #e3e3dd;
  --text: #1c1c19;
  --text-muted: #6b6b64;
  --primary: #16a34a;
  --primary-weak: #dcfce7;
  --danger: #ef4444;
  --sidebar: #1c1c19;
  --sidebar-2: #2d2d29;
  --sidebar-text: #d6d6cf;
  --sidebar-active: #16a34a;
  --shadow: 0 1px 3px rgba(28,28,25,.08), 0 1px 2px rgba(28,28,25,.04);
  --brand-grad-1: #16a34a;
  --brand-grad-2: #4ade80;
  --card-a: #16a34a;
  --card-b: #0ea5e9;
  --card-c: #f59e0b;
  --card-d: #ec4899;
  --heat-1: #bbf7d0;
  --heat-2: #4ade80;
  --heat-3: #16a34a;
}

/* ====== 主题：橘猫（奶油底 + 暖橘） ====== */
[data-theme="cat"] {
  --bg: #fdf4e9;
  --surface: #ffffff;
  --surface-2: #fff8ee;
  --border: #f0dfc5;
  --text: #452c12;
  --text-muted: #a37c55;
  --primary: #f97316;
  --primary-weak: #ffedd5;
  --danger: #ef4444;
  --sidebar: #452c12;
  --sidebar-2: #5e3d1c;
  --sidebar-text: #f0cfa8;
  --sidebar-active: #f97316;
  --shadow: 0 1px 3px rgba(69,44,18,.08), 0 1px 2px rgba(69,44,18,.04);
  --brand-grad-1: #f97316;
  --brand-grad-2: #fbbf24;
  --card-a: #f97316;
  --card-b: #10b981;
  --card-c: #f43f5e;
  --card-d: #a16207;
  --heat-1: #ffddba;
  --heat-2: #fdba74;
  --heat-3: #f97316;
}

/* ====== 主题：柴犬（米色底 + 金毛金） ====== */
[data-theme="dog"] {
  --bg: #f8f4ec;
  --surface: #ffffff;
  --surface-2: #fbf8f1;
  --border: #e5dbc6;
  --text: #3f3222;
  --text-muted: #8a7a5f;
  --primary: #d97706;
  --primary-weak: #fef3c7;
  --danger: #ef4444;
  --sidebar: #3f3222;
  --sidebar-2: #57482f;
  --sidebar-text: #dbcda9;
  --sidebar-active: #d97706;
  --shadow: 0 1px 3px rgba(63,50,34,.08), 0 1px 2px rgba(63,50,34,.04);
  --brand-grad-1: #d97706;
  --brand-grad-2: #fbbf24;
  --card-a: #d97706;
  --card-b: #10b981;
  --card-c: #84cc16;
  --card-d: #ec4899;
  --heat-1: #fce8bd;
  --heat-2: #f5c469;
  --heat-3: #d97706;
}

/* ====== 主题：企鹅（极夜深蓝 + 冰川蓝） ====== */
[data-theme="penguin"] {
  --bg: #0d1b26;
  --surface: #16283a;
  --surface-2: #122230;
  --border: #24405a;
  --text: #e3edf5;
  --text-muted: #8fa9be;
  --primary: #38bdf8;
  --primary-weak: #0e3448;
  --danger: #f87171;
  --sidebar: #08131d;
  --sidebar-2: #122230;
  --sidebar-text: #8fa9be;
  --sidebar-active: #0ea5e9;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --brand-grad-1: #0ea5e9;
  --brand-grad-2: #38bdf8;
  --card-a: #38bdf8;
  --card-b: #34d399;
  --card-c: #fbbf24;
  --card-d: #f472b6;
  --heat-1: #0c3a52;
  --heat-2: #0e7490;
  --heat-3: #38bdf8;
}

/* ====== 主题：照片背景 / 内置背景（毛玻璃浮层） ====== */
[data-theme="photo"],
[data-theme^="bg-"] {
  --bg: #f1f5f9;
  --surface: rgba(255,255,255,.84);
  --surface-2: rgba(255,255,255,.62);
  --border: rgba(15,23,42,.14);
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #4f46e5;
  --primary-weak: rgba(79,70,229,.10);
  --danger: #ef4444;
  --sidebar: rgba(15,23,42,.82);
  --sidebar-2: rgba(30,41,59,.72);
  --sidebar-text: #cbd5e1;
  --sidebar-active: #4f46e5;
  --shadow: 0 4px 18px rgba(15,23,42,.14);
  --brand-grad-1: #6366f1;
  --brand-grad-2: #8b5cf6;
  --card-a: #4f46e5;
  --card-b: #10b981;
  --card-c: #f59e0b;
  --card-d: #ec4899;
  --heat-1: #c7d2fe;
  --heat-2: #818cf8;
  --heat-3: #4f46e5;
}
html[data-theme="photo"] body,
html[data-theme^="bg-"] body {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
html[data-theme="photo"] .sidebar,
html[data-theme="photo"] .topbar,
html[data-theme="photo"] .panel,
html[data-theme="photo"] .card,
html[data-theme="photo"] .tool-card,
html[data-theme="photo"] .chart-card,
html[data-theme="photo"] .day-group,
html[data-theme="photo"] .theme-picker,
html[data-theme^="bg-"] .sidebar,
html[data-theme^="bg-"] .topbar,
html[data-theme^="bg-"] .panel,
html[data-theme^="bg-"] .card,
html[data-theme^="bg-"] .tool-card,
html[data-theme^="bg-"] .chart-card,
html[data-theme^="bg-"] .day-group,
html[data-theme^="bg-"] .theme-picker {
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

/* ====== 主题切换过渡动画 ====== */
body, .sidebar, .topbar, .panel, .card, .input, .data th, .data tbody tr,
.tool-card, .day-group, .day-head, .batch-bar, .chart-card, .theme-picker {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }

.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-grad-1), var(--brand-grad-2));
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.brand-logo.emoji { font-size: 20px; }
.brand-name { color: #fff; font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--sidebar-text); opacity: .7; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  color: var(--sidebar-text); font-size: 13px; transition: .15s;
  user-select: none; position: relative;
}
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-ico { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; padding: 1px 8px; border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 11px; font-weight: 700;
  line-height: 1.4; min-width: 20px; text-align: center;
}
.nav-badge:empty { display: none; }
.nav-item.active .nav-badge { background: rgba(255,255,255,.22); }
.sidebar-foot { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- 主题选择器 ---------- */
.theme-picker-wrap { position: relative; }
.theme-btn {
  width: 100%; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  background: var(--sidebar-2); color: var(--sidebar-text); border: 1px solid rgba(255,255,255,.08);
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.theme-btn:hover { color: #fff; }
.theme-btn-ico { font-size: 15px; }
.theme-btn-label { flex: 1; text-align: left; }
.theme-btn-arrow { font-size: 11px; transition: transform .2s; }
.theme-btn-arrow.open { transform: rotate(180deg); }
.theme-picker {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 6px; z-index: 100;
  max-height: 380px; overflow-y: auto;
}
.theme-picker::-webkit-scrollbar { width: 6px; }
.theme-picker::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.theme-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; transition: background .15s;
}
.theme-opt:hover { background: var(--surface-2); }
.theme-opt.active { background: var(--primary-weak); }
.theme-opt-dots { display: flex; gap: 4px; flex-shrink: 0; }
.theme-opt-dot { width: 14px; height: 14px; border-radius: 4px; }
.theme-opt-name { font-size: 13px; color: var(--text); flex: 1; }
.theme-opt.active .theme-opt-name { color: var(--primary); font-weight: 600; }
.theme-opt-check { font-size: 14px; opacity: 0; color: var(--primary); }
.theme-opt.active .theme-opt-check { opacity: 1; }
.theme-opt-x {
  width: 18px; height: 18px; border-radius: 50%; font-size: 10px; line-height: 18px;
  text-align: center; background: rgba(239,68,68,.14); color: var(--danger);
  cursor: pointer; flex-shrink: 0; user-select: none;
}
.theme-opt-x:hover { background: var(--danger); color: #fff; }
/* 内置背景缩略图分组 */
.theme-bg-divider { height: 1px; background: var(--border); margin: 8px 6px 2px; }
.theme-bg-group-title { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 6px 8px 4px; }
.theme-bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 4px 6px; }
.theme-bg-thumb {
  position: relative; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: var(--surface-2);
  transition: border-color .15s, transform .15s;
}
.theme-bg-thumb:hover { transform: translateY(-1px); }
.theme-bg-thumb.active { border-color: var(--primary); }
.theme-bg-thumb img { width: 100%; height: 52px; object-fit: cover; display: block; }
.theme-bg-name {
  display: block; font-size: 11px; color: var(--text-muted);
  text-align: center; padding: 3px 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.theme-bg-thumb.active .theme-bg-name { color: var(--primary); font-weight: 600; }
.theme-bg-check {
  position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
  opacity: 0; transition: opacity .15s;
}
.theme-bg-thumb.active .theme-bg-check { opacity: 1; }
.foot-tip { font-size: 11px; color: #475569; text-align: center; margin-top: 10px; }

/* ---------- 主区域 ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px; padding: 0 26px;
}
.top-title-wrap { display: flex; flex-direction: column; justify-content: center; }
.top-title { font-weight: 800; font-size: 18px; color: var(--text); line-height: 1.25; }
.top-subtitle { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.top-search { flex: 1; max-width: 480px; }
.top-search input {
  width: 100%; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13px; outline: none;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.04);
}
.top-search input:focus { border-color: var(--primary); background: var(--surface); }
.top-user { color: var(--text-muted); font-size: 13px; }

.content { flex: 1; overflow-y: auto; padding: 26px; }

/* ---------- 水平滑动翻页（左右翻页） ----------
 * #main-content 作为视口：裁剪溢出，保证翻页时旧页面被完全覆盖、不残留/不闪现。
 * .page-track 横向排列各模块页面；.page 每页占满视口宽高，独立纵向滚动。
 */
.content.view { position: relative; overflow: hidden; padding: 0; }
.page-track { position: absolute; inset: 0; display: flex; touch-action: pan-y; }
.page {
  position: relative; flex: 0 0 100%; width: 100%; height: 100%;
  overflow-y: auto; padding: 26px; box-sizing: border-box;
}
@media (prefers-reduced-motion: reduce) {
  .page-track { transition: none !important; }
}

/* ---------- 页面头部 ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.page-head-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-ico {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
  background: var(--primary-weak); color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.08);
}
.page-head h1 { font-size: 22px; margin: 0; line-height: 1.25; }
.page-head .sub { color: var(--text-muted); margin: 3px 0 0; font-size: 13px; }
.head-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ---------- 卡片 ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
}
.card-ico { font-size: 26px; }
.card-val { font-size: 21px; font-weight: 800; }
.card-lab { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.card-a { border-left: 4px solid var(--card-a); }
.card-b { border-left: 4px solid var(--card-b); }
.card-c { border-left: 4px solid var(--card-c); }
.card-d { border-left: 4px solid var(--card-d); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.fg-full { grid-column: 1 / -1; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); }
.input {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text); font-size: 13px; outline: none; width: 100%;
}
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 150px; }
.toolbar .search { flex: 1; min-width: 200px; }

/* ---------- 按钮 ---------- */
.btn {
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.hidden { display: none !important; }

/* ---------- 批量选择 ---------- */
.ck-cell { width: 36px; text-align: center; }
.ck-cell input[type="checkbox"], .batch-bar input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; vertical-align: middle;
}
.batch-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding: 8px 12px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px;
  font-size: 12px; color: var(--text-muted);
}
.ck-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); font-weight: 600; user-select: none; }
.ck-count { flex: 1; }
.data tbody tr.sel { background: var(--primary-weak); }
.tool-card.sel { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.tool-top-right { display: flex; align-items: center; gap: 8px; }

/* ---------- 表格 ---------- */
.data { width: 100%; border-collapse: collapse; font-size: 13px; }
.data th, .data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data th { color: var(--text-muted); font-weight: 600; font-size: 12px; background: var(--surface-2); }
.data tbody tr:hover { background: var(--surface-2); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data .muted { color: var(--text-muted); }
.data .note { color: var(--text-muted); max-width: 320px; }
.row-act { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- 记录置顶 ---------- */
.pin-btn { padding: 2px 7px; font-size: 13px; line-height: 1.4; filter: grayscale(1); opacity: .55; }
.pin-btn:hover { filter: none; opacity: 1; }
.pin-btn.on { filter: none; opacity: 1; }
.pin-mark { cursor: default; }

/* 表格置顶行（开销 / 健身 / 学习） */
.data tbody tr.pinned-row { background: var(--primary-weak); }
.data tbody tr.pinned-row:hover { background: var(--primary-weak); }
.data tbody tr.pinned-row td { border-top: 1px solid var(--border); }
.data tbody tr.pinned-row td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

/* 日常记录：置顶分组区块 */
.day-group.pinned-group { border: 1px solid var(--primary-weak); box-shadow: inset 3px 0 0 var(--primary); }
.day-group.pinned-group .day-title { color: var(--primary); font-weight: 700; }
.task-row.pinned .task-text { font-weight: 600; }
.pin-date {
  display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 20px;
  font-size: 11px; font-weight: 600; background: var(--primary-weak); color: var(--primary);
}

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px;
  background: var(--primary-weak); color: var(--primary); font-weight: 600;
}

/* ---------- 图表 ---------- */
.charts-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 18px; }
.charts-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin: 8px 0 18px; }
.chart-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.chart-card-wide { grid-column: 1 / -1; }
.chart-card h3 { margin: 0 0 12px; font-size: 14px; }
.chart-box { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.chart-donut svg { flex-shrink: 0; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 12px; flex: 1; min-width: 140px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-label { flex: 1; color: var(--text); }
.legend-val { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }

/* ---------- 工具卡片（总控面板） ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 4px; }
.tool-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; transition: .15s;
}
.tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.tool-top { display: flex; justify-content: space-between; align-items: center; }
.tool-kind { font-size: 18px; }
.tool-name { font-weight: 700; font-size: 14px; word-break: break-all; }
.tool-path { font-size: 11px; color: var(--text-muted); word-break: break-all; min-height: 16px; }
.tool-actions { display: flex; gap: 6px; margin-top: 4px; }
.btn-open { background: var(--primary); color: #fff; }

/* ---------- 学习打卡热力 ---------- */
.heat { display: flex; flex-direction: column; gap: 10px; }
.heat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.heat-cell { aspect-ratio: 1; border-radius: 4px; background: var(--border); }
.heat-cell.lvl1 { background: var(--heat-1); }
.heat-cell.lvl2 { background: var(--heat-2); }
.heat-cell.lvl3 { background: var(--heat-3); }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.heat-legend .heat-cell { width: 12px; height: 12px; }

/* ---------- 空状态 & 提示 ---------- */
.empty { color: var(--text-muted); text-align: center; padding: 28px 10px; font-size: 13px; }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: #b91c1c; }

/* ---------- 统一底部快捷输入栏（快捷输入 / 键盘提交 / 备注可折叠） ---------- */
.quick-bar {
  position: sticky; bottom: 8px; z-index: 30; margin-top: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 -6px 24px rgba(15,23,42,.10);
  padding: 12px 14px;
}
.qb-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.qb-head .qb-mode { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.qb-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qb-date { display: flex; flex-direction: column; gap: 4px; width: 150px; flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.qb-date .input { width: 100%; }
.qb-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qb-pill {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); font-size: 13px; cursor: pointer;
  transition: .15s; white-space: nowrap; user-select: none; line-height: 1.2;
}
.qb-pill:hover { border-color: var(--primary); color: var(--primary); }
.qb-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.qb-pill-ico { margin-right: 5px; font-size: 14px; line-height: 1; }
.qb-field { flex: 1; min-width: 130px; }
.qb-field .input { width: 100%; }
.qb-actions { display: flex; gap: 8px; flex-shrink: 0; }
.qb-toggle {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none;
  font-size: 13px; color: var(--text-muted); padding: 7px 8px; white-space: nowrap; border-radius: 8px;
}
.qb-toggle:hover { color: var(--primary); background: var(--surface-2); }
.qb-toggle.active { color: var(--primary); font-weight: 600; }
.qb-extra { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.quick-bar.open .qb-extra { display: block; }
.qb-extra .rte-mount { margin-bottom: 8px; }
.qb-extra .input { width: 100%; }
.qb-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* 日常记录：聊天式底部输入栏 */
.daily-qb .qb-main { align-items: stretch; }
.daily-qb .qb-editor { flex: 1; min-width: 220px; display: flex; }
.daily-qb .qb-editor .rte-mount { flex: 1; }
.daily-qb .voice-status { flex: 0 1 auto; }

/* 移动端：输入栏紧凑全宽 */
@media (max-width: 600px) {
  .quick-bar { padding: 10px; bottom: 0; border-radius: 0; border-left: none; border-right: none; box-shadow: 0 -4px 16px rgba(15,23,42,.12); }
  .qb-head { margin-bottom: 8px; }
  .qb-main { gap: 8px; }
  .qb-date { width: 100%; flex-direction: row; align-items: center; gap: 6px; }
  .qb-date .input { flex: 1; width: auto; }
  .qb-pills { width: 100%; }
  .qb-pill { padding: 6px 10px; font-size: 12px; }
  .qb-pill-ico { font-size: 13px; }
  .qb-field { min-width: 100%; }
  .qb-actions { width: 100%; }
  .qb-actions .btn { flex: 1; justify-content: center; }
  .daily-qb .qb-main { flex-wrap: wrap; }
  .daily-qb .qb-editor { min-width: 100%; }
}

@media (max-width: 900px) {
  .cards, .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .charts-2, .charts-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .qb-date { width: 100%; }
}

/* ---------- 日常记录（每日一记） ---------- */
.daily-add { margin-bottom: 16px; }
.daily-add-row { display: flex; gap: 14px; align-items: flex-start; }
.daily-date { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-muted); width: 160px; flex-shrink: 0; }
.daily-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.daily-input-actions { display: flex; align-items: center; gap: 10px; }
.voice-status { font-size: 12px; color: var(--danger); flex: 1; }
#dr-voice.recording { background: var(--danger); color: #fff; border-color: var(--danger); animation: dr-pulse 1.1s infinite; }
@keyframes dr-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.daily-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.daily-toolbar .input { width: auto; min-width: 150px; }
.daily-toolbar .search { flex: 1; min-width: 200px; }

.daily-stats { display: flex; gap: 18px; margin-bottom: 14px; font-size: 13px; color: var(--text-muted); }
.daily-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.daily-stats .ok b { color: #10b981; }
.daily-stats .pend b { color: #f59e0b; }

.daily-list { display: flex; flex-direction: column; gap: 16px; }
.day-group { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.day-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.day-title { font-weight: 700; font-size: 14px; }
.day-wd { color: var(--text-muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.day-prog { font-size: 12px; color: var(--text-muted); }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-row .ck-label { margin-top: 2px; }
.task-body { flex: 1; min-width: 0; }
.task-text { font-size: 14px; color: var(--text); word-break: break-word; white-space: pre-wrap; }
.task-done-tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: rgba(16,185,129,.14); color: #10b981; }
.task-actions { display: flex; gap: 6px; }
.task-row.done { background: var(--surface-2); }
.task-row.done .task-text { color: var(--text-muted); text-decoration: line-through; }

/* ================= 设置中心 ================= */
#settings-btn { margin-top: 8px; }

/* 顶栏用户区（可点击打开设置） */
.top-user { cursor: pointer; display: flex; align-items: center; gap: 7px; user-select: none; transition: .15s; }
.top-user:hover { opacity: .8; }
.tu-avatar { font-size: 18px; }
.tu-name { font-size: 13px; font-weight: 600; }
.tu-role { font-size: 11px; padding: 1px 8px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.tu-role.r-admin { background: rgba(245,158,11,.16); color: #d97706; }
.tu-role.r-member { background: var(--primary-weak); color: var(--primary); }
.tu-role.r-guest { background: rgba(100,116,139,.14); color: var(--text-muted); }

/* 弹窗骨架 */
.st-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(15,23,42,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.st-modal {
  width: 640px; max-width: 100%; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28); animation: st-pop .18s ease;
}
@keyframes st-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.st-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.st-title { font-size: 17px; font-weight: 800; }
.st-close { border: 0; background: transparent; font-size: 15px; cursor: pointer; color: var(--text-muted); padding: 4px 10px; border-radius: 8px; }
.st-close:hover { background: var(--surface-2); color: var(--danger); }
.st-tabs { display: flex; gap: 6px; padding: 14px 20px 0; border-bottom: 1px solid var(--border); }
.st-tab {
  border: 0; background: transparent; padding: 9px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s;
}
.st-tab:hover { color: var(--primary); }
.st-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.st-body { padding: 18px 20px 20px; overflow-y: auto; }

/* 区块 */
.st-sec { margin-bottom: 22px; }
.st-sec:last-child { margin-bottom: 0; }
.st-sec-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.st-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.st-profile-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-top: 14px; }
.st-note { font-size: 11px; color: var(--text-muted); margin-top: 8px; line-height: 1.7; }

/* 头像选择 */
.st-av-list { display: flex; gap: 6px; flex-wrap: wrap; }
.st-av {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 17px; cursor: pointer; transition: .15s;
}
.st-av:hover { border-color: var(--primary); transform: translateY(-1px); }
.st-av.active { border-color: var(--primary); background: var(--primary-weak); box-shadow: 0 0 0 1px var(--primary); }

/* PIN */
.st-pin-row { display: flex; gap: 8px; }
.st-pin-row .input { flex: 1; }
.st-pin-gate { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 34px 10px; }
.st-pin-ico { font-size: 32px; }
.st-pin-tip { font-size: 13px; color: var(--text-muted); }
.st-pin-gate .input { width: 220px; text-align: center; letter-spacing: 4px; }

/* 账号列表 */
.st-acc-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface-2);
}
.st-acc-row.me { border-color: var(--primary); background: var(--primary-weak); }
.st-acc-avatar {
  font-size: 20px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; flex-shrink: 0;
}
.st-acc-info { flex: 1; min-width: 0; }
.st-acc-name { font-size: 13px; font-weight: 700; }
.st-acc-cur { color: var(--primary); font-weight: 400; font-size: 12px; }
.st-acc-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-acc-acts { display: flex; gap: 6px; flex-shrink: 0; }
.st-add-acc { display: flex; gap: 8px; margin-top: 10px; }
.st-add-acc .input:first-child { flex: 1; }
.st-add-acc select { width: 110px; flex-shrink: 0; }

/* 权限矩阵 */
.st-note-bar {
  font-size: 12px; color: var(--text-muted); background: var(--surface-2);
  border: 1px dashed var(--border); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; line-height: 1.7;
}
.st-note-bar b { color: var(--text); }
.st-role-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.st-role-tab {
  padding: 6px 18px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s;
}
.st-role-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.st-perm-table td.st-ck, .st-perm-table th { text-align: center; }
.st-perm-table td:first-child, .st-perm-table th:first-child { text-align: left; }
.st-perm-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.st-perm-table input[type="checkbox"]:disabled { opacity: .35; cursor: not-allowed; }
.st-empty { text-align: center; padding: 44px 10px; color: var(--text-muted); font-size: 14px; line-height: 2.2; }
.st-empty span { display: block; font-size: 12px; }

/* 数据管理 */
.st-usage-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 12px; }
.st-usage-name { width: 80px; font-weight: 600; flex-shrink: 0; }
.st-usage-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.st-usage-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-grad-1), var(--brand-grad-2)); }
.st-usage-val { width: 130px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.st-usage-total { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); text-align: right; }
.st-data-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 只读模式 */
.ro-banner {
  padding: 9px 14px; margin-bottom: 14px; border-radius: 10px; font-size: 12px; font-weight: 600;
  background: rgba(245,158,11,.12); color: #b45309; border: 1px dashed rgba(245,158,11,.5);
}
.page.readonly button,
.page.readonly input[type="checkbox"],
.page.readonly [contenteditable="true"] { opacity: .45; cursor: not-allowed; }

@media (max-width: 640px) {
  .st-modal { width: 100%; }
  .st-profile-cols { grid-template-columns: 1fr; }
  .st-acc-sub { display: none; }
}

/* ====== 提醒中心 ====== */
/* 提醒按钮（只读模式下也保持可点击：允许查看提醒） */
.page.readonly .rm-open { opacity: 1; cursor: pointer; }

/* 提醒管理弹窗 */
.rm-modal { width: 560px; }
.rm-list { display: flex; flex-direction: column; gap: 8px; }
.rm-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.rm-item-ico { font-size: 18px; flex-shrink: 0; }
.rm-item-body { flex: 1; min-width: 0; }
.rm-item-txt { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; }
.rm-item-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.rm-add-sec { margin-top: 22px; border-top: 1px dashed var(--border); padding-top: 16px; }
#rm-text { margin-top: 4px; }
.rm-form-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.rm-form-row .input { flex: 1; min-width: 90px; }
.rm-form-row .btn { flex-shrink: 0; }

/* 右下角通知卡片 */
.rm-notice {
  position: fixed; right: 20px; bottom: 20px; z-index: 950; width: 330px;
  max-width: calc(100vw - 40px); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.24); overflow: hidden;
  transform: translateY(16px); opacity: 0; pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
}
.rm-notice.show { transform: none; opacity: 1; pointer-events: auto; }
.rm-notice-head {
  padding: 10px 14px; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand-grad-1, #6366f1), var(--brand-grad-2, #8b5cf6));
}
.rm-notice-item {
  display: flex; gap: 10px; padding: 10px 14px; cursor: pointer;
  transition: background .15s; border-top: 1px solid var(--border);
}
.rm-notice-item:hover { background: var(--surface-2); }
.rm-notice-ico { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.rm-notice-body { min-width: 0; }
.rm-notice-txt { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; }
.rm-notice-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 富文本编辑器 ---------- */
.rte-label { grid-column: 1 / -1; }
.rte-mount { width: 100%; }
.rte {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--surface-2); transition: border-color .15s;
}
.rte:focus-within { border-color: var(--primary); }
.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 5px 6px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.rte-btn {
  min-width: 28px; height: 26px; padding: 0 7px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text); font-size: 13px; line-height: 1; transition: .15s;
}
.rte-btn:hover { background: var(--surface-2); }
.rte-btn.active { background: var(--primary-weak); color: var(--primary); }
.rte-clear { color: var(--text-muted); font-size: 12px; }
.rte-select {
  height: 26px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
  color: var(--text); font-size: 12px; margin: 0 4px; cursor: pointer; outline: none;
}
.rte-colorwrap { position: relative; display: inline-block; }
.rte-colorbtn { min-width: 28px; height: 26px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 13px; line-height: 1; }
.rte-colorbtn:hover { background: var(--surface-2); }
.rte-colorpop {
  position: absolute; top: 30px; left: 0; z-index: 60; display: grid;
  grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.rte-swatch { width: 18px; height: 18px; border-radius: 5px; cursor: pointer; border: 1px solid rgba(0, 0, 0, .14); transition: transform .12s; }
.rte-swatch:hover { transform: scale(1.18); }
.rte-area {
  min-height: 64px; max-height: 260px; overflow-y: auto; padding: 9px 11px;
  font-size: 14px; color: var(--text); line-height: 1.6; outline: none; word-break: break-word;
}
.rte-area:focus { background: var(--surface-2); }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--text-muted); opacity: .75; pointer-events: none; }

/* 字号映射（编辑区与展示区一致） */
.rte-area font[size="1"], .rte-content font[size="1"] { font-size: 11px; }
.rte-area font[size="2"], .rte-content font[size="2"] { font-size: 13px; }
.rte-area font[size="3"], .rte-content font[size="3"] { font-size: 15px; }
.rte-area font[size="4"], .rte-content font[size="4"] { font-size: 17px; }
.rte-area font[size="5"], .rte-content font[size="5"] { font-size: 20px; }
.rte-area font[size="6"], .rte-content font[size="6"] { font-size: 24px; }
.rte-area font[size="7"], .rte-content font[size="7"] { font-size: 28px; }

/* 富文本展示（列表 / 表格内） */
.rte-content { line-height: 1.6; word-break: break-word; }
.rte-content p { margin: 4px 0; }
.rte-content ul, .rte-content ol { margin: 4px 0; padding-left: 22px; }
.rte-content li { margin: 2px 0; }
.rte-content b, .rte-content strong { font-weight: 700; }

/* 已完成置灰需覆盖富文本内联样式 */
.task-row.done .task-text,
.task-row.done .task-text * {
  color: var(--text-muted) !important;
  text-decoration: line-through !important;
  background: transparent !important;
}

/* ---------- 云端同步状态徽标 ---------- */
.top-sync { display: flex; align-items: center; margin-left: 4px; }
.sync-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 6px 10px; border-radius: 999px; cursor: default;
  border: 1px solid #e2e8f0; background: #f1f5f9; color: #64748b;
  white-space: nowrap; user-select: none; transition: all .2s;
}
.sync-badge.ok { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.sync-badge.syncing { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.sync-badge.err { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

/* ---------- 云端同步设置面板 ---------- */
.st-c-status { margin: 6px 0 2px; }
.st-ok { color: #047857; }
.st-err { color: #b91c1c; }
.st-steps { margin: 8px 0 4px; padding-left: 20px; }
.st-steps li { margin: 6px 0; line-height: 1.6; }
.st-steps code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.st-steps a { color: var(--primary); }


/* ================= 新原型风格组件 ================= */

/* ---------- 三栏工作台布局 ---------- */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 18px;
  align-items: start;
}
.dashboard-main { min-width: 0; }
.dashboard-aside {
  display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 20px;
}
@media (max-width: 1100px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-aside { position: static; }
}

/* ---------- 仪表盘工具栏 & 分节标题 ---------- */
.dashboard-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.dashboard-toolbar-left { font-size: 15px; font-weight: 700; color: var(--text); }
.dashboard-toolbar-right { display: flex; gap: 8px; }
.section-head { margin-bottom: 12px; }
.section-head h2 { font-size: 15px; font-weight: 700; margin: 0; color: var(--text); }

/* ---------- KPI 卡 ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-card .val { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.2; }
.kpi-card .lab { font-size: 12px; color: var(--text-muted); }
.kpi-card .delta {
  font-size: 11px; font-weight: 600; margin-top: 2px;
}
.kpi-card .delta.up { color: #10b981; }
.kpi-card .delta.down { color: var(--danger); }
.kpi-ico {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-bottom: 4px; flex-shrink: 0;
}
.kpi-card.tone-a .kpi-ico { background: rgba(37,99,235,.12); color: #2563eb; }
.kpi-card.tone-b .kpi-ico { background: rgba(16,185,129,.12); color: #10b981; }
.kpi-card.tone-c .kpi-ico { background: rgba(245,158,11,.12); color: #d97706; }
.kpi-card.tone-d .kpi-ico { background: rgba(236,72,153,.12); color: #ec4899; }

/* ---------- 模块概览卡 ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.module-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s, box-shadow .15s;
  height: 100%;
  cursor: pointer;
}
.module-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15,23,42,.1); border-color: var(--primary); }
.module-card-header { display: flex; align-items: center; gap: 10px; }
.module-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary-weak); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.module-icon.a { background: rgba(37,99,235,.12); color: #2563eb; }
.module-icon.b { background: rgba(16,185,129,.12); color: #10b981; }
.module-icon.c { background: rgba(245,158,11,.12); color: #d97706; }
.module-icon.d { background: rgba(236,72,153,.12); color: #ec4899; }
.module-title { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.module-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.status-pill {
  padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted);
}
.status-pill.ok { background: rgba(16,185,129,.12); color: #10b981; }
.status-pill.warn { background: rgba(245,158,11,.12); color: #d97706; }
.status-pill.primary { background: var(--primary-weak); color: var(--primary); }
.module-list { display: flex; flex-direction: column; gap: 10px; }
.module-row { display: flex; align-items: center; gap: 10px; }
.module-row-text {
  flex: 1; font-size: 13px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.progress-bar {
  flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.progress-bar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.module-row-pct { width: 34px; text-align: right; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.module-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }

/* ---------- 右侧边栏面板 ---------- */
.right-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.right-panel h3 { margin: 0 0 14px; font-size: 14px; font-weight: 700; color: var(--text); }
.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.todo-item:last-child { border-bottom: 0; }
.todo-ico {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-weak); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.todo-ico.overdue { background: rgba(239,68,68,.12); color: var(--danger); }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 13px; font-weight: 600; color: var(--text); }
.todo-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.todo-btn { margin-top: 8px; }

/* ---------- 统计网格 & 迷你条形图 ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-item { background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; }
.stat-item .num { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-item .lab { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 60px; margin-top: 8px; }
.mini-bar { flex: 1; background: var(--border); border-radius: 4px 4px 0 0; min-height: 4px; }
.mini-bar.fill { background: var(--primary); }
.mini-bar.today { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-weak); }

/* ---------- 图表行 ---------- */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.chart-card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--text); }

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .kpi-row, .module-grid, .chart-row { grid-template-columns: 1fr; }
}

/* ---------- 常用工具（快捷入口） ---------- */
.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: 12px;
  color: var(--text); transition: .15s; max-width: 100%;
}
.tool-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
.tool-chip .tc-ico { font-size: 14px; }
.tool-chip .tc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-chip .tc-x {
  margin-left: 2px; opacity: .5; font-size: 12px; line-height: 1; padding: 1px 3px; border-radius: 6px;
}
.tool-chip .tc-x:hover { opacity: 1; background: rgba(239,68,68,.15); color: var(--danger); }
.tool-add {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px;
  border: 1px dashed var(--border); background: transparent; cursor: pointer; font-size: 12px; color: var(--text-muted);
}
.tool-add:hover { border-color: var(--primary); color: var(--primary); }
.tools-empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; }
.tool-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.tool-form.hidden { display: none; }
.tool-form-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text); }
.tool-form-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-form-grid .fg-full { grid-column: 1 / -1; }
.tool-form .input { width: 100%; }
.tool-form-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.tool-form-actions .btn { min-width: 64px; }
.tool-form-hint { grid-column: 1 / -1; margin-top: 2px; font-size: 11px; line-height: 1.5; color: var(--text-muted); }

/* ====== 账单导入预览弹窗 ====== */
.bi-overlay {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.45); backdrop-filter: blur(2px); padding: 16px;
}
.bi-modal {
  width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.bi-head { padding: 16px 20px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--border); }
.bi-body { padding: 16px 20px; font-size: 13px; line-height: 1.9; color: var(--text); }
.bi-row { margin-bottom: 6px; }
.bi-row b { color: var(--primary); }
.bi-row b.ok { color: var(--card-b); }
.bi-cats { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 4px; }
.bi-note { margin-top: 10px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.bi-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ====== 设置 - 输入习惯 ====== */
.st-radio-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.st-radio {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.st-radio:hover { border-color: var(--primary); }
.st-radio.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.18); background: var(--surface); }
.st-radio-dot { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--border); position: relative; }
.st-radio.active .st-radio-dot { border-color: var(--primary); }
.st-radio.active .st-radio-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); }
.st-radio-body { flex: 1; }
.st-radio-title { font-weight: 600; font-size: 14px; color: var(--text); }
.st-radio-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.6; }
.st-kbd-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.st-kbd-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text); }
.st-kbd-row kbd {
  flex: 0 0 auto; min-width: 96px; text-align: center; padding: 3px 8px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; color: var(--text);
}
.st-kbd-row span { color: var(--text-muted); }

/* ====== 读书模块 ====== */
/* 微信读书官方入口 CTA（可见链接元素，点击新标签页打开） */
.weread-cta {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  padding: 16px 18px; margin-bottom: 16px; border-radius: var(--radius);
  color: #fff; background: linear-gradient(135deg, #07c160 0%, #059c4a 100%);
  box-shadow: 0 6px 18px rgba(7,193,96,.28); border: 1px solid rgba(255,255,255,.18);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.weread-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(7,193,96,.36); filter: brightness(1.03); }
.weread-cta:active { transform: translateY(0); }
.weread-cta .wr-ico {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 24px; background: rgba(255,255,255,.18);
}
.weread-cta .wr-text { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.weread-cta .wr-text b { font-size: 16px; font-weight: 700; }
.weread-cta .wr-text small { font-size: 12px; opacity: .85; }
.weread-cta .wr-arrow { flex: 0 0 auto; font-size: 22px; font-weight: 700; opacity: .9; }
/* 评分列 */
.rate { white-space: nowrap; color: #f59e0b; }
/* 进度条内嵌百分比文字 */
.module-row-pct { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
/* 数字小字段（进度 / 评分） */
.qb-num { flex: 0 0 auto; width: 110px; }
.qb-num label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 2px; }
.qb-field.qb-num .input { width: 100%; }

/* ====== 累加式分页 ====== */
.pager-wrap { margin-top: 12px; }
.pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-wrap: wrap; padding: 12px 14px; margin-top: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  user-select: none;
}
.pager-info { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.pager-info b { color: var(--text); font-weight: 700; }
.pager-btn {
  padding: 7px 16px; font-size: 13px; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  transition: filter .15s, transform .1s, border-color .15s;
}
.pager-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); filter: brightness(1.02); }
.pager-btn:active:not(:disabled) { transform: translateY(1px); }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; background: var(--surface); color: var(--text-muted); }

/* ---------- 周报模块 ---------- */
.wr-week-label { font-size: 14px; font-weight: 700; color: var(--primary); margin: 4px 2px 12px; }
.wr-preview.empty {
  color: var(--text-muted); font-size: 14px; line-height: 1.9; padding: 18px;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius);
}
.wr-meta { font-size: 13px; color: var(--text-muted); padding: 10px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.wr-meta b { color: var(--text); }
.wr-doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; line-height: 1.95; }
.wr-title { font-size: 22px; margin: 0 0 6px; padding-bottom: 10px; border-bottom: 3px solid var(--primary); }
.wr-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.wr-blank { height: 10px; }
.wr-h { font-size: 16px; margin: 18px 0 6px; color: var(--text); }
.wr-p { margin: 0 0 6px; font-size: 14px; color: var(--text); text-align: justify; }
.wr-p b { color: var(--text); }
.wr-note { margin-top: 14px; font-size: 12px; color: var(--text-muted); line-height: 1.8; }
.wr-note code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ---------- 周报：视图切换条 + 明细表 ---------- */
.wr-views { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; }
.wr-views .wr-view.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.wr-spacer { flex: 1; }
.wr-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.wr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wr-table th, .wr-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; line-height: 1.5; }
.wr-table thead th { background: var(--surface-2); color: var(--primary); font-weight: 700; position: sticky; top: 0; white-space: nowrap; }
.wr-table tbody tr:nth-child(even) { background: rgba(127,127,127,0.04); }
.wr-table td:nth-child(5) { min-width: 320px; }
.wr-empty-tip { padding: 18px; color: var(--text-muted); font-size: 14px; }
