/* ==================== CSS 变量 & 重置 ==================== */
:root {
  --bg-primary: #FAFBF8;
  --bg-secondary: #F0F2EC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F5F7F2;
  --text-primary: #1E2B25;
  --text-secondary: #4F6358;
  --text-muted: #8A9E92;
  --accent: #339976;
  --accent-light: #3FB48A;
  --accent-glow: rgba(51, 153, 118, 0.14);
  --gold: #C79830;
  --gold-light: #DCAD3E;
  --gold-glow: rgba(199, 152, 48, 0.12);
  --success: #339976;
  --warning: #C79830;
  --danger: #C94545;
  --border: rgba(30, 43, 37, 0.07);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(30, 43, 37, 0.05), 0 1px 2px rgba(30, 43, 37, 0.03);
  --shadow-md: 0 4px 12px rgba(30, 43, 37, 0.07), 0 2px 4px rgba(30, 43, 37, 0.04);
  --shadow-lg: 0 12px 36px rgba(30, 43, 37, 0.09), 0 4px 12px rgba(30, 43, 37, 0.05);
  --font-display: 'Space Grotesk', sans-serif;
  --font: 'LXGW WenKai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --dim-color-1: #e17055;
  --dim-color-2: #fab1a0;
  --dim-color-3: #fdcb6e;
  --dim-color-4: #00cec9;
  --dim-color-5: #55efc4;
  --dim-color-6: #81ecec;
  --dim-color-7: #74b9ff;
  --dim-color-8: #0984e3;
  --dim-color-9: #a0c4ff;
  --dim-color-10: #ff7675;
  --dim-color-11: #e17055;
  --dim-color-12: #fab1a0;
  --dim-color-13: #ffeaa7;
  --dim-color-14: #fdcb6e;
  --dim-color-15: #f9ca24;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== 通用组件 ==================== */
.page {
  display: none;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.page.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s ease;
}

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* 所有可点击元素 cursor */
button, [role="button"], a, .option-btn, .btn-primary, .btn-secondary {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* 按钮 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--accent-light);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

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

/* ==================== 首页 ==================== */
#page-home {
  background: 
    radial-gradient(ellipse at 30% -10%, rgba(51, 153, 118, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 100%, rgba(199, 152, 48, 0.05) 0%, transparent 50%),
    var(--bg-primary);
}

.home-container {
  text-align: center;
  padding: 40px 24px;
  max-width: 600px;
  width: 100%;
}

.home-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(51, 153, 118, 0.07);
  border: 1px solid rgba(51, 153, 118, 0.15);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 32px;
  letter-spacing: 2px;
}

.home-title {
  margin-bottom: 24px;
}

.title-main {
  display: block;
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 8px;
  line-height: 1.1;
}

.title-sub {
  display: block;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 8px;
  letter-spacing: 6px;
}

.home-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 36px;
}

.home-desc strong {
  color: var(--gold);
  font-weight: 700;
}

.home-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 40px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  background: rgba(199, 152, 48, 0.05);
  border-radius: var(--radius-md);
}

.stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.btn-arrow {
  transition: var(--transition);
  display: inline-block;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.home-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==================== 答题页 ==================== */
#page-quiz {
  align-items: flex-start;
  padding-top: 0;
  background: var(--bg-primary);
}

.quiz-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 24px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 顶栏 */
.quiz-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 14px;
}

.topbar-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.topbar-brand {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.topbar-center {
  flex-shrink: 0;
}

.topbar-dim {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
}

.topbar-count {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.topbar-count #progress-current {
  color: var(--accent);
  font-weight: 700;
}

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  margin-bottom: 28px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* 题目区域 */
.question-area {
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
}

.question-number {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 10px;
  opacity: 0.7;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.8;
  margin-bottom: 28px;
  color: var(--text-primary);
}

/* 选项 */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font);
  line-height: 1.6;
  box-shadow: 0 1px 2px rgba(30, 43, 37, 0.04);
}

