:root {
  /* 深色硬核主题 —— 石墨黑蓝 + 冷调霓虹强调 */
  --bg-gradient: linear-gradient(160deg, #0a0e16 0%, #0d1320 45%, #090c13 100%);
  --bg-solid: #0a0e16;
  --panel: rgba(18, 25, 38, 0.72);
  --panel-solid: #111827;
  --card-bg: rgba(20, 28, 43, 0.78);
  --card-border: rgba(120, 160, 210, 0.14);
  --card-border-hi: rgba(56, 189, 248, 0.45);
  --text: #e6ecf5;
  --text-strong: #f7faff;
  --text-muted: #8a98ad;
  --text-dim: #5d6b80;
  --cyan: #38bdf8;
  --cyan-deep: #0ea5e9;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --green: #10b981;
  --green-bright: #34d399;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --red: #ff4d4f;        /* 涨 */
  --fall: #00d68f;       /* 跌（中国习惯绿） */
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 8px 26px rgba(14, 165, 233, 0.1);
  --radius: 10px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-solid);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-gradient);
  background-attachment: fixed;
}

/* ---------- 顶部 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(12, 17, 27, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(120, 160, 210, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
  color: #04121f;
}
.brand h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-strong);
}
.subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.search-box {
  flex: 1;
  max-width: 380px;
  margin: 0 24px;
  display: flex;
  align-items: center;
  background: rgba(10, 15, 24, 0.9);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  box-shadow: inset 0 0 0 1px rgba(120, 160, 210, 0.15);
}
.search-box:focus-within { box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.55); }
.search-icon { font-size: 13px; margin-right: 8px; opacity: 0.55; }
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
}
.search-box input::placeholder { color: var(--text-dim); }
.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.conn-state {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}
.conn-state.ok { background: rgba(16, 185, 129, 0.14); color: var(--green-bright); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35); }
.conn-state.err { background: rgba(255, 77, 79, 0.14); color: var(--red); box-shadow: inset 0 0 0 1px rgba(255, 77, 79, 0.35); }
.clock {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: var(--text-muted);
  min-width: 72px;
  text-align: right;
  letter-spacing: 1px;
}
.btn-refresh {
  border: 1px solid rgba(120, 160, 210, 0.2);
  background: rgba(56, 189, 248, 0.1);
  color: var(--cyan);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  transition: all .2s;
}
.btn-refresh:hover { background: rgba(56, 189, 248, 0.2); box-shadow: 0 0 12px rgba(56, 189, 248, 0.3); }
.btn-refresh:active { transform: scale(0.94) rotate(90deg); }

/* ---------- 布局 ---------- */
.layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ---------- 左侧导航 ---------- */
.side-nav {
  width: 96px;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid rgba(120, 160, 210, 0.1);
  background: rgba(10, 14, 22, 0.4);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .18s;
  color: var(--text-dim);
  border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(56, 189, 248, 0.08);
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.18);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(34, 211, 238, 0.14));
  color: var(--cyan);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.18);
}
.nav-icon { font-size: 20px; }
.nav-label { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; }

/* ---------- 主内容区 ---------- */
.main {
  flex: 1;
  padding: 18px 24px 18px 8px;
  overflow-y: auto;
}

