/* ========================================
   卫星之眼 · 暗色太空卫星风 UI
   ======================================== */

/* ---- CSS 变量 ---- */
:root {
  --bg-deep: #060a12;
  --bg-card: rgba(16, 24, 40, 0.85);
  --bg-card-solid: #101828;
  --border-subtle: rgba(100, 130, 180, 0.15);
  --border-glow: rgba(80, 160, 255, 0.3);
  --text-primary: #e8eef5;
  --text-secondary: #8a9bb0;
  --text-muted: #5a6a80;
  --accent-blue: #4aa8ff;
  --accent-cyan: #5ce1e6;
  --accent-green: #4ade80;
  --accent-red: #f87171;
  --accent-yellow: #fbbf24;
  --accent-purple: #a78bfa;
  --shadow-glow: 0 0 20px rgba(74, 168, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---- 星空背景 ---- */
.stars-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(40, 60, 100, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(60, 40, 100, 0.1) 0%, transparent 50%);
}

.stars-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 40px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 60px 120px, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 120px 80px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 180px 30px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 250px 150px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 320px 60px, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 400px 180px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 480px 90px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 550px 140px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 620px 50px, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 700px 170px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 780px 100px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 850px 160px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 920px 70px, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 1000px 190px, rgba(255,255,255,0.4), transparent);
  background-size: 1100px 220px;
  animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ---- 视图切换 ---- */
.view {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.view.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  z-index: 0;
}

/* ========================================
   首页
   ======================================== */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
}

/* ---- 轨道装饰 ---- */
.orbit-decoration {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 8px;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border-glow);
}

.orbit-1 {
  width: 100px;
  height: 100px;
  top: 20px;
  left: 20px;
  animation: orbit-spin 12s linear infinite;
  border-top-color: var(--accent-cyan);
  border-right-color: transparent;
}

.orbit-2 {
  width: 140px;
  height: 140px;
  top: 0;
  left: 0;
  animation: orbit-spin 18s linear infinite reverse;
  border-bottom-color: var(--accent-blue);
  border-left-color: transparent;
}

.satellite-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  animation: satellite-float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(92, 225, 230, 0.4));
}

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

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

/* ---- 品牌区 ---- */
.brand {
  text-align: center;
  margin-bottom: 32px;
}

.brand-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: earth-pulse 4s ease-in-out infinite;
}

@keyframes earth-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(74, 168, 255, 0.3)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(74, 168, 255, 0.5)); }
}

.brand-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.title-main {
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-cyan) 50%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(74, 168, 255, 0.2));
}

.title-sub {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.brand-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 1px;
}

/* ---- 特性卡片 ---- */
.feature-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
  max-width: 480px;
  width: 100%;
}

.feat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.feat-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.feat-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.feat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feat-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---- 首页操作区 ---- */
.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.best-score {
  font-size: 14px;
  color: var(--accent-yellow);
  font-weight: 500;
}

.best-score .score-num {
  font-weight: 700;
}

.home-footer {
  position: absolute;
  bottom: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ========================================
   按钮系统
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #3d8bfe);
  color: #fff;
  box-shadow: 0 4px 16px rgba(74, 168, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(74, 168, 255, 0.4);
}

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

.btn-glow {
  animation: btn-glow-pulse 2s ease-in-out infinite;
}

@keyframes btn-glow-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(74, 168, 255, 0.3); }
  50% { box-shadow: 0 4px 24px rgba(74, 168, 255, 0.5), 0 0 40px rgba(74, 168, 255, 0.1); }
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-glow);
  background: rgba(74, 168, 255, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.25);
}

.btn-icon {
  font-size: 18px;
}

.btn-arrow {
  transition: transform 0.2s ease;
}

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

.btn-icon-only {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-only:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
  background: rgba(74, 168, 255, 0.08);
}

/* ========================================
   游戏页 - 顶部状态栏
   ======================================== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(6, 10, 18, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.game-title-mini {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 2;
  max-width: 200px;
}

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

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

.progress-text {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.score-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}

/* ---- 连击横幅 ---- */
.streak-banner {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 6px 16px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-yellow);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

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

/* ========================================
   游戏页 - 主体布局（新）
   ======================================== */
.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ---- 卫星图框（占满剩余空间） ---- */
.map-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 0;
  overflow: hidden;
  background: #000;
}

