﻿/* ─────────────────────────────────────────────
   六年之约 · 墨与金
   手机优先，桌面增强
   ───────────────────────────────────────────── */

:root {
  --bg: #f7f4ec;
  --surface: #fffdf8;
  --ink: #14130f;
  --ink-2: #3a382f;
  --muted: #8c877a;
  --line: #e4dfd2;
  --line-soft: #efeade;
  --gold: #b5852f;
  --gold-soft: #f1e7d3;
  --danger: #a5483a;
  --radius: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: ui-serif, Georgia, "Songti SC", "Noto Serif CJK SC",
                "Source Han Serif SC", "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg: #121110;
  --surface: #1b1a17;
  --ink: #f4f0e6;
  --ink-2: #cdc7b8;
  --muted: #8a8478;
  --line: #2c2a25;
  --line-soft: #232220;
  --gold: #d9b36b;
  --gold-soft: #2a2419;
  --danger: #d98b7c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ── 印章 ─────────────────────────────── */
.seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1;
  flex: none;
}
.seal-sm { width: 32px; height: 32px; font-size: 17px; border-radius: 6px; }

/* ── 登录 ─────────────────────────────── */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 22px;
}

.auth-inner { width: 100%; max-width: 380px; }

.auth-mark { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-title { font-family: var(--font-serif); font-size: 26px; letter-spacing: .12em; }
.auth-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .05em;
  margin-top: 2px;
}

.auth-lead { font-size: 14px; color: var(--ink-2); line-height: 1.9; margin-bottom: 28px; }

.auth-form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: .06em; }

input, textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: 16px; /* 防止 iOS 聚焦时放大 */
  transition: border-color .2s, background .2s;
}
input:hover, textarea:hover { border-color: var(--muted); }
input:focus, textarea:focus { outline: none; border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: var(--muted); }

textarea { resize: vertical; min-height: 84px; line-height: 1.7; }

.auth-error {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--danger);
  line-height: 1.4;
}

