/* ============ 人生平台 v0.2 · 设计系统 ============ */
/* 浅色主题 · 靛蓝强调色 · 大圆角 · 柔和多层阴影 · 移动端优先 */

:root {
  /* 强调色（Kimi 系蓝紫） */
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef0fe;
  --accent-border: #dfe3fb;
  --accent-glow: rgba(79, 70, 229, .16);
  --grad: linear-gradient(90deg, #6366f1, #4f46e5);

  /* 灰阶 */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --border: #e9ebef;
  --border-strong: #dde0e6;
  --text-1: #191c24;
  --text-2: #4d5566;
  --text-3: #929aad;

  /* 状态色 */
  --ok: #0f9d58;       --ok-soft: #e6f6ee;
  --warn: #d97706;     --warn-soft: #fdf2e2;
  --danger: #dc2626;   --danger-soft: #fdecec;
  --info: #0284c7;     --info-soft: #e8f4fc;

  /* 尺寸 */
  --r-lg: 16px;
  --r-md: 11px;
  --r-sm: 8px;
  --sidebar-w: 236px;

  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(25, 28, 36, .04), 0 1px 8px rgba(25, 28, 36, .04);
  --shadow-2: 0 2px 8px rgba(25, 28, 36, .05), 0 10px 28px rgba(25, 28, 36, .07);
  --shadow-3: 0 16px 48px rgba(25, 28, 36, .16);

  --font: -apple-system, "PingFang SC", "HarmonyOS Sans", "Microsoft YaHei", sans-serif;

  --t-fast: 150ms cubic-bezier(.4, 0, .2, 1);
  --t-med: 220ms cubic-bezier(.4, 0, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-glow); }

#app { min-height: 100vh; }

/* 启动页 */
.boot-splash { min-height: 100vh; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--text-3); font-size: 14px; }
.boot-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--grad); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.86); opacity: .75; } }

/* ================= 布局 ================= */
.layout { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: none; flex-direction: column; z-index: 30;
  padding: 20px 14px 16px;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 18px; font-size: 17px; font-weight: 700; letter-spacing: .01em;
}
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.sidebar-group { margin-top: 14px; }
.sidebar-group-title { padding: 0 12px 6px; font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: .04em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r-md);
  color: var(--text-2); text-decoration: none; font-size: 14.5px;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-nav a svg { flex: none; opacity: .8; }
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text-1); }
.sidebar-nav a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 20%; bottom: 20%;
  width: 3.5px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.sidebar-foot .muted { font-size: 12.5px; }

.main { min-height: 100vh; display: flex; flex-direction: column; }

/* 移动端顶栏 */
.mobile-topbar {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.mobile-topbar .sidebar-logo { padding: 0; font-size: 16px; }
.mobile-topbar .grow { flex: 1; }

/* 页面标题栏 */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
  padding: 22px 20px 4px; flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.page-body { padding: 14px 20px 110px; display: flex; flex-direction: column; gap: 14px; max-width: 860px; width: 100%; margin: 0 auto; }

/* 底部标签导航（移动端） */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 10px; border-radius: var(--r-md);
  color: var(--text-3); text-decoration: none; font-size: 11px;
  transition: color var(--t-fast), background var(--t-fast);
  min-width: 52px;
}
.tabbar a svg { opacity: .9; }
.tabbar a.active { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }

/* 桌面断点 */
@media (min-width: 900px) {
  .sidebar { display: flex; }
  .mobile-topbar, .tabbar { display: none; }
  .main { margin-left: var(--sidebar-w); }
  .page-head { padding: 30px 32px 6px; }
  .page-body { padding: 18px 32px 60px; }
}

/* 内容进场动画 */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise var(--t-med) both; }
.rise-1 { animation-delay: 30ms; } .rise-2 { animation-delay: 70ms; } .rise-3 { animation-delay: 110ms; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--r-md);
  padding: 8px 16px; font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none; line-height: 1.4; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px var(--accent-glow), 0 4px 12px rgba(79, 70, 229, .22); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); box-shadow: 0 2px 4px var(--accent-glow), 0 8px 20px rgba(79, 70, 229, .3); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text-1); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text-1); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fbdcdc; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #b91c1c; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn-icon { padding: 7px; border-radius: var(--r-sm); }

