@font-face {
  font-family: "MaShanZheng";
  src: url("assets/fonts/MaShanZheng-Names.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #111d2a;
  --muted: #63707c;
  --paper: #f3f0e7;
  --paper-strong: #fffdf8;
  --line: rgba(11, 46, 77, 0.16);
  --green: #0b2e4d;
  --green-bright: #8a6a24;
  --green-soft: #e5edf3;
  --amber: #c6a052;
  --amber-soft: #f2e5c2;
  --red: #a83239;
  --teal: #1f6179;
  --shadow: 0 18px 50px rgba(8, 36, 61, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    repeating-linear-gradient(135deg, rgba(11, 46, 77, 0.025) 0 1px, transparent 1px 18px),
    linear-gradient(rgba(11, 46, 77, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 46, 77, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 9px 14px;
  border: 1px solid rgba(198, 160, 82, 0.38);
  border-bottom: 4px solid var(--amber);
  border-radius: 8px;
  color: #fffdf7;
  background: var(--green);
  box-shadow: 0 10px 26px rgba(8, 36, 61, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 5px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy small {
  color: rgba(255, 253, 247, 0.68);
  font-size: 12px;
}

.theme-chip {
  padding: 8px 13px;
  border: 1px solid rgba(198, 160, 82, 0.72);
  border-radius: 999px;
  color: #f1dfb1;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 700;
}

.home-view {
  padding-top: 44px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.62fr);
  align-items: center;
  gap: 40px;
  min-height: 280px;
  padding: 34px 40px;
  overflow: hidden;
  border: 1px solid rgba(198, 160, 82, 0.45);
  border-left: 7px solid var(--amber);
  border-radius: 8px;
  color: #fffdf7;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 22px),
    var(--green);
  box-shadow: 0 18px 48px rgba(8, 36, 61, 0.18);
}

.hero-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #f1dfb1;
  font-size: 13px;
  font-weight: 800;
}

.hero-identity img {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 5px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-bright);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 58px;
  line-height: 1.05;
  color: #fffdf7;
  font-weight: 800;
}

.hero h1 span {
  color: #f0d994;
}

.hero-lead {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 253, 247, 0.78);
  font-size: 17px;
  line-height: 1.9;
}

.hero-gate {
  display: grid;
  min-height: 240px;
  place-items: center;
}

.hero-gate img {
  display: block;
  width: min(290px, 100%);
  height: auto;
  border: 1px solid rgba(198, 160, 82, 0.32);
  border-radius: 8px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.route-card {
  position: relative;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 218px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: 0 12px 30px rgba(31, 48, 40, 0.07);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.route-card:hover {
  transform: translateY(-3px);
  border-color: rgba(198, 160, 82, 0.8);
  box-shadow: 0 18px 36px rgba(31, 48, 40, 0.12);
}

.route-card:focus-visible,
.option-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid rgba(231, 167, 61, 0.7);
  outline-offset: 3px;
}

.route-art {
  display: grid;
  place-items: center;
  min-height: 100%;
  border-right: 1px solid rgba(198, 160, 82, 0.28);
  background: #e7edf2;
}

.route-card.community .route-art {
  background: #f2e5c2;
}

.route-art img {
  display: block;
  width: 132px;
  height: 132px;
}

.route-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 24px;
}

.route-number {
  margin: 0 0 11px;
  color: var(--green-bright);
  font-size: 12px;
  font-weight: 800;
}

.route-copy h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 26px;
  line-height: 1.25;
}

.route-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.route-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-top: 19px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.route-action::after {
  content: "→";
  font-size: 17px;
}

.game-entry {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 18px;
  padding: 20px 24px;
  border: 1px solid rgba(11, 46, 77, 0.16);
  border-top: 5px solid var(--red);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: 0 12px 30px rgba(31, 48, 40, 0.07);
  text-decoration: none;
}

.game-entry:hover {
  border-color: rgba(198, 160, 82, 0.8);
  border-top-color: var(--red);
}

.game-entry img {
  display: block;
  width: 150px;
  height: auto;
}

.game-entry-copy {
  display: grid;
  gap: 5px;
}

.game-entry-label {
  color: #8a6a24;
  font-size: 12px;
  font-weight: 900;
}

.game-entry-copy strong {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 28px;
}

.game-entry-copy > span:last-child {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.game-entry-action {
  color: var(--green);
  font-weight: 900;
  white-space: nowrap;
}

.home-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.game-view {
  max-width: 920px;
  margin: 0 auto;
  padding-top: 26px;
}

.game-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.text-button {
  padding: 4px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

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

.progress-track {
  height: 7px;
  overflow: hidden;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(11, 46, 77, 0.12);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
  transition: width 240ms ease;
}

.scene-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.scene-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 164px;
  padding: 24px;
  overflow: hidden;
  color: #fffdf7;
  background: var(--green);
}

.scene-banner.community {
  background: #173f5d;
  box-shadow: inset 0 6px 0 var(--red);
}

.scene-banner::before {
  position: absolute;
  top: -65px;
  right: -38px;
  width: 210px;
  height: 210px;
  content: "";
  border: 34px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.scene-banner::after {
  position: absolute;
  right: 35px;
  bottom: -82px;
  width: 190px;
  height: 128px;
  content: "";
  border: 18px solid rgba(255, 255, 255, 0.08);
  border-radius: 50% 50% 0 0;
}

.scene-stage,
.scene-count {
  position: relative;
  z-index: 1;
}

.scene-stage {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(198, 160, 82, 0.72);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.scene-count {
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 700;
}

.scene-content {
  padding: 28px;
}

.scene-role {
  margin: 0 0 9px;
  color: #8a6a24;
  font-size: 13px;
  font-weight: 800;
}

.scene-title {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 31px;
  line-height: 1.3;
}

.scene-story {
  margin: 15px 0 24px;
  color: #44534d;
  font-size: 16px;
  line-height: 1.9;
}

.options {
  display: grid;
  gap: 11px;
}

.option-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  padding: 15px;
  border: 1px solid rgba(11, 46, 77, 0.17);
  border-radius: 8px;
  background: #fffefa;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.option-button:hover:not(:disabled) {
  transform: translateX(3px);
  border-color: var(--green-bright);
  background: #f6fbf8;
}

.option-button:disabled {
  cursor: default;
}

.option-key {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  color: #f7efd9;
  background: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.option-text {
  padding-top: 5px;
  font-size: 15px;
  line-height: 1.65;
}

.option-button.is-best {
  border-color: var(--green-bright);
  background: #eef8f3;
}

.option-button.is-partial {
  border-color: var(--amber);
  background: #fff8e8;
}

.option-button.is-wrong {
  border-color: var(--red);
  background: #fff1ef;
}

.feedback {
  padding: 24px 28px 27px;
  border-top: 1px solid var(--line);
  background: #eef2f5;
}

.feedback-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feedback-score {
  display: grid;
  min-width: 54px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.feedback-score.partial {
  color: var(--ink);
  background: var(--amber);
}

.feedback-score.wrong {
  background: var(--red);
}

.feedback h3 {
  margin: 0;
  font-size: 18px;
}

.feedback p {
  margin: 12px 0 0;
  color: #43524c;
  font-size: 15px;
  line-height: 1.85;
}

.feedback-tip {
  padding-top: 12px;
  border-top: 1px dashed rgba(11, 46, 77, 0.17);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 19px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--amber);
  color: #fff;
  background: var(--green);
}

.primary-button:hover {
  background: #08243d;
}

.secondary-button {
  border: 1px solid rgba(11, 46, 77, 0.2);
  color: var(--ink);
  background: #fffefa;
}

.secondary-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.result-view {
  padding-top: 32px;
}

.result-summary {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 34px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  box-shadow: inset 0 5px 0 var(--amber), var(--shadow);
}

.score-ring {
  display: grid;
  width: 184px;
  height: 184px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--amber) var(--score-angle, 0deg), #dfe5e9 0deg);
}

.score-ring-inner {
  display: grid;
  width: 148px;
  height: 148px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-strong);
  text-align: center;
}

.score-ring strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 49px;
  line-height: 1;
}

.score-ring span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.result-copy h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  color: var(--green);
  font-size: 42px;
  line-height: 1.2;
}

