:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e7e3d9;
  --primary: #1f6f54;
  --primary-soft: #e7f1ec;
  --primary-ink: #ffffff;
  --amber: #b45309;
  --amber-soft: #fef3e2;
  --red: #b91c1c;
  --red-soft: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 41, 55, 0.06), 0 4px 14px rgba(31, 41, 55, 0.05);
  --nav-h: 60px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}

a { color: var(--primary); text-decoration: none; }
img { display: block; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: #fff; padding: 8px 12px; border-radius: 8px; }

.wrap { max-width: 760px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 244, 238, 0.92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand img { border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; }
.brand-text span { font-size: 12px; color: var(--muted); }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--primary);
  font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 8px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.bottomnav a {
  flex: 0 0 auto; min-width: 112px; text-align: center;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; color: var(--muted);
}
.bottomnav a.active, .bottomnav a[aria-current="page"] { background: var(--primary); color: var(--primary-ink); }

.hero { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.hero h2 { margin: 0 0 6px; font-size: 18px; }
.hero-stage { margin: 0 0 4px; color: var(--primary); font-size: 14px; }
.hero-stage strong { font-size: 17px; }
.hero-desc { margin: 0 0 14px; color: var(--muted); }
.hero-stats { display: flex; gap: 12px; margin-bottom: 14px; }
.hero-stats > div { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.hero-stats b { display: block; font-size: 20px; color: var(--text); }
.hero-stats span { font-size: 12px; color: var(--muted); }

.callout { border-radius: 10px; padding: 12px 14px; margin: 10px 0; font-size: 14px; }
.callout b { display: block; margin-bottom: 3px; font-size: 13px; }
.callout-tip { background: var(--primary-soft); border: 1px solid #cfe3d8; }
.callout-buy { background: #eef5ff; border: 1px solid #d4e2f7; }
.callout-warn { background: var(--amber-soft); border: 1px solid #f2dcb8; }
.callout-warn ul { margin: 6px 0 0; padding-left: 18px; }

.section-title { font-size: 17px; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

.flow { display: flex; flex-direction: column; gap: 10px; }
.flow-item { display: flex; align-items: stretch; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.flow-marker {
  flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff; background: #cbd5e1;
}
.flow-item.done .flow-marker { background: var(--primary); }
.flow-item.current .flow-marker { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.flow-item.current { border-color: var(--primary); }
.flow-body { flex: 1; min-width: 0; color: var(--text); }
.flow-title { font-weight: 600; }
.flow-desc { font-size: 13px; color: var(--muted); margin: 2px 0; }
.flow-meta { font-size: 12px; color: var(--muted); }
.flow-actions { display: flex; align-items: center; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; vertical-align: 1px; }
.badge-done { background: var(--primary-soft); color: var(--primary); }
.badge-current { background: var(--primary); color: #fff; }
.badge-todo { background: #eef0f3; color: var(--muted); }
.badge-good { background: var(--primary-soft); color: var(--primary); }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-muted { background: #eef0f3; color: var(--muted); }

.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-ghost { color: var(--primary); border-color: #cfe3d8; }
.page-head { margin-top: 16px; }
.back { font-size: 13px; color: var(--muted); }
.page-head h2 { margin: 8px 0 2px; font-size: 21px; }
.page-actions { margin-top: 10px; }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.task-card summary { display: flex; align-items: center; gap: 10px; padding: 14px; cursor: pointer; list-style: none; }
.task-card summary::-webkit-details-marker { display: none; }
.task-num { flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.task-title { flex: 1; font-weight: 600; }
.task-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.task-card[open] summary { border-bottom: 1px solid var(--line); }
.task-body { padding: 6px 14px 10px; }
.dim { border-bottom: 1px dashed var(--line); padding: 9px 0; }
.dim:last-child { border-bottom: 0; }
.dim-label { display: block; font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.dim p { margin: 0; font-size: 14.5px; }

.kbtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.kbtab { padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.kbtab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.module { margin-top: 12px; }
.module h2 { font-size: 19px; margin: 0 0 4px; }
.module .muted { margin-top: 0; }
.tips { margin: 12px 0 0; padding-left: 0; list-style: none; counter-reset: tip; }
.tips li { counter-increment: tip; position: relative; padding: 11px 12px 11px 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; font-size: 14.5px; }
.tips li::before { content: counter(tip); position: absolute; left: 12px; top: 11px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.std-list, .decision-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.std-card, .decision { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.std-top { display: flex; gap: 6px; margin-bottom: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tag-lvl { background: #eef0f3; color: var(--muted); }
.std-code { font-weight: 700; font-size: 16px; }
.std-title { font-weight: 600; }
.std-meta { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.std-summary { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.std-link { font-size: 13px; }
.decision-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.decision-head b { flex: 1; }
.decision-value { margin: 6px 0; font-size: 14.5px; }
.decision-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; }

.footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }

@media (min-width: 720px) {
  body { padding-bottom: 120px; }
  .bottomnav { max-width: 560px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
}
