/* ==========================================================================
   OKR 每日进度 · 预期管理 —— 设计系统
   ========================================================================== */

:root {
  --bg: #f5f7fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e3e8f0;
  --border-strong: #cfd8e6;
  --text: #101828;
  --text-2: #475467;
  --text-3: #8494ab;
  --brand: #4f46e5;
  --brand-soft: #eef0ff;
  --brand-2: #0ea5e9;

  --done: #059669;
  --done-soft: #e7f7f1;
  --ahead: #16a34a;
  --ahead-soft: #eaf7ee;
  --ok: #2563eb;
  --ok-soft: #eaf1fe;
  --risk: #d97706;
  --risk-soft: #fdf3e3;
  --behind: #dc2626;
  --behind-soft: #fdeded;
  --idle: #64748b;
  --idle-soft: #f1f5f9;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 14px -6px rgba(16, 24, 40, .16), 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 20px 40px -20px rgba(16, 24, 40, .28), 0 2px 6px rgba(16, 24, 40, .06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --bg-soft: #10162b;
  --surface: #141b30;
  --surface-2: #182140;
  --surface-3: #1d2748;
  --border: #26314f;
  --border-strong: #38456b;
  --text: #eef2ff;
  --text-2: #b9c4dd;
  --text-3: #8593b3;
  --brand: #818cf8;
  --brand-soft: #1e2547;
  --brand-2: #38bdf8;

  --done: #34d399;
  --done-soft: #10312a;
  --ahead: #4ade80;
  --ahead-soft: #11301f;
  --ok: #60a5fa;
  --ok-soft: #14243f;
  --risk: #fbbf24;
  --risk-soft: #362813;
  --behind: #f87171;
  --behind-soft: #3a1b1e;
  --idle: #94a3b8;
  --idle-soft: #1c2438;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 6px 18px -8px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 50px -24px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }

.app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 8px 8px auto auto;
  width: 7px; height: 7px; border-radius: 3px; background: rgba(255, 255, 255, .85);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }

.topbar-cycle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: 4px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.today-pill {
  font-size: 12px; color: var(--text-2); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px;
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; border-radius: 999px; padding: 3px 10px;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.chip strong { color: var(--text); font-weight: 620; }
.chip.brand { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--brand); }
.chip.brand strong { color: inherit; }

/* ---------- 标签导航 ---------- */
.tabs {
  position: sticky; top: 55px; z-index: 25;
  display: flex; gap: 4px; padding: 8px 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--text-2);
  padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, color .15s;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-selected="true"] { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.tab[aria-selected="true"] .tab-badge { background: rgba(255, 255, 255, .25); color: #fff; }
.tab-badge {
  font-size: 11px; background: var(--surface-3); color: var(--text-2);
  border-radius: 999px; padding: 0 7px; min-width: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}

.storage-warn {
  margin: 12px 22px 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--risk-soft); color: var(--risk); font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--risk) 30%, transparent);
}

