/* 落子 · 样式。纸、墨、一点朱砂。只用系统字体（国内无需加载外部字体）。 */
:root {
  --paper: #f5f0e6; --paper-2: #fbf8f1; --line: #ddd4c1; --line-2: #c9bfa9;
  --ink: #1d1b18; --ink-2: #57514a; --ink-3: #857d72;
  --red: #b23b26; --red-ink: #fff; --red-soft: #f3ddd4;
  --green: #2f5d50; --green-soft: #dde8e1; --amber: #8a5a00; --amber-soft: #f2e4c4;
  --shadow: 0 1px 0 rgba(0,0,0,.03), 0 8px 24px -16px rgba(40,30,10,.25);
  --r: 14px; --tab-h: 62px;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191816; --paper-2: #22201d; --line: #36322c; --line-2: #4a453d;
    --ink: #ece6da; --ink-2: #b9b1a3; --ink-3: #8b8377;
    --red: #e0694f; --red-ink: #1a0d09; --red-soft: #3d231c;
    --green: #86b8a6; --green-soft: #22332d; --amber: #e0b860; --amber-soft: #3a2f17;
    --shadow: 0 1px 0 rgba(255,255,255,.02), 0 8px 24px -16px rgba(0,0,0,.8);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
h1, h2, h3, p, ul, ol { margin: 0; }
h1 { font: 700 1.6rem/1.3 var(--serif); letter-spacing: .01em; text-wrap: balance; }
h2 { font: 700 1.1rem/1.4 var(--serif); }
h3 { font: 600 1.02rem/1.45 var(--sans); }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.page { max-width: 680px; margin: 0 auto; padding: 20px 18px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); }
:where(.page > *, .page section) > * + * { margin-top: 14px; }
.page-head { padding: 8px 0 4px; }
.page-head > * + * { margin-top: 6px; }
.muted { color: var(--ink-2); }
.fine { color: var(--ink-3); font-size: .82rem; line-height: 1.5; }
.strong { font-weight: 600; }
.center { text-align: center; }
.center-block { display: block; margin-left: auto; margin-right: auto; }
.eyebrow { font-size: .78rem; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: 10px; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 0; }
.plain { list-style: none; padding: 0; }
.plain li { padding-left: 1.1em; position: relative; }
.plain li::before { content: ""; position: absolute; left: .15em; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.plain li + li { margin-top: 6px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 6px; margin-right: 8px; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; background: none; text-align: center; transition: transform .08s, background .15s, border-color .15s; }
.btn:active { transform: scale(.985); }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 54px; font-size: 1.05rem; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--red)); }
.btn.ghost { border-color: var(--line-2); background: var(--paper-2); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn.danger { background: var(--red); color: var(--red-ink); }
.danger-text { color: var(--red); }
.btn.ai { border: 1px dashed var(--red); color: var(--red); background: color-mix(in srgb, var(--red-soft) 45%, transparent); }
.btn.ai .spark { font-size: .9em; }
.btn.ai.loading { opacity: .8; cursor: progress; }
.btn.ai.loading .spark { animation: spin 1.4s linear infinite; display: inline-block; }
.btn:disabled { cursor: not-allowed; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 6px 2px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; font-size: .92rem; min-height: 32px; }
.link:hover { color: var(--ink); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; font-size: 1.4rem; line-height: 1; color: var(--ink-3); flex: none; }
.icon-btn:hover { background: var(--line); color: var(--ink); }

/* 卡片 */
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card > * + * { margin-top: 10px; }
.card.quiet { background: none; box-shadow: none; }
.card.due { border-color: var(--red); background: color-mix(in srgb, var(--red-soft) 50%, var(--paper-2)); }
.note-card { border-top: 1px solid var(--line); padding-top: 18px; }
.note-card > * + * { margin-top: 10px; }

/* 输入 */
.input { width: 100%; font: inherit; color: inherit; background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; resize: none; display: block; line-height: 1.55; }
.input::placeholder { color: var(--ink-3); opacity: .85; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
.field { display: block; }
.field-label { display: block; font-weight: 600; margin-bottom: 4px; }
.field-hint { display: block; font-size: .82rem; color: var(--ink-3); margin: -2px 0 6px; }

/* chips 与分段 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: var(--paper-2); border-radius: 999px; padding: 7px 13px; font-size: .9rem; min-height: 38px; text-decoration: none; display: inline-flex; align-items: center; text-align: left; }
.chip.sm { padding: 3px 11px; min-height: 32px; font-size: .84rem; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.static { cursor: default; color: var(--ink-2); }
.seg { display: inline-flex; background: var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg.wide { display: flex; }
.seg-btn { flex: 1; border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-size: .9rem; color: var(--ink-2); text-decoration: none; text-align: center; min-height: 38px; white-space: nowrap; }
.seg-btn.on { background: var(--paper-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.switch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); flex: none; }

/* 首页 */
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.1rem var(--serif); letter-spacing: .2em; }
.stone { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a554d, var(--ink) 60%); display: inline-block; }
@media (prefers-color-scheme: dark) { .stone { background: radial-gradient(circle at 35% 30%, #fff, #cfc8ba 70%); } }
.hero { padding: 18px 0 6px; }
.hero > * + * { margin-top: 18px; }
.hero h1 { font-size: clamp(1.9rem, 7.4vw, 2.7rem); line-height: 1.25; }
.lede { font-size: 1.04rem; color: var(--ink-2); max-width: 34em; }
.cta-col { display: grid; gap: 10px; }
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 0; border-top: 1px solid var(--line); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font: 700 .82rem var(--serif); margin-top: 2px; }
.steps li:nth-child(odd)::before { background: var(--ink); color: var(--paper); }
.step-t { font: 700 1.05rem var(--serif); }
.step-d { color: var(--ink-2); font-size: .94rem; }

/* 今天 */
.stones { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.cell { width: 18px; height: 18px; border-radius: 50%; border: 1.5px dashed var(--line-2); flex: none; }
.cell.act { background: var(--ink); border: 1.5px solid var(--ink); }
.cell.rest { background: var(--paper-2); border: 1.5px solid var(--ink-3); }
.cell.today { box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--red); }
.plan .when { color: var(--ink-2); font-size: .95rem; }
.plan .do { font: 700 1.28rem/1.45 var(--serif); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat { text-align: center; padding: 12px 4px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font: 700 1.35rem/1.2 var(--serif); }
.stat span { font-size: .76rem; color: var(--ink-3); }
.log-list { list-style: none; padding: 0; }
.log-list li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 10px 0; }
.log-list li + li { border-top: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; background: var(--ink); }
.dot.rest { background: none; border: 1.5px solid var(--ink-3); }
.log-fb { color: var(--green); font-size: .93rem; margin-top: 2px; }

/* 摆局 */
.wiz-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 8px; }
.crumbs { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; font-size: .74rem; color: var(--ink-3); }
.crumbs li { padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.crumbs li.on { background: var(--ink); color: var(--paper); font-weight: 600; }
.crumbs li.done { color: var(--ink-2); }
@media (max-width: 400px) { .crumbs li:not(.on) { width: 8px; height: 8px; padding: 0; overflow: hidden; color: transparent; background: var(--line-2); align-self: center; } .crumbs li.done { background: var(--ink-3); } }
.opt-list { display: grid; gap: 10px; }
.opt-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; }
.opt-no { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); display: inline-grid; place-items: center; font: 700 .8rem var(--serif); flex: none; }
.ai-box > * + * { margin-top: 8px; }
.insight { border-left: 3px solid var(--red); background: color-mix(in srgb, var(--red-soft) 40%, var(--paper-2)); padding: 14px; border-radius: 0 var(--r) var(--r) 0; font-size: .95rem; }
.insight > * + * { margin-top: 10px; }
.question { font-family: var(--serif); font-weight: 700; font-size: 1.02rem; }
.cards { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 14px -18px 0; padding: 4px 18px 12px; scrollbar-width: thin; }
.opt-card { flex: 0 0 86%; max-width: 360px; scroll-snap-align: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.opt-card header { display: flex; gap: 10px; align-items: flex-start; }
.opt-card h2 { font-size: 1.08rem; }
.opt-card .pick { margin-top: auto; }
.cf { display: block; }
.cf-label { display: block; font-size: .76rem; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; margin-bottom: 2px; }
.cf .input { border-color: transparent; background: none; padding: 4px 6px; margin: 0 -6px; width: calc(100% + 12px); font-size: .95rem; border-bottom: 1px dashed var(--line-2); border-radius: 6px 6px 0 0; }
.cf .input:focus { background: var(--paper); border-color: var(--ink); border-style: solid; border-radius: 6px; }
.suggest { display: grid; gap: 8px; }
.sug { text-align: left; background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.sug:hover { border-color: var(--ink); }
.sug b { font-size: .78rem; color: var(--red); }

/* 行动中 */
body.immersive .page { padding-bottom: 40px; min-height: 100dvh; display: grid; align-items: center; }
.session { display: grid; gap: 18px; }
.session-do { font: 700 1.4rem/1.5 var(--serif); text-align: center; text-wrap: balance; }
.ring-wrap { position: relative; width: min(64vw, 260px); aspect-ratio: 1; margin: 6px auto; }
.ring { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.over .ring-fg { stroke: var(--red); }
.clock { position: absolute; inset: 0; display: grid; place-items: center; font: 700 2.6rem var(--serif); font-variant-numeric: tabular-nums; }

/* 复盘、留存 */
.two-col { display: grid; gap: 14px; }
.verdicts { display: grid; gap: 10px; }
.keep-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.keep { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.keep > * + * { margin-top: 8px; }
.keep.row > * + * { margin-top: 0; }
.keep-body { white-space: pre-wrap; color: var(--ink-2); font-size: .95rem; }
.badge { font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--line); color: var(--ink-2); }
.badge.t-0, .badge.t-1 { background: var(--amber-soft); color: var(--amber); }
.badge.t-2, .badge.t-3, .badge.t-4 { background: var(--green-soft); color: var(--green); }
.badge.t-5 { background: var(--red-soft); color: var(--red); }
details summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--ink-2); }
details > * + * { margin-top: 8px; }
details p { font-size: .95rem; }
.empty { text-align: center; padding: 36px 12px; }
.empty > * + * { margin-top: 8px; }
.empty-stone { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--line-2); margin: 0 auto 6px; }

