:root {
  --ink: #173d33;
  --water: #2f6f73;
  --paper: #f7f0de;
  --card: #fffaf0;
  --mist: #e8f1ec;
  --muted: #53665c;
  --line: rgba(33, 77, 66, 0.18);
  --red: #b14434;
  --gold: #d7bd7d;
  --blue: #365f9f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 16% 20%, rgba(47, 111, 115, 0.28), transparent 30%),
    radial-gradient(circle at 84% 78%, rgba(177, 68, 52, 0.18), transparent 32%),
    #202524;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #24352f;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone {
  width: min(390px, 100vw);
  height: min(820px, 100vh);
  display: grid;
  grid-template-rows: 54px 1fr 64px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: #fffaf0;
}

.brand {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.page {
  overflow: auto;
  padding: 18px 14px 22px;
  background:
    linear-gradient(180deg, rgba(232, 241, 236, 0.94) 0%, rgba(247, 240, 222, 0.98) 54%, #f2e5cf 100%),
    var(--paper);
}

.eyebrow {
  margin-bottom: 6px;
  color: #8d4a38;
  font-size: 12px;
  font-weight: 700;
}

.title,
.section-title,
h1,
h2 {
  color: var(--ink);
  letter-spacing: 0;
}

.title,
h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.12;
}

h1 {
  font-size: 34px;
}

h2 {
  margin: 12px 0 6px;
  font-size: 15px;
}

p {
  margin: 0;
  line-height: 1.62;
}

.subtitle,
.copy {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.provenance {
  margin-top: 9px;
  color: #8d4a38;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.home-hero {
  position: relative;
  min-height: 238px;
  padding: 22px 18px;
  overflow: hidden;
  border: 1px solid rgba(23, 61, 51, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(255, 250, 240, 0.93), rgba(232, 241, 236, 0.88)),
    url("../assets/images/ch01_scene.png") center/cover;
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -34px;
  width: 146px;
  height: 146px;
  border: 1px solid rgba(47, 111, 115, 0.24);
  border-radius: 50%;
  background: rgba(215, 189, 125, 0.18);
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

.hero-actions,
.quest-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.quest-actions.single {
  grid-template-columns: 1fr;
}

.hero-actions button,
.quest-actions button,
.share-button,
.quick-entry button,
.choice,
.faq-node {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 800;
}

.primary,
.ghost,
.share-button,
.quick-entry button,
.keyword-row button,
.text-link {
  border: 0;
}

.primary {
  background: var(--ink);
  color: #fff8e9;
}

.primary.red {
  background: var(--red);
}

.ghost,
.quick-entry button,
.keyword-row button {
  border: 1px solid rgba(33, 77, 66, 0.24);
  background: rgba(255, 250, 240, 0.92);
  color: var(--ink);
}

.progress-card,
.card,
.recommend,
.node-overview {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 0 8px 24px rgba(44, 57, 45, 0.08);
}

.progress-card.compact {
  padding: 12px;
}

.progress-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.progress-card .title-row strong {
  color: var(--ink);
  font-size: 15px;
}

.progress-card strong {
  color: var(--ink);
  font-size: 24px;
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.track {
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #d7d8c4;
}

.fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--water), var(--red));
  transition: width 180ms ease;
}

.section-title {
  font-size: 16px;
  font-weight: 900;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.node-pill {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #e7eadb;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.node-pill.done {
  background: var(--ink);
  color: #fff8e9;
}

.node-pill.current {
  background: var(--red);
  color: #fff8e9;
}

.node-pill.locked {
  background: #e0ddd1;
  color: #8d938d;
}

.quick-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.share-button {
  width: 100%;
  margin-top: 12px;
  background: var(--blue);
  color: #fff;
}

.share-fallback {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
}

.share-fallback textarea {
  width: 100%;
  min-height: 96px;
  margin-top: 10px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffef9;
  color: var(--ink);
  line-height: 1.5;
}

.share-fallback button {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  border-radius: 6px;
  font-weight: 800;
}

.share-card {
  margin-top: 12px;
}

.certificate {
  margin-top: 4px;
  padding: 22px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(237, 242, 233, 0.94)),
    var(--card);
  text-align: center;
  box-shadow: 0 8px 24px rgba(44, 57, 45, 0.08);
}

.seal {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--red);
  color: #fffaf0;
  font-size: 30px;
  font-weight: 900;
}

.honor {
  margin-top: 16px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.16;
}

.certificate-count {
  margin-top: 8px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
}

.certificate-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.certificate-tags span {
  padding: 6px 9px;
  border-radius: 6px;
  background: #e0ddd1;
  color: #68726c;
  font-size: 12px;
  font-weight: 800;
}

.certificate-tags .earned {
  background: #e7eadb;
  color: #315246;
}

.poster-button {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border-radius: 6px;
  font-weight: 900;
}

.map {
  position: relative;
  height: 260px;
  margin-top: 12px;
  overflow: hidden;
  border: 3px solid #5b4422;
  border-radius: 4px;
  background: var(--gold);
}

.map.scene {
  height: 220px;
}

.map img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.hot {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 250, 240, 0.9);
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.hot.done {
  background: var(--ink);
}

.hot.locked {
  background: #6f7771;
  opacity: 0.7;
}

.hot span {
  display: none;
}

.node-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.node-card {
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.94);
  color: var(--ink);
  text-align: left;
}

.node-card span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  grid-row: span 2;
  border-radius: 50%;
  background: var(--ink);
  color: #fff8e9;
  font-size: 11px;
  font-weight: 900;
}

.node-card strong {
  font-size: 13px;
}

.node-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.node-card.current {
  border-color: rgba(177, 68, 52, 0.38);
  background: #fff4ea;
}

