/* ==========================================================================
   AI防忽悠段位全国统考 - 样式系统 (Cyber Shield Theme)
   纯 CSS，零外部字体，移动端优先，严格防横向溢出
   ========================================================================== */

:root {
  --bg-deep: #070b14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(6, 182, 212, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #06b6d4;
  --accent-blue: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-size: 15px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 页面主外框容器 */
.app-container {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 40px;
}

/* 顶部状态微光条 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px;
}

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

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

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px var(--accent-cyan); }
}

.brand-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-blue);
  text-transform: uppercase;
}

.header-status {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 视图面板管理 */
.view-panel {
  display: none;
  width: 100%;
  flex-direction: column;
  padding: 18px 16px;
  animation: fadeIn 0.28s ease-out forwards;
}

.view-panel.active {
  display: flex;
}

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

/* ==========================================================================
   首页 (Start View) 布局与视觉
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 18px 8px 12px;
}

.cyber-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.main-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  text-shadow: 0 0 24px rgba(6, 182, 212, 0.3);
}

.sub-title {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* 特性标签栏 */
.feature-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 18px 0 22px;
}

.feature-tag {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 按钮样式体系 */
.home-action-wrap {
  width: 100%;
  margin: 6px 0 26px;
}

.btn-primary {
  width: 100%;
  height: 54px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 60%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.4);
}

.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  animation: shineLoop 3.5s infinite;
}

@keyframes shineLoop {
  0% { left: -100%; }
  30%, 100% { left: 160%; }
}

.btn-secondary {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* 5大段位画廊 */
.tiers-preview-section {
  width: 100%;
  margin-top: 10px;
}

.section-title-wrap {
  margin-bottom: 12px;
}

.section-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent-cyan);
  display: block;
}

.section-heading {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

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

.tier-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.tier-preview-card.tier-s { border-left: 4px solid var(--accent-cyan); }
.tier-preview-card.tier-a { border-left: 4px solid var(--accent-emerald); }
.tier-preview-card.tier-b { border-left: 4px solid var(--accent-amber); }
.tier-preview-card.tier-c { border-left: 4px solid var(--accent-purple); }
.tier-preview-card.tier-d { border-left: 4px solid var(--accent-pink); }

.tier-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.tier-level-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.tier-s .tier-level-tag { color: var(--accent-cyan); }
.tier-a .tier-level-tag { color: var(--accent-emerald); }
.tier-b .tier-level-tag { color: var(--accent-amber); }
.tier-c .tier-level-tag { color: var(--accent-purple); }
.tier-d .tier-level-tag { color: var(--accent-pink); }

.tier-score-tag {
  font-size: 11px;
  color: var(--text-dim);
}

.tier-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.tier-brief {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* 免责声明通用底栏 */
.site-disclaimer {
  margin-top: 32px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.disclaimer-title {
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ==========================================================================
   答题视图 (Quiz View)
   ========================================================================== */
.quiz-top-bar {
  width: 100%;
  margin-bottom: 16px;
}

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

.index-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-blue);
}

.topic-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

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

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.question-headline {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 10px;
}

.question-narrative {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  width: 100%;
  min-height: 52px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.option-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(6, 182, 212, 0.35);
}

.option-btn:active, .option-btn.selected {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
  transform: scale(0.99);
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-top: 1px;
}

.option-btn.selected .option-letter {
  background: var(--accent-cyan);
  color: #070b14;
  border-color: var(--accent-cyan);
}

.option-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  flex: 1;
}

.quiz-hint-bar {
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   结果页 (Result View)
   ========================================================================== */
.result-hero-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 18px 20px;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.result-tier-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.badge-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.result-sub-tag {
  font-size: 11px;
  color: var(--text-dim);
}

.result-title {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}

.score-display-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}

.score-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.score-number {
  font-size: 38px;
  font-weight: 900;
  color: #38bdf8;
  line-height: 1;
}

.score-total {
  font-size: 14px;
  color: var(--text-dim);
}

.result-slogan {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.45;
}

.result-summary {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 440px;
  margin: 0 auto;
}

/* 结果页模块卡片通用 */
.result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.panel-header {
  margin-bottom: 14px;
}

.panel-subhead {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--accent-cyan);
  display: block;
}

.panel-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

/* 雷达与指标条 */
.radar-box {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metrics-bars-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-bar-item {
  width: 100%;
}

.bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

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

.bar-val {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill-cyan { background: linear-gradient(90deg, #06b6d4, #38bdf8); }
.bar-fill-emerald { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-fill-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* 特征清单 */
.traits-bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trait-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.5;
}

.trait-dot {
  color: var(--accent-cyan);
  font-size: 12px;
  margin-top: 3px;
}

/* 建议卡片 */
.tips-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tip-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.tip-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

/* 逐题解析复盘列表 */
.review-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.review-item.is-correct {
  border-left: 3px solid var(--accent-emerald);
}

.review-item.is-flawed {
  border-left: 3px solid var(--accent-amber);
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.review-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-blue);
}

.review-score {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.review-question {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.review-user-choice {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.review-explanation {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
}

.review-explanation strong {
  color: var(--accent-cyan);
}

/* 操作按钮组 */
.result-actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* 隐藏离线画板 */
.offscreen-canvas {
  display: none;
}

/* ==========================================================================
   移动端与极端屏幕保护 (320px - 480px)
   ========================================================================== */
@media screen and (max-width: 480px) {
  .app-container {
    padding-left: 0;
    padding-right: 0;
  }
  .view-panel {
    padding-left: 14px;
    padding-right: 14px;
  }
  .main-title {
    font-size: 23px;
  }
  .sub-title {
    font-size: 13.5px;
  }
  .result-title {
    font-size: 25px;
  }
  .btn-primary {
    height: 50px;
    font-size: 15px;
  }
}