/* ---------- KPI 统计 ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.kpi-card {
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-cyan::before { background: linear-gradient(90deg, #38bdf8, #22d3ee); }
.kpi-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kpi-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.kpi-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.kpi-cyan { box-shadow: var(--shadow), inset 0 1px 0 rgba(56,189,248,0.08); }
.kpi-icon { font-size: 18px; opacity: 0.9; }
.kpi-cyan .kpi-icon { filter: drop-shadow(0 0 6px rgba(56,189,248,0.5)); }
.kpi-amber .kpi-icon { filter: drop-shadow(0 0 6px rgba(245,158,11,0.5)); }
.kpi-green .kpi-icon { filter: drop-shadow(0 0 6px rgba(16,185,129,0.5)); }
.kpi-blue .kpi-icon { filter: drop-shadow(0 0 6px rgba(59,130,246,0.5)); }
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.kpi-label { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }

/* ---------- 模块切换 ---------- */
.module-content { min-height: 360px; }
.module { display: none; animation: fadeIn .2s ease; }
.module.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(8px);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.card-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-strong);
}
.card-time {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.index-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.index-pill {
  background: rgba(10, 15, 24, 0.85);
  border: 1px solid rgba(120, 160, 210, 0.16);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.index-pill .name { color: var(--text-muted); }
.index-pill .val { font-weight: 700; }
.index-pill .pct { font-weight: 700; }

/* ---------- 输入与按钮 ---------- */
.add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.add-row input {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  border: 1px solid rgba(120, 160, 210, 0.18);
  border-radius: var(--radius-sm);
  outline: none;
  background: rgba(10, 15, 24, 0.85);
  font-size: 13px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.add-row input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18); }
.add-row input::placeholder { color: var(--text-dim); }
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #04121f;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: transform .12s, box-shadow .15s, filter .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(1.08); box-shadow: 0 0 14px rgba(56, 189, 248, 0.25); }
.btn-cyan { background: linear-gradient(135deg, var(--cyan-deep), var(--cyan)); }
.btn-green { background: linear-gradient(135deg, var(--green), var(--green-bright)); }
.btn-blue { background: linear-gradient(135deg, var(--blue), var(--blue-light)); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 14px;
}
.data-table td {
  background: rgba(13, 19, 30, 0.7);
  padding: 12px 14px;
  font-size: 14px;
  border-top: 1px solid rgba(120, 160, 210, 0.07);
  border-bottom: 1px solid rgba(120, 160, 210, 0.07);
}
.data-table td:first-child { border-left: 1px solid rgba(120, 160, 210, 0.07); border-radius: 8px 0 0 8px; }
.data-table td:last-child { border-right: 1px solid rgba(120, 160, 210, 0.07); border-radius: 0 8px 8px 0; text-align: right; }
.stk-name { font-weight: 700; color: var(--text-strong); }
.stk-code { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.del-btn {
  border: 1px solid rgba(255, 77, 79, 0.3);
  background: rgba(255, 77, 79, 0.1);
  color: var(--red);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all .15s;
}
.del-btn:hover { background: rgba(255, 77, 79, 0.22); box-shadow: 0 0 10px rgba(255, 77, 79, 0.3); }

/* ---------- 红涨绿跌（中国习惯）---------- */
.up { color: var(--red); font-weight: 700; }
.down { color: var(--fall); font-weight: 700; }
.flat { color: var(--text-muted); }

/* ---------- 打卡/任务列表 ---------- */
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(13, 19, 30, 0.7);
  border: 1px solid rgba(120, 160, 210, 0.1);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: background .18s, border-color .18s;
}
.check-list li:hover { border-color: rgba(56, 189, 248, 0.25); }
.check-list li.done { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.25); opacity: 0.8; }
.check-list li.done .t-text,
.check-list li.done .f-name { text-decoration: line-through; color: var(--text-dim); }
.check-list .cb {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
  cursor: pointer;
  flex-shrink: 0;
}
.check-list .t-text,
.check-list .f-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.check-list .t-due,
.check-list .f-target,
.check-list .f-freq {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(10, 15, 24, 0.7);
  border: 1px solid rgba(120, 160, 210, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.check-list .f-freq { color: var(--amber-light); background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.25); }

/* ---------- 热点 ---------- */
.hot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hot-block {
  background: rgba(10, 15, 24, 0.55);
  border: 1px solid rgba(120, 160, 210, 0.12);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.hot-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.hot-list { display: flex; flex-direction: column; gap: 7px; }
.hot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(13, 19, 30, 0.7);
  border: 1px solid rgba(120, 160, 210, 0.08);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
}
.hot-row:hover { border-color: rgba(56, 189, 248, 0.22); }
.hot-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.hot-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.hot-kind {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}
.hot-leader, .hot-up, .hot-amt { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hot-pct { font-weight: 700; min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 自选股重要公告 ---------- */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.switch-label input { accent-color: var(--amber); width: 15px; height: 15px; cursor: pointer; }
.anno-list { display: flex; flex-direction: column; gap: 7px; }
.anno-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(13, 19, 30, 0.7);
  border: 1px solid rgba(120, 160, 210, 0.08);
  border-left: 3px solid rgba(120, 160, 210, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.anno-row:hover { border-color: rgba(56, 189, 248, 0.3); background: rgba(20, 30, 45, 0.85); }
.anno-row.imp { border-left-color: var(--amber); background: rgba(40, 30, 12, 0.55); }
.anno-stock {
  font-size: 12px; font-weight: 700; color: var(--cyan);
  background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px; border-radius: 5px; flex-shrink: 0; white-space: nowrap;
}
.anno-title { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anno-badge {
  font-size: 10px; font-weight: 700; color: #1a1205;
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  padding: 2px 7px; border-radius: 5px; flex-shrink: 0;
}
.anno-date { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ---------- 任务体系 ---------- */
.seg-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.seg-tab {
  border: 1px solid rgba(120, 160, 210, 0.18);
  background: rgba(10, 15, 24, 0.7);
  color: var(--text-muted);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.seg-tab:hover { color: var(--text); border-color: rgba(56, 189, 248, 0.3); }
.seg-tab.active {
  color: #04121f; border-color: transparent;
  background: linear-gradient(135deg, var(--cyan-deep), var(--cyan));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}
.todo-toolbar { margin-bottom: 12px; }
.tag-filters { display: flex; gap: 7px; flex-wrap: wrap; }
.tag-chip {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(120, 160, 210, 0.2); background: rgba(10, 15, 24, 0.6);
  color: var(--text-muted); white-space: nowrap;
}
#tagFilters .tag-chip { cursor: pointer; transition: all .15s; }
#tagFilters .tag-chip:hover { color: var(--text); border-color: rgba(56, 189, 248, 0.3); }
#tagFilters .tag-chip.active { color: #04121f; border-color: transparent; background: linear-gradient(135deg, var(--cyan-deep), var(--cyan)); }
/* 标签配色（筛选与行内通用） */
.tag-work { color: #93c5fd; border-color: rgba(59,130,246,0.45); background: rgba(59,130,246,0.12); }
.tag-study { color: #7dd3fc; border-color: rgba(56,189,248,0.45); background: rgba(56,189,248,0.12); }
.tag-personal { color: #cbd5e1; border-color: rgba(148,163,184,0.4); background: rgba(148,163,184,0.1); }
.tag-bill { color: #fcd34d; border-color: rgba(245,158,11,0.45); background: rgba(245,158,11,0.12); }
.tag-shop { color: #6ee7b7; border-color: rgba(16,185,129,0.45); background: rgba(16,185,129,0.12); }
.tag-follow { color: #c4b5fd; border-color: rgba(167,139,250,0.45); background: rgba(167,139,250,0.12); }

.reminder-banner {
  display: flex; flex-wrap: wrap; gap: 10px;
  background: linear-gradient(135deg, rgba(245,158,11,0.16), rgba(251,191,36,0.08));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--amber-light); font-weight: 600;
}
.reminder-banner span { display: inline-flex; align-items: center; }

.todo-add .sel {
  min-width: 96px; width: auto; flex: 0 0 auto;
  padding: 10px 10px; border: 1px solid rgba(120, 160, 210, 0.18);
  border-radius: var(--radius-sm); outline: none; background: rgba(10, 15, 24, 0.85);
  font-size: 13px; color: var(--text); cursor: pointer;
}
.todo-add .sel:focus { border-color: var(--cyan); }
.todo-add select.sel option { background: #0d1320; color: var(--text); }
.btn-star {
  border: 1px solid rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.1);
  color: var(--amber-light); width: 42px; height: 42px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 18px; flex-shrink: 0; transition: all .15s;
}
.btn-star.on { background: rgba(245, 158, 11, 0.25); box-shadow: 0 0 12px rgba(245, 158, 11, 0.3); }
.btn-star:hover { filter: brightness(1.1); }

.todo-list li { flex-wrap: wrap; }
.todo-list .star-btn {
  border: none; background: transparent; cursor: pointer; font-size: 17px;
  color: var(--text-dim); flex-shrink: 0; padding: 0 2px; line-height: 1;
}
.todo-list .star-btn.on { color: var(--amber); text-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.todo-list .t-text { flex: 1; min-width: 120px; }
.rec-flag {
  font-size: 11px; color: var(--cyan); background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25); padding: 2px 7px; border-radius: 5px;
}
.todo-list li.overdue {
  border-color: rgba(255, 77, 79, 0.55); background: rgba(255, 77, 79, 0.08);
}
.todo-list li.overdue .t-text { color: var(--red); }
.todo-list li.overdue .t-due.od { color: var(--red); border-color: rgba(255, 77, 79, 0.4); background: rgba(255, 77, 79, 0.12); }

/* ---------- 健身 + 饮食 ---------- */
.fit-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fit-col { background: rgba(10, 15, 24, 0.5); border: 1px solid rgba(120, 160, 210, 0.12); border-radius: var(--radius-sm); padding: 14px; }
.fit-col-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.5px; }
.fit-none { color: var(--text-dim); font-size: 12px; padding: 8px 2px; background: transparent !important; border: none !important; }
.f-diet-amt { color: var(--amber-light); background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.25); }
.btn-amber { background: linear-gradient(135deg, var(--amber), var(--amber-light)); color: #1a1205; }
.btn-green.checked { background: linear-gradient(135deg, var(--green), var(--green-bright)); color: #04121f; box-shadow: 0 0 14px rgba(16,185,129,0.3); }

.fit-history { margin-top: 18px; }
.fit-history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.hist-day {
  background: rgba(13, 19, 30, 0.7); border: 1px solid rgba(120, 160, 210, 0.1);
  border-radius: var(--radius-sm); padding: 10px; text-align: center;
}
.hist-day.on { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.08); }
.hist-date { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hist-stat { font-size: 13px; color: var(--text); margin: 4px 0; font-variant-numeric: tabular-nums; }
.hist-check { font-size: 13px; color: var(--green-bright); height: 14px; }

/* ---------- 空态/错误 ---------- */
.empty-tip {
  text-align: center;
  color: var(--text-dim);
  padding: 26px;
  font-size: 13px;
}
.error-tip {
  text-align: center;
  color: var(--red);
  padding: 26px;
  font-size: 13px;
  background: rgba(255, 77, 79, 0.08);
  border: 1px solid rgba(255, 77, 79, 0.25);
  border-radius: var(--radius-sm);
}

/* ---------- footer ---------- */
.footer {
  margin-top: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* ---------- 滚动条 ---------- */
.main::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.main::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: rgba(120, 160, 210, 0.2); border-radius: 4px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .hot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .search-box { order: 3; max-width: none; margin: 0; width: 100%; }
  .layout { flex-direction: column; }
  .side-nav {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px;
    gap: 8px;
    order: 2;
    border-right: none;
    border-bottom: 1px solid rgba(120, 160, 210, 0.1);
  }
  .nav-item { flex-direction: row; padding: 8px 12px; gap: 6px; }
  .main { padding: 14px; order: 1; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-value { font-size: 22px; }
  .card-head { flex-direction: column; }
  .fit-cols { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .kpi-row { grid-template-columns: 1fr; }
  .add-row input { min-width: 100%; }
  .btn { width: 100%; }
}