/* ---------- 布局 ---------- */
.view { flex: 1; padding: 18px 22px 40px; max-width: 1400px; width: 100%; margin: 0 auto; outline: none; }
.footer {
  padding: 14px 22px 26px; color: var(--text-3); font-size: 12px;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center;
}
.footer .dot { opacity: .5; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1080px) {
  .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: minmax(0, 1fr); }
  .view { padding: 14px 12px 32px; }
  .topbar, .tabs { padding-inline: 12px; }
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px;
}
.card.tight { padding: 12px 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-head .spacer { margin-left: auto; }
.card-sub { font-size: 12px; color: var(--text-3); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 2px 12px; }
.section-title h2 { font-size: 16px; }
.section-title .spacer { margin-left: auto; }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 13px;
  border-radius: var(--radius-sm); padding: 7px 13px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 86%, #000); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--behind); border-color: color-mix(in srgb, var(--behind) 35%, transparent); }
.btn-danger:hover { background: var(--behind-soft); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-icon { padding: 5px 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  appearance: none; border: 0; background: transparent; font: inherit; font-size: 12.5px;
  color: var(--text-2); padding: 4px 12px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
input, select, textarea {
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 10px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input[type="number"] { font-variant-numeric: tabular-nums; }
textarea { resize: vertical; min-height: 62px; font-size: 12.5px; }
input[type="checkbox"] { width: auto; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* ---------- 状态徽标 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px;
  border: 1px solid transparent; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.done { background: var(--done-soft); color: var(--done); }
.pill.ahead { background: var(--ahead-soft); color: var(--ahead); }
.pill.onTrack { background: var(--ok-soft); color: var(--ok); }
.pill.atRisk { background: var(--risk-soft); color: var(--risk); }
.pill.behind { background: var(--behind-soft); color: var(--behind); }
.pill.idle { background: var(--idle-soft); color: var(--idle); }

.gap { font-variant-numeric: tabular-nums; font-weight: 640; font-size: 12.5px; }
.gap.pos { color: var(--ahead); }
.gap.neg { color: var(--behind); }
.gap.zero { color: var(--text-3); }

/* ---------- KPI 磁贴 ---------- */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .kpi-label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.kpi .kpi-value { font-size: 25px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.kpi .kpi-foot { font-size: 11.5px; color: var(--text-3); }

.hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero-body { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- 进度条 ---------- */
.bar {
  position: relative; height: 9px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden;
}
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--brand); }
.bar.lg { height: 13px; }
.bar-fill.done { background: var(--done); }
.bar-fill.ahead { background: var(--ahead); }
.bar-fill.onTrack { background: var(--ok); }
.bar-fill.atRisk { background: var(--risk); }
.bar-fill.behind { background: var(--behind); }
.bar-fill.idle { background: var(--idle); }
.bar .expect-mark {
  position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px;
  background: var(--text); opacity: .55;
}
.bar.lg .expect-mark { top: -4px; bottom: -4px; width: 3px; }
.bar-legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; align-items: center; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 11.5px; position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--surface-2); }

/* ---------- KR 行 ---------- */
.kr-list { display: flex; flex-direction: column; }
.kr-row {
  display: grid; gap: 10px; align-items: center;
  grid-template-columns: minmax(0, 2.2fr) 120px 86px 122px;
  padding: 10px 6px; border-top: 1px solid var(--border);
}
.kr-row:first-child { border-top: 0; }
.kr-row .kr-title { min-width: 0; }
.kr-row .kr-title .t { font-size: 13.5px; font-weight: 560; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.kr-row .kr-title .m { font-size: 11.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.kr-row .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .kr-row { grid-template-columns: minmax(0, 1fr) auto; }
  .kr-row .kr-spark { display: none; }
}

/* ---------- 打卡表 ---------- */
.ci-obj { margin-bottom: 14px; }
.ci-obj-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.ci-obj-head h3 { font-size: 14px; }
.ci-grid { display: flex; flex-direction: column; }
.ci-row {
  display: grid; gap: 12px; align-items: start;
  grid-template-columns: minmax(0, 1.6fr) 168px minmax(0, 1.4fr) 172px;
  padding: 12px 8px; border-top: 1px solid var(--border);
}
.ci-row:first-child { border-top: 0; }
.ci-row.filled { background: color-mix(in srgb, var(--ahead-soft) 55%, transparent); }
.ci-title { font-size: 13.5px; font-weight: 560; }
.ci-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: flex; gap: 9px; flex-wrap: wrap; }
.ci-input { display: flex; flex-direction: column; gap: 5px; }
.ci-input-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.ci-quick { display: flex; gap: 5px; flex-wrap: wrap; }
input.dirty { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface)); }
@media (max-width: 900px) {
  .ci-row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 任务打卡 ---------- */
.tk-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.tk-hero-num .big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tk-hero-num .big small { font-size: 17px; font-weight: 500; color: var(--text-3); }
.tk-hero-kpis { display: flex; gap: 18px; flex-wrap: wrap; }
.tk-hero-kpis > div { display: flex; flex-direction: column; }
.tk-hero-kpis b { font-size: 17px; font-variant-numeric: tabular-nums; }
.tk-hero-kpis span { font-size: 11.5px; color: var(--text-3); }

.tk-group { margin-top: 12px; }
.tk-group-head {
  font-size: 12px; color: var(--text-2); font-weight: 600; letter-spacing: .02em;
  padding: 6px 2px; display: flex; gap: 8px; align-items: baseline;
  border-bottom: 1px solid var(--border);
}
.tk-row {
  display: grid; gap: 10px; align-items: center;
  grid-template-columns: 38px minmax(0, 1.5fr) 132px minmax(0, 1fr) auto;
  padding: 9px 4px; border-top: 1px solid var(--border);
}
.tk-row:first-child { border-top: 0; }
.tk-row > div:first-child { min-width: 0; }
.tk-row.done .tk-title { color: var(--text-2); }
.tk-row.skip { opacity: .6; }
.tk-row.skip .tk-title { text-decoration: line-through; }
.tk-row.overdue { grid-template-columns: 108px minmax(0, 1fr) auto; background: color-mix(in srgb, var(--risk-soft) 45%, transparent); border-radius: var(--radius-sm); }
/* 月度计划里的任务行：标题 / 进度 / 操作 三列 */
.tk-row.plan-row { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.5fr) auto; }
.tk-title { font-size: 13.5px; font-weight: 560; }
.tk-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.tk-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.tk-date { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tk-check {
  width: 30px; height: 30px; padding: 0 !important; border-radius: 50% !important;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
  border: 2px solid var(--border-strong) !important; background: var(--surface) !important; color: transparent !important;
}
.tk-check.none { color: transparent !important; }
.tk-check.done { background: var(--done) !important; border-color: var(--done) !important; color: #fff !important; }
.tk-check.partial { background: var(--risk-soft) !important; border-color: var(--risk) !important; color: var(--risk) !important; }
.tk-check.skip { background: var(--surface-3) !important; border-color: var(--border-strong) !important; color: var(--text-3) !important; }
.tk-quick { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.tk-settled { margin-top: 12px; }
.tk-settled > summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); padding: 6px 0; }

.daybars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.daybar {
  flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 1px; cursor: pointer; border-radius: 3px; min-width: 3px; background: transparent;
}
.daybar:hover { background: var(--surface-3); }
.daybar i { display: block; border-radius: 2px; }
.daybar i.done { background: var(--ahead); }
.daybar i.miss { background: var(--surface-3); }
.daybar.none i { background: transparent; }
.daybar.future i.miss { background: var(--surface-2); border: 1px dashed var(--border); }
.daybar.today i.done { box-shadow: 0 0 0 1px var(--brand); }
.daybar-labels { position: relative; height: 16px; margin-top: 4px; }
.daybar-labels span { position: absolute; font-size: 10.5px; color: var(--text-3); transform: translateX(-50%); }

.score-box { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.score-dot {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--border-strong); padding: 0 2px;
}
.score-dot.on { color: #f59e0b; }

.goal-section { margin-top: 12px; }
.goal-section > summary {
  cursor: pointer; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; list-style: none;
}
.goal-section > summary::-webkit-details-marker { display: none; }

@media (max-width: 900px) {
  .tk-row { grid-template-columns: 38px minmax(0, 1fr); }
  .tk-row > *:not(.tk-check):not(div:nth-child(2)) { grid-column: 2; }
  .tk-row.overdue { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 日历 ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; color: var(--text-3); text-align: center; padding: 2px 0; }
.cal-cell {
  position: relative; border: 1px solid var(--border); border-radius: 8px;
  min-height: 50px; padding: 5px 6px; background: var(--surface-2);
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: border-color .12s, transform .06s, background .12s;
}
.cal-cell:hover { border-color: var(--border-strong); background: var(--surface-3); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.out { background: transparent; border-color: transparent; opacity: .38; }
.cal-cell.out:hover { background: var(--surface-2); border-color: transparent; }
.cal-cell .d { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-cell .mark { position: absolute; right: 6px; top: 6px; font-size: 10.5px; color: var(--text-3); }
.cal-cell .heat { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px; border-radius: 3px; background: var(--surface-3); }
.cal-cell.today { outline: 2px solid var(--brand); outline-offset: -1px; }
.cal-cell.selected { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 22%, transparent); }
.cal-cell.future { opacity: .55; }
.cal-week { margin-bottom: 16px; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: inherit; fill: var(--text-3); font-size: 11px; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-line { stroke: var(--border-strong); stroke-width: 1; }
.chart .line-expected { fill: none; stroke: var(--text-3); stroke-width: 2; stroke-dasharray: 6 5; }
.chart .line-actual { fill: none; stroke: var(--brand); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.chart .area-actual { fill: color-mix(in srgb, var(--brand) 14%, transparent); stroke: none; }
.chart .target-line { stroke: var(--behind); stroke-width: 1.4; stroke-dasharray: 4 4; }
.chart .today-line { stroke: var(--brand); stroke-width: 1.4; stroke-dasharray: 3 3; opacity: .8; }
.chart .pt { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.chart .legend { font-size: 11.5px; fill: var(--text-2); }

/* ---------- 关注列表 ---------- */
.alert-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-top: 1px solid var(--border); font-size: 13px;
}
.alert-item:first-child { border-top: 0; }
.alert-item .idx {
  width: 20px; height: 20px; flex: none; border-radius: 6px; background: var(--surface-3);
  color: var(--text-2); font-size: 11px; display: grid; place-items: center; font-weight: 650;
}
.alert-item .txt { min-width: 0; flex: 1; }
.alert-item .txt .s { font-size: 11.5px; color: var(--text-3); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 42px 18px; color: var(--text-3); }
.empty h3 { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.empty .actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- 设置页 ---------- */
.obj-block { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.obj-block > summary {
  cursor: pointer; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14px; list-style: none;
}
.obj-block > summary::-webkit-details-marker { display: none; }
.obj-block > summary::before { content: "▸"; color: var(--text-3); font-size: 12px; transition: transform .15s; }
.obj-block[open] > summary::before { transform: rotate(90deg); }
.obj-block .obj-body { padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.kr-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-top: 10px; background: var(--surface-2); }
.kr-block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kr-block-head .t { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 700px) { .form-grid .span-2 { grid-column: span 1; } }
.hint { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.danger-zone { border-color: color-mix(in srgb, var(--behind) 30%, transparent); }

/* ---------- Toast / Modal ---------- */
/* ---------- 同步 ---------- */
.sync-chip { gap: 7px; font-size: 12.5px; }
.sync-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-strong); flex: none;
}
.sync-status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sync-status .sync-dot { width: 10px; height: 10px; }
.code-block {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; margin: 8px 0 0; font-family: var(--mono); font-size: 11.5px;
  white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; color: var(--text-2);
}

.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; max-width: 340px; animation: pop .18s ease-out;
}
.toast.ok { border-left: 3px solid var(--ahead); }
.toast.warn { border-left: 3px solid var(--risk); }
.toast.err { border-left: 3px solid var(--behind); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

.modal-host { position: fixed; inset: 0; z-index: 100; background: rgba(10, 15, 30, .45); display: grid; place-items: center; padding: 18px; backdrop-filter: blur(3px); }
/* 关键：自定义 display 会覆盖 UA 的 [hidden]{display:none}，必须显式关掉，否则遮罩会一直压暗整个页面 */
.modal-host[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); width: min(720px, 100%); max-height: 86vh; overflow: auto; padding: 22px;
}
.modal h2 { font-size: 17px; margin-bottom: 6px; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media print {
  .topbar, .tabs, .footer, .toast-host, .btn { display: none !important; }
  .view { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