.option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1.5px solid rgba(30, 43, 37, 0.08);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.option-text {
  flex: 1;
}

.option-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(51, 153, 118, 0.25);
}

.option-btn:hover .option-label {
  border-color: rgba(51, 153, 118, 0.3);
  color: var(--accent);
}

.option-btn.selected {
  background: rgba(51, 153, 118, 0.06);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(51, 153, 118, 0.08);
}

.option-btn.selected .option-label {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 8px;
  color: #fff;
}

.option-btn.selected .option-text {
  font-weight: 700;
}

/* 底部操作 */
.quiz-hint {
  margin-top: 28px;
  text-align: center;
  opacity: 0.35;
  transition: opacity 0.3s;
}

.quiz-hint:hover {
  opacity: 0.6;
}

.hint-keys {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.hint-keys kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 0.65rem;
  font-family: var(--font);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 0 1px;
}

/* 移动端隐藏键盘提示 */
@media (hover: none) {
  .quiz-hint {
    display: none;
  }
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 0;
  margin-top: 28px;
}

/* ==================== 加载页 ==================== */
#page-loading {
  background: var(--bg-primary);
}

.loading-container {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* 圆环进度 */
.loading-visual {
  position: relative;
}

.loading-ring {
  width: 120px;
  height: 120px;
  position: relative;
}

.loading-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}

.ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 263.9;
  stroke-dashoffset: 263.9;
  transition: stroke-dashoffset 0.3s ease;
}

.ring-pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

/* 文字区域 */
.loading-text-area {
  min-height: 4em;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loading-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.loading-text.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

.loading-text.fade-in {
  opacity: 0;
  transform: translateY(8px);
}

.loading-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.4em;
  transition: opacity 0.25s ease;
}

.loading-sub.fade-out {
  opacity: 0;
}

/* 步骤指示点 */
.loading-steps {
  display: flex;
  gap: 8px;
  align-items: center;
}

.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--accent);
  width: 8px;
  height: 8px;
  box-shadow: 0 0 8px rgba(51, 153, 118, 0.4);
}

/* ==================== 结果页 ==================== */
#page-result {
  align-items: flex-start;
  padding: 0;
}

.result-container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* 主类型卡片 */
.result-card {
  text-align: center;
  padding: 48px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.6s ease;
  box-shadow: var(--shadow-md);
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--success));
}

.result-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.result-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

.result-character {
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.result-code {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--gold);
  margin-bottom: 8px;
}

.result-name {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: 4px;
}

.result-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 24px;
  line-height: 1.6;
}

.result-match {
  display: inline-block;
  padding: 8px 20px;
  background: rgba(51, 153, 118, 0.07);
  border: 1px solid rgba(51, 153, 118, 0.15);
  border-radius: 100px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
}

/* 结果区块 */
.result-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 20px;
  animation: slideUp 0.6s ease;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.result-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.9;
  white-space: pre-line;
}

.result-advice {
  font-size: 0.95rem;
  color: var(--accent);
  line-height: 1.8;
  padding: 16px;
  background: rgba(51, 153, 118, 0.04);
  border-radius: var(--radius-md);
}

