:root {
  --bg: #f3f5f2;
  --bg-soft: #e9f0e8;
  --ink: #1f2a24;
  --ink-soft: #5c6b62;
  --card: #ffffff;
  --line: #d8e0d8;
  --primary: #1d6b45;
  --primary-strong: #17573a;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(29, 58, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, #dfeee2 0%, transparent 36%),
    radial-gradient(circle at 92% 12%, #e7f2e9 0%, transparent 30%),
    linear-gradient(180deg, #f7faf7 0%, var(--bg) 58%);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 22px 18px 26px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#view-quiz.active,
#view-result.active {
  min-height: calc(100dvh - 48px);
}

.start-shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(160deg, #ffffff 0%, #f4faf5 100%);
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}

.start-shell::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: radial-gradient(circle, #c9e7d3 0%, rgba(201, 231, 211, 0.16) 70%, transparent 100%);
}

.kicker {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #70857a;
}

.brand {
  margin: 0 0 10px;
  font-size: 46px;
  line-height: 1;
  font-family: "Times New Roman", "Songti SC", "STSong", serif;
  letter-spacing: 1px;
}

.subtitle {
  margin: 0 0 14px;
  font-size: 23px;
  line-height: 1.35;
  font-weight: 700;
  max-width: 21ch;
}

.start-explain {
  margin: 0 0 10px;
  color: #3f5147;
  line-height: 1.72;
  font-size: 15px;
}

.start-note {
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed #cfe0d4;
  color: #6f8378;
  font-size: 13px;
}

.hint {
  margin: 10px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

.btn {
  height: 50px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: 160ms ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  margin-top: 14px;
  color: #fff;
  background: linear-gradient(180deg, #22764d 0%, var(--primary) 100%);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #1c6944 0%, var(--primary-strong) 100%);
}

.btn-ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
}

.quiz-header strong {
  font-size: 19px;
  font-family: "Times New Roman", "Songti SC", "STSong", serif;
}

.progress-wrap {
  flex: 1;
}

.progress-wrap span {
  display: block;
  margin-bottom: 6px;
  text-align: right;
  font-size: 12px;
  color: var(--ink-soft);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5ebe5;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2d8c5c 0%, #1d6b45 100%);
}

.notice {
  margin: 10px 2px 0;
  font-size: 12px;
  color: #6c7f74;
}

.quiz-card {
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
}

.question {
  margin: 0 0 14px;
  font-size: 36px;
  line-height: 1.35;
  font-family: "Times New Roman", "Songti SC", "STSong", serif;
  font-size: clamp(25px, 4.8vw, 34px);
}

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

.option {
  min-height: 54px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #d9e1d9;
  background: #fbfdfb;
  text-align: left;
  font-size: 18px;
  font-family: "Songti SC", "STSong", serif;
  line-height: 1.4;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.option:hover {
  border-color: #b9cfbf;
}

.option.active {
  border-color: #2e7f56;
  background: #eff9f1;
}

.option.selected-feedback {
  border-color: #14663f;
  background: linear-gradient(180deg, #d8f0e0 0%, #cbe8d5 100%);
  box-shadow: 0 14px 28px rgba(29, 107, 69, 0.24);
  transform: scale(0.97);
}

.quiz-card.feedback-active {
  box-shadow: 0 0 0 2px rgba(29, 107, 69, 0.14), 0 16px 34px rgba(29, 107, 69, 0.16);
}

.answer-flash {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #1d6b45;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.answer-flash.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.quiz-meta {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.quiz-meta span {
  flex: 1;
  text-align: center;
  border-radius: 999px;
  border: 1px solid #d7e4d9;
  background: #edf5ef;
  color: #547261;
  font-size: 12px;
  padding: 6px 4px;
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(420px, 58%) minmax(320px, 42%);
  gap: 16px;
  margin-bottom: 14px;
  align-items: stretch;
}

.result-image-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
  aspect-ratio: 1 / 1;
}

.result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-meta {
  height: 100%;
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, #ffffff 0%, #f6faf7 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
}

.tag-name {
  margin: 0 0 10px;
  font-size: clamp(44px, 4vw, 60px);
  line-height: 1.12;
  font-family: "Times New Roman", "Songti SC", "STSong", serif;
}

.tag-short,
.score {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 24px;
  line-height: 1.55;
}

.score {
  font-size: 30px;
  color: #3f5e4d;
}

.labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.labels span {
  font-size: 20px;
  border-radius: 999px;
  border: 1px solid #d7e1d8;
  background: #fff;
  padding: 8px 14px;
}

.card {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--card);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: #304039;
  line-height: 1.64;
}

.card ul {
  margin: 0;
  padding-left: 18px;
}

.card li {
  margin: 0 0 6px;
  color: #304039;
  font-size: 14px;
  line-height: 1.55;
}

.dim-row {
  margin-bottom: 8px;
}

.dim-row:last-child {
  margin-bottom: 0;
}

.dim-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
}

.dim-track {
  height: 8px;
  border-radius: 999px;
  background: #e9eeea;
  overflow: hidden;
}

.dim-fill {
  height: 100%;
  background: linear-gradient(90deg, #2b9160 0%, #176243 100%);
}

.full {
  width: 100%;
  margin: 6px 0 20px;
}

dialog {
  border: 0;
  padding: 14px;
  border-radius: var(--radius);
  width: min(95vw, 500px);
}

.share-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

#share-canvas {
  display: none;
}

.share-preview {
  width: 100%;
  display: block;
}

.share-tip {
  margin: 10px 2px 0;
  color: #4d5a52;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

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

@media (min-width: 768px) {
  .app {
    max-width: 620px;
  }
}

@media (min-width: 900px) {
  .app {
    max-width: 980px;
    padding: 24px 20px 30px;
  }

  #view-quiz,
  #view-quiz {
    max-width: 520px;
    margin: 0 auto;
  }

  #view-result {
    max-width: 1100px;
    margin: 0 auto;
  }

  #view-start {
    max-width: 680px;
    margin: 0 auto;
  }
}

@media (max-width: 767px) {
  .result-hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .result-image-wrap {
    min-height: 300px;
  }

  .result-meta {
    padding: 14px 12px;
    gap: 8px;
  }

  .tag-name {
    font-size: 38px;
  }

  .tag-short {
    font-size: 18px;
  }

  .score {
    font-size: 22px;
  }

  .labels span {
    font-size: 16px;
    padding: 6px 10px;
  }
}
