:root {
  color-scheme: light;
  --ink: #2f2921;
  --muted: #786f62;
  --line: #2b2722;
  --paper: #fbf4e3;
  --paper-deep: #f1dfbd;
  --card: #fffaf0;
  --cinnabar: #b83a2f;
  --cinnabar-soft: #fff1ec;
  --indigo: #315f80;
  --jade: #4f7f63;
  --gold: #b9833d;
  --tab: #5a5045;
  --shadow: rgba(75, 49, 25, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(184, 58, 47, 0.08), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(79, 127, 99, 0.12), transparent 24%),
    linear-gradient(135deg, #ead7b5, #f7edda 42%, #d9cab0);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(100vw, 520px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(88, 55, 22, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(88, 55, 22, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.75), transparent 38%),
    var(--paper);
  background-size: 22px 22px, 22px 22px, 100% 100%, auto;
}

.app-shell::before {
  content: "高额头男神  高额头男神  高额头男神\A 高额头男神  高额头男神  高额头男神\A 高额头男神  高额头男神  高额头男神\A 高额头男神  高额头男神  高额头男神";
  position: fixed;
  inset: -10% auto auto 50%;
  width: 760px;
  transform: translateX(-50%) rotate(-24deg);
  color: rgba(67, 58, 48, 0.065);
  font-size: 50px;
  font-weight: 900;
  line-height: 2.6;
  pointer-events: none;
  white-space: pre-wrap;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px 16px 94px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(47, 41, 33, 0.18);
}

.brand {
  min-width: 0;
}

.eyebrow {
  color: var(--cinnabar);
  font-size: 13px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: 0;
}

.top-mark {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.seal {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--cinnabar);
  background: var(--cinnabar);
  color: #fff8ef;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 3px rgba(255, 248, 239, 0.28);
}

.pill,
.mini-btn {
  flex: none;
  border: 2px solid var(--line);
  background: #fff8eb;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 3px 3px 0 rgba(43, 39, 34, 0.12);
}

.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 14px;
  border: 2px solid var(--line);
  background:
    linear-gradient(90deg, rgba(184, 58, 47, 0.1), transparent 40%),
    var(--card);
  box-shadow: 4px 4px 0 var(--shadow);
}

.home-hero strong {
  display: block;
  color: var(--cinnabar);
  font-size: 18px;
  font-weight: 900;
}

.home-hero span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.stat {
  border: 2px solid var(--line);
  background: rgba(255, 250, 240, 0.92);
  padding: 10px;
  box-shadow: 3px 3px 0 var(--shadow);
}

.stat strong {
  display: block;
  color: var(--cinnabar);
  font-size: 23px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel,
.herb-card,
.question-card {
  border: 3px solid var(--line);
  background: rgba(255, 250, 240, 0.96);
  box-shadow: 5px 5px 0 var(--shadow);
}

.panel {
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--tab);
  color: #fff8ef;
  font-weight: 900;
}

.panel-head span:last-child {
  color: #f5d497;
}

.chapter-list,
.summary-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.chapter-range {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.range-summary,
.range-card {
  border: 2px solid var(--line);
  background: #fffaf0;
}

.range-summary {
  padding: 12px;
}

.range-summary strong {
  display: block;
  color: var(--cinnabar);
  font-size: 18px;
}

.range-summary span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.range-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #6b604f;
  color: #fff8ef;
  font-weight: 900;
}

.range-card p {
  padding: 10px;
  color: var(--indigo);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.75;
}

.chapter-btn,
.summary-btn,
.option-btn,
.action-btn {
  width: 100%;
  border: 2px solid var(--line);
  background: #fffaf0;
  color: var(--ink);
  text-align: left;
  font-weight: 900;
}

.chapter-btn,
.summary-btn {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 12px 12px 16px;
  box-shadow: 3px 3px 0 rgba(43, 39, 34, 0.1);
}

.chapter-btn::before,
.summary-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--cinnabar);
}

.summary-btn::before {
  background: var(--jade);
}

