/* 色卡1: #DFEEEB #EBE5D0 #E1C9A6 #D9B083 #9E7F62  色卡2: #EDEBE8 #F3EAD4 #F0CFAB #4E5562 #779090 */
:root {
  --bg: #edebe8;
  --bg-mint: #dfeeeb;
  --panel: #fdfcf9;
  --panel-warm: #f3ead4;
  --text: #4e5562;
  --muted: #779090;
  --primary: #9e7f62;
  --primary-deep: #7f654e;
  --accent-soft: #f0cfab;
  --accent-line: #d9b083;
  --cream: #ebe5d0;
  --border-soft: #e1c9a6;
  --option-bg: #f3ead4;
  --shadow: rgba(78, 85, 98, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(223, 238, 235, 0.65) 0%, transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(240, 207, 171, 0.35) 0%, transparent 36%),
    var(--bg);
}

#app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 20px 48px;
}

.quiz-card,
.result-card,
.metric-card {
  background: var(--panel);
  border-radius: 22px;
  border: 1px solid rgba(225, 201, 166, 0.55);
  box-shadow: 0 10px 28px var(--shadow), 0 1px 4px rgba(78, 85, 98, 0.04);
}

.home {
  display: flex;
  min-height: calc(100vh - 36px);
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding-top: clamp(24px, 7vh, 64px);
}

.home-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.home-brand h1 {
  margin: 0;
  padding: 0;
  font-size: 90px;
  letter-spacing: 1px;
  font-weight: 800;
  color: #4e5562;
  line-height: 1;
}

.subtitle {
  color: #4e5562;
  margin: 0;
  letter-spacing: 0.5px;
  font-size: 30px;
  font-weight: 800;
}

/* 副标题与下方 teaser：在 flex gap 16px 基础上再加 24px，合计 40px ≈ 2.5×原 16px */
.home .subtitle {
  margin-bottom: 24px;
}

.home-teaser {
  margin: 0;
  max-width: 22em;
  color: #5c6572;
  font-size: 17px;
  line-height: 1.65;
}

.home-logo-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.home-logo {
  width: min(220px, 62%);
  max-height: 160px;
  object-fit: contain;
}

.cta {
  width: min(520px, 100%);
  border: 0;
  border-radius: 14px;
  background: linear-gradient(165deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fdfcf9;
  font-size: 21px;
  font-weight: 700;
  padding: 16px 20px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  box-shadow: 0 8px 22px rgba(158, 127, 98, 0.35);
}

.cta:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.04);
  box-shadow: 0 12px 28px rgba(158, 127, 98, 0.42);
}

.copyright {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  width: 100%;
  margin-top: 18px;
}

.home-publisher {
  margin-top: 2px;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}

.publisher-title {
  font-size: 14px;
}

.publisher-links {
  font-size: 14px;
  margin-bottom: calc(1.1em + 1 * 1.7em);
}

.publisher-links a {
  color: var(--text);
  text-decoration: none;
}

.publisher-links a:hover {
  text-decoration: underline;
}

.publisher-tail {
  margin-top: 4px;
  font-size: 14px;
}

.quiz-page {
  padding-top: clamp(40px, 8vh, 88px);
}

.quiz-head {
  margin-bottom: 16px;
}

.quiz-head h2 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 42px;
  letter-spacing: 0.8px;
  color: var(--text);
}

.progress-wrap {
  height: 10px;
  width: 100%;
  background: rgba(119, 144, 144, 0.22);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(225, 201, 166, 0.6);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #779090, var(--primary));
  transition: width 0.3s ease;
}

.quiz-card {
  padding: 24px;
}

