/* ==========================================================================
   复利人生 · Personal Review OS — 设计系统
   参考 Linear / Notion / Things 3：低饱和、细边框、克制阴影、信息密度优先
   ========================================================================== */

:root {
  --bg: #fbfbf9;
  --bg-side: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --surface-3: #f1f1ed;
  --text: #1b1a17;
  --text-2: #55524b;
  --muted: #8b877d;
  --border: #e9e7e1;
  --border-strong: #d9d6ce;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-ring: rgba(79, 70, 229, 0.22);
  --good: #15803d;
  --good-soft: rgba(21, 128, 61, 0.10);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.10);
  --bad: #b91c1c;
  --bad-soft: rgba(185, 28, 28, 0.09);
  --info: #1d4ed8;
  --info-soft: rgba(29, 78, 216, 0.09);
  --ring-track: #eeece7;
  --shadow-sm: 0 1px 2px rgba(24, 22, 18, 0.04);
  --shadow: 0 1px 3px rgba(24, 22, 18, 0.05), 0 8px 24px -16px rgba(24, 22, 18, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(20, 18, 14, 0.28), 0 2px 8px rgba(20, 18, 14, 0.06);
  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --sidebar-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0e0e11;
  --bg-side: #121215;
  --surface: #17171b;
  --surface-2: #1c1c21;
  --surface-3: #232329;
  --text: #ececee;
  --text-2: #b4b3bd;
  --muted: #7f7e8a;
  --border: #26262d;
  --border-strong: #33333c;
  --accent: #7c78ff;
  --accent-hover: #918eff;
  --accent-soft: rgba(124, 120, 255, 0.14);
  --accent-ring: rgba(124, 120, 255, 0.28);
  --good: #4ade80;
  --good-soft: rgba(74, 222, 128, 0.13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --ring-track: #26262d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 12px 32px -20px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.012em; }
p { margin: 0; }
::selection { background: var(--accent-soft); }

/* 滚动条 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================ 布局 ============================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh; /* iOS 地址栏收起时 100vh 会偏大，dvh 更准 */
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  padding: 14px 10px 10px;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 16px;
  user-select: none;
}
.brand-mark {
  width: 28px; height: 28px; flex: none; display: block;
  filter: drop-shadow(0 2px 4px rgba(24, 22, 18, 0.16));
}
/* 顶栏品牌（仅移动端，桌面端由侧边栏承担） */
.topbar-brand { display: none; }
@media (max-width: 860px) {
  .topbar-brand { display: block; width: 24px; height: 24px; margin-left: 1px; }
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 13.5px; letter-spacing: 0.01em; }
.brand-text span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.nav-group { margin-bottom: 14px; }
.nav-label {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 0 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7.5px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none;
  font-size: 13px; font-weight: 500;
  position: relative;
  transition: background 0.14s, color 0.14s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.nav-item.on::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .ico { color: var(--muted); flex: none; }
.nav-item.on .ico { color: var(--accent); }
.nav-item .nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 6px; border-radius: 20px;
}
.nav-item .nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; }
.side-user:hover { background: var(--surface-3); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(150deg, #ede9fe, #ddd6fe);
  color: #5b21b6; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; flex: none;
}
[data-theme="dark"] .avatar { background: #2a2547; color: #c4b5fd; }
.side-user-info { min-width: 0; flex: 1; }
.side-user-info b { display: block; font-size: 12.5px; font-weight: 600; }
.side-user-info span { display: block; font-size: 10.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 54px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.search-box {
  position: relative; width: 240px; max-width: 40vw;
}
.search-toggle { display: none; }
.search-box .ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input {
  width: 100%; height: 32px; padding: 0 10px 0 30px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); font-size: 12.5px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.search-box kbd {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--muted); border: 1px solid var(--border);
  padding: 0 4px; border-radius: 4px; background: var(--surface-2);
  font-family: var(--font);
}

.content { padding: 10px 26px 64px; max-width: 1220px; width: 100%; margin: 0 auto; }

/* ============================ 通用 ============================ */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.bordered { border-color: var(--border); background: var(--surface); }
.icon-btn.bordered:hover { border-color: var(--border-strong); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 12.8px; font-weight: 500;
  white-space: nowrap; transition: all 0.14s var(--ease);
  text-decoration: none;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 38px; padding: 0 18px; font-size: 13.5px; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn .ico { flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; padding: 1.5px 7px;
  border-radius: 20px; white-space: nowrap; max-width: 150px;
  overflow: hidden; text-overflow: ellipsis;
  background: var(--surface-3); color: var(--text-2);
}
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-ok { background: var(--info-soft); color: var(--info); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-muted { background: var(--surface-3); color: var(--muted); }

.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--mono); }
.tiny { font-size: 11px; }
.small { font-size: 12.2px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.hide { display: none !important; }

/* ============================ 页头 ============================ */
.view-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin: 12px 0 18px;
}
.view-head h1 { font-size: 21px; letter-spacing: -0.02em; font-weight: 600; }
.view-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.view-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ============================ 卡片 ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.card.pad0 { padding: 0; }
.card-hover { transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s; }
.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; display: flex; align-items: center; gap: 6px; }
.card-title .ico { color: var(--muted); }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-link { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.card-link:hover { color: var(--accent); text-decoration: none; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2.05fr); }

/* ============================ 仪表盘 ============================ */
.hello-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hello-row h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; }
.hello-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.today-score {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--border);
}
.today-score .big { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.today-score .lbl { font-size: 11px; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.quick-item {
  display: flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 9px 10px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12.4px; color: var(--text-2); text-decoration: none;
  transition: all 0.14s;
}
.quick-item:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); text-decoration: none; }
.quick-item .ico { color: var(--accent); }