.auth-switch { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.auth-note { margin-top: 30px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }

/* ── 按钮 ─────────────────────────────── */
.btn {
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  letter-spacing: .03em;
  transition: border-color .2s, background .2s, color .2s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-block { width: 100%; padding: 14px; font-size: 15px; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.link-btn:hover { color: var(--ink); border-color: var(--ink); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  transition: border-color .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }

/* ── 顶栏 + 导航 ───────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px 7px;
}
.hdr-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hdr-meta { display: grid; gap: 1px; min-width: 0; }
.hdr-name {
  font-size: 13.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}
.hdr-sync { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); }
.hdr-sync i { width: 5px; height: 5px; border-radius: 50%; background: #6da17f; display: block; }
.hdr-sync[data-state="saving"] i { background: var(--gold); }
.hdr-sync[data-state="offline"] i { background: var(--danger); }
.hdr-sync b { font-weight: 400; }
.hdr-right { display: flex; gap: 8px; flex: none; }

/* ── 主体 ─────────────────────────────── */
.main { padding: 0 18px 40px; max-width: 760px; margin: 0 auto; }

/* Hero */
.hero {
  position: relative;
  padding: 44px 0 22px;
  overflow: hidden;
}

.hero-ghost {
  display: none;
  position: absolute;
  right: 0;
  top: 58px;
  font-family: var(--font-serif);
  font-size: 170px;
  line-height: .8;
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  opacity: .6;
  pointer-events: none;
  user-select: none;
}

.eyebrow {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  margin-bottom: 4px;
}
.mono { font-family: var(--font-mono); }

.countdown { position: relative; display: flex; align-items: baseline; gap: 8px; }

.countdown-num {
  font-family: var(--font-serif);
  font-size: clamp(64px, 19vw, 132px);
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.countdown-unit { font-size: 17px; color: var(--muted); letter-spacing: .08em; }

.hero-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}
.hero-foot b { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.dot-sep { opacity: .45; }

.progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i {
  display: block; height: 100%; width: 0;
  background: var(--gold);
  border-radius: inherit;
  transition: width .8s cubic-bezier(.2,.7,.2,1);
}
.hero-progress { position: relative; margin-top: 16px; }

/* 金句 */
.quote-card {
  margin: 18px 0 26px;
  padding: 18px 18px 14px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: 4px 12px 12px 4px;
}
.quote-text {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .01em;
}
.quote-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.quote-author { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }

/* 统计 */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.stat { background: var(--bg); padding: 16px 14px; display: grid; gap: 2px; }
.stat-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.stat-value {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.stat-value small { font-size: 11px; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.stat-sub { font-size: 11px; color: var(--muted); }

/* 区块 */
.block { padding: 34px 0; border-bottom: 1px solid var(--line); }
.block:last-of-type { border-bottom: 0; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 18px;
}
.block-head h2 { font-size: 15px; letter-spacing: .08em; }
.block-note { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 阶段 */
.stages { display: grid; gap: 18px; }
.stage { display: grid; gap: 6px; }
.stage-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stage-name { font-size: 13.5px; }
.stage-name em { font-style: normal; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--muted); margin-left: 6px; }
.stage-figures { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stage-figures b { color: var(--ink-2); font-weight: 500; }
.stage .progress { height: 3px; }
.stage.is-past .progress i { background: var(--muted); opacity: .5; }
.stage.is-future { opacity: .55; }

/* 热力图 */
.year-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.year-tab {
  padding: 3px 8px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; font-family: var(--font-mono);
  font-size: 10.5px; color: var(--muted); letter-spacing: .03em;
}
.year-tab[aria-selected="true"] { color: var(--ink); border-color: var(--line); }

.heatmap-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  gap: 4px;
  min-height: 108px;
  width: max-content;
}
.cell { width: 12px; height: 12px; border-radius: 3px; background: var(--line-soft); }
.cell.pad, .cell.out { background: transparent; }
.cell.on { background: var(--gold); }
.cell.future { background: transparent; box-shadow: inset 0 0 0 1px var(--line-soft); }
.cell.today { box-shadow: 0 0 0 1.5px var(--ink); }
.cell:not(.pad):not(.out):not(.future) { cursor: pointer; }
.cell:not(.pad):not(.out):not(.future):active { transform: scale(1.2); }

.heat-legend { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 10.5px; color: var(--muted); }
.heat-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--line-soft); display: inline-block; }
.heat-legend i.on { background: var(--gold); }
.heat-legend em { font-style: normal; margin-left: auto; font-variant-numeric: tabular-nums; }

/* 时间轴 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
}
.tl-item.past::before { background: var(--muted); border-color: var(--muted); }
.tl-item.current::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.tl-item.future { opacity: .55; }
.tl-year { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; color: var(--muted); }
.tl-title { font-size: 14px; margin: 2px 0 1px; }
.tl-desc { font-size: 11.5px; color: var(--muted); }

/* 表单 */
.income-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.income-form input[type="text"] { grid-column: 1 / -1; }
.income-form .btn { grid-column: 1 / -1; }
input[type="date"], input[type="time"] { font-size: 15px; }

.note-form { display: grid; gap: 9px; }
.note-pair { display: grid; gap: 8px; }
.pair-field { display: grid; gap: 4px; }
.pair-field span { font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.note-actions { display: flex; align-items: center; justify-content: space-between; }
.note-count { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

/* 列表 */
.ledger, .notes { margin-top: 14px; }
.ledger li, .notes li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.ledger-date, .notes-date {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  letter-spacing: .03em; white-space: nowrap; padding-top: 3px; min-width: 56px;
}
.ledger-body, .notes-body { flex: 1; min-width: 0; }
.ledger-source { font-size: 13px; }
.notes-body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.ledger-amount { font-family: var(--font-serif); font-size: 16px; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }

.note-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 5px;
  background: var(--gold-soft); color: var(--ink-2); line-height: 1.7;
}
.tag.stuck { background: var(--line-soft); color: var(--muted); }

.del {
  border: 0; background: transparent; color: var(--muted);
  font-size: 15px; line-height: 1; padding: 4px 6px; border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}
.del:hover { color: var(--danger); }

.empty { padding: 20px 0; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-soft); }

/* 海报 */
.poster-wrap { display: grid; gap: 16px; }
.poster-canvas {
  width: 100%;
  max-width: 300px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.poster-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.poster-side { display: grid; gap: 10px; align-content: start; justify-items: start; }

.disclaimer { font-size: 10.5px; color: var(--muted); padding: 28px 0 0; text-align: center; }

/* 页脚 */
.footer {
  max-width: 760px; margin: 0 auto;
  padding: 18px 18px 110px; /* 给底部条留位置 */
  display: flex; gap: 22px;
}

/* 底部打卡条 */
.bottombar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  transform: translateY(115%);
  transition: transform .28s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
}
.bottombar.show { transform: translateY(0); pointer-events: auto; }

.checkin-btn {
  width: 100%;
  display: grid;
  gap: 1px;
  padding: 12px 16px;
  border: 0;
  border-radius: 13px;
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  transition: background .25s, color .25s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.checkin-btn:active { transform: scale(.99); }
.checkin-btn span { font-size: 16px; letter-spacing: .1em; }
.checkin-btn small { font-size: 10.5px; opacity: .6; letter-spacing: .04em; }
.checkin-btn.done { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

/* 设置面板 */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10,10,8,.42); backdrop-filter: blur(2px); }
.sheet-panel {
  position: relative;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 6px 20px calc(24px + var(--safe-b));
  max-height: 88dvh;
  overflow-y: auto;
  animation: sheet-up .28s cubic-bezier(.2,.7,.2,1);
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 6px; }
.sheet-head h3 { font-size: 16px; letter-spacing: .1em; }
.sheet-body { display: grid; gap: 4px; }
.sheet-note { font-size: 11px; color: var(--muted); line-height: 1.7; padding: 12px 0 0; }

.setting {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft);
}
.setting-main { display: grid; gap: 2px; }
.setting-title { font-size: 13.5px; }
.setting-desc { font-size: 11px; color: var(--muted); }
.setting input[type="number"], .setting input[type="time"] { width: 116px; padding: 8px 10px; font-size: 15px; text-align: right; }

.switch { position: relative; display: inline-block; width: 46px; height: 27px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; z-index: 2; cursor: pointer; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line); transition: background .2s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .2s;
}
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::after { transform: translateX(19px); }

/* ── 导航条 ───────────────────────────── */
.nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }

.nav-btn {
  flex: none;
  padding: 9px 8px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.on { color: var(--ink); border-bottom-color: var(--gold); }

/* ── 页面 ─────────────────────────────── */
.page { animation: page-in .3s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 26px 0 4px;
}
.page-head h2 { font-size: 17px; letter-spacing: .1em; }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}
.ms {
  background: var(--bg);
  padding: 14px 8px;
  display: grid;
  gap: 1px;
  text-align: center;
}
.ms-v {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.ms-k { font-size: 10px; color: var(--muted); letter-spacing: .06em; }

/* ── 首页：倒计时 ─────────────────────── */
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
}
.hero-date { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: .03em; }

.hero-motto {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink-2);
  letter-spacing: .05em;
  margin-top: 4px;
}