.node-card.current span {
  background: var(--red);
}

.node-card.done {
  background: #edf2e9;
}

.node-card.locked {
  background: #e2dfd2;
  color: #68726c;
}

.node-card.locked span {
  background: #6f7771;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #e3dccb;
  background: #fffaf0;
}

.tabbar button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tabbar .active {
  color: var(--red);
}

.list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notice {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(177, 68, 52, 0.28);
  border-radius: 8px;
  background: #fff1e9;
  color: #8d4a38;
  font-size: 13px;
  font-weight: 700;
}

.collection-summary {
  margin-top: 12px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.collection-card {
  min-height: 118px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 241, 230, 0.82);
  color: var(--ink);
  text-align: left;
}

.collection-card.earned {
  background:
    linear-gradient(160deg, rgba(255, 250, 240, 0.98), rgba(232, 241, 236, 0.86)),
    var(--card);
  box-shadow: inset 0 0 0 2px rgba(177, 68, 52, 0.1);
}

.collection-card.locked {
  color: #68726c;
}

.card-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff8e9;
  font-size: 11px;
  font-weight: 900;
}

.collection-card.locked .card-index {
  background: #6f7771;
}

.collection-card strong {
  align-self: end;
  font-size: 16px;
  line-height: 1.25;
}

.collection-card em,
.collection-card small,
.reward em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.reward-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.reward {
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4eddf;
  color: var(--ink);
  text-align: left;
}

.reward span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d7d8c4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.reward.earned {
  background: #edf2e9;
}

.reward.earned span {
  background: var(--ink);
  color: #fff8e9;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 35, 30, 0.72);
}

.modal-panel {
  position: relative;
  width: min(354px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(215, 189, 125, 0.62);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 61, 51, 0.88);
  color: #fffaf0;
  font-size: 22px;
  line-height: 1;
}

.reward-art {
  width: 100%;
  display: block;
  margin-top: 10px;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.reward-modal .honor {
  margin-top: 14px;
  font-size: 25px;
}

.modal-primary {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border-radius: 6px;
  font-weight: 900;
}

.poster-modal {
  width: min(374px, 100%);
}

.poster-canvas {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.poster-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.poster-actions > * {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-weight: 900;
  text-decoration: none;
}

.collection-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.collection-actions button {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 800;
}

.card-scene {
  height: 210px;
}

.mini-card {
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 241, 230, 0.82);
}

.mini-card.earned {
  background: var(--card);
  box-shadow: inset 0 0 0 2px rgba(177, 68, 52, 0.1);
}

.source {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 7px;
  border-radius: 4px;
  background: #e7eadb;
  color: #315246;
  font-size: 12px;
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.keyword-row button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  color: var(--water);
  font-size: 12px;
  font-weight: 800;
}

.result-count {
  margin-top: 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.search-result h2 {
  margin-top: 8px;
}

.source-node-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.source-node {
  min-height: 40px;
  border-radius: 6px;
  font-weight: 800;
}

.choice {
  width: 100%;
  height: auto;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px;
  text-align: left;
}

.choice.selected {
  border-color: rgba(177, 68, 52, 0.62);
  background: #fff4ea;
}

.choice.selected.correct {
  border-color: rgba(23, 61, 51, 0.5);
  background: #edf2e9;
}

.choice.selected.incorrect,
.task-feedback.error {
  color: #9f382e;
}

.choice.selected.incorrect {
  border-color: rgba(177, 68, 52, 0.7);
  background: #fff1e9;
}

.task-feedback.success {
  color: var(--ink);
}

.choice[disabled],
.read-mark[disabled] {
  cursor: default;
  opacity: 0.7;
}

.task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-head h2 {
  margin-top: 12px;
}

.read-state {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7eadb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.read-state.done {
  background: var(--ink);
  color: #fff8e9;
}

.read-mark {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  border-radius: 6px;
  font-weight: 800;
}

.check-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.check-row span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e7eadb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.check-row .checked {
  background: var(--ink);
  color: #fff8e9;
}

.complete-node {
  width: 100%;
  min-height: 42px;
  border-radius: 6px;
  font-weight: 900;
}

.complete-node.is-disabled {
  opacity: 0.58;
}

.done-note {
  color: var(--ink);
  font-weight: 800;
}

.faq-card .faq-node {
  width: 100%;
  margin-top: 10px;
}

.faq-filter {
  padding-bottom: 12px;
}

.faq-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.faq-category-row button,
.faq-category {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(33, 77, 66, 0.22);
  border-radius: 15px;
  background: rgba(255, 250, 240, 0.92);
  color: var(--water);
  font-size: 12px;
  font-weight: 800;
}

.faq-category-row button.active,
.faq-category {
  border-color: transparent;
  background: var(--ink);
  color: #fff8e9;
}

.faq-card h2 {
  margin-top: 10px;
}

.faq-sources {
  margin-top: 10px;
}

.faq-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.faq-actions button {
  width: 100%;
  min-height: 40px;
  border-radius: 6px;
  font-weight: 800;
}

.text-link {
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.empty {
  color: var(--muted);
}

.toast {
  position: sticky;
  right: 0;
  bottom: 10px;
  left: 0;
  min-height: 0;
  margin: 12px auto 0;
  padding: 0 12px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--ink);
  color: #fff8e9;
  font-size: 13px;
  line-height: 0;
  text-align: center;
  opacity: 0;
  transition: opacity 160ms ease, line-height 160ms ease, padding 160ms ease;
}

.toast.show {
  padding: 10px 12px;
  line-height: 1.45;
  opacity: 1;
}

@media (max-width: 430px) {
  body {
    place-items: stretch;
  }

  .phone {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }
}
