:root {
  color-scheme:light;
  --ink:#243a35; --muted:#58665f; --paper:#f6f5ef; --white:#fffefa;
  --line:#d7ddd3; --accent:#245f4e; --accent-hover:#194b3d;
  --soft:#eaf0e8; --warm:#eee5d3; --focus:#9b5b16;
  --serif:"Songti TC","Noto Serif CJK TC","PMingLiU",serif;
  --radius:12px; --shadow:0 4px 16px #243a3506;
}
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:system-ui,-apple-system,"Microsoft JhengHei","PingFang HK",sans-serif; font-size:16px; line-height:1.7; }
main { max-width:1200px; margin:auto; padding:24px 32px 40px; }
h1,h2,h3,p { margin:0; }
h1,h2 { font-family:var(--serif); font-weight:700; text-wrap:balance; }
h1 { margin:18px 0 8px; font-size:clamp(30px,3.6vw,42px); line-height:1.35; letter-spacing:.04em; }
h2 { font-size:25px; line-height:1.45; letter-spacing:.03em; }
h3 { font-size:18px; line-height:1.5; }
.masthead { display:flex; gap:12px; align-items:center; padding-bottom:16px; border-bottom:1px solid var(--line); font-weight:650; letter-spacing:.06em; }
.masthead::before { content:""; width:8px; height:24px; background:var(--accent); border-radius:2px; flex-shrink:0; }
.subtitle { color:var(--muted); font-size:18px; }
.warning { margin-top:18px; padding:12px 16px; border-left:3px solid var(--focus); background:var(--warm); border-radius:0 8px 8px 0; }
.muted,.version { color:var(--muted); }
fieldset { margin:24px 0 0; padding:0; border:0; min-width:0; }
legend { padding:0; margin-bottom:12px; font-weight:700; }
.levels { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.level { display:flex; gap:12px; padding:16px; border:1px solid var(--line); border-radius:var(--radius); cursor:pointer; background:var(--white); transition:background .18s,border-color .18s; }
.level:has(input:checked) { background:var(--soft); border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
input[type=radio] { margin:5px 0 0; accent-color:var(--accent); flex-shrink:0; width:18px; height:18px; }
.level strong,.level span { display:block; }
.level strong { font-size:17px; }
.level .summary { color:var(--muted); margin-top:6px; }
fieldset > .muted { margin-top:10px; }
/* Cards keep their intrinsic height, including when a neighbouring task opens. */
.task-overview { margin-top:28px; }
.group + .group { margin-top:28px; }
.group { min-width:0; }
.group > h2 { display:flex; align-items:center; gap:14px; }
.group > h2::after { content:""; flex:1; height:1px; background:var(--line); }
.group-note { color:var(--muted); margin:6px 0 12px; }
.cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 16px; align-items:start; }
.card { display:block; align-self:start; min-width:0; background:var(--white); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
summary { cursor:pointer; min-height:44px; padding:8px 0; }
.card-heading { display:flex; align-items:center; gap:12px; padding:12px 18px; list-style:none; border-radius:var(--radius); transition:background .18s,color .18s; }
.card-heading::-webkit-details-marker { display:none; }
.card-heading h3 { flex:1; min-width:0; }
.card-id { color:var(--accent); font-size:14px; font-weight:750; letter-spacing:.06em; flex-shrink:0; padding:2px 8px; background:var(--soft); border-radius:5px; }
.card-heading::after { content:""; width:8px; height:8px; border-right:2px solid var(--accent); border-bottom:2px solid var(--accent); transform:rotate(45deg); flex-shrink:0; margin:0 3px 4px; }
.card[open] > .card-heading { border-bottom:1px solid var(--line); background:var(--soft); border-radius:var(--radius) var(--radius) 0 0; }
.card[open] > .card-heading::after { transform:rotate(225deg); margin-top:6px; }
.card[open] > .card-heading .card-id { background:var(--white); }
.card-content { padding:20px 24px 24px; }
.purpose { color:var(--muted); }
.group-extra { margin-top:14px; padding:12px 14px; background:var(--soft); border-radius:8px; }
.before { margin-top:18px; padding:14px 16px; background:var(--paper); border-left:2px solid var(--line); border-radius:0 8px 8px 0; }
.before > strong { display:block; margin-bottom:4px; font-weight:650; }
.card h4 { font-size:16px; margin:20px 0 10px; }
ul,ol { margin:0; padding-left:22px; }
li+li { margin-top:10px; }
.materials strong { font-weight:650; }
.materials li::marker { color:var(--accent); }
.hint { display:block; color:var(--muted); margin-top:3px; }
.optional { color:var(--muted); }
.optional h4 { font-weight:500; margin-bottom:2px; }
.optional .materials { list-style:none; padding:0; }
.optional .hint { padding:0 0 8px 18px; }
.card-bottom { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.current { color:var(--accent); font-size:16px; font-weight:600; margin-bottom:10px; }
.actions { display:flex; gap:10px; flex-wrap:wrap; }
button { min-height:44px; min-width:44px; padding:10px 16px; border:1px solid var(--accent); border-radius:8px; background:var(--white); color:var(--accent); font:inherit; font-weight:650; cursor:pointer; transition:background .18s,border-color .18s; }
button.primary { background:var(--accent); color:var(--white); }
@media(hover:hover) {
  button:hover,.level:hover { background:var(--soft); border-color:var(--accent); }
  button.primary:hover { background:var(--accent-hover); }
  summary:hover { color:var(--accent); }
  .card-heading:hover { background:var(--soft); }
}
button:active { box-shadow:inset 0 0 0 2px var(--ink); }
button:disabled { opacity:.65; cursor:wait; }
:focus-visible { outline:3px solid var(--focus); outline-offset:4px; }
input[type=radio]:focus { outline:3px solid var(--focus); outline-offset:4px; }
.status { flex-basis:100%; color:var(--accent); font-weight:650; }
.status:empty { display:none; }
.preview { margin:24px 0; padding:24px; border:1px solid var(--accent); border-top:4px solid var(--accent); border-radius:var(--radius); background:var(--white); box-shadow:var(--shadow); scroll-margin-top:16px; }
.preview[hidden] { display:none; }
.preview-head { display:flex; align-items:start; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.preview .current { margin-top:12px; }
.preview > button + button { margin-left:10px; }
textarea { display:block; width:100%; height:55vh; min-height:220px; margin:16px 0; padding:16px; resize:vertical; border:1px solid var(--line); border-radius:8px; background:var(--paper); color:var(--ink); font:inherit; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
/* A small reading guide: ordered steps and a separate photo checklist. */
.guide { margin-top:40px; padding-top:28px; border-top:1px solid var(--line); }
.guide-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.guide-panel { min-width:0; padding:24px; border:1px solid var(--line); border-radius:var(--radius); background:var(--white); }
.photo-panel { background:var(--soft); }
.guide h2 { font-size:24px; padding-bottom:16px; margin-bottom:18px; border-bottom:1px solid var(--line); }
.steps,.photo-checks { list-style:none; padding:0; }
.steps li { display:grid; grid-template-columns:32px minmax(0,1fr); gap:14px; }
.steps li+li { margin-top:18px; }
.step-number { display:flex; align-items:center; justify-content:center; width:32px; height:32px; border:1px solid var(--line); border-radius:50%; color:var(--accent); font-size:14px; font-weight:700; font-variant-numeric:tabular-nums; }
.steps strong { display:block; margin-bottom:3px; font-weight:650; }
.steps p,.photo-checks p { color:var(--muted); }
.photo-checks li { display:grid; grid-template-columns:20px minmax(0,1fr); gap:12px; }
.photo-checks li+li { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.check-icon { width:14px; height:8px; border-left:2px solid var(--accent); border-bottom:2px solid var(--accent); transform:rotate(-45deg); margin:8px 0 0 2px; }
.judgement { margin-top:24px; padding:14px 18px; border-left:3px solid var(--accent); background:var(--soft); border-radius:0 8px 8px 0; font-weight:600; }
.guide > .muted { margin-top:18px; }
.version { margin-top:12px; font-size:14px; }
@media(min-width:1000px) {
  .task-overview { display:grid; grid-template-columns:1.2fr 1fr; grid-template-rows:min-content 1fr; gap:24px 32px; align-items:start; }
  .task-overview .group + .group { margin-top:0; }
  .task-overview .group:first-child { grid-row:span 2; }
  .task-overview .cards { grid-template-columns:1fr; }
}
@media(max-width:699px) {
  main { padding:20px 16px 32px; }
  .subtitle { font-size:16px; }
  .cards,.levels,.guide-columns { grid-template-columns:1fr; }
  .level { padding:14px; }
  .level .summary { margin-top:4px; }
  .task-overview { margin-top:28px; }
  .card-heading { padding:14px; gap:10px; }
  .card-content { padding:18px; }
  .actions button { flex:1 1 auto; }
  .guide { margin-top:32px; padding-top:24px; }
  .guide-columns { gap:16px; }
  .guide-panel,.preview { padding:20px 18px; }
  .steps li { gap:12px; }
}
@media(prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; transition:none !important; } }