.precise {
  display: flex;
  margin-top: 20px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pu { flex: 1; text-align: center; display: grid; gap: 1px; }
.pu b {
  font-family: var(--font-serif);
  font-size: 27px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.pu i { font-style: normal; font-size: 9.5px; color: var(--muted); letter-spacing: .12em; }
.precise-note {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .14em;
  margin-top: 14px;
}

/* ── 今日状态 ─────────────────────────── */
.today-card {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1;
  padding: 13px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
  transition: color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.tab.on { color: var(--ink); border-bottom-color: var(--gold); }
.tab-body { padding: 16px; }

.checkin-big {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 16px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  transition: background .25s, color .25s, border-color .25s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.checkin-big:active { transform: scale(.99); }
.checkin-big span { font-size: 16px; letter-spacing: .12em; }
.checkin-big small { font-size: 10.5px; opacity: .62; letter-spacing: .03em; }
.checkin-big.done { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }

.streak-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
}
.streak-row b { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }

.autosave {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--muted);
  text-align: right;
  transition: color .3s;
}
.autosave.flash { color: var(--gold); }

/* 今日日不断 */
.tc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 0;
}
.tc-title { font-size: 13px; letter-spacing: .06em; }
.tc-progress {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.habits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 12px 16px 2px;
}
.habit-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
  transition: border-color .2s, background .2s, color .2s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.habit-chip:active { transform: scale(.98); }
.habit-chip .hdot-c {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  flex: none;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: transparent;
  transition: background .2s, border-color .2s;
}
.habit-chip.on {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
}
.habit-chip.on .hdot-c {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}
.today-card .streak-row { padding: 0 16px 16px; }

/* 日不断详情列表 */
.habit-list { display: grid; gap: 9px; }
.habit {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  transition: border-color .2s, background .2s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.habit:active { transform: scale(.995); }
.habit.on { border-color: var(--gold); }
.h-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  flex: none;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: transparent;
  transition: background .2s, border-color .2s;
}
.habit.on .h-circle { background: var(--gold); border-color: var(--gold); color: #fff; }
.h-main { flex: 1; display: grid; gap: 3px; min-width: 0; }
.h-name { font-size: 13.5px; }
.h-meta { font-size: 10.5px; color: var(--muted); }
.h-dots { display: flex; gap: 4px; flex: none; }
.h-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-soft); }
.h-dot.on { background: var(--gold); }