/* 地图上下的蓝色辉光边线 */
.map-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--border-glow) 50%, transparent 95%);
  z-index: 10;
  pointer-events: none;
}

.map-frame-label {
  position: absolute;
  top: 10px;
  left: 14px;
  z-index: 9;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(92, 225, 230, 0.5);
  pointer-events: none;
  background: rgba(6, 10, 18, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* 四角装饰 */
.map-frame-corners .corner {
  position: absolute;
  width: 18px;
  height: 18px;
  z-index: 9;
  pointer-events: none;
}

.corner-tl { top: 8px; left: 8px; border-top: 2px solid var(--accent-cyan); border-left: 2px solid var(--accent-cyan); border-top-left-radius: 4px; }
.corner-tr { top: 8px; right: 8px; border-top: 2px solid var(--accent-cyan); border-right: 2px solid var(--accent-cyan); border-top-right-radius: 4px; }
.corner-bl { bottom: 8px; left: 8px; border-bottom: 2px solid var(--accent-cyan); border-left: 2px solid var(--accent-cyan); border-bottom-left-radius: 4px; }
.corner-br { bottom: 8px; right: 8px; border-bottom: 2px solid var(--accent-cyan); border-right: 2px solid var(--accent-cyan); border-bottom-right-radius: 4px; }

/* ---- 地图区域 ---- */
.map-section {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

#satelliteMap {
  width: 100%;
  height: 100%;
}

.map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
  z-index: 5;
}

.map-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-deep);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.map-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(74, 168, 255, 0.15);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}

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

.map-loader p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Leaflet 覆盖样式 */
.leaflet-container {
  background: #000 !important;
}

.leaflet-control-attribution {
  background: rgba(6, 10, 18, 0.8) !important;
  color: var(--text-muted) !important;
  font-size: 9px !important;
  padding: 2px 6px !important;
}

.leaflet-control-attribution a {
  color: var(--text-muted) !important;
}

/* ---- 扫描线动效 ---- */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--accent-cyan) 20%,
    rgba(92, 225, 230, 0.8) 50%,
    var(--accent-cyan) 80%,
    transparent
  );
 z-index: 6;
 opacity: 0;
 pointer-events: none;
 box-shadow: 0 0 12px 2px rgba(92, 225, 230, 0.3);
}

.scan-line.active {
  opacity: 1;
  animation: scan-sweep 1.8s ease-in-out;
}

@keyframes scan-sweep {
  0% {
    top: 0;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* ---- 底部提示条 ---- */
.hint-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(to top, rgba(6, 10, 18, 0.92) 0%, rgba(6, 10, 18, 0.6) 70%, transparent 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.hint-bar.show {
  opacity: 1;
  transform: translateY(0);
}

.hint-bar-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.hint-bar-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ========================================
   游戏页 - 统一答题面板（CSS Grid 叠加）
   ======================================== */
.answer-panel {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(6, 10, 18, 0.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glow);
  z-index: 15;
  /* Grid 叠加：选项和反馈共享同一单元格，面板高度由内容撑开 */
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}

/* 面板顶部蓝色辉光线 */
.answer-panel::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--border-glow) 50%, transparent 95%);
  z-index: 1;
}

/* ---- 视图切换容器（Grid 叠加到同一单元格） ---- */
.panel-view {
  grid-area: 1 / 1 / 2 / 2;
  padding: 16px;
}

.options-view {
  z-index: 2;
  animation: panel-enter 0.35s ease-out;
}

.feedback-view {
  z-index: 1;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  /* 保证面板高度不低于反馈内容 */
  height: fit-content;
}

.feedback-view.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 3;
}

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

/* ---- 选项网格 ---- */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.option-btn {
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
  /* 交错入场动画初始态 */
  opacity: 0;
  transform: translateY(12px);
  animation: option-enter 0.3s ease-out forwards;
}

/* 交错延迟 */
.option-btn:nth-child(1) { animation-delay: 0.05s; }
.option-btn:nth-child(2) { animation-delay: 0.1s; }
.option-btn:nth-child(3) { animation-delay: 0.15s; }
.option-btn:nth-child(4) { animation-delay: 0.2s; }