.goal-card { display: flex; flex-direction: column; gap: 8px; }
.goal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.goal-name { font-size: 13.2px; font-weight: 550; line-height: 1.35; }
.goal-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }

.bar { height: 5px; background: var(--ring-track); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.5s var(--ease); }
.bar.good > i { background: var(--good); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }
.bar.thin { height: 3px; }
.bar-row { display: flex; align-items: center; gap: 9px; }
.bar-row .bar { flex: 1; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-val { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.stat-val small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.stat-lbl { font-size: 11.5px; color: var(--muted); }
.stat-delta { font-size: 11px; display: inline-flex; align-items: center; gap: 2px; }
.stat-delta.up { color: var(--good); }
.stat-delta.down { color: var(--bad); }

/* ============================ 图表 ============================ */
.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-radar { max-height: 300px; }
.c-grid { stroke: var(--border); stroke-width: 1; }
.c-grid-fill { fill: none; stroke: var(--border); stroke-width: 1; }
.c-axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.c-radar-label { font-size: 10.5px; }
.c-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.c-legend span { display: inline-flex; align-items: center; gap: 5px; }
.c-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.chart-empty {
  display: grid; place-items: center; color: var(--muted); font-size: 12px;
  border: 1px dashed var(--border); border-radius: var(--r);
}
.heatmap svg { max-height: 140px; }
.heat-legend { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
.spark { display: block; }

.ring { position: relative; display: grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-txt { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.ring-txt b { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.ring-txt span { font-size: 9px; color: var(--muted); }

.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 74px 1fr 64px; align-items: center; gap: 9px; font-size: 11.5px; }
.hbar-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 6px; background: var(--ring-track); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; transition: width 0.5s var(--ease); }
.hbar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ============================ AI 洞察 ============================ */
.insight {
  display: flex; gap: 10px; padding: 11px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.insight + .insight { margin-top: 8px; }
.insight-ico {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  flex: none; background: var(--surface); color: var(--accent); border: 1px solid var(--border);
}
.insight b { font-size: 12px; font-weight: 600; display: block; margin-bottom: 2px; }
.insight p { font-size: 12.2px; color: var(--text-2); line-height: 1.55; }
.insight.ai { background: linear-gradient(135deg, var(--accent-soft), transparent 85%); border-color: var(--accent-ring); }

.ai-box {
  border: 1px solid var(--accent-ring);
  background: linear-gradient(160deg, var(--accent-soft), transparent 60%);
  border-radius: var(--r);
  padding: 14px 16px;
}
.ai-box-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }

/* AI 连通性测试结果 */
.ai-res {
  border-radius: 9px; padding: 9px 11px; font-size: 12px; line-height: 1.65;
  border: 1px solid var(--border); background: var(--surface-2);
  word-break: break-word;
}
.ai-res.ok { border-left: 3px solid var(--good); background: var(--good-soft); }
.ai-res.bad { border-left: 3px solid var(--bad); background: var(--bad-soft); }
.ai-res-t { font-weight: 650; margin-bottom: 2px; }
.ai-res.ok .ai-res-t { color: var(--good); }
.ai-res.bad .ai-res-t { color: var(--bad); }
.ai-res-l { color: var(--muted); font-size: 11.5px; }
.ai-res-l code { font-family: var(--mono); font-size: 11px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }

.md { font-size: 13.2px; line-height: 1.75; color: var(--text-2); }
.md h1, .md h2, .md h3, .md h4 { color: var(--text); margin: 18px 0 7px; line-height: 1.4; }
.md h1 { font-size: 17px; } .md h2 { font-size: 15px; } .md h3 { font-size: 13.6px; } .md h4 { font-size: 13px; }
.md h2:first-child, .md h3:first-child, .md h4:first-child { margin-top: 4px; }
.md p { margin: 7px 0; }
.md ul, .md ol { margin: 7px 0; padding-left: 20px; }
.md li { margin: 3px 0; }
.md strong { color: var(--text); font-weight: 600; }
.md code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--surface-2); padding: 11px; border-radius: 8px; overflow: auto; border: 1px solid var(--border); }
.md blockquote { margin: 9px 0; padding: 2px 0 2px 12px; border-left: 2px solid var(--accent); color: var(--muted); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.md a { text-decoration: underline; }

/* ============================ 表单 ============================ */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field-label { font-size: 12px; font-weight: 550; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field-label .opt { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 400; }
.field-hint { font-size: 11px; color: var(--muted); line-height: 1.5; }
.input {
  width: 100%; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  resize: vertical; line-height: 1.6;
}
.input:hover { border-color: var(--border-strong); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input::placeholder { color: var(--muted); opacity: 0.85; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b877d' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.auto-grow { overflow: hidden; min-height: 60px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

.rate-row { display: grid; grid-template-columns: minmax(120px, 150px) 1fr 34px; align-items: center; gap: 12px; padding: 7px 0; }
.rate-meta { display: flex; flex-direction: column; }
.rate-label { font-size: 12.5px; font-weight: 500; }
.rate-hint { font-size: 10.5px; color: var(--muted); }
.rate-val {
  font-size: 13px; font-weight: 600; text-align: center;
  background: var(--surface-3); border-radius: 6px; padding: 2px 0;
  font-variant-numeric: tabular-nums;
}
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; outline: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--p, 55%), var(--ring-track) var(--p, 55%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); margin-top: -5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform 0.12s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--ring-track); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }

.segmented { display: inline-flex; background: var(--surface-3); padding: 2px; border-radius: 8px; gap: 2px; }
.segmented .seg {
  border: none; background: transparent; padding: 4px 11px; border-radius: 6px;
  font-size: 12px; color: var(--text-2); transition: all 0.14s;
}
.segmented .seg.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  padding: 4px 10px; border-radius: 20px; font-size: 12px; color: var(--text-2);
  transition: all 0.14s;
}
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

checkbox, .check-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ============================ 分步复盘 ============================ */
.steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.step-dot {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 5px; border-radius: 20px; font-size: 11.5px;
  color: var(--muted); background: transparent; border: 1px solid transparent;
}
.step-dot .n {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; background: var(--surface-3); color: var(--muted); flex: none;
}
.step-dot.on { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.step-dot.on .n { background: var(--accent); color: #fff; }
.step-dot.done .n { background: var(--good-soft); color: var(--good); }
.step-sep { width: 12px; height: 1px; background: var(--border); }

.step-body { min-height: 320px; }
.step-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 3px; }
.step-desc { font-size: 12.3px; color: var(--muted); margin-bottom: 18px; }

.q { margin-bottom: 16px; }
.q-label { font-size: 12.8px; font-weight: 550; margin-bottom: 5px; display: flex; align-items: baseline; gap: 6px; }
.q-label .qn { font-size: 10px; color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }

.wizard-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.autosave { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; transition: color 0.2s; }
.autosave::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--good); opacity: .7; }
.autosave.flash { color: var(--good); }

.win-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.win-row .idx { font-size: 11px; color: var(--muted); width: 16px; flex: none; }
.win-row .input { flex: 1; }
.win-row select.input { max-width: 150px; flex: none; }

/* ============================ 列表 / 表格 ============================ */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 12.8px;
}
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 500; }
.list-row .s { font-size: 11px; color: var(--muted); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
  letter-spacing: 0.02em;
}
table.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }

/* 任务勾选 */
.task {
  display: flex; align-items: center; gap: 9px; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 12.8px;
}
.task:last-child { border-bottom: none; }
.task-check {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  background: var(--surface); display: grid; place-items: center; flex: none;
  color: transparent; transition: all 0.14s; cursor: pointer; padding: 0;
}
.task-check:hover { border-color: var(--accent); }
.task-check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.task-title { flex: 1; min-width: 0; }
.task-min { font-size: 10.5px; color: var(--muted); }

/* 空状态 */
.empty { text-align: center; padding: 34px 16px; }
.empty-ico {
  width: 40px; height: 40px; border-radius: 11px; margin: 0 auto 10px;
  display: grid; place-items: center; background: var(--surface-3); color: var(--muted);
}
.empty h4 { font-size: 13px; margin-bottom: 4px; }
.empty p { font-size: 12px; color: var(--muted); max-width: 320px; margin: 0 auto; }
.empty-act { margin-top: 12px; }

/* 骨架 */
.skeleton { display: flex; flex-direction: column; gap: 9px; padding: 6px 0; }
.sk-line {
  height: 11px; border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ============================ 弹层 ============================ */
.modal-host { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18, 16, 12, 0.36); backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.2s; }
[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, 0.6); }
.modal {
  position: relative; width: 100%; background: var(--surface); border-radius: 14px;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.99); opacity: 0; transition: all 0.22s var(--ease);
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.modal-host.in .modal-backdrop { opacity: 1; }
.modal-host.in .modal { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 14px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.confirm-msg { font-size: 13px; color: var(--text-2); line-height: 1.7; }

.toast-host {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--text); color: var(--bg);
  padding: 8px 14px; border-radius: 9px; font-size: 12.5px;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px);
  transition: all 0.26s var(--ease); max-width: min(90vw, 520px);
}
[data-theme="dark"] .toast { background: #2c2c33; color: var(--text); border: 1px solid var(--border-strong); }
.toast.in { opacity: 1; transform: none; }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); flex: none; }
.toast-error .toast-dot { background: #f87171; }
.toast-warn .toast-dot { background: #fbbf24; }
.toast-msg { line-height: 1.5; }

/* ============================ 时间线 ============================ */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--surface); border: 1.5px solid var(--border-strong);
}
.tl-item.highlight::before { background: var(--accent); border-color: var(--accent); }
.tl-date { font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }
.tl-title { font-size: 12.8px; font-weight: 550; margin: 1px 0 2px; }
.tl-body { font-size: 12px; color: var(--text-2); }