/* 外壳 */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); z-index: 20; }
.tab { flex: 1; display: grid; place-content: center; justify-items: center; gap: 0; text-decoration: none; font-size: .76rem; color: var(--ink-3); }
.tab-glyph { font-size: 1.05rem; line-height: 1.3; }
.tab.on { color: var(--ink); font-weight: 700; }
.demo-bar { background: var(--amber-soft); color: var(--amber); font-size: .84rem; padding: 8px 14px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 15; text-align: center; }
.demo-bar .link { color: inherit; padding: 0; min-height: 0; font-weight: 700; }
.demo-bar.warn { background: var(--red-soft); color: var(--red); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: .92rem; z-index: 60; max-width: min(92vw, 420px); width: max-content; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); animation: rise .25s ease-out; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.sheet-wrap { position: fixed; inset: 0; background: rgba(20,16,10,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--paper); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 14px 18px calc(22px + env(safe-area-inset-bottom)); animation: up .25s ease-out; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet-body > * + * { margin-top: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* 大屏 */
@media (min-width: 760px) {
  .page { padding-top: 44px; }
  .page-new { max-width: 1120px; }
  .page-new .wizard > section > *:not(.cards):not(.insight) { max-width: 680px; margin-left: auto; margin-right: auto; }
  .page-new .insight { max-width: 680px; margin-left: auto; margin-right: auto; }
  .cards { margin: 18px 0 0; padding: 4px 0 12px; overflow: visible; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .opt-card { max-width: none; }
  .swipe-hint { display: none; }
  .cta-col { grid-template-columns: auto auto; justify-content: start; }
  .two-col { grid-template-columns: 1fr 1fr; align-items: start; }
  .verdicts { grid-template-columns: repeat(3, 1fr); }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 20px; }
  .tabs { left: 50%; right: auto; transform: translateX(-50%); bottom: 18px; width: 320px; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); height: 56px; padding: 0; }
  .tab { grid-auto-flow: column; gap: 6px; align-items: center; font-size: .88rem; }
}
.stat-row > .stat { margin-top: 0; }

:where(.page section > div:not([class])) > * + * { margin-top: 14px; }