/* 写复盘卡片 */
.write-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  display: grid;
  gap: 10px;
}
.wc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wc-title { font-size: 13px; letter-spacing: .06em; }
.write-card .autosave { margin-top: 0; }

/* 热力图强度 */
.cell.on.lv1 { opacity: .45; }
.cell.on.lv2 { opacity: .62; }
.cell.on.lv3 { opacity: .82; }
.heat-legend i.lv2 { background: var(--gold); opacity: .62; }
.heat-legend i.lv3 { background: var(--gold); opacity: .82; }
.cal-cell.on.lv1 { opacity: .5; }
.cal-cell.on.lv2 { opacity: .68; }
.cal-cell.on.lv3 { opacity: .85; }

/* ── 进度总览 ─────────────────────────── */
.overview { display: grid; gap: 14px; }
.ov-row {
  display: grid;
  grid-template-columns: 42px 1fr 50px;
  align-items: center;
  gap: 10px;
}
.ov-label { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.ov-bar { height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.ov-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 4px;
  transition: width .9s cubic-bezier(.2,.7,.2,1);
}
.ov-bar i.gold { background: var(--gold); }
.ov-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-align: right;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.ov-note { margin-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ── 月度记录 ─────────────────────────── */
.months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.month {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.month.open { grid-column: 1 / -1; }
.month-head {
  width: 100%;
  display: grid;
  gap: 1px;
  padding: 10px;
  border: 0;
  background: transparent;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.m-id { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: var(--gold); }
.m-date { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.m-days { font-size: 12px; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }

.month-detail { padding: 2px 12px 14px; }
.md-sum { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-w { font-size: 9px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 10px;
  border-radius: 4px;
  background: var(--line-soft);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cal-cell.blank, .cal-cell.out { background: transparent; }
.cal-cell.future { background: transparent; box-shadow: inset 0 0 0 1px var(--line-soft); }
.cal-cell.on { background: var(--gold); color: #fff; }
.cal-cell.today { box-shadow: 0 0 0 1.5px var(--ink); }
.cal-cell.on.today { box-shadow: 0 0 0 1.5px var(--ink); }

/* ── 桌面增强 ─────────────────────────── */
@media (min-width: 720px) {
  body { font-size: 15px; }
  .hero-ghost { display: block; }
  .months { grid-template-columns: repeat(6, 1fr); }
  .pu b { font-size: 34px; }
  .today-card { margin: 30px 0; }
  .tab-body { padding: 20px; }
  .hdr { padding: 16px 34px; }
  .hdr-name { max-width: none; font-size: 14px; }
  .main { padding: 0 34px 40px; max-width: 860px; }
  .hero { padding: 66px 0 30px; }
  .hero-ghost { font-size: 230px; right: 10px; top: 40px; }
  .countdown-num { font-size: 132px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 20px 18px; }
  .stat-value { font-size: 28px; }
  .block { padding: 44px 0; }
  .income-form { grid-template-columns: 150px 140px 1fr auto; }
  .income-form input[type="text"] { grid-column: auto; }
  .income-form .btn { grid-column: auto; }
  .note-pair { grid-template-columns: 1fr 1fr; }
  .poster-wrap { grid-template-columns: 260px 1fr; align-items: start; }
  .footer { padding: 18px 34px 48px; }
  .bottombar { display: none; }
  .sheet { align-items: center; justify-items: center; }
  .sheet-panel { width: 440px; border-radius: 18px; padding: 6px 24px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── 打卡弹窗 ─────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; }
.modal-bg { position: absolute; inset: 0; background: rgba(10, 10, 8, .45); backdrop-filter: blur(2px); }
.modal-panel {
  position: relative;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 8px 20px calc(20px + var(--safe-b));
  display: grid;
  gap: 9px;
  max-height: 88dvh;
  overflow-y: auto;
  animation: sheet-up .26s cubic-bezier(.2, .7, .2, 1);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.modal-head h3 { font-size: 16px; letter-spacing: .05em; }
.modal-sub { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.modal-hint { font-size: 10.5px; color: var(--muted); }
.modal-actions { display: flex; align-items: center; gap: 10px; padding-top: 6px; flex-wrap: wrap; }
.modal-actions .spacer { flex: 1; }
.modal-actions .link-btn { font-size: 11.5px; }

@media (min-width: 720px) {
  .modal { align-items: center; justify-items: center; }
  .modal-panel { width: 460px; border-radius: 18px; padding: 8px 24px 22px; }
}

/* 五个芯片时，最后一个占满一行 */
.habits .habit-chip:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ── 积分商城 ─────────────────────────── */
.points-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 16px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--surface) 70%);
}
.pt-label { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); display: block; }
.pt-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1.05;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.pt-right { display: grid; gap: 3px; text-align: right; font-size: 11px; color: var(--muted); }
.pt-right b { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }

.board {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}
.board-head h2 { font-size: 15px; letter-spacing: .08em; }
.board-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.edit-btn {
  width: 32px; height: 32px; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--gold); font-size: 14px;
  transition: border-color .2s, background .2s;
}
.edit-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.board-body { padding: 2px 16px 16px; }
.board-text { font-size: 13.5px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.board-empty {
  font-size: 13px; color: var(--muted);
  padding: 14px 0; border-top: 1px dashed var(--line);
}

.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.img-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); display: block;
}
.thumb { position: relative; }
.thumb button {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; line-height: 1;
}

.rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reward {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  display: grid;
  align-content: start;
}
.reward-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--line-soft); }
.reward-ph {
  display: grid; place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--gold-soft);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 24px;
}
.reward-body { padding: 9px 10px 11px; display: grid; gap: 7px; }
.reward-name { font-size: 12.5px; line-height: 1.4; }
.reward-cost { font-family: var(--font-mono); font-size: 11px; color: var(--gold); }
.reward-btn {
  width: 100%; padding: 7px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  font-size: 12px; color: var(--ink-2);
  transition: border-color .2s, color .2s, background .2s;
}
.reward-btn:not(:disabled):hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.reward-btn:disabled { opacity: .4; }

.redeems li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.redeems .rd-date { font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.redeems .rd-name { flex: 1; }
.redeems .rd-cost { color: var(--gold); font-family: var(--font-mono); font-size: 11px; }

@media (min-width: 720px) {
  .rewards { grid-template-columns: repeat(3, 1fr); }
  .img-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── 今日 AI 要闻 ─────────────────────── */
.news-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 13px 15px 4px;
}
.news-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 4px;
}
.news-head h2 { font-size: 13px; letter-spacing: .08em; }
.news-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }

.news-list li { border-top: 1px solid var(--line-soft); }
.news-list li:first-child { border-top: 0; }
.news-list a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  text-decoration: none;
  color: inherit;
}
.news-src {
  flex: none;
  font-size: 9px;
  line-height: 1.6;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--gold);
  white-space: nowrap;
}
.news-title { flex: 1; font-size: 12.5px; line-height: 1.55; }
.news-list a:hover .news-title { color: var(--gold); }
.news-time { flex: none; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.news-empty { font-size: 12px; color: var(--muted); padding: 12px 0; }

@media (max-width: 719px) {
  .news-list li:nth-child(n+5) { display: none; }
}

/* ── 同路人 ───────────────────────────── */
.feed-lead { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.feed-item { border-top: 1px solid var(--line-soft); }
.feed-item:first-child { border-top: 0; }
.feed-row { display: flex; align-items: center; gap: 9px; padding: 12px 0; }
.feed .avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 15px;
}
.feed .fb { flex: 1; min-width: 0; }
.feed .fname { font-size: 13px; line-height: 1.4; }
.feed .fact { font-size: 12px; color: var(--muted); }
.feed .fact b { color: var(--gold); font-weight: 500; }
.feed .ftime { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.feed-empty { font-size: 12.5px; color: var(--muted); padding: 18px 0; border-top: 1px solid var(--line-soft); }

/* ── 排行榜 ───────────────────────────── */
.rank { padding: 0 16px 10px; }
.rank li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}
.rank li:first-child { border-top: 0; }
.rank .rk {
  width: 20px; flex: none; text-align: right;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted);
}
.rank li:nth-child(-n+3) .rk { color: var(--gold); }
.rank .rname { flex: 1; font-size: 13px; }
.rank .rst { font-family: var(--font-serif); font-size: 15px; color: var(--gold); }
.rank .rst small { font-size: 9.5px; color: var(--muted); font-family: var(--font-sans); margin-left: 2px; }
.rank .rfull { font-size: 10px; color: var(--muted); font-family: var(--font-mono); }
.rank-empty { font-size: 12.5px; color: var(--muted); padding: 16px; }