/* ============================ 目标 ============================ */
.goal-row {
  display: grid; grid-template-columns: 1fr 150px 110px 96px;
  align-items: center; gap: 14px; padding: 11px 12px;
  border-radius: 9px; border: 1px solid transparent;
  transition: all 0.14s;
}
.goal-row:hover { background: var(--surface-2); border-color: var(--border); }
.goal-row .title { font-size: 13px; font-weight: 500; }
.goal-row .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.goal-row .goal-ops { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 0; }
.goal-quick { display: inline-flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.goal-row:hover .goal-quick, .goal-row:focus-within .goal-quick { opacity: 1; }
.goal-quick .icon-btn { width: 24px; height: 24px; }
@media (hover: none) { .goal-quick { opacity: 1; } }
.goal-section-title { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 20px 0 8px; }

.metric-box { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; background: var(--surface-2); }
.metric-name { font-size: 12px; font-weight: 500; }
.metric-val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-val small { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ============================ 档案 ============================ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 7px 12px; font-size: 12.5px; color: var(--muted); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 550; }

.cog-item {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); transition: border-color .15s;
}
.cog-item:hover { border-color: var(--border-strong); }
.cog-item .title { font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.cog-item .content { font-size: 12.3px; color: var(--text-2); margin-top: 4px; line-height: 1.65; }
.cog-item .meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 10.5px; color: var(--muted); }

.evidence {
  font-size: 11.5px; color: var(--text-2); background: var(--surface-2);
  border-left: 2px solid var(--border-strong); padding: 5px 9px; border-radius: 0 6px 6px 0;
  margin-top: 5px;
}
.evidence b { color: var(--accent); font-weight: 500; font-family: var(--mono); font-size: 10.5px; }

