:root {
  --bg: #eef1f4;
  --bg-soft: #e6eaee;
  --card: #ffffff;
  --ink: #1b2430;
  --ink-light: #4a5568;
  --muted: #7b8794;
  --border: #d8dee4;
  --accent: #4a6fa5;
  --accent-light: #d8dee4;
  --accent-soft: rgba(74, 111, 165, 0.10);
  --primary: #1e293b;
  --best: #3d6e6b;
  --best-soft: rgba(61, 110, 107, 0.10);
  --worst: #8b5a6b;
  --worst-soft: rgba(139, 90, 107, 0.10);
  --success: #3d6e6b;
  --danger: #8b5a6b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(27, 36, 48, 0.07);
  --shadow-sm: 0 4px 14px rgba(27, 36, 48, 0.05);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 18px 20px 6px;
  text-align: center;
}

.logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--muted);
  font-weight: 400;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 10px 20px 40px;
}

.page {
  display: none;
  animation: fadeIn 0.35s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 首页 */
.eyebrow {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--primary);
}

.hero-subtitle {
  color: var(--ink-light);
  margin: 0 0 18px;
  font-size: 15px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tag {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-light);
  background: rgba(255,255,255,0.5);
}

.preview-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--muted);
}

.preview-label {
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 1px;
}

.preview-count {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 999px;
}

.preview-figure {
  text-align: center;
  padding: 20px 0;
  border: 1px dashed var(--border);
  border-radius: 14px;
  margin-bottom: 18px;
  background: var(--bg-soft);
}

.preview-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--primary);
}

.preview-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 10px;
}

.preview-tags span {
  display: inline-block;
  padding: 4px 12px;
  margin: 0 4px;
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  color: var(--ink-light);
  border: 1px solid var(--border);
}

.preview-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--ink-light);
}

.preview-features li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon {
  font-size: 13px;
  width: 18px;
  text-align: center;
  color: var(--accent);
}

.buy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.price-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.price-value {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 41, 59, 0.18);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(30, 41, 59, 0.24);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-light);
  border: 1px solid var(--border);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.author-line {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.link-notes {
  display: block;
  width: 100%;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px;
}

/* 版权声明 */
.copyright-notice {
  margin-top: 20px;
  padding: 14px 16px 4px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.copyright-notice .copyright-title {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.copyright-notice .copyright-desc {
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 8px;
}
.copyright-notice .copyright-author {
  font-size: 11px;
  color: var(--ink-light);
  margin: 0;
}
.copyright-notice .wechat-id {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 密钥页 */
.gate-label {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--muted);
}

.gate-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  margin: 8px 0 18px;
  line-height: 1.35;
  color: var(--primary);
}

.one-time-key {
  display: inline-block;
  float: right;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  margin-top: -42px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.key-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  margin: 18px 0 8px;
  outline: none;
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: 1px;
}

.key-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.key-message {
  min-height: 22px;
  font-size: 13px;
  color: var(--worst);
  margin-bottom: 12px;
}

.key-message.ok {
  color: var(--best);
}

.gate-tips {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip {
  background: var(--bg);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--ink-light);
  text-align: center;
}

.btn-back {
  display: block;
  margin: 18px auto 0;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

/* 答题页 */
.quiz-header {
  margin-bottom: 18px;
}

.quiz-count {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.progress {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.question-card {
  margin-bottom: 20px;
  overflow: visible;
}

.question-meta {
  margin-bottom: 10px;
}

.question-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 22px;
  color: var(--primary);
  font-weight: 500;
}

.primary-dim {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* 横向双选列表 */
.choice-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-light);
  font-weight: 500;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-best .legend-dot {
  background: var(--best);
  box-shadow: 0 0 0 4px var(--best-soft);
}

.legend-worst .legend-dot {
  background: var(--worst);
  box-shadow: 0 0 0 4px var(--worst-soft);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.single-choice {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.single-choice:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.single-choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.single-choice-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.choice-row {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 66px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.choice-row:hover {
  box-shadow: var(--shadow-sm);
}

.choice-side {
  width: 66px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: background 0.2s, color 0.2s;
  writing-mode: horizontal-tb;
}

.choice-side:hover {
  background: var(--bg-soft);
}

.choice-side.best {
  background: var(--best-soft);
  color: var(--best);
}

.choice-side.worst {
  background: var(--worst-soft);
  color: var(--worst);
}

.choice-side.best:hover,
.choice-side.worst:hover {
  opacity: 0.92;
}

.choice-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.choice-row.best-active {
  border-color: var(--best);
  box-shadow: 0 0 0 3px var(--best-soft);
}

.choice-row.worst-active {
  border-color: var(--worst);
  box-shadow: 0 0 0 3px var(--worst-soft);
}

.selection-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  text-align: center;
  line-height: 1.5;
}

.selection-hint.complete {
  color: var(--best);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

/* 加载页 */
#loading-page {
  text-align: center;
  padding-top: 120px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--muted);
  font-size: 14px;
}

/* 结果页 */
.result-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.result-eyebrow {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}

.result-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  margin: 8px 0 18px;
  color: var(--primary);
}

.quality-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

/* 卷宗摘要 */
.section-heading {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--ink-light);
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
}

.case-summary {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.summary-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-column-gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}

.summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-row:first-child {
  padding-top: 0;
}

.summary-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  padding-top: 2px;
}

.summary-value {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.summary-note {
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.65;
}

/* 叙述卡片 */
.narrative-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.narrative-card.warning-card {
  border-color: #c8b8a0;
  background: #faf6f0;
}

.narrative-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.narrative-num {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
}

.narrative-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.narrative-body p {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.85;
  margin: 0 0 8px;
}

.narrative-body p:last-child {
  margin-bottom: 0;
}

/* 好评返现专属边框 */
.review-incentive-box {
  margin: 28px 0 8px;
  padding: 20px 24px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  text-align: center;
}

.review-incentive-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.review-incentive-desc {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.6;
}

/* 匹配度进度条 */
.match-bar-wrap {
  margin: 10px 0 6px;
}

.match-bar-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
}

.match-bar-track {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}

.match-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.quality-tag {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-light);
  border: 1px solid var(--border);
}

.result-archetype {
  text-align: center;
  padding: 22px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  background: var(--bg-soft);
}

.result-archetype-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px;
  font-weight: 700;
}