.medal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 0 12px;
  padding: 5px 11px;
  border: 1px solid rgba(11, 46, 77, 0.18);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.medal-chip.gold {
  color: #6d4e0d;
  background: #f4e2a9;
}

.medal-chip.silver {
  color: #46545e;
  background: #e4e9ec;
}

.medal-chip.bronze {
  color: #754b29;
  background: #eed5bd;
}

.medal-chip.observer {
  color: #1f556c;
  background: #dcecf3;
}

.medal-chip.learner {
  color: #5a646d;
  background: #ecebe7;
}

.result-copy p {
  margin: 13px 0 0;
  color: #43524c;
  font-size: 16px;
  line-height: 1.85;
}

.result-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.result-facts strong {
  color: var(--ink);
}

.result-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 18px;
  margin-top: 18px;
}

.review-panel,
.certificate-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: inset 0 4px 0 rgba(198, 160, 82, 0.68);
}

.review-panel h2,
.certificate-panel h2 {
  margin: 0 0 16px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
}

.review-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-list li {
  padding: 13px 0 0;
  border-top: 1px solid var(--line);
  color: #43524c;
  font-size: 14px;
  line-height: 1.75;
}

.review-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.review-list strong {
  color: var(--ink);
}

.certificate-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(11, 46, 77, 0.13);
  border-radius: 8px;
  background: #f5f0e4;
}