/* ================= 卡片 ================= */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 16px 18px;
  transition: box-shadow var(--t-med), border-color var(--t-med), transform var(--t-med);
}
.card-hover:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); transform: translateY(-1px); }
.card-title { font-weight: 600; font-size: 15.5px; letter-spacing: -.005em; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head .card-title { margin-right: auto; }
.card-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--text-3); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row + .row { margin-top: 6px; }
.grow { flex: 1; min-width: 0; }
.section-title { font-size: 13px; font-weight: 600; margin: 8px 2px -4px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.stat-card { padding: 16px; cursor: default; }
.stat-num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .stat-num { font-size: 24px; } }
.stat-label { color: var(--text-3); font-size: 12.5px; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 8px; }
.stat-icon.indigo { background: var(--accent-soft); color: var(--accent); }
.stat-icon.amber { background: var(--warn-soft); color: var(--warn); }
.stat-icon.rose { background: var(--danger-soft); color: var(--danger); }

/* ================= 徽标 pill ================= */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.plain { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.danger { color: var(--danger); background: var(--danger-soft); }
.pill.info { color: var(--info); background: var(--info-soft); }
.pill.accent { color: var(--accent-strong); background: var(--accent-soft); }

/* ================= 表单 ================= */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font-size: 15px; font-family: inherit; background: var(--surface); color: var(--text-1);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: #b7bdca; }
input:hover, select:hover, textarea:hover { border-color: #c9cfdb; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-glow); }
textarea { min-height: 76px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input:disabled { background: var(--surface-2); color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 12px; cursor: pointer; user-select: none; }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d3d8e2; transition: background var(--t-med); pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--t-med); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(17px); }

/* ================= 进度条 ================= */
.progress { height: 8px; background: #eef0f4; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width 450ms cubic-bezier(.4, 0, .2, 1); }
.progress.near > i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress.over > i { background: linear-gradient(90deg, #f87171, #dc2626); }

/* ================= 提醒流 ================= */
.reminder-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r-md); transition: background var(--t-fast); }
.reminder-item:hover { background: var(--surface-2); }
.reminder-item + .reminder-item { border-top: 1px solid var(--border); border-radius: 0; }
.reminder-item + .reminder-item:hover { border-radius: 0 0 var(--r-md) var(--r-md); }
.reminder-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; }
.reminder-dot.紧急 { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.reminder-dot.提醒 { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.reminder-dot.提示 { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }

/* 任务行 */
.task-check { width: 21px; height: 21px; border-radius: 7px; border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; flex: none; transition: background var(--t-fast), border-color var(--t-fast); }
.task-check:hover { border-color: var(--accent); }
.task-check.done { background: var(--accent); border-color: var(--accent); }
.task-check svg { opacity: 0; transform: scale(.5); transition: all var(--t-fast); }
.task-check.done svg { opacity: 1; transform: scale(1); }
.task-title .task-edit-hint { display: inline-flex; vertical-align: -1.5px; margin-left: 5px; opacity: 0; transition: opacity var(--t-fast); }
.task-title:hover .task-edit-hint { opacity: .75; }

/* ================= 表格 ================= */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: var(--accent-soft); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ================= 空状态 ================= */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; text-align: center; color: var(--text-3); }
.empty svg { opacity: .55; margin-bottom: 4px; }
.empty .empty-title { font-size: 14.5px; font-weight: 500; color: var(--text-2); }
.empty .empty-sub { font-size: 13px; max-width: 300px; }
.empty .btn { margin-top: 10px; }

/* ================= Toast ================= */
.toast-root { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 900px) { .toast-root { bottom: 36px; } }
.toast {
  background: rgba(24, 27, 36, .93); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 14px; max-width: 84vw; text-align: center;
  box-shadow: var(--shadow-3); backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 8px;
  animation: toast-in var(--t-med) both;
}
.toast.ok svg { color: #4ade80; } .toast.err svg { color: #f87171; }
.toast.leaving { animation: toast-out var(--t-fast) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ================= 弹窗 ================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150; background: rgba(20, 23, 33, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity var(--t-med);
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-3);
  width: 100%; max-width: 380px; padding: 22px;
  transform: translateY(14px) scale(.96); transition: transform var(--t-med);
}
.modal-overlay.show .modal { transform: none; }
.modal h3 { font-size: 16.5px; font-weight: 650; margin-bottom: 6px; }
.modal p { color: var(--text-2); font-size: 14px; margin-bottom: 18px; white-space: pre-wrap; }
.modal .row { justify-content: flex-end; }

/* ================= 认证页 ================= */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 500px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 372px; padding: 30px 28px; }
.auth-card .logo-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 21px; margin: 0 auto 14px; }
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 3px; letter-spacing: -.01em; }
.auth-card .sub { text-align: center; color: var(--text-3); font-size: 13.5px; margin-bottom: 22px; }
.auth-card .btn { width: 100%; margin-top: 4px; }