@keyframes option-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.option-btn:hover:not(:disabled) {
  border-color: var(--border-glow);
  background: rgba(74, 168, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.option-btn:active:not(:disabled) {
  transform: translateY(0);
}

.option-btn .city-flag {
  font-size: 20px;
  margin-right: 6px;
  vertical-align: middle;
}

.option-btn .city-name {
  vertical-align: middle;
}

/* 选项状态 */
.option-btn.correct {
  background: rgba(74, 222, 128, 0.12) !important;
  border-color: var(--accent-green) !important;
  color: var(--accent-green) !important;
  animation: correct-pulse 0.5s ease forwards;
}

.option-btn.wrong {
  background: rgba(248, 113, 113, 0.12) !important;
  border-color: var(--accent-red) !important;
  color: var(--accent-red) !important;
  animation: wrong-shake 0.4s ease forwards;
}

.option-btn:disabled {
  cursor: default;
  opacity: 0.9;
}

@keyframes correct-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ---- 反馈视图内容 ---- */
.feedback-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.feedback-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.feedback-result {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}

.feedback-result.correct-text {
  color: var(--accent-green);
}

.feedback-result.wrong-text {
  color: var(--accent-red);
}

.feedback-score {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* ---- 冷知识卡片 ---- */
.trivia-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  /* 交错入场 */
  animation: trivia-enter 0.4s ease-out 0.15s both;
}

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

.trivia-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.trivia-icon {
  font-size: 16px;
}

.trivia-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-yellow);
  letter-spacing: 1px;
}

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

.trivia-item {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  /* 冷知识逐条入场 */
  opacity: 0;
  transform: translateX(-8px);
  animation: trivia-item-enter 0.3s ease-out forwards;
}

.trivia-item:nth-child(1) { animation-delay: 0.25s; }
.trivia-item:nth-child(2) { animation-delay: 0.35s; }
.trivia-item:nth-child(3) { animation-delay: 0.45s; }

@keyframes trivia-item-enter {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.trivia-item::before {
  content: '·';
  color: var(--accent-blue);
  font-weight: 700;
  flex-shrink: 0;
}

/* 下一题按钮 */
.next-btn {
  width: 100%;
  animation: trivia-enter 0.4s ease-out 0.35s both;
}

/* ========================================
   结算页
   ======================================== */
.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.result-emoji {
  font-size: 56px;
  margin-bottom: 12px;
  animation: result-bounce 1s ease;
}

@keyframes result-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.result-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.result-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  text-align: center;
}

/* ---- 统计卡片 ---- */
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-glow);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- 回顾区 ---- */
.review-section {
  width: 100%;
  margin-bottom: 24px;
}

.review-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

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

.review-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.review-item:hover {
  border-color: var(--border-glow);
}

.review-flag {
  font-size: 24px;
  flex-shrink: 0;
}

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

.review-city {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.review-country {
  font-size: 11px;
  color: var(--text-muted);
}

.review-status {
  font-size: 20px;
  flex-shrink: 0;
}

.review-status.correct {
  color: var(--accent-green);
}

.review-status.wrong {
  color: var(--accent-red);
}

/* ---- 分享区 ---- */
.share-section {
  width: 100%;
  margin-bottom: 24px;
}

.share-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

.share-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.share-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
}

/* ---- 结算操作 ---- */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
}

/* ========================================
   弹窗与提示
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-box {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-box p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

/* ========================================
   响应式适配
   ======================================== */

/* ---- 手机（< 480px）---- */
@media (max-width: 479px) {
  .feature-cards {
    flex-direction: column;
  }

  .feat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px 14px;
  }

  .feat-icon {
    font-size: 24px;
    margin-bottom: 0;
  }

  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .options-grid {
    gap: 8px;
  }

  .option-btn {
    padding: 14px 12px;
    font-size: 15px;
    min-height: 48px;
  }

  .panel-view {
    padding: 12px;
  }

  .brand-tagline {
    font-size: 13px;
  }

  /* 手机端反馈面板内边距 */
  .feedback-view {
    padding: 12px;
  }

  .feedback-result {
    font-size: 14px;
  }

  .trivia-item {
    font-size: 12px;
  }

  /* 手机端游戏标题缩小 */
  .game-title-mini {
    display: none;
  }

  .header-left {
    flex: 0.5;
  }

  /* 手机端结算页 */
  .result-container {
    padding: 24px 16px;
  }

  .result-emoji {
    font-size: 44px;
  }

  .result-title {
    font-size: 24px;
  }

  .result-desc {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 12px 6px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 10px;
  }

  .review-list {
    gap: 6px;
  }

  .review-item {
    padding: 10px 12px;
  }

  .share-card {
    padding: 12px;
  }

  .share-content {
    font-size: 13px;
    line-height: 1.6;
  }

  .result-actions {
    gap: 8px;
  }

  .result-actions .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* ---- 大屏手机 / 小平板（480px - 767px）---- */
