:root {
  --bg: #faf7f4;
  --surface: #ffffff;
  --surface-soft: #f4eee8;
  --ink: #2b2224;
  --ink-muted: #6c5e61;
  --ink-light: #96878a;
  --brand: #7a3e48;
  --brand-hover: #643039;
  --brand-soft: #f5e9eb;
  --border: #eadfd9;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(74, 42, 48, 0.06);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view.active {
  display: block;
}

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

/* 顶部品牌条 */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--ink-muted);
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.03em;
}

/* 通用卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.hero-card {
  background: linear-gradient(160deg, #fffdf9 0%, #f8eef0 100%);
  border: 1px solid #edd9dd;
  padding: 28px 22px 24px;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
}

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

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

.stat-item {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
}

.stat-num {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand);
}

.stat-label {
  font-size: 11.5px;
  color: var(--ink-light);
  margin-top: 2px;
}

/* 兑换码输入区 */
.code-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.code-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-light);
}

.input-row {
  display: flex;
  gap: 8px;
}

.code-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: #fdfbfa;
  outline: none;
  transition: border-color 0.2s;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

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

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

.btn-secondary {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #ece3db;
}

.btn-block {
  width: 100%;
}

.msg-bar {
  margin-top: 10px;
  font-size: 13px;
  min-height: 20px;
}

.msg-bar.error { color: #c0392b; }
.msg-bar.success { color: #2f6f5e; }

/* 报告模块预览清单 */
.preview-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.preview-list li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-muted);
  align-items: flex-start;
}

.preview-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

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

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

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

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

.question-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.question-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 14px;
}

.question-text {
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 24px;
  color: var(--ink);
}

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

.option-btn {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.16s ease;
}

.option-btn:hover {
  border-color: #c89ca4;
  background: #fdf9fa;
}

.option-btn.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.option-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #cdb8bc;
  flex-shrink: 0;
}

.option-btn.selected .option-dot {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 3px #fff;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

/* 报告页 */
.report-hero {
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 14px 32px rgba(55, 32, 38, 0.16);
}

.report-tag {
  display: inline-block;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.report-name {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.report-en {
  font-size: 12.5px;
  opacity: 0.85;
  margin: 2px 0 12px;
  letter-spacing: 0.06em;
}

.report-tagline {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.6;
  opacity: 0.96;
}

.subtype-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.score-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.score-pill {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}

.score-pill .v {
  font-size: 20px;
  font-weight: 700;
}

.score-pill .k {
  font-size: 11px;
  opacity: 0.88;
}

.section-title {
  margin: 0 0 12px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: var(--brand);
}

.chart-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chart-box canvas {
  max-width: 100%;
  height: auto;
}

.chart-caption {
  font-size: 12px;
  color: var(--ink-light);
  text-align: center;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-muted);
  font-size: 14px;
  display: grid;
  gap: 8px;
}

.match-box {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 13.5px;
  display: grid;
  gap: 8px;
}

.match-row strong {
  color: var(--ink);
}

.plan-list {
  display: grid;
  gap: 10px;
}

.plan-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: #fdfbfa;
}

.plan-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.plan-week {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.plan-title {
  font-size: 14.5px;
  font-weight: 600;
}

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

.action-bar {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.disclaimer {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--ink-light);
  text-align: center;
  line-height: 1.6;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 18, 20, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

.modal-card img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 10px 0 14px;
}
