:root {
  --ink: #17342d;
  --muted: #65736e;
  --paper: #f7f4ed;
  --card: #fffdf8;
  --green: #173d33;
  --green-2: #2c6555;
  --mint: #dfece6;
  --gold: #c8994c;
  --gold-soft: #f4ead4;
  --red: #a53d35;
  --red-soft: #f8e8e5;
  --line: #dedbd2;
  --shadow: 0 12px 30px rgba(23, 61, 51, .09);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; }

body.large-text { font-size: 19px; }
body.large-text .timeline-time { font-size: 1rem; }

.app-shell { min-height: 100vh; padding-bottom: calc(82px + var(--safe-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 12px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(23, 61, 51, .08);
}
.topbar h1 { margin: 1px 0 0; font-size: 1.35rem; letter-spacing: -.03em; }
.eyebrow { margin: 0; color: var(--green-2); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border: 0; border-radius: 15px;
  display: grid; place-items: center; background: var(--card); box-shadow: 0 4px 14px rgba(23,61,51,.08);
}
.icon-btn svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.text-icon { font-weight: 900; font-size: .9rem; }
.install-hidden { display: none; }

main { max-width: 820px; margin: 0 auto; }
.view { display: none; padding: 14px 16px 28px; animation: enter .22s ease-out; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }

.hero {
  position: relative; overflow: hidden;
  padding: 24px; border-radius: 28px; color: white;
  background: linear-gradient(135deg, #173d33 0%, #315f51 62%, #857048 100%);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  right: -60px; top: -70px; border: 32px solid rgba(255,255,255,.08);
}
.hero-kicker { margin: 0 0 9px; opacity: .78; font-weight: 700; font-size: .8rem; }
.hero h2 { margin: 0; max-width: 88%; font-size: clamp(1.6rem, 7vw, 2.3rem); line-height: 1.18; letter-spacing: -.04em; }
.hero-meta { display: flex; gap: 12px; align-items: center; margin-top: 20px; color: #f5e5c4; font-size: .9rem; }
.hero-meta span { display: inline-flex; gap: 6px; align-items: center; }

.section-head { display: flex; justify-content: space-between; align-items: end; margin: 23px 2px 10px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 1.08rem; letter-spacing: -.02em; }
.section-head small { color: var(--muted); }
.section-title { margin: 24px 2px 10px; font-size: 1.12rem; }

.card {
  border: 1px solid rgba(23,61,51,.08); border-radius: var(--radius);
  background: var(--card); box-shadow: 0 7px 23px rgba(23,61,51,.055);
  padding: 17px; margin-bottom: 12px;
}
.card h3 { margin: 0 0 8px; font-size: 1rem; }
.card p { margin: 6px 0; line-height: 1.65; color: #385048; }
.card.compact { padding: 14px; }
.accent-card { background: linear-gradient(145deg, var(--mint), #f5f5eb); border-color: transparent; }
.warning-card { background: var(--gold-soft); border-color: #e7d1a5; }
.danger-card { background: var(--red-soft); border-color: #edc7c1; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-btn {
  border: 0; text-align: left; padding: 15px; border-radius: 18px; background: var(--card);
  box-shadow: 0 6px 18px rgba(23,61,51,.06); min-height: 92px;
}
.quick-btn strong { display: block; margin: 8px 0 3px; }
.quick-btn small { color: var(--muted); line-height: 1.35; }
.quick-icon {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 11px; background: var(--mint); color: var(--green); font-weight: 900;
}

.timeline { position: relative; padding-left: 4px; }
.timeline-row { display: grid; grid-template-columns: 58px 17px 1fr; gap: 9px; position: relative; }
.timeline-row:not(:last-child)::after { content: ""; position: absolute; left: 66px; top: 25px; bottom: -2px; width: 2px; background: #d5dfda; }
.timeline-time { color: var(--green-2); font-size: .82rem; font-weight: 900; padding-top: 3px; }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); margin-top: 6px; z-index: 1; box-shadow: 0 0 0 4px var(--card); }
.timeline-content { padding: 0 0 17px; min-width: 0; }
.timeline-content strong { display: block; line-height: 1.4; }
.timeline-content p { font-size: .88rem; color: var(--muted); margin: 5px 0 0; line-height: 1.55; }

.day-strip { display: flex; overflow-x: auto; gap: 8px; padding: 3px 1px 12px; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 0 0 auto; min-width: 62px; border: 1px solid var(--line);
  background: var(--card); border-radius: 16px; padding: 9px 11px; text-align: center;
}
.day-chip span { display: block; font-size: .72rem; color: var(--muted); }
.day-chip strong { display: block; margin-top: 2px; }
.day-chip.active { background: var(--green); color: white; border-color: var(--green); }
.day-chip.active span { color: #cbe0d8; }

.search {
  width: 100%; border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); padding: 13px 15px; color: var(--ink); outline: none;
}
.search:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(44,101,85,.12); }

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.guide-card {
  border: 0; background: var(--card); border-radius: 20px; min-height: 124px;
  padding: 16px; text-align: left; box-shadow: 0 7px 22px rgba(23,61,51,.06);
}
.guide-card .guide-symbol { font-size: 1.5rem; display: block; margin-bottom: 14px; }
.guide-card strong { display: block; }
.guide-card small { display: block; margin-top: 5px; color: var(--muted); }
.guide-reader-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.back-btn { border: 0; background: var(--mint); border-radius: 13px; padding: 9px 12px; font-weight: 800; }

details.reader-section { background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 10px; overflow: hidden; }
details.reader-section summary { cursor: pointer; list-style: none; padding: 15px 16px; font-weight: 800; display: flex; justify-content: space-between; gap: 10px; }
details.reader-section summary::-webkit-details-marker { display: none; }
details.reader-section summary::after { content: "＋"; color: var(--green-2); }
details.reader-section[open] summary::after { content: "－"; }
.reader-body { border-top: 1px solid var(--line); padding: 4px 16px 14px; }
.reader-body p { line-height: 1.72; color: #3f554d; }
.reader-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 10px 0; }
.reader-table td, .reader-table th { border-bottom: 1px solid var(--line); padding: 9px 5px; text-align: left; vertical-align: top; line-height: 1.5; }
.reader-table th { color: var(--green); font-weight: 900; }

.check-group { margin-bottom: 20px; }
.check-item {
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start;
  background: var(--card); border-bottom: 1px solid #ece8df; padding: 13px 14px;
}
.check-item:first-of-type { border-radius: 18px 18px 0 0; }
.check-item:last-of-type { border-radius: 0 0 18px 18px; border-bottom: 0; }
.check-item:only-of-type { border-radius: 18px; }
.check-item input { width: 21px; height: 21px; accent-color: var(--green); margin-top: 1px; }
.check-item span { line-height: 1.45; }
.check-item small { display: block; color: var(--muted); margin-top: 3px; }
.check-item.done span { text-decoration: line-through; color: #86918d; }
.progress-track { height: 8px; background: #e2e4dd; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg,var(--green-2),var(--gold)); width: 0; transition: width .25s; }

.emergency-hero { background: linear-gradient(145deg,#7f302b,#b14c42); }
.contact-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.call-btn {
  display: block; border-radius: 18px; text-decoration: none; padding: 16px;
  background: var(--card); border: 1px solid var(--line);
}
.call-btn strong { display: block; color: var(--red); font-size: 1.25rem; }
.call-btn small { color: var(--muted); }
.symptom-card h3 { display: flex; align-items: center; gap: 8px; }
.badge { display: inline-flex; border-radius: 99px; padding: 4px 8px; background: var(--mint); font-size: .72rem; color: var(--green); }
.badge.red { color: var(--red); background: var(--red-soft); }
.action-list { margin: 8px 0 0; padding-left: 20px; }
.action-list li { margin: 7px 0; line-height: 1.55; }

.map-link, .primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; border: 0; border-radius: 14px; padding: 10px 14px;
  background: var(--green); color: white; text-decoration: none; font-weight: 800;
}
.map-link.secondary { background: var(--mint); color: var(--green); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 35px 20px; color: var(--muted); }

.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 50;
  width: min(100%, 820px); display: grid; grid-template-columns: repeat(5,1fr);
  padding: 8px 8px calc(8px + var(--safe-bottom)); background: rgba(255,253,248,.94);
  border-top: 1px solid rgba(23,61,51,.1); backdrop-filter: blur(20px);
}
.nav-item { border: 0; background: transparent; color: #7c8783; display: grid; place-items: center; gap: 2px; padding: 4px; font-size: .68rem; }
.nav-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: var(--green); font-weight: 900; }
.emergency-tab { color: var(--red); }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-bottom)); transform: translate(-50%, 20px);
  background: #17342d; color: white; border-radius: 14px; padding: 11px 16px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 90; max-width: 85%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .view { padding: 22px 24px 36px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .guide-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 32px; }
}

@media print {
  .topbar, .bottom-nav, .top-actions { display: none !important; }
  .app-shell { padding: 0; }
  .view { display: none !important; }
  .view.active { display: block !important; }
  .card, .hero { box-shadow: none; break-inside: avoid; }
}