.certificate-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(11, 46, 77, 0.13);
  border-radius: 8px;
  background: #f5f0e4;
}

.name-field {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  color: #43524c;
  font-size: 14px;
  font-weight: 800;
}

.name-field input {
  width: 100%;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid rgba(11, 46, 77, 0.22);
  border-radius: 8px;
  color: var(--ink);
  background: #fffefa;
  font-family: "MaShanZheng", "STXingkai", "KaiTi", serif;
  font-size: 25px;
}

.name-field input:focus {
  border-color: var(--amber);
  outline: 3px solid rgba(198, 160, 82, 0.2);
}

.privacy-note,
.certificate-save-tip {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.certificate-save-tip {
  margin-top: 11px;
  margin-bottom: 0;
}

.certificate-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.certificate-actions {
  margin-top: 14px;
}

.result-actions {
  justify-content: center;
  margin-top: 22px;
}

.fatal {
  margin: 50px auto;
  max-width: 680px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 22px, 720px);
    padding-top: 10px;
  }

  .topbar {
    min-height: 58px;
  }

  .theme-chip {
    max-width: 142px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .home-view {
    padding-top: 28px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
  }

  .hero h1 {
    font-size: 45px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .hero-gate {
    display: none;
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .route-card {
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 182px;
  }

  .route-art img {
    width: 95px;
    height: 95px;
  }

  .route-copy {
    padding: 20px 18px;
  }

  .route-copy h2 {
    font-size: 23px;
  }

  .game-entry {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 15px;
    padding: 16px;
  }

  .game-entry img {
    width: 82px;
  }

  .game-entry-copy strong {
    font-size: 23px;
  }

  .game-entry-action {
    grid-column: 2;
    font-size: 14px;
  }

  .scene-content,
  .feedback {
    padding: 22px 18px;
  }

  .scene-banner {
    min-height: 140px;
    padding: 19px 18px;
  }

  .scene-title {
    font-size: 27px;
  }

  .result-summary {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 22px;
    padding: 26px 20px;
    text-align: center;
  }

  .result-copy h1 {
    font-size: 34px;
  }

  .result-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .brand-copy small {
    display: none;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .theme-chip {
    max-width: 122px;
    padding: 7px 9px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .scene-count {
    font-size: 28px;
  }

  .option-button {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 12px;
  }

  .option-key {
    width: 32px;
    height: 32px;
  }
}