@media (min-width: 480px) and (max-width: 767px) {
  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .option-btn {
    min-height: 48px;
  }

  .panel-view {
    padding: 14px;
  }

  /* 游戏标题保留 */
  .game-title-mini {
    display: inline;
  }

  .feedback-view {
    padding: 14px;
  }

  .result-container {
    padding: 32px 20px;
  }

  .result-emoji {
    font-size: 48px;
  }

  .result-title {
    font-size: 26px;
  }

  .stat-card {
    padding: 14px 8px;
  }

  .stat-value {
    font-size: 22px;
  }

  .review-list {
    gap: 8px;
  }

  .share-card {
    padding: 14px;
  }

  .share-content {
    font-size: 13px;
  }
}

/* ---- 平板（768px - 1023px）---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .home-container {
    padding: 48px 32px;
  }

  .orbit-decoration {
    width: 180px;
    height: 180px;
  }

  .orbit-1 {
    width: 130px;
    height: 130px;
    top: 25px;
    left: 25px;
  }

  .orbit-2 {
    width: 180px;
    height: 180px;
  }

  .satellite-icon {
    font-size: 44px;
  }

  .game-header {
    padding: 14px 24px;
  }

  /* 平板端保留游戏标题 */
  .game-title-mini {
    display: inline;
  }

  .header-center {
    max-width: 260px;
  }

  .panel-view {
    padding: 20px;
  }

  .options-grid {
    gap: 12px;
    max-width: 500px;
  }

  .option-btn {
    padding: 18px 18px;
    font-size: 17px;
    min-height: 52px;
  }

  .result-container {
    padding: 48px 32px;
  }

  .result-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .stat-value {
    font-size: 24px;
  }

  .review-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .feedback-view {
    padding: 20px;
  }

  .feedback-result {
    font-size: 17px;
  }

  .trivia-item {
    font-size: 14px;
  }

  /* 平板端地图框加圆角 */
  .map-frame {
    border-radius: var(--radius-lg);
    margin: 8px;
    border: 1px solid var(--border-subtle);
  }
}