.result-archetype-motto {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 10px;
  font-style: italic;
}

.result-archetype-desc {
  font-size: 13px;
  color: var(--ink-light);
  padding: 0 14px;
  line-height: 1.75;
}

.personality-portrait {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 18px;
}

.personality-portrait h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--primary);
}

.personality-portrait p {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.85;
  margin: 0;
}

.top-figure {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 14px;
}

.top-figure-rank {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.top-figure-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.top-figure-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.top-figure-desc {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.7;
}

.top-figure-distance {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  font-family: 'Noto Sans SC', sans-serif;
}

.figure-detail {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.figure-detail h4 {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--primary);
  font-weight: 500;
}

.figure-detail p {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.7;
  margin: 0;
}

.least-like {
  border-color: var(--worst);
  background: var(--worst-soft);
}

.least-like-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.least-like-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--primary);
}

.least-like-text {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.7;
}

.radar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.radar-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
}

.dimension-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.dim-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.dim-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.dim-name {
  font-size: 13px;
  font-weight: 500;
}

.dim-value {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}

.dim-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.dim-interpretation {
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.6;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.weakest {
  border-color: var(--worst);
  background: var(--worst-soft);
}

.advice-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.advice-box strong {
  color: var(--primary);
  font-weight: 500;
}

.advice-box p {
  margin: 6px 0 0;
  color: var(--ink-light);
  line-height: 1.7;
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.result-actions .btn {
  flex: 1;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(27, 36, 48, 0.45);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--card);
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  padding: 20px 24px 30px;
  animation: slideUp 0.25s ease;
  border: 1px solid var(--border);
  border-bottom: none;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  margin: 0;
  color: var(--primary);
}

.modal-close {
  background: var(--bg);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--ink-light);
  cursor: pointer;
}

.note-item {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.note-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.note-item h3 {
  font-size: 14px;
  margin: 0 0 4px;
  color: var(--primary);
}

.note-item p {
  font-size: 13px;
  color: var(--ink-light);
  margin: 0;
  line-height: 1.6;
}

/* 桌面端适配 */
@media (min-width: 600px) {
  .container {
    padding-top: 30px;
  }

  .modal {
    align-items: center;
  }

  .modal-content {
    border-radius: 22px;
    animation: fadeIn 0.25s ease;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 360px) {
  .dial-option {
    width: 64px;
    height: 64px;
    margin-left: -32px;
    margin-top: -32px;
    font-size: 11px;
  }

  .dial-center {
    width: 52px;
    height: 52px;
    margin-left: -26px;
    margin-top: -26px;
  }

  .question-text {
    font-size: 15px;
  }
}
