:root {
  --bg: #f6f3ec;
  --surface: #fffdf9;
  --surface-soft: #f0ebe1;
  --ink: #1a2421;
  --ink-muted: #5a6560;
  --ink-soft: #858f8a;
  --primary: #1b3b34;
  --primary-hover: #132c26;
  --accent: #b8843b;
  --accent-soft: #f4ead8;
  --border: rgba(27, 59, 52, 0.11);
  --shadow: 0 12px 34px rgba(24, 42, 36, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --font-serif: "Songti SC", "Noto Serif SC", "STSong", "Source Han Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(184, 132, 59, 0.10), transparent 36%),
    radial-gradient(circle at 90% 24%, rgba(27, 59, 52, 0.07), transparent 40%);
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 16px 36px;
}

/* 顶部栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 132, 59, 0.18);
}

.brand-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
}

.badge-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(27, 59, 52, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}

/* 视图切换 */
.view {
  display: none;
  animation: fadeUp 0.28s ease;
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 首页 Hero */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 20px 22px;
  box-shadow: var(--shadow);
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 29px;
  line-height: 1.28;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.hero-title span {
  color: var(--primary);
  background: linear-gradient(transparent 66%, rgba(184, 132, 59, 0.28) 66%);
  padding: 0 3px;
}

.hero-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--ink-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.stat-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.stat-num span {
  font-size: 12px;
  font-weight: 500;
  margin-left: 2px;
  color: var(--accent);
}

.stat-label {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* 按钮体系 */
.cta-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  width: 100%;
  border: none;
  border-radius: 13px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--primary);
  color: #fffdf8;
  box-shadow: 0 8px 20px rgba(27, 59, 52, 0.22);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid rgba(27, 59, 52, 0.22);
}

.btn-ghost:hover {
  background: rgba(27, 59, 52, 0.05);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--ink-soft);
}

/* 首页交付说明 */
.preview-section {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink);
}

.section-head span {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feature-icon {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-item h3 {
  margin: 0 0 2px;
  font-size: 14px;
  color: var(--ink);
}

.feature-item p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.footer-note {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
  padding: 0 10px;
}

/* 答题页 */
.quiz-progress-wrap {
  margin-bottom: 16px;
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mode-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.progress-text {
  font-size: 13px;
  color: var(--ink-muted);
}

.progress-text strong {
  color: var(--primary);
  font-size: 16px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(27, 59, 52, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 18px 20px;
  box-shadow: var(--shadow);
  min-height: 390px;
  display: flex;
  flex-direction: column;
}

.q-dimension {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.q-title {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.48;
  color: var(--ink);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: auto;
}

.option-btn {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 13px;
  padding: 14px 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  transition: all 0.16s ease;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.48;
}

.option-btn:hover {
  border-color: rgba(27, 59, 52, 0.28);
  background: #fdfbf7;
}

.option-btn.selected {
  background: rgba(27, 59, 52, 0.08);
  border-color: var(--primary);
  font-weight: 600;
}

.opt-letter {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.option-btn.selected .opt-letter {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.btn-nav {
  width: auto;
  padding: 10px 16px;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
}

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

.btn-text {
  width: auto;
  padding: 10px 10px;
  font-size: 13px;
  background: transparent;
  color: var(--ink-soft);
}

/* 加载分析页 */
.loading-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 64px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid rgba(27, 59, 52, 0.12);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-box h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 19px;
}

.loading-box p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* 结果页 */
.result-hero {
  background: linear-gradient(155deg, #1b3b34 0%, #122823 100%);
  color: #f9f6ef;
  border-radius: var(--radius-lg);
  padding: 26px 20px 22px;
  box-shadow: 0 16px 36px rgba(18, 40, 35, 0.24);
  margin-bottom: 16px;
}

.result-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #dfbc7a;
  font-weight: 700;
  margin-bottom: 10px;
}

.archetype-en {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(249, 246, 239, 0.68);
  text-transform: uppercase;
}

.archetype-cn {
  margin: 4px 0 12px;
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.2;
  color: #fffdf8;
}

.archetype-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.res-tag {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(223, 188, 122, 0.35);
  color: #f6e7c8;
}

.archetype-quote {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.07);
  border-left: 3px solid #dfbc7a;
  border-radius: 0 10px 10px 0;
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: #fffaf0;
}

.rarity-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: rgba(249, 246, 239, 0.72);
}

.rarity-bar strong {
  color: #dfbc7a;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(24, 42, 36, 0.04);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.card-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--primary);
}

.card-head span {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
}

.radar-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 14px;
}

.radar-wrap svg {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.dim-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dim-row {
  display: grid;
  grid-template-columns: 76px 1fr 38px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.dim-name {
  color: var(--ink);
  font-weight: 600;
}

.dim-track {
  height: 8px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
}

.dim-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.dim-score {
  text-align: right;
  font-weight: 700;
  color: var(--primary);
}

.report-body {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink);
}

.bullet-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bullet-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.bullet-list li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 10px;
  color: var(--accent);
}

.career-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.career-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.career-item h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  color: var(--primary);
}

.career-item p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.warn-card {
  background: #fffcf6;
  border-color: rgba(184, 132, 59, 0.28);
}

.tip-box {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: #4f3a19;
  margin-bottom: 12px;
}

.partner-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-muted);
  padding-top: 10px;
  border-top: 1px dashed rgba(184, 132, 59, 0.3);
}

.partner-row span {
  white-space: nowrap;
  flex-shrink: 0;
}

.partner-row strong {
  color: var(--primary);
  text-align: right;
}

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 26, 23, 0.56);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 99;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeUp 0.2s ease;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border-radius: 20px;
  padding: 24px 20px 20px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.24);
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 6px;
}

.modal-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 21px;
}

.modal-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-muted);
}

.input-group {
  margin-bottom: 14px;
}

.input-group input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(27, 59, 52, 0.22);
  background: var(--bg);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  outline: none;
}

.input-group input:focus {
  border-color: var(--primary);
  background: #fff;
}

.error-msg {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: #b83b3b;
}

.modal-tip {
  margin-top: 12px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.poster-modal-card {
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 16px 18px;
}

.poster-tip-top {
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  padding-right: 24px;
}

.poster-img-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  background: var(--bg);
}

.poster-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

/* 320px 小屏精细适配 */
@media (max-width: 350px) {
  .app-shell {
    padding: 12px 12px 28px;
  }
  .hero-title {
    font-size: 24px;
  }
  .q-title {
    font-size: 17px;
  }
  .archetype-cn {
    font-size: 27px;
  }
}