/* 目标树缩进 */
.tree-level-1 { margin-left: 18px; } .tree-level-2 { margin-left: 36px; } .tree-level-3 { margin-left: 54px; }

/* 日记列表 */
.diary-snippet { color: var(--text-3); font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 同步状态条 */
.sync-strip { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sync-strip.ok { color: var(--ok); }
.sync-strip.err { color: var(--danger); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 额度剩余速览（仪表盘） */
.quota-chip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.quota-chip .qc-num { font-weight: 650; font-variant-numeric: tabular-nums; }
.quota-chip .qc-bar { flex: 1; }

/* 图标基础 */
.ic { display: inline-block; vertical-align: middle; }
a .ic, .btn .ic { vertical-align: -3px; }

/* ================= 本站说明卡片 ================= */
.intro-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(120deg, #f4f5ff 0%, #ffffff 60%);
  border-color: var(--accent-border);
}
.intro-close { flex: none; color: var(--text-3); }
.intro-close:hover { color: var(--text-1); background: var(--accent-soft); }

/* ================= 建设日志时间线 ================= */
.tl-item { display: flex; gap: 4px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; width: 16px; flex: none; padding-top: 6px; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex: none; }
.tl-line { width: 2px; flex: 1; background: var(--border); margin-top: 4px; border-radius: 2px; }
.tl-body { flex: 1; min-width: 0; padding: 0 0 16px 10px; }
.tl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.tl-date { font-weight: 650; font-size: 14px; letter-spacing: -.005em; }
.tl-list { list-style: none; margin: 2px 0 0; }
.tl-list li { position: relative; padding-left: 14px; font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.tl-list li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }

/* ================= Markdown 文档渲染（参考指南） ================= */
.md-doc { line-height: 1.75; }
.md-doc .md-h1, .md-doc h2.md-h1 { font-size: 20px; font-weight: 700; margin: 14px 0 8px; letter-spacing: -.01em; }
.md-doc h3.md-h2 { font-size: 16.5px; font-weight: 650; margin: 16px 0 6px; }
.md-doc h4.md-h3 { font-size: 14.5px; font-weight: 600; margin: 12px 0 4px; color: var(--text-2); }
.md-doc .md-p { margin: 6px 0; font-size: 14px; color: var(--text-2); }
.md-doc .md-list { margin: 6px 0 10px; padding-left: 4px; list-style: none; }
.md-doc .md-list li { position: relative; padding-left: 16px; font-size: 14px; color: var(--text-2); margin: 3px 0; }
.md-doc .md-list li::before { content: ""; position: absolute; left: 3px; top: .68em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.md-doc ol.md-list { counter-reset: ol; }
.md-doc ol.md-list li::before { content: counter(ol) "."; counter-increment: ol; background: none; color: var(--accent); font-size: 12px; font-weight: 600; top: 2px; left: 0; width: auto; height: auto; }
.md-doc .md-quote { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; padding: 8px 14px; margin: 8px 0; font-size: 13.5px; color: var(--text-2); }
.md-doc code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent-strong); }
.md-doc .md-hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.md-doc .tbl { margin: 8px 0 12px; }
.md-doc .tbl th { font-weight: 600; }

/* ================= 账单分析图表 ================= */
.chart-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.lg-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; cursor: default; transition: background 150ms; }
.lg-row:hover { background: var(--surface-2); }

/* Logo 图形标 */
.logo-svg { flex: none; display: inline-block; vertical-align: middle; }
.sidebar-logo { display: flex; align-items: center; gap: 9px; }

/* 倒计时区块 */
.cd-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.cd-card { flex: none; width: 132px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 10px 12px; transition: box-shadow 150ms, transform 150ms; }
.cd-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.cd-add { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 96px; cursor: pointer; border-style: dashed; background: transparent; box-shadow: none; }
.cd-add:hover { border-color: var(--accent); background: var(--accent-soft); }

/* 日程月视图 */
.ev-grid-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.ev-grid-head > div { text-align: center; font-size: 12px; color: var(--text-3); padding: 4px 0; }
.ev-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ev-cell { min-height: 74px; border: 1px solid var(--border); border-radius: 10px; padding: 5px 6px; cursor: pointer; transition: border-color 120ms, background 120ms; overflow: hidden; }
.ev-cell:hover { border-color: var(--accent); background: var(--accent-soft); }
.ev-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.ev-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ev-cell.sel { background: var(--accent-soft); }
.ev-date { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.ev-cell.today .ev-date { color: var(--accent); }
.ev-pills { display: flex; flex-direction: column; gap: 2px; }
.ev-pill { font-size: 10.5px; color: #fff; border-radius: 5px; padding: 1px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 日记情绪标签 */
.mood-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--border); font-size: 13px; cursor: pointer; user-select: none; transition: all 120ms; }
.mood-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

/* 媒体卡片 */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media-cover { height: 64px; border-radius: 10px 10px 0 0; display: flex; align-items: center; justify-content: center; font-size: 26px; }

/* 侧边栏滚动（v1.2）：logo 固定，导航区滚动 */
.sidebar { overflow: hidden; }
.sidebar-scroll { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }

/* ================= 月历热力图（账单分析 v1.4） ================= */
.hm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.hm-wd { text-align: center; font-size: 11px; color: var(--text-3); padding: 2px 0; }
.hm-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; border: none; border-radius: 8px; cursor: pointer; padding: 4px 2px; font-family: inherit; transition: transform var(--t-fast); }
.hm-cell:hover { transform: scale(1.05); }
.hm-cell:disabled { cursor: default; }
.hm-empty { background: transparent; cursor: default; }
.hm-day { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.hm-amt { font-size: 9.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 12px; }
.hm-lv0 { background: var(--surface-2); }
.hm-lv1 { background: #e0e7ff; }
.hm-lv2 { background: #a5b4fc; }
.hm-lv3 { background: #6366f1; }
.hm-lv4 { background: #312e81; }
.hm-lv3 .hm-day, .hm-lv3 .hm-amt, .hm-lv4 .hm-day, .hm-lv4 .hm-amt { color: #fff; }
.hm-today { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-chip { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.hm-chip.hm-lv0 { background: var(--surface-2); border: 1px solid var(--border); }

/* ================= ICP 备案页脚 ================= */
.beian { font-size: 11.5px; color: var(--text-3); }
.beian a { color: var(--text-3); text-decoration: none; }
.beian a:hover { color: var(--accent); }
.sidebar-foot { flex-wrap: wrap; padding-bottom: 6px; }
.sidebar-beian { width: 100%; padding: 6px 2px 2px; }
.auth-beian { text-align: center; margin-top: 18px; }

/* ================= 外部服务入口（v1.7） ================= */
.sidebar-nav a.ext-link svg.ext-ic, .ext-link > svg:last-child { margin-left: auto; opacity: .4; }
a.svc-card { display: block; text-decoration: none; color: inherit; }