.chapter-btn:active,
.summary-btn:active,
.option-btn:active,
.action-btn:active,
.mini-btn:active {
  transform: translate(1px, 1px);
}

.chapter-btn small,
.summary-btn small {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.select {
  width: 100%;
  border: 2px solid var(--line);
  background: #fffaf0;
  padding: 10px;
  color: var(--ink);
  font-weight: 900;
}

.herb-card {
  min-height: 560px;
}

.herb-header {
  padding: 14px;
  border-bottom: 2px solid var(--line);
  background:
    linear-gradient(90deg, rgba(79, 127, 99, 0.13), transparent 48%),
    rgba(255, 248, 235, 0.88);
}

.herb-header h2 {
  color: var(--jade);
  font-size: 42px;
  line-height: 1.05;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  border: 1.5px solid rgba(47, 41, 33, 0.55);
  background: #f8edd8;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tag.warn {
  border-color: var(--cinnabar);
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
}

.section-block {
  padding: 14px;
  border-bottom: 2px solid rgba(47, 41, 33, 0.22);
}

.label {
  margin-bottom: 8px;
  color: var(--cinnabar);
  font-size: 15px;
  font-weight: 900;
}

.effects {
  color: var(--indigo);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.55;
}

.indications,
.memory {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.55;
}

.memory {
  color: var(--gold);
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
}

.action-btn {
  padding: 12px 8px;
  text-align: center;
  box-shadow: 3px 3px 0 rgba(43, 39, 34, 0.1);
}

.action-btn.primary {
  background: var(--cinnabar);
  color: #fff8ef;
}

.action-btn.blue {
  background: #e7f0f2;
  color: var(--indigo);
}

.question-card {
  padding-bottom: 12px;
}

.question-title {
  padding: 16px;
  border-bottom: 2px solid var(--line);
  background: linear-gradient(90deg, rgba(184, 58, 47, 0.12), transparent);
}

.question-title h2 {
  color: var(--jade);
  font-size: 30px;
}

.options {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.option-btn {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  line-height: 1.5;
  box-shadow: 3px 3px 0 rgba(43, 39, 34, 0.1);
}

.option-key {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: var(--tab);
  color: #fff8ef;
  font-weight: 900;
}

.option-btn.correct {
  background: #edf8ef;
  border-color: #3d8b56;
}

.option-btn.wrong {
  background: #fff0ec;
  border-color: var(--cinnabar);
}

.answer-box {
  margin: 0 12px 12px;
  border: 2px solid var(--cinnabar);
  background: var(--cinnabar-soft);
  padding: 12px;
  font-weight: 900;
  line-height: 1.55;
}

.summary-card {
  border: 2px solid var(--line);
  background: rgba(255, 250, 240, 0.96);
}

.summary-card h3 {
  padding: 10px 12px;
  background: var(--tab);
  color: #fff8ef;
}

.summary-card p {
  padding: 10px 12px;
  font-weight: 800;
  line-height: 1.55;
}

.summary-card .rhyme {
  margin: 0 12px 12px;
  border: 2px solid var(--cinnabar);
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
}

.bottom-nav {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 0;
  display: grid;
  width: min(100vw, 520px);
  grid-template-columns: repeat(4, 1fr);
  transform: translateX(-50%);
  border-top: 3px solid var(--line);
  background: #fffaf0;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 18px rgba(43, 39, 34, 0.12);
}

.nav-btn {
  border: 0;
  border-right: 1px solid rgba(47, 41, 33, 0.16);
  background: #fffaf0;
  padding: 10px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.nav-btn.active {
  color: var(--cinnabar);
  background: #f8ead0;
}

.empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
  line-height: 1.6;
}

@media (max-width: 370px) {
  .page {
    padding-right: 12px;
    padding-left: 12px;
  }

  h1 {
    font-size: 25px;
  }

  .seal {
    display: none;
  }
}

@media (min-width: 760px) {
  .app-shell {
    margin-top: 18px;
    min-height: calc(100vh - 36px);
    border: 3px solid var(--line);
  }
}