/* ============================ 聊天 ============================ */
.chat-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; height: calc(100vh - 150px); min-height: 520px; }
.chat-side { display: flex; flex-direction: column; gap: 6px; overflow: auto; border-right: 1px solid var(--border); padding-right: 10px; }
.chat-side .item { padding: 8px 10px; border-radius: 8px; font-size: 12.2px; color: var(--text-2); cursor: pointer; }
.chat-side .item:hover { background: var(--surface-3); }
.chat-side .item.on { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); font-weight: 500; }
.chat-main { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg-user { flex-direction: row-reverse; }
.msg-ava {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 10px; font-weight: 600; background: var(--surface-3); color: var(--text-2);
}
.msg-ai .msg-ava { background: var(--accent-soft); color: var(--accent); }
.msg-bubble {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 10px 13px; border-radius: 11px; font-size: 13px; line-height: 1.7;
  max-width: min(760px, 88%); color: var(--text-2);
}
.msg-user .msg-bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
.msg-user .msg-bubble a { color: #fff; text-decoration: underline; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 5px; }
.chat-input-wrap { border-top: 1px solid var(--border); padding: 10px 12px; background: var(--surface); }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
  flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px;
  resize: none; max-height: 140px; outline: none; font-size: 13px; line-height: 1.55;
  background: var(--surface-2);
}
.chat-input:focus { border-color: var(--accent); background: var(--surface); }
.chat-hint { font-size: 10.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.chat-hint button { background: none; border: none; color: var(--muted); font-size: 10.5px; padding: 0; text-decoration: underline dotted; }
.chat-hint button:hover { color: var(--accent); }

.typing { display: inline-flex; gap: 3px; align-items: center; padding: 4px 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ============================ 设置 ============================ */
.set-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row .info { flex: 1; min-width: 0; }
.set-row .info b { font-size: 12.8px; font-weight: 550; display: block; }
.set-row .info span { font-size: 11.5px; color: var(--muted); line-height: 1.55; display: block; margin-top: 2px; }
.set-row .ctrl { flex: none; display: flex; align-items: center; gap: 8px; }

.switch { position: relative; width: 34px; height: 19px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 20px; background: var(--border-strong);
  transition: background 0.18s; cursor: pointer;
}
.switch span::before {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: transform 0.18s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(15px); }

.kv { display: grid; grid-template-columns: 100px 1fr; gap: 6px 12px; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-2); }

/* ============================ 搜索面板 ============================ */
.search-panel {
  position: fixed; inset: 0; z-index: 220; display: flex; justify-content: center;
  padding-top: 10vh; background: rgba(18,16,12,.28); backdrop-filter: blur(3px);
}
[data-theme="dark"] .search-panel { background: rgba(0,0,0,.55); }
.search-card {
  width: min(620px, 92vw); max-height: 70vh; background: var(--surface);
  border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.search-card input {
  border: none; outline: none; width: 100%; padding: 15px 17px; font-size: 14.5px;
  background: transparent; border-bottom: 1px solid var(--border);
}
.search-results { overflow-y: auto; padding: 6px; }
.sr-item { padding: 9px 11px; border-radius: 8px; cursor: pointer; display: block; text-decoration: none; color: inherit; }
.sr-item:hover, .sr-item.on { background: var(--surface-2); text-decoration: none; }
.sr-item .k { font-size: 10px; color: var(--accent); letter-spacing: .02em; }
.sr-item .t { font-size: 12.8px; font-weight: 500; margin: 1px 0; }
.sr-item .s { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ 移动端 ============================ */
.bottom-nav { display: none; }
.menu-btn { display: none; }

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 120;
    transform: translateX(-104%); transition: transform 0.26s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; height: 50px; }
  .content { padding: 6px 14px 92px; }
  .view-head h1 { font-size: 18.5px; }
  .view-head { flex-direction: column; align-items: stretch; gap: 10px; margin: 8px 0 14px; }
  .view-actions { justify-content: flex-start; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g4 { gap: 10px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 14px; border-radius: 13px; }
  .search-box { display: none; }
  .search-toggle { display: inline-grid; }
  .topbar-date { display: none; }
  body { overflow-x: hidden; }
  .chat-wrap { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 190px); }
  .chat-side { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .rate-row { grid-template-columns: 110px 1fr 32px; gap: 8px; }
  .goal-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; padding: 12px; }
  .goal-row .hide-sm { display: none; }
  .goal-row > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .goal-row > div:nth-child(4) { grid-column: 2; grid-row: 1; }
  .goal-head { display: none !important; }
  .step-dot { white-space: nowrap; }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 9.5px; color: var(--muted); text-decoration: none; padding: 4px 0; border-radius: 8px;
  }
  .bottom-nav a.on { color: var(--accent); }
  .bottom-nav a.on .ico { color: var(--accent); }
  .modal-host { padding: 0; align-items: flex-end; }
  .modal { max-width: none !important; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .modal-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .steps { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .step-dot span:not(.n) { display: none; }
  .step-dot.on span:not(.n) { display: inline; }
  .toast-host { bottom: 78px; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .view-actions, .no-print, .toast-host { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ==========================================================================
   账号与同步 / 数据保护
   ========================================================================== */
.sync-chip { position: relative; }
.sync-chip::after {
  content: ""; position: absolute; right: 5px; bottom: 5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); box-shadow: 0 0 0 2px var(--surface);
}
.sync-chip.ok::after { background: var(--good); }
.sync-chip.run::after { background: var(--info); animation: pulse 1.2s infinite; }
.sync-chip.warn::after { background: var(--warn); }
.sync-chip.bad::after { background: var(--bad); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.sync-pill {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.sync-pill.ok { background: var(--good-soft); color: var(--good); }
.sync-pill.run { background: var(--info-soft); color: var(--info); }
.sync-pill.warn { background: var(--warn-soft); color: var(--warn); }
.sync-pill.bad { background: var(--bad-soft); color: var(--bad); }
.sync-pill.off { background: var(--surface-3); color: var(--muted); }

.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head-row h3 { font-size: 13.5px; font-weight: 650; }

.acct-hero { display: flex; gap: 14px; align-items: flex-start; }
.acct-badge {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.login-body { margin-top: 18px; }
.login-block .fl {
  display: block; font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: .04em; margin-bottom: 6px;
}
.login-row { display: flex; gap: 8px; }
.login-row .input { flex: 1; min-width: 0; }
.login-row .btn { flex: 0 0 auto; white-space: nowrap; }
.login-or {
  display: flex; align-items: center; gap: 10px; margin: 16px 0;
  color: var(--muted); font-size: 11px;
}
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-alt { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-wide { flex: 1; min-width: 150px; justify-content: center; }
.field-err { color: var(--bad); font-size: 12px; margin-top: 8px; min-height: 0; }
.field-err:empty { display: none; }

.acct-signed { display: flex; align-items: center; gap: 14px; }
.acct-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 17px;
}

.kv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; }
.kv-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kv-grid b { font-size: 13px; font-weight: 620; }

.list-body { border-top: 1px solid var(--border); }
.row-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 20px; border-bottom: 1px solid var(--border);
}
.row-item:last-child { border-bottom: none; }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-main b { font-size: 12.8px; font-weight: 600; }
.row-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.empty-mini { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }

.alert {
  border-radius: var(--r-sm); padding: 10px 12px; font-size: 12.4px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
}
.alert.info { background: var(--info-soft); border-color: rgba(29, 78, 216, .18); color: var(--info); }
.alert.warn { background: var(--warn-soft); border-color: rgba(180, 83, 9, .18); color: var(--warn); }
.alert.bad { background: var(--bad-soft); border-color: rgba(185, 28, 28, .18); color: var(--bad); }

.ok-dot, .bad-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.ok-dot { background: var(--good); }
.bad-dot { background: var(--warn); }

.protect-list { display: grid; gap: 10px; }
.protect-item {
  display: grid; grid-template-columns: 108px 1fr; gap: 12px;
  font-size: 12.6px; color: var(--text-2); line-height: 1.65;
}
.protect-item b { color: var(--text); font-weight: 620; }

.icon-btn.danger { color: var(--bad); }
.icon-btn.danger:hover { background: var(--bad-soft); }

.btn { white-space: nowrap; }
.flex > .btn, .flex > a.btn { flex: 0 0 auto; }

@media (max-width: 860px) {
  .kv-grid { grid-template-columns: repeat(2, 1fr); }
  .protect-item { grid-template-columns: 1fr; gap: 2px; }
  .login-row { flex-wrap: wrap; }
  .login-row .input { flex: 1 1 100%; }
  .login-row .btn { flex: 1 1 auto; }
  .acct-signed { flex-wrap: wrap; }
  .row-item { padding: 11px 14px; }
  .row-main b { font-size: 12.5px; }
}

/* 深色主题下浅紫底 + 白字对比度不足，改为深色文字 */
[data-theme="dark"] .btn-primary { color: #14141a; }
[data-theme="dark"] .btn-primary:hover { color: #14141a; }

/* ==========================================================================
   2.0 新增模块样式（沿用第一版设计变量，不引入新品牌色）
   ========================================================================== */

/* 通用栅格与指标 */
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.g-3-1 { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) {
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g-3-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .grid.g3 { grid-template-columns: minmax(0, 1fr); }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stat-card { padding: 13px 15px; }
.stat-card .n { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-card .l { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.stat-card .s { font-size: 11px; color: var(--text-2); margin-top: 5px; }
.stat-card.sc-good .n { color: var(--good); }
.stat-card.sc-warn .n { color: var(--warn); }
.stat-card.sc-bad .n { color: var(--bad); }
.stat-card.sc-accent .n { color: var(--accent); }
@media (max-width: 480px) { .stat-card .n { font-size: 19px; } }

.check-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.check-row input { accent-color: var(--accent); }

/* 依据卡 */
.basis { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); padding: 11px 13px; }
.basis-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.basis-title { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text); }
.basis-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 9px; }
.bk { font-size: 10.5px; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 4px; }
.bk-fact { color: var(--info); }
.bk-inf { color: var(--warn); }
.bk-unk { color: var(--muted); }
.basis-list { margin: 0; padding-left: 15px; font-size: 12px; line-height: 1.7; color: var(--text-2); }
.basis-src { margin-top: 9px; border-top: 1px dashed var(--border); padding-top: 8px; }
.basis-src summary { cursor: pointer; font-size: 11.5px; color: var(--accent); }
.basis-src-list { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; }
.basis-src-item { display: flex; gap: 8px; font-size: 11.5px; color: var(--text-2); text-decoration: none; padding: 3px 0; }
.basis-src-item:hover { color: var(--accent); }
.basis-src-item .d { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.basis-src-item .k { color: var(--muted); flex: 0 0 auto; }
.basis-src-item .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.basis-mini { margin-top: 8px; }
.basis-mini summary { cursor: pointer; font-size: 11.5px; color: var(--accent); }
@media (max-width: 720px) { .basis-cols { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

/* 决策库 */
.dc-card { display: block; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 13px 15px; text-decoration: none; color: inherit; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.dc-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.dc-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dc-title { font-size: 14.5px; font-weight: 600; margin-top: 7px; letter-spacing: -0.01em; }
.dc-body { font-size: 12.5px; color: var(--text-2); margin-top: 5px; line-height: 1.65; }
.dc-foot { display: flex; align-items: center; gap: 7px; margin-top: 8px; flex-wrap: wrap; }

.opt-row { display: grid; grid-template-columns: 22px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 7px; align-items: center; margin-bottom: 7px; }
.opt-row .idx { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.opt-view { border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; margin-bottom: 8px; }
.opt-view.chosen { border-color: var(--accent); background: var(--accent-soft); }
.opt-h { display: flex; align-items: center; gap: 7px; font-size: 12.8px; font-weight: 550; }
.opt-b { display: flex; gap: 12px; margin-top: 4px; font-size: 11.5px; flex-wrap: wrap; }
.opt-b .pos { color: var(--good); }
.opt-b .neg { color: var(--warn); }
@media (max-width: 640px) { .opt-row { grid-template-columns: 18px minmax(0, 1fr); } .opt-row .input:nth-of-type(2), .opt-row .input:nth-of-type(3) { grid-column: 2; } }

.plan-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.plan-row:last-child { border-bottom: 0; }
.plan-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: 0 0 auto; }
.plan-row.done .dot { background: var(--good); }
.plan-row.due .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.plan-row .t { font-size: 12.5px; }
.plan-row .s { font-size: 11px; color: var(--muted); }
.review-block { border-top: 1px solid var(--border); padding-top: 11px; margin-top: 11px; }
.rv-head { display: flex; align-items: center; gap: 8px; font-size: 12.8px; flex-wrap: wrap; }
.kv-grid.tight { gap: 8px 14px; margin-top: 8px; }

/* 时间投资 */
.stack-days { display: flex; align-items: flex-end; gap: 5px; height: 150px; padding: 6px 0 0; }
.sd-col { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.sd-bar { width: 100%; max-width: 26px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.sd-bar i { display: block; width: 100%; }
.sd-lb { font-size: 9.5px; color: var(--muted); margin-top: 5px; }
.tl-compact { display: flex; flex-direction: column; }
.tlc-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.tlc-row:last-child { border-bottom: 0; }
.tlc-d { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 42px; font-size: 11.5px; }
.tlc-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.tlc-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlc-p { flex: 0 0 auto; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlc-m { flex: 0 0 auto; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tlc-v { flex: 0 0 42px; text-align: right; font-size: 11px; color: var(--muted); }
@media (max-width: 600px) { .tlc-p { display: none; } }

/* 实验室 */
.exp-card { padding: 14px; }
.exp-title { display: block; font-size: 14.5px; font-weight: 600; color: inherit; text-decoration: none; letter-spacing: -0.01em; }
.exp-title:hover { color: var(--accent); }
.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 4px; }
.log-cell { aspect-ratio: 1; border-radius: 5px; display: grid; place-items: center; font-size: 10px; background: var(--surface-3); color: var(--muted); }
.log-cell.yes { background: var(--good); color: #fff; }
.log-cell.partial { background: var(--warn-soft); color: var(--warn); }
.log-cell.no { background: var(--bad-soft); color: var(--bad); }
.rule-row { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 3px 0; line-height: 1.65; }
.rule-row .n { color: var(--muted); flex: 0 0 14px; text-align: right; }

.loop-card { padding: 14px; }
.loop-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.loop-plan { padding: 7px 10px; background: var(--surface-2); border-radius: 8px; display: flex; flex-direction: column; gap: 2px; }
.loop-verdict { padding: 8px 10px; border-radius: 8px; background: var(--good-soft); }
.loop-todo { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); text-decoration: none; color: inherit; }
.loop-todo:last-of-type { border-bottom: 0; }
.loop-todo .grow { display: flex; flex-direction: column; min-width: 0; }
.loop-todo b { font-size: 12.5px; font-weight: 550; }
.loop-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.loop-stats .n { display: block; font-size: 13.5px; font-weight: 600; }
.loop-stats .l { display: block; font-size: 10.5px; color: var(--muted); }

/* 战略地图 */
.map-layer { margin-bottom: 20px; }
.map-layer-h { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.map-layer-h .lv { font-size: 10px; padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--muted); letter-spacing: 0.03em; }
.map-layer-h b { font-size: 13.5px; }
.vision-card { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r); background: var(--surface); padding: 15px 17px; }
.vision-card.empty { border-left-color: var(--border-strong); }
.vision-text { font-size: 14px; line-height: 1.85; color: var(--text); }
.map-branch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; margin-bottom: 10px; align-items: start; }
.map-children { display: flex; flex-direction: column; gap: 8px; border-left: 1px dashed var(--border-strong); padding-left: 14px; }
.map-node { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 11px 13px; }
.map-node.lv1 { border-left: 3px solid var(--accent); }
.map-node.lv2 { padding: 9px 11px; }
.lv-tag { font-size: 10px; color: var(--muted); letter-spacing: 0.03em; margin-bottom: 4px; }
.map-title { font-size: 13px; font-weight: 600; color: inherit; text-decoration: none; }
.map-title:hover { color: var(--accent); }
.map-goal.sm .map-title { font-size: 12.3px; }
.map-leaf { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; border-top: 1px dashed var(--border); padding-top: 7px; }
.leaf-item { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-2); text-decoration: none; }
.leaf-item:hover { color: var(--accent); }
.map-empty { padding: 14px; border: 1px dashed var(--border); border-radius: var(--r); }
.map-orphan { margin-top: 10px; padding: 12px; border: 1px dashed var(--border); border-radius: var(--r); display: flex; flex-direction: column; gap: 8px; }
.drift-row { display: flex; align-items: baseline; gap: 9px; font-size: 12.5px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.drift-row:last-child { border-bottom: 0; }
.drift-row .dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: var(--muted); margin-top: 5px; }
.drift-row.tone-warn .dot { background: var(--warn); }
.drift-row.tone-bad .dot { background: var(--bad); }
.act-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.act-row:last-child { border-bottom: 0; }
.act-row .grow.done { color: var(--muted); text-decoration: line-through; }
.act-row .chk { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 9px; color: #fff; flex: 0 0 auto; }
.act-row .chk.on { background: var(--good); border-color: var(--good); }
@media (max-width: 820px) { .map-branch { grid-template-columns: minmax(0, 1fr); } }

/* 能力档案 */
.skill-card { padding: 14px; }
.sk-name { font-size: 14px; font-weight: 600; }
.sk-level { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sk-level small { font-size: 11px; color: var(--muted); font-weight: 400; }
.sk-bars { display: flex; flex-direction: column; gap: 6px; }
.sk-bar { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: center; }
.sk-bar .bar { margin: 0; }

/* 人生事件 */
.year-block { margin-bottom: 18px; }
.year-head { display: flex; align-items: baseline; gap: 9px; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.year-head b { font-size: 17px; letter-spacing: -0.02em; }
.ev-list { position: relative; }
.ev-item { display: grid; grid-template-columns: 54px 10px minmax(0, 1fr); gap: 11px; padding: 10px 0; align-items: start; }
.ev-date { text-align: right; font-variant-numeric: tabular-nums; }
.ev-date b { display: block; font-size: 12.5px; }
.ev-date span { display: block; font-size: 10px; color: var(--muted); }
.ev-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; box-shadow: 0 0 0 3px var(--surface); }
.ev-body { border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
.ev-item:last-child .ev-body { border-bottom: 0; }
.ev-item.ms .ev-dot { box-shadow: 0 0 0 3px var(--warn-soft); }
.ev-title { font-size: 13.8px; font-weight: 600; letter-spacing: -0.01em; }
.ev-text { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.7; }
.att-list { display: flex; gap: 6px; flex-wrap: wrap; }
.att-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 6px; background: var(--surface-3); font-size: 10.5px; color: var(--text-2); cursor: pointer; }
.att-chip:hover { background: var(--accent-soft); color: var(--accent); }
.cand-row { display: flex; gap: 9px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--border); cursor: pointer; }
.cand-row input { margin-top: 3px; accent-color: var(--accent); }
.cand-main { display: block; min-width: 0; }
.cand-t { font-size: 13px; font-weight: 600; margin-right: 7px; }

/* 报告与摘要 */
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sum-block { min-width: 0; }
.sum-block .bk { margin-bottom: 3px; }
.sum-block .tiny { line-height: 1.7; }
@media (max-width: 900px) { .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .summary-grid { grid-template-columns: minmax(0, 1fr); } }

/* 每日复盘：能量折叠区 */
.energy-fold { border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; background: var(--surface-2); }
.energy-fold > summary { cursor: pointer; font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.energy-fold[open] > summary { margin-bottom: 4px; }
.energy-fold .rate-row { margin: 4px 0; }
.energy-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 720px) { .energy-sliders { grid-template-columns: minmax(0, 1fr); } }

/* 侧栏：分组更多时更紧凑 */
.sidebar { overflow-y: auto; }
.nav-group + .nav-group { margin-top: 12px; }
.nav-label { font-size: 10px; letter-spacing: 0.08em; }
.nav-item { padding-top: 6px; padding-bottom: 6px; }
.nav-badge.warn { background: var(--warn-soft); color: var(--warn); }

/* ================= 2.1 导入过去的日记 ================= */
.imp-drop {
  border: 1.5px dashed var(--border); border-radius: 12px; padding: 26px 18px;
  text-align: center; cursor: pointer; transition: all 0.16s; background: var(--surface-2);
}
.imp-drop:hover, .imp-drop.hot { border-color: var(--accent); background: var(--accent-soft); }
.imp-drop-ico { color: var(--accent); margin-bottom: 8px; display: flex; justify-content: center; }
.imp-drop-t { font-size: 13px; }
.imp-drop-t b { font-weight: 600; }
.imp-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.imp-drop-s { font-size: 11px; color: var(--muted); margin-top: 6px; }
.imp-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--muted); font-size: 11px; }
.imp-or::before, .imp-or::after { content: ''; height: 1px; background: var(--border); flex: 1; }
.imp-paste { width: 100%; font-family: inherit; line-height: 1.8; resize: vertical; }
.imp-hint { margin-top: 12px; font-size: 12px; color: var(--muted); }
.imp-hint summary { cursor: pointer; color: var(--accent); font-size: 12px; }
.imp-hint > div { margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }
.imp-err { margin-top: 12px; font-size: 12px; color: var(--bad); background: var(--bad-soft); border-radius: 8px; padding: 8px 10px; display: flex; gap: 6px; align-items: center; }

.imp-list { display: flex; flex-direction: column; gap: 8px; }
.imp-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.imp-item.off { opacity: 0.5; }
.imp-check { flex: none; padding-top: 3px; }
.imp-check input { width: 15px; height: 15px; accent-color: var(--accent); }
.imp-item-main { flex: 1; min-width: 0; }
.imp-date { width: 150px; padding: 4px 8px; font-size: 12px; }
.imp-preview { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

.imp-opt { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.imp-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.imp-note { font-size: 12px; color: var(--warn); margin-top: 10px; display: flex; gap: 6px; align-items: center; }
.imp-note.ok { color: var(--good); }

.imp-summary { background: var(--surface-2); }
.imp-sum-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; text-align: center; }
.imp-sum-grid > div { display: flex; flex-direction: column; gap: 2px; }
.imp-sum-grid b { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.imp-sum-grid span { font-size: 11px; color: var(--muted); }
.imp-sum-grid.big b { font-size: 26px; }

.imp-day { border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.imp-day.off { opacity: 0.45; }
.imp-day-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.imp-day-head input { width: 15px; height: 15px; accent-color: var(--accent); }
.imp-ratings { font-size: 11px; color: var(--accent); display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.imp-fields { display: flex; flex-direction: column; gap: 6px; }
.imp-field { display: grid; grid-template-columns: 92px 1fr; gap: 8px; font-size: 12px; align-items: baseline; }
.imp-field-l { color: var(--muted); }
.imp-field-v { line-height: 1.65; }
.imp-quote { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 4px; padding: 0 5px; }
.imp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.imp-tag {
  font-size: 11px; border: 1px solid var(--border); border-radius: 99px; padding: 2px 9px;
  display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); background: var(--surface-2);
}
.imp-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.imp-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s; }

@media (max-width: 720px) {
  .imp-sum-grid { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .imp-field { grid-template-columns: 1fr; gap: 2px; }
  .imp-date { width: 100%; }
  .imp-drop { padding: 20px 14px; }
}
.import-src { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.import-src summary { cursor: pointer; padding: 9px 12px; font-size: 12px; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.import-src-body {
  padding: 0 12px 12px; font-size: 12px; line-height: 1.8; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto;
}

/* ============================ PWA 全屏（安装到主屏/桌面） ============================
   只在 display-mode:standalone 下生效：浏览器里 env(safe-area-inset-top) 为 0，
   但为保持浏览器布局完全不变，这里用单独的媒体查询隔离，避免影响现有排版。 */
@media (display-mode: standalone) {
  .topbar {
    height: calc(54px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
  .sidebar { padding-top: env(safe-area-inset-top); }
}
@media (display-mode: standalone) and (max-width: 860px) {
  .topbar { height: calc(50px + env(safe-area-inset-top)); }
  .sidebar { padding-top: env(safe-area-inset-top); }
}