/* 点赞 */
.like-btn {
  flex: none;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  color: var(--muted);
  transition: border-color .2s, color .2s, background .2s;
}
.like-btn:hover { border-color: var(--gold); color: var(--gold); }
.like-btn.liked { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }

/* 评论 */
.feed-comments { padding: 0 0 12px 43px; display: grid; gap: 6px; }
.cmt { font-size: 12px; color: var(--ink-2); line-height: 1.65; }
.cmt b { color: var(--muted); font-weight: 400; margin-right: 2px; }
.cmt-form { display: flex; gap: 6px; margin-top: 4px; }
.cmt-form input { flex: 1; padding: 8px 10px; font-size: 13px; border-radius: 8px; min-width: 0; }
.cmt-form .btn { padding: 8px 14px; font-size: 12.5px; }
/* ── 阅读打卡 ─────────────────────────── */
.rm-book {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  gap: 6px;
}
.rm-book-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rm-book-title { font-size: 14px; font-family: var(--font-serif); }
.rm-book-meta { font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); }
.rm-progress { height: 4px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.rm-progress i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 4px; transition: width .4s; }
.rm-fields { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
@media (max-width: 380px) { .rm-fields { grid-template-columns: 1fr; } }

/* ── 某一天的详情 ─────────────────────── */
.cal-hint { font-size: 10px; color: var(--muted); margin-top: 9px; }
.cal-cell.sel { box-shadow: 0 0 0 2px var(--ink); }
.day-detail {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
}
.dd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dd-date { font-size: 12.5px; letter-spacing: .03em; }
.dd-full { font-family: var(--font-mono); font-size: 10px; color: var(--gold); }
.dd-row { display: flex; gap: 8px; font-size: 11.5px; line-height: 1.65; }
.dd-name { flex: none; width: 30px; color: var(--muted); }
.dd-text { flex: 1; color: var(--ink-2); word-break: break-word; }
.dd-row.on .dd-name { color: var(--gold); }
.dd-row:not(.on) .dd-text { color: var(--muted); }
.dd-note {
  margin-top: 4px;
  padding: 9px 11px;
  background: var(--gold-soft);
  border-radius: 8px;
  display: grid;
  gap: 3px;
}
.dd-note-t { font-size: 9.5px; color: var(--muted); letter-spacing: .1em; }
.dd-note-b { font-size: 11.5px; color: var(--ink-2); line-height: 1.65; }

/* ── 论坛 ─────────────────────────────── */
.posts li { border-top: 1px solid var(--line-soft); padding: 14px 0; }
.posts li:first-child { border-top: 0; }
.post-head { display: flex; align-items: center; gap: 9px; }
.post-name { font-size: 13px; }
.post-time { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }
.post-text { font-size: 13px; line-height: 1.8; margin-top: 8px; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.post-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 9px; }
.post-imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.post-foot { display: flex; gap: 8px; margin-top: 9px; }
.post-comments {
  margin-top: 9px;
  padding-left: 11px;
  border-left: 2px solid var(--line-soft);
  display: grid;
  gap: 7px;
}

/* ── 看图灯箱 ─────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0, 0, 0, .93);
  display: grid;
  place-items: center;
  padding: 16px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.lightbox-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(0, 0, 0, .3);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.post-imgs img, .img-grid img { cursor: zoom-in; }

/* 确认弹窗 */
.cf-panel { gap: 14px; }
.cf-text { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }

/* 资讯：主编点评 + 标签 */
.news-digest {
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-2);
  background: var(--gold-soft);
  border-radius: 8px;
  padding: 9px 11px;
  margin: 6px 0 4px;
  white-space: pre-wrap;
}
.news-tag {
  flex: none;
  font-size: 8.5px;
  line-height: 1.6;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--gold-soft);
  color: var(--gold);
}
.news-orig {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.5;
}


/* 站内通知 */
.toast-wrap {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 9999;
  padding: 10px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  font-size: 12.5px;
  line-height: 1.6;
  animation: toastIn .22s ease;
  cursor: pointer;
}
.toast b { color: var(--gold); font-weight: 600; }
.toast small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.nav-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #e2483d;
  margin-left: 4px;
  vertical-align: top;
  margin-top: 2px;
}