.question-meta {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.question-title {
  font-size: 21px;
  color: var(--text);
  margin: 0 0 22px;
  line-height: 1.55;
  font-weight: 600;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.option {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  margin: 0;
  font-family: inherit;
  border: 1px solid rgba(225, 201, 166, 0.55);
  background: var(--option-bg);
  border-radius: 18px;
  min-height: 72px;
  padding: 16px 22px;
  font-size: 17px;
  color: var(--text);
  line-height: 1.55;
  cursor: pointer;
  overflow: hidden;
  transition: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  -webkit-appearance: none;
  appearance: none;
  border-style: solid;
  -webkit-tap-highlight-color: transparent;
}

.option:focus,
.option:focus-visible,
.option:active {
  outline: none;
}

.option-letter {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-right: 8px;
}

.option-text {
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.option:hover {
  background: var(--option-bg);
  color: var(--text);
  border-color: rgba(225, 201, 166, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.option.active {
  background: linear-gradient(165deg, #4e5562 0%, #5a626f 100%);
  color: #fdfcf9;
}

.option.active .option-letter {
  color: #f0cfab;
}

.nav {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.ghost-btn {
  border-radius: 999px;
  border: 0;
  padding: 10px 24px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ghost-btn {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  color: var(--text);
}

.ghost-btn:hover {
  transform: translateY(-1px);
}

.result-card {
  padding: 24px;
}

.result-type-label {
  margin: 0 0 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.type-label-cn {
  color: #111;
  font-weight: 800;
}

.result-code-title {
  margin: 0 0 20px;
  text-align: center;
  line-height: 1.35;
}

.result-code-cn {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: #111;
}

.result-code-en {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #2f8b5d;
}

.result-img-wrap {
  text-align: center;
  margin: 0 0 22px;
}

.result-type-img {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 18px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 10px 24px var(--shadow);
  border: 1px solid rgba(225, 201, 166, 0.45);
}

.result-interpret-head {
  margin: 0 0 32px;
  text-align: center;
  font-size: 19.2px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--primary);
}

/* 与 mark 之间的细短分隔线 + 间距（仅 mark 版式） */
.result-mark + .result-interpret-head {
  margin-top: 32px;
  padding-top: 18px;
}

.result-mark + .result-interpret-head::before {
  content: "";
  display: block;
  width: min(300px, 88%);
  height: 1px;
  margin: 0 auto 14px;
  background: rgba(78, 85, 98, 0.22);
}

.result-mark {
  margin: 0;
  font-size: 17px;
  line-height: 1.8;
  font-weight: 700;
  color: #2f3339;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.result-tagline {
  margin: 0 0 1.2em;
  line-height: 1.8;
  color: var(--text);
  text-align: center;
  font-weight: 700;
}

.result-body {
  color: var(--text);
}

.result-body .result-para {
  text-indent: 2em;
  margin: 0 0 0.85em;
  line-height: 2.05;
}

.result-body .result-para:last-child {
  margin-bottom: 0;
}

.metric-card {
  margin-top: 18px;
  padding: 24px;
}

.percentage {
  text-align: center;
  font-size: 46px;
  color: var(--primary);
  font-weight: 800;
  margin-top: 14px;
  margin-bottom: 4px;
}

.bar-row {
  margin: 16px 0;
  position: relative;
}

.bar-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}

.bar-title {
  margin-bottom: 0;
}

.hint-btn {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 0;
  background: var(--hint-btn-bg, rgba(119, 144, 144, 0.22));
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.hint-btn:hover {
  background: var(--hint-btn-hover, rgba(119, 144, 144, 0.35));
  color: var(--text);
}

.hint-pop {
  margin: 0 0 0;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--hint-pop-bg, var(--panel-warm));
  border: 1px solid transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition:
    max-height 0.18s ease,
    opacity 0.18s ease,
    transform 0.18s ease,
    margin 0.18s ease,
    padding 0.18s ease,
    border-color 0.18s ease;
}

.hint-pop.open {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-color: var(--hint-pop-border, var(--border-soft));
  max-height: 220px;
  opacity: 1;
  transform: translateY(0);
}

.track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(119, 144, 144, 0.18);
  overflow: hidden;
  border: 1px solid rgba(225, 201, 166, 0.55);
}

.bar-row .track {
  background: var(--bar-track, rgba(119, 144, 144, 0.18));
  border-color: var(--bar-track-border, rgba(225, 201, 166, 0.55));
}

.fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #779090, var(--accent-line));
}

.bar-row .fill {
  background: var(
    --bar-fill,
    linear-gradient(90deg, #779090, var(--accent-line))
  );
}

.labels {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.share-panel {
  margin-top: 24px;
  text-align: center;
}

.share-intro {
  margin: 0 0 26px;
  text-align: center;
  line-height: 1.9;
}

.share-intro-line {
  display: block;
  text-align: center;
}

.share-intro-hint {
  margin: 0;
  line-height: 1.75;
  color: var(--text);
}

.share-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  margin: 0 auto;
}

.share-url-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--panel-warm);
  text-align: left;
  overflow: hidden;
}

.share-url {
  display: block;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.share-btn {
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.share-btn-copy {
  background: var(--panel);
  color: var(--text);
}

.share-btn-gen {
  background: linear-gradient(165deg, var(--primary) 0%, var(--primary-deep) 100%);
  border-color: transparent;
  color: #fdfcf9;
  box-shadow: 0 6px 16px rgba(158, 127, 98, 0.28);
}

/* 结果页进入：更夸张的下浮上弹 + 错落进场 */
.result-entering > .result-card,
.result-entering > .metric-card,
.result-entering > .share-panel,
.result-entering > .copyright {
  animation: resultFloatIn 980ms cubic-bezier(0.18, 0.92, 0.22, 1) both;
}

.result-entering > .metric-card {
  animation-delay: 110ms;
}

.result-entering > .share-panel {
  animation-delay: 200ms;
}

.result-entering > .copyright {
  animation-delay: 290ms;
}

@keyframes resultFloatIn {
  0% {
    opacity: 0;
    transform: translate3d(0, min(42vh, 200px), 0) scale(0.86);
  }
  58% {
    opacity: 1;
    transform: translate3d(0, -28px, 0) scale(1.03);
  }
  78% {
    transform: translate3d(0, 10px, 0) scale(1);
  }
  92% {
    transform: translate3d(0, -4px, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.share-btn:hover {
  transform: translateY(-1px);
}

@media (max-width: 520px) {
  .share-row {
    flex-wrap: wrap;
  }

  .share-url-wrap {
    flex: 1 1 100%;
    min-width: 0;
  }

  .share-btn {
    flex: 1 1 calc(50% - 5px);
  }
}

@media (max-width: 680px) {
  .home-brand h1 {
    font-size: 66px;
  }
  .subtitle {
    font-size: 22px;
  }
  .options {
    grid-template-columns: 1fr;
  }
}