/* ---- 桌面端（≥ 1024px）：地图左侧 + 右侧面板 ---- */
@media (min-width: 1024px) {
  .game-body {
    flex-direction: row;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
  }

  .map-frame {
    flex: 3;
    border-radius: var(--radius-lg);
    margin: 12px;
    margin-right: 0;
    border: 1px solid var(--border-glow);
    box-shadow:
      0 0 30px rgba(74, 168, 255, 0.1),
      inset 0 0 0 1px rgba(74, 168, 255, 0.08);
  }

  .answer-panel {
    flex: 1;
    min-width: 320px;
    max-width: 420px;
    margin: 12px;
    margin-left: 0;
    border-top: none;
    border-left: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    overflow: hidden;
    /* 桌面端：面板填满高度，内容在内部滚动 */
    display: flex;
    flex-direction: column;
    box-shadow:
      0 0 30px rgba(74, 168, 255, 0.1),
      inset 0 0 0 1px rgba(74, 168, 255, 0.08);
  }

  /* 桌面端：面板左侧辉光线替代顶部辉光线 */
  .answer-panel::before {
    top: 0;
    bottom: 0;
    left: -1px;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, transparent 5%, var(--border-glow) 50%, transparent 95%);
  }

  /* 桌面端：Panel-View 用 flex 布局占满面板 */
  .panel-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  /* 桌面端选项单列，居中 */
  .options-view {
    justify-content: center;
    padding: 24px 20px;
  }

  .options-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 100%;
  }

  .option-btn {
    padding: 18px 20px;
    font-size: 17px;
    min-height: 52px;
  }

  .option-btn:hover:not(:disabled) {
    transform: translateX(4px);
  }

  /* 桌面端反馈视图：从右侧滑入，内容可滚动 */
  .feedback-view {
    padding: 24px 20px;
    transform: translateX(30px);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }

  .feedback-view.active {
    opacity: 1;
    transform: translateX(0);
  }

  /* 桌面端冷知识卡片 */
  .trivia-card {
    padding: 18px;
  }

  .trivia-item {
    font-size: 14px;
  }

  /* 桌面端结算页 */
  .result-container {
    padding: 56px 32px;
    max-width: 720px;
  }

  .result-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 600px;
  }

  .stat-card {
    padding: 20px 16px;
  }

  .stat-value {
    font-size: 28px;
  }

  .review-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
    margin: 0 auto;
  }

  .result-actions {
    flex-direction: row;
    max-width: 400px;
  }

  .result-actions .btn {
    flex: 1;
  }

  /* 桌面端首页 */
  .home-container {
    padding: 60px;
  }

  .orbit-decoration {
    width: 200px;
    height: 200px;
  }

  .orbit-1 {
    width: 150px;
    height: 150px;
    top: 25px;
    left: 25px;
  }

  .orbit-2 {
    width: 200px;
    height: 200px;
  }

  .satellite-icon {
    font-size: 50px;
  }

  .feature-cards {
    max-width: 600px;
  }

  .feat-card {
    padding: 24px 20px;
  }

  .feat-icon {
    font-size: 32px;
  }

  .feat-title {
    font-size: 15px;
  }

  .feat-desc {
    font-size: 13px;
  }

  /* 桌面端：地图框圆角，调整四角装饰 */
  .map-frame .corner-tl { top: 14px; left: 14px; }
  .map-frame .corner-tr { top: 14px; right: 14px; }
  .map-frame .corner-bl { bottom: 14px; left: 14px; }
  .map-frame .corner-br { bottom: 14px; right: 14px; }

  /* 桌面端头部 */
  .game-header {
    padding: 16px 32px;
  }

  .header-center {
    max-width: 300px;
  }

  .btn-icon-only {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* ---- 超宽屏（≥ 1600px）：居中约束 ---- */
@media (min-width: 1600px) {
  .game-body {
    max-width: 1440px;
  }

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

/* ---- 横屏手机优化 ---- */
@media (max-height: 500px) and (orientation: landscape) {
  .home-container {
    justify-content: flex-start;
    padding-top: 16px;
  }

  .orbit-decoration {
    width: 80px;
    height: 80px;
    margin-bottom: 4px;
  }

  .orbit-1 {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
  }

  .orbit-2 {
    width: 80px;
    height: 80px;
  }

  .satellite-icon {
    font-size: 24px;
  }

  .brand-icon {
    font-size: 32px;
    margin-bottom: 4px;
  }

  .feature-cards {
    display: none;
  }

  .brand {
    margin-bottom: 12px;
  }

  .game-header {
    padding: 6px 12px;
  }

  .game-body {
    flex-direction: row;
  }

  .map-frame {
    flex: 2;
  }

  .answer-panel {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    border-top: none;
    border-left: 1px solid var(--border-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* 横屏面板左侧辉光线 */
  .answer-panel::before {
    top: 0;
    bottom: 0;
    left: -1px;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, transparent 5%, var(--border-glow) 50%, transparent 95%);
  }

  .panel-view {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .options-view {
    justify-content: center;
  }

  .options-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .option-btn {
    padding: 8px 10px;
    font-size: 13px;
    min-height: 36px;
  }

  .trivia-card {
    padding: 8px;
    margin-bottom: 8px;
  }

  .trivia-item {
    font-size: 11px;
  }

  .feedback-view {
    padding: 8px 10px;
    transform: translateX(20px);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
  }

  .feedback-view.active {
    transform: translateX(0);
  }

  .feedback-result {
    font-size: 13px;
  }

  .result-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---- 安全区域（刘海屏 / 底部指示条）---- */
@supports (padding: env(safe-area-inset-bottom)) {
  .answer-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .toast {
    bottom: calc(40px + env(safe-area-inset-bottom));
  }

  .home-container {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .result-container {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
}

/* ========================================
   滚动条美化
   ======================================== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-glow);
}</arg_value>