:root {
  color-scheme: light;
  --bg:#f5f4ee; --paper:#fffef8; --ink:#232b24; --sub:#555e55; --rule:#dadcd2;
  --accent:#285943; --tint:#e5eee5; --accent-on:#fff; --warn:#8c4331; --warn-bg:#f9eae0;
  --shadow:0 14px 38px #28342715; --radius:17px;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;
}
* { box-sizing:border-box }
[hidden] { display:none!important }
body { margin:0; color:var(--ink); background:var(--bg); -webkit-tap-highlight-color:transparent }
button,input,textarea { font:inherit; color:inherit }
button { cursor:pointer }
button:disabled { cursor:wait; opacity:.6 }
button:focus-visible,input:focus-visible,textarea:focus-visible { outline:2px solid var(--accent); outline-offset:3px }
.app { max-width:540px; margin:0 auto; min-height:100dvh; position:relative }
.bar { padding:calc(15px + env(safe-area-inset-top)) 20px 13px; display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid var(--rule) }
.wordmark { display:flex; gap:9px; align-items:center; font-size:14px; line-height:1.2; font-weight:730; white-space:nowrap }
.wordmark small { display:block; margin-top:4px; font-size:8px; letter-spacing:.12em; color:var(--sub); font-weight:700 }
.sync { display:flex; align-items:center; gap:6px; border:1px solid var(--rule); border-radius:100px; background:var(--paper); min-height:42px; padding:0 11px; text-align:left; font-size:12px; color:var(--sub) }
.sync i { width:7px; height:7px; border-radius:7px; background:#947a54; flex:none }
.sync[data-state=done] i { background:var(--accent) }
.sync[data-state=error] i { background:var(--warn) }
main { padding:0 20px calc(107px + env(safe-area-inset-bottom)); }
.intro { padding:24px 0 20px; }
.eyebrow { margin:0; font-size:12px; font-weight:680; color:var(--accent); letter-spacing:.06em }
h1 { margin:6px 0 8px; font-family:"Songti SC","Noto Serif CJK SC",serif; font-size:48px; letter-spacing:-.045em; line-height:1.12 }
.subtitle { color:var(--sub); margin:0; font-size:14px; line-height:1.6; overflow-wrap:anywhere }
.capture { border:1px solid var(--rule); background:var(--paper); border-radius:var(--radius); padding:13px 13px 13px 15px; box-shadow:0 2px 10px #28342708; }
label { display:block; font-weight:680; font-size:13px; margin-bottom:8px }
.entry { display:flex; gap:8px; }
.entry input { min-width:0; flex:1; font-size:16px; background:transparent; border:0; padding:6px 0; border-radius:4px }
.entry button,.primary { background:var(--accent); color:var(--accent-on); border:1px solid transparent; border-radius:12px; min-height:44px; font-weight:680 }
.entry button { width:44px; flex:none; display:grid; place-items:center }
.entry button svg { width:22px; height:22px; stroke:currentColor; stroke-width:1.8; stroke-linecap:round }
.primary,.secondary { padding:0 14px }
.secondary { min-height:44px; border:1px solid var(--rule); border-radius:12px; background:var(--paper) }
.lists section,.notes { margin-top:22px; }
h2 { margin:8px 0 12px; font-size:19px; line-height:1.25; }
.lists h2 { display:flex; align-items:baseline; gap:8px; font-size:16px; margin:0 0 8px }
.lists h2 span { font-size:12px; color:var(--sub); font-weight:500; font-variant-numeric:tabular-nums }
.lists ul { list-style:none; margin:0; padding:0 10px; border:1px solid var(--rule); border-radius:var(--radius); background:var(--paper) }
li.task { min-height:64px; display:grid; align-items:center; gap:3px; grid-template-columns:38px minmax(0,1fr) auto; padding:5px 0; }
li.task+li.task { border-top:1px solid var(--rule) }
.title { font-size:15px; line-height:1.45; overflow-wrap:anywhere; }
.meta { font-size:11px; line-height:1.4; color:var(--sub); margin-top:3px; overflow-wrap:anywhere }
.task[data-done=true] .title { color:var(--sub) }
.task .check { width:38px; height:44px; padding:0; border:0; background:none; display:grid; place-items:center }
.check::before { content:""; width:17px; height:17px; border:1.5px solid #69766a; border-radius:50% }
.task[data-done=true] .check::before { content:"✓"; border-color:transparent; color:var(--accent); font-weight:700; text-align:center; }
.move { border:0; background:transparent; font-size:12px; border-radius:8px; color:var(--accent); min-height:44px; padding:0 5px 0 8px; white-space:nowrap }
.empty { border:1px dashed var(--rule); padding:15px; border-radius:var(--radius); font-size:14px; line-height:1.5; color:var(--sub); margin:0 }
.notes { display:grid; gap:10px }
.note-card { text-align:left; border:1px solid var(--rule); border-radius:var(--radius); background:var(--paper); padding:15px; min-width:0 }
.note-card strong,.note-card span { display:block; overflow-wrap:anywhere }
.note-card strong { font-size:15px; margin-bottom:5px }
.note-card span { color:var(--sub); font-size:13px; line-height:1.45; white-space:pre-wrap }
.nav { position:fixed; left:50%; bottom:0; transform:translateX(-50%); width:min(100%,540px); display:flex; gap:6px; padding:9px 20px calc(11px + env(safe-area-inset-bottom)); border-top:1px solid var(--rule); background:var(--bg); z-index:2 }
.nav button { display:flex; align-items:center; justify-content:center; gap:7px; flex:1; border:1px solid transparent; background:none; border-radius:12px; min-height:46px; color:var(--sub) }
.nav button[aria-current] { background:var(--tint); color:var(--accent); font-weight:730 }
.nav svg { width:19px; height:19px; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round }
dialog { width:min(calc(100% - 26px),420px); max-height:90dvh; border:1px solid var(--rule); padding:0; border-radius:22px; color:var(--ink); background:var(--paper); box-shadow:var(--shadow) }
dialog::backdrop { background:#1d29266b }
.sheet { padding:20px }
.sheet h2 { margin-bottom:9px; }
.sheet form,.sheet label:not(.visually-hidden),.sheet textarea { margin-top:13px }
.sheet input,.sheet textarea { display:block; width:100%; background:var(--bg); border:1px solid var(--rule); border-radius:12px; padding:10px; min-height:44px; font-size:16px }
.sheet textarea { min-height:140px; resize:vertical; }
.sheet form>.primary { width:100%; margin-top:12px }
.sheet-actions,.date-shortcuts { display:flex; justify-content:flex-end; gap:8px; margin-top:14px }
.date-shortcuts { justify-content:flex-start; }
.hint { color:var(--sub); font-size:12px; line-height:1.5; }
.notice { position:fixed; z-index:4; bottom:calc(83px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:min(90%,460px); background:var(--ink); border-radius:13px; color:var(--paper); padding:12px 16px; font-size:13px; line-height:1.5 }
.conflicts { margin-top:25px; background:var(--warn-bg); padding:12px; border-radius:var(--radius); color:var(--warn) }
.conflicts h2 { font-size:16px; }
.conflict-row { padding:8px 0; border-top:1px solid var(--rule) }
.conflict-row p { margin:5px 0 9px; overflow-wrap:anywhere; white-space:pre-wrap; font-size:13px; line-height:1.5 }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0 }
@media(prefers-color-scheme:dark) {
  :root { color-scheme:dark; --bg:#191f1a; --paper:#222b23; --ink:#ebefe5; --sub:#aeb9ad; --rule:#3b493e; --accent:#a3d0b0; --accent-on:#173322; --tint:#2e4435; --warn:#f7b8a3; --warn-bg:#3f2621 }
}
