:root {
  --paper: #f6f7f4;
  --paper-deep: #e9eee8;
  --ink: #17201f;
  --muted: #66706d;
  --line: rgba(23, 32, 31, 0.16);
  --panel: rgba(255, 255, 253, 0.84);
  --panel-solid: #fffffb;
  --jade: #0a6d61;
  --jade-deep: #064d45;
  --cinnabar: #a33f2f;
  --copper: #bd7148;
  --blue: #294b72;
  --shadow: 0 24px 70px rgba(23, 32, 31, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(10, 109, 97, 0.09) 0 1px, transparent 1px 28px),
    linear-gradient(90deg, rgba(163, 63, 47, 0.08) 0 1px, transparent 1px 92px),
    linear-gradient(180deg, var(--paper) 0%, #eef2ef 48%, #f9faf5 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.42;
  background-image:
    repeating-linear-gradient(0deg, rgba(23, 32, 31, 0.045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(23, 32, 31, 0.035) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.page-frame {
  width: min(1220px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 10px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 32, 31, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 44%, var(--cinnabar) 44% 50%, transparent 50%),
    linear-gradient(45deg, var(--jade) 0 48%, var(--panel-solid) 48% 52%, var(--copper) 52%);
  box-shadow: 8px 8px 0 rgba(10, 109, 97, 0.12);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.25;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
}

.topnav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a {
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid rgba(23, 32, 31, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 253, 0.62);
  color: #26302e;
  font-size: 14px;
}

.topnav a:hover,
.topnav a:focus-visible {
  border-color: rgba(10, 109, 97, 0.5);
  outline: none;
  color: var(--jade-deep);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(520px, 1.18fr);
  gap: 38px;
  align-items: end;
  min-height: calc(100vh - 156px);
}

.hero-copy {
  padding: 54px 0 42px;
}

.eyebrow,
.card-kicker,
.question-kicker {
  margin: 0;
  color: var(--cinnabar);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-copy h1,
.quiz-intro h1,
.result-title {
  margin: 14px 0 0;
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 620px;
  font-size: 56px;
}

.lede {
  max-width: 520px;
  margin: 24px 0 0;
  color: #3d4744;
  font-size: 18px;
  line-height: 1.8;
}

.language-map {
  display: grid;
  gap: 10px;
  margin-top: 30px;
  max-width: 560px;
}

.language-map span {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 253, 0.66);
  color: #4b5552;
  font-size: 14px;
  line-height: 1.5;
}

.language-map strong {
  color: var(--jade-deep);
  font-weight: 800;
}

.test-grid {
  display: grid;
  gap: 18px;
}

.test-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  min-height: 255px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 31, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 253, 0.9), rgba(255, 255, 253, 0.68)),
    var(--panel-solid);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.test-card::after {
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--jade), var(--cinnabar), var(--blue));
}

.test-card:hover,
.test-card:focus-visible {
  border-color: rgba(10, 109, 97, 0.54);
  outline: none;
  transform: translateY(-4px);
  box-shadow: 0 34px 86px rgba(23, 32, 31, 0.18);
}

.card-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  min-width: 0;
  padding: 28px;
}

.card-copy strong {
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-size: 29px;
  line-height: 1.18;
}

.card-copy span:not(.card-kicker):not(.card-action) {
  color: #485350;
  font-size: 15px;
  line-height: 1.72;
}

.card-action {
  width: fit-content;
  margin-top: 2px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--jade);
  color: var(--jade-deep);
  font-weight: 700;
  font-size: 15px;
}

.card-visual {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  overflow: hidden;
  min-height: 255px;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 34% 26%, rgba(189, 113, 72, 0.18), transparent 28%),
    radial-gradient(circle at 72% 70%, rgba(41, 75, 114, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(233, 238, 232, 0.96), rgba(255, 255, 253, 0.72));
}

.card-visual::before {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(23, 32, 31, 0.12);
  border-radius: 999px;
  content: "";
  transform: rotate(-8deg);
}

.card-visual i {
  position: relative;
  z-index: 1;
  min-width: 76px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 32, 31, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 253, 0.78);
  color: #273330;
  font-style: normal;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 20px rgba(23, 32, 31, 0.08);
}

.card-visual i:nth-child(2n) {
  transform: translateX(16px);
}

.card-visual i:nth-child(2n + 1) {
  transform: translateX(-14px);
}

.quiz-main {
  display: grid;
  gap: 28px;
  padding-top: 18px;
}

.quiz-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(23, 32, 31, 0.2);
}

.quiz-intro h1 {
  max-width: 760px;
  font-size: 44px;
}

.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quiz-meta span {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 253, 0.62);
  color: #3d4744;
  font-size: 13px;
}

.progress-panel {
  padding: 18px 0 6px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: #394340;
  font-size: 14px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 31, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 253, 0.74);
}

.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--jade), var(--copper), var(--cinnabar));
  transition: width 220ms ease;
}

.question-jump {
  display: grid;
  grid-template-columns: repeat(30, minmax(8px, 1fr));
  gap: 5px;
  margin-top: 14px;
}

.question-jump button {
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 32, 31, 0.18);
  cursor: pointer;
}

.question-jump button.is-done {
  background: rgba(10, 109, 97, 0.72);
}

.question-jump button.is-current {
  background: var(--cinnabar);
}

.question-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 30px;
  align-items: start;
}

.question-block {
  min-width: 0;
}