/* 维度评分 */
.dimensions-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dim-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dim-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dim-score-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dim-bar {
  height: 8px;
  background: rgba(30, 43, 37, 0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.dim-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.dim-labels {
  display: flex;
  justify-content: space-between;
}

.dim-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* 五大模型 */
.models-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.model-card {
  padding: 16px;
  background: rgba(30, 43, 37, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}

.model-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.model-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.model-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.model-score {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent);
}

.model-bar {
  height: 4px;
  background: rgba(30, 43, 37, 0.06);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.model-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* 免责声明 */
.disclaimer {
  background: rgba(199, 152, 48, 0.05);
  border-color: rgba(199, 152, 48, 0.12);
}

.disclaimer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}

.disclaimer-footer {
  margin-top: 12px;
  opacity: 0.7;
}

/* 操作按钮 */
.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* ==================== D: 系统毒舌备注 ==================== */
.result-remark {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: rgba(199, 152, 48, 0.06);
  border: 1px solid rgba(199, 152, 48, 0.12);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  animation: slideUp 0.5s ease;
}

.remark-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.remark-text {
  line-height: 1.6;
}

/* ==================== H: 随机彩蛋 ==================== */
.result-easter-egg {
  text-align: center;
  padding: 12px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 24px;
  animation: slideUp 0.6s ease;
}

.egg-icon {
  margin-right: 4px;
}

/* ==================== C: 维度亮点 ==================== */
.dim-highlights {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: transform 0.2s;
}

.highlight-high {
  background: rgba(51, 153, 118, 0.05);
  border: 1px solid rgba(51, 153, 118, 0.12);
}

.highlight-low {
  background: rgba(199, 152, 48, 0.05);
  border: 1px solid rgba(199, 152, 48, 0.12);
}

.highlight-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.highlight-body {
  flex: 1;
  min-width: 0;
}

.highlight-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.highlight-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.highlight-pct {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent);
  flex-shrink: 0;
}

.highlight-low .highlight-pct {
  color: var(--warning);
}

/* ==================== B: 用户 vs 类型对比图 ==================== */
.profile-compare {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compare-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compare-label {
  width: 80px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

.compare-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.compare-bar {
  height: 6px;
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.compare-bar-user {
  background: var(--accent);
}

.compare-bar-type {
  background: var(--gold);
  opacity: 0.5;
}

.profile-compare-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 6px;
  border-radius: 3px;
  display: inline-block;
}

.legend-user .legend-dot {
  background: var(--accent);
}

.legend-type .legend-dot {
  background: var(--gold);
  opacity: 0.5;
}

/* ==================== E: 最佳/最差拍档 ==================== */
.match-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.match-card {
  padding: 20px 16px;
  border-radius: var(--radius-md);
  text-align: center;
}

.match-best {
  background: rgba(51, 153, 118, 0.04);
  border: 1px solid rgba(51, 153, 118, 0.12);
}

.match-worst {
  background: rgba(201, 69, 69, 0.04);
  border: 1px solid rgba(201, 69, 69, 0.12);
}

.match-tag {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.match-emoji {
  font-size: 2rem;
  margin-bottom: 6px;
}

.match-code {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 2px;
}

.match-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.match-reason {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==================== A: 人格排行榜 ==================== */
.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 16px;
}

.rankings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(30, 43, 37, 0.02);
}

.rank-first {
  background: rgba(51, 153, 118, 0.06);
  border: 1px solid rgba(51, 153, 118, 0.12);
}

.rank-pos {
  width: 28px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.rank-emoji {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-code {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.rank-name {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0;
}

.rank-bar-bg {
  height: 4px;
  background: rgba(30, 43, 37, 0.06);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.rank-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  width: 40px;
  text-align: right;
}

.rank-worst-item .rank-bar-fill {
  background: linear-gradient(90deg, var(--danger), #E57373);
}

.rank-worst-item .rank-pct {
  color: var(--danger);
}

.rankings-worst {
  margin-top: 16px;
}

.rank-worst-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 4px;
}

/* ==================== G: 全网统计 ==================== */
.global-stats {
  text-align: center;
}

.gs-main {
  padding: 16px 0 20px;
}

.gs-big-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.gs-pct-sign {
  font-size: 1.2rem;
  font-weight: 700;
  margin-left: 2px;
}

.gs-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.gs-desc strong {
  color: var(--gold);
}

.gs-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.gs-detail-item {
  padding: 10px;
  background: rgba(30, 43, 37, 0.02);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gs-detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gs-detail-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gs-error,
.global-stats-loading {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 20px;
}

/* ==================== F: 类型名片海报 ==================== */
.poster-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

#poster-canvas {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ==================== 响应式 ==================== */
/* 超小屏 ≤375px */
@media (max-width: 375px) {
  .title-main {
    font-size: 2.8rem;
    letter-spacing: 2px;
  }

  .title-sub {
    font-size: 1rem;
  }

  .home-stats {
    flex-direction: column;
    gap: 12px;
  }

  .btn-primary {
    padding: 14px 32px;
    font-size: 1rem;
  }

  .quiz-container {
    padding: 0 16px 20px;
  }

  .quiz-topbar {
    padding: 0 0 10px;
  }

  .topbar-brand {
    font-size: 0.75rem;
  }

  .topbar-dim {
    font-size: 0.65rem;
  }

  .topbar-count {
    font-size: 0.7rem;
  }

  .question-number {
    font-size: 0.75rem;
  }

  .question-text {
    font-size: 1.05rem;
    margin-bottom: 20px;
  }

  .option-btn {
    padding: 14px 14px;
    gap: 12px;
    font-size: 0.9rem;
  }

  .option-label {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    border-radius: 6px;
  }

  .quiz-footer {
    margin-top: 20px;
  }

  .btn-secondary {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .result-code {
    font-size: 2.2rem;
  }
}

/* 小屏 ≤480px */
@media (max-width: 480px) {
  .title-main {
    font-size: 3.5rem;
    letter-spacing: 4px;
  }

  .title-sub {
    font-size: 1.2rem;
  }

  .home-desc {
    font-size: 0.9rem;
  }

  .home-stats {
    gap: 20px;
  }

  .stat-num {
    font-size: 1.5rem;
  }

  .quiz-container {
    padding: 0 18px 22px;
  }

  .question-text {
    font-size: 1.1rem;
    margin-bottom: 22px;
  }

  .option-btn {
    padding: 14px 16px;
    font-size: 0.95rem;
    gap: 14px;
  }

  .progress-bar {
    margin-bottom: 22px;
  }

  .quiz-footer {
    margin-top: 22px;
  }

  .result-card {
    padding: 36px 20px;
  }

  .result-code {
    font-size: 2.8rem;
  }

  .result-name {
    font-size: 1.3rem;
  }

  .models-overview {
    grid-template-columns: 1fr;
  }

  .match-duo {
    grid-template-columns: 1fr;
  }

  .compare-label {
    width: 60px;
    font-size: 0.7rem;
  }

  .gs-details {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .quiz-container {
    min-height: 100vh;
  }

  .question-area {
    padding: 0;
  }
}

/* 平板横屏 */
@media (min-width: 768px) and (max-width: 1024px) {
  .home-container {
    max-width: 560px;
  }

  .result-container {
    max-width: 580px;
  }
}

/* 大屏 ≥1440px */
@media (min-width: 1440px) {
  .home-container {
    max-width: 720px;
  }

  .quiz-container {
    max-width: 720px;
  }

  .result-container {
    max-width: 720px;
  }

  .title-main {
    font-size: 6rem;
  }
}

/* 减弱动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== 过渡动画类 ==================== */

/* 选项入场动画 */
.option-btn {
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: optionFadeIn 0.18s ease forwards;
  will-change: transform, opacity;
}

.option-btn:nth-child(1) { animation-delay: 0.02s; }
.option-btn:nth-child(2) { animation-delay: 0.05s; }
.option-btn:nth-child(3) { animation-delay: 0.08s; }
.option-btn:nth-child(4) { animation-delay: 0.11s; }

@keyframes optionFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 选项点击水波纹 */
.option-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(51, 153, 118, 0.08);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s, opacity 0.5s;
  opacity: 0;
}

.option-btn:active::after {
  width: 400px;
  height: 400px;
  opacity: 1;
}

/* 快捷键提示 */
.option-label {
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .option-label::after {
    content: '';
  }
}

/* ==================== 焦点指示器 ==================== */
.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: var(--bg-card-hover);
  border-color: rgba(51, 153, 118, 0.3);
}

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--text-primary);
  border: none;
  border-radius: var(--radius-lg);
  color: var(--bg-primary);
  font-size: 0.9rem;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