.question-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.question-title h2 {
  margin: 0;
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-size: 31px;
  line-height: 1.2;
}

.question-title span {
  color: var(--muted);
  font-size: 14px;
}

.option-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.option-tile {
  position: relative;
  min-height: 178px;
  padding: 22px;
  border: 1px solid rgba(23, 32, 31, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 253, 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(23, 32, 31, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.option-tile::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  content: "";
  background: rgba(10, 109, 97, 0.18);
}

.option-tile:hover,
.option-tile:focus-visible {
  border-color: rgba(10, 109, 97, 0.5);
  outline: none;
  transform: translateY(-2px);
}

.option-tile.is-selected {
  border-color: rgba(10, 109, 97, 0.86);
  background: #fffffb;
}

.option-tile.is-selected::before {
  background: linear-gradient(180deg, var(--jade), var(--cinnabar));
}

.option-index {
  display: block;
  margin-bottom: 18px;
  color: var(--cinnabar);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.option-text {
  display: block;
  color: #25302d;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.72;
}

.side-panel {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 16px;
  padding-top: 4px;
}

.mini-report {
  border-left: 3px solid var(--jade);
  padding-left: 16px;
}

.mini-report strong {
  display: block;
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-size: 22px;
  line-height: 1.25;
}

.mini-report span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.count-list {
  display: grid;
  gap: 9px;
}

.count-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  color: #303936;
  font-size: 13px;
}

.count-row .bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 32, 31, 0.13);
}

.count-row .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--jade);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.action-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid rgba(23, 32, 31, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 253, 0.78);
  color: #22302d;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.btn:hover,
.btn:focus-visible {
  border-color: rgba(10, 109, 97, 0.58);
  outline: none;
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  transform: none;
}

.btn-primary {
  border-color: var(--jade-deep);
  background: var(--jade-deep);
  color: #fff;
}

.btn-danger {
  border-color: rgba(163, 63, 47, 0.48);
  color: var(--cinnabar);
}

.hint {
  min-height: 24px;
  color: var(--cinnabar);
  font-size: 14px;
}

.result-view {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(420px, 1.16fr);
  gap: 32px;
  align-items: start;
}

.result-hero {
  padding-top: 10px;
}

.result-title {
  font-size: 48px;
}

.result-lede {
  margin: 18px 0 0;
  color: #3c4744;
  font-size: 18px;
  line-height: 1.8;
}

.result-badges {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.badge-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.badge-line:last-child {
  border-bottom: 1px solid var(--line);
}

.badge-line span:first-child {
  color: var(--muted);
}

.badge-line strong {
  color: var(--jade-deep);
}

.result-panel {
  display: grid;
  gap: 18px;
}

.score-list {
  display: grid;
  gap: 12px;
}

.score-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.score-letter {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(23, 32, 31, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 253, 0.76);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.score-name {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: #273330;
  font-weight: 700;
}

.score-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 32, 31, 0.12);
}

.score-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--jade), var(--copper), var(--cinnabar));
}

.score-value {
  color: #273330;
  font-weight: 800;
  text-align: right;
}

.insight {
  border-left: 3px solid var(--cinnabar);
  padding: 4px 0 4px 16px;
  color: #3d4744;
  line-height: 1.75;
}

.toast {
  min-height: 24px;
  color: var(--jade-deep);
  font-size: 14px;
}

.creator-egg {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(23, 32, 31, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 253, 0.62);
  color: rgba(23, 32, 31, 0.34);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  box-shadow: 0 12px 28px rgba(23, 32, 31, 0.08);
  transition: width 180ms ease, color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.creator-egg::after {
  width: 0;
  overflow: hidden;
  color: var(--jade-deep);
  white-space: nowrap;
  content: "作者：姜昊";
  opacity: 0;
  transition: width 180ms ease, opacity 180ms ease, margin-left 180ms ease;
}

.creator-egg:hover,
.creator-egg:focus-visible {
  width: 118px;
  border-color: rgba(10, 109, 97, 0.45);
  outline: none;
  background: rgba(255, 255, 253, 0.9);
  color: var(--cinnabar);
}

.creator-egg:hover::after,
.creator-egg:focus-visible::after {
  width: 66px;
  margin-left: 6px;
  opacity: 1;
}

@media (max-width: 980px) {
  .page-frame {
    width: min(100% - 28px, 760px);
  }

  .home-hero,
  .quiz-intro,
  .question-shell,
  .result-view {
    grid-template-columns: 1fr;
  }

  .home-hero {
    align-items: start;
    min-height: auto;
  }

  .hero-copy {
    padding: 32px 0 10px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .quiz-meta {
    justify-content: flex-start;
  }

  .side-panel {
    position: static;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-frame {
    width: min(100% - 22px, 560px);
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .topnav {
    justify-content: flex-start;
  }

  .hero-copy h1,
  .result-title {
    font-size: 36px;
  }

  .quiz-intro h1 {
    font-size: 34px;
  }

  .test-card {
    grid-template-columns: 1fr;
  }

  .card-visual {
    min-height: 210px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .language-map span {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .option-list {
    grid-template-columns: 1fr;
  }

  .option-tile {
    min-height: 136px;
  }

  .option-text {
    font-size: 18px;
  }

  .question-jump {
    grid-template-columns: repeat(15, minmax(8px, 1fr));
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .action-group,
  .btn {
    width: 100%;
  }

  .btn {
    justify-content: center;
  }
}
