/* style.css - 《星际算能机甲：零熵之战》全局科技感视觉系统与响应式交互样式 */

:root {
  --bg-dark: #070a12;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --border-glow: rgba(56, 189, 248, 0.3);
  --cyan: #00f0ff;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 顶部驾驶员状态HUD栏 */
.game-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.92);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 28px;
  animation: pulse-spin 6s infinite linear;
}

@keyframes pulse-spin {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px var(--cyan)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 12px var(--cyan)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 4px var(--cyan)); }
}

.game-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-badge-sub {
  font-size: 11px;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
  white-space: nowrap;
}

.pilot-hud {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 6px 14px;
}

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

.pilot-name-btn {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.pilot-name-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.pilot-lv {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
}

.exp-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 120px;
}

.exp-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.exp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  transition: width 0.4s ease;
}

.exp-text {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

.currency-box {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: bold;
}

.coin-chip {
  color: #fcd34d;
}

.star-chip {
  color: #60a5fa;
}

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

.btn-header {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-header:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--cyan);
}
.btn-header.muted {
  opacity: 0.6;
}

/* 模块导航标签条 */
.nav-tab-bar {
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

/* 主内容容器 */
.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ===================================================
   视图 1：星际星图 (Galaxy Map)
   =================================================== */
.view-title-block {
  text-align: center;
  margin-bottom: 28px;
}

.view-main-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.view-desc {
  font-size: 14px;
  color: var(--text-muted);
}

.galaxy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.stage-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stage-card.unlocked {
  cursor: pointer;
}
.stage-card.unlocked:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 16px var(--border-glow);
}

.stage-card.locked {
  opacity: 0.6;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

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

.stage-unit-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.stage-stars .star-icon {
  font-size: 16px;
  color: #334155;
  margin-left: 2px;
}
.stage-stars .star-icon.lit {
  color: #f59e0b;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.stage-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.stage-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  min-height: 38px;
}

.stage-boss-preview {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.badge-tag {
  font-size: 11.5px;
  color: var(--cyan);
}

.btn-enter-stage {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}
.btn-enter-stage.active {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #000;
}
.btn-enter-stage.disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ===================================================
   视图 2：作战模拟舱 (Battle Arena)
   =================================================== */
.battle-arena-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

@media (max-width: 992px) {
  .battle-arena-layout {
    grid-template-columns: 1fr;
  }
}

.battle-main-card {
  background: var(--bg-card);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.battle-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.unit-tag {
  color: var(--cyan);
  font-size: 13px;
  font-weight: bold;
}

.level-num-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}

/* Boss 对决血条展示区 */
.boss-versus-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.combatant-block .combatant-title {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
}

.combatant-hp-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transition: width 0.4s ease;
}

.player-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  transition: width 0.4s ease;
}

/* 战区战术简报 */
.battle-lore-card {
  background: rgba(56, 189, 248, 0.05);
  border-left: 3px solid var(--cyan);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 互动直观教具容器 */
.vis-container-card {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 24px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 题目呈现区域 */
.problem-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.question-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.7;
  color: #fff;
  margin-bottom: 8px;
}

.calc-formula-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 16px;
  color: #38bdf8;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

/* 选项按钮阵列 */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.option-choice-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
}

.option-choice-btn:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--cyan);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.15);
}

.opt-tag {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cyan);
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.option-choice-btn.btn-success {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: var(--emerald) !important;
  color: #fff !important;
}

.option-choice-btn.btn-error {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: var(--rose) !important;
  color: #fff !important;
}

.option-choice-btn.correct-answer {
  border-color: var(--emerald);
}

/* 反馈与解析面板 (小智 AI 领航) */
.feedback-panel {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 20px;
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.feedback-panel.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.feedback-panel.warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.fb-header {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.combo-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: auto;
}

.fb-expl {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 12px;
}

.fb-hint-alert {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13.5px;
  color: #fbbf24;
  margin-bottom: 16px;
}

.fb-actions {
  display: flex;
  gap: 12px;
}

.btn-next-action {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #fff;
  border: none;
  font-weight: bold;
  font-size: 15px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.btn-next-action:hover {
  transform: scale(1.02);
}
.btn-next-action.secondary {
  background: #475569;
}

.btn-retry-action {
  background: linear-gradient(135deg, var(--amber), #d97706);
  color: #fff;
  border: none;
  font-weight: bold;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* 战术右侧边栏（伴随助手与捷径） */
.battle-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.companion-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.companion-avatar {
  font-size: 48px;
  margin-bottom: 10px;
  animation: float-bot 3s infinite ease-in-out;
}

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

.companion-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--cyan);
  margin-bottom: 4px;
}

.companion-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.companion-bubble {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 13px;
  color: var(--text-main);
  text-align: left;
  line-height: 1.6;
}

.quick-tools-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.btn-sidebar-tool {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-top: 8px;
  cursor: pointer;
}
.btn-sidebar-tool:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cyan);
}

/* ===================================================
   互动直观教具专项样式 (Visualizers)
   =================================================== */

/* 1. 小数乘法光子网格 */
.vis-photon-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.vis-math-equation {
  font-size: 15px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.photon-grid-box {
  background: #0f172a;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.photon-matrix {
  display: grid;
  grid-template-columns: repeat(10, 20px);
  grid-template-rows: repeat(10, 20px);
  gap: 2px;
}

.p-cell {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.p-cell.in-row {
  background: rgba(59, 130, 246, 0.3);
}

.p-cell.in-col {
  background: rgba(236, 72, 153, 0.3);
}

.p-cell.overlap {
  background: var(--cyan) !important;
  box-shadow: 0 0 6px var(--cyan);
}

.vis-slider-controls {
  display: flex;
  gap: 24px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 2. 雷达数对平面直角网格 */
.vis-radar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.radar-status-bar {
  font-size: 14px;
  color: var(--text-muted);
}
.active-coord {
  color: var(--cyan);
  font-weight: 800;
  font-size: 16px;
}

.radar-screen {
  background: #020617;
  border: 2px solid #0284c7;
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.2);
}

.radar-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.radar-row {
  display: flex;
  gap: 3px;
}

.r-cell {
  width: 28px;
  height: 28px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.r-cell:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: var(--cyan);
}

.r-cell.selected {
  background: var(--cyan) !important;
  box-shadow: 0 0 8px var(--cyan);
}

.r-cell.target-point {
  border-color: #f59e0b;
}

.radar-x-axis {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 6px;
  padding-right: 2px;
}

.axis-title {
  font-size: 11px;
  color: #64748b;
  margin-right: auto;
}

.axis-num {
  width: 28px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

.radar-y-axis {
  position: absolute;
  left: -24px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.axis-num-y {
  height: 28px;
  display: flex;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
}

/* 3. 动态天平 */
.vis-balance-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.balance-formula {
  font-size: 14px;
  color: var(--text-muted);
}

.state-balanced {
  color: var(--cyan);
  font-weight: bold;
}
.state-balanced.success {
  color: var(--emerald);
}

.balance-stage {
  width: 100%;
  max-width: 440px;
}

.scale-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.balance-ops {
  text-align: center;
}

.op-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.op-btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

.btn-op {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.btn-op:hover {
  background: rgba(56, 189, 248, 0.3);
}

.scale-result-log {
  font-size: 13px;
  color: var(--text-muted);
}

/* 4. 多边形几何切割板 */
.vis-polygon-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.polygon-formula-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.polygon-stage {
  width: 100%;
  max-width: 380px;
}

.poly-svg {
  width: 100%;
  height: auto;
}

.poly-btn-area {
  text-align: center;
}

.btn-poly {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 6px;
}

.poly-tip-result {
  font-size: 12.5px;
  color: var(--cyan);
}

/* 5. 植树问题防线 */
.vis-pylon-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pylon-desc {
  font-size: 13.5px;
  color: var(--text-muted);
}

.mode-tag {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.pylon-track-box {
  background: #020617;
  padding: 30px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.3);
  position: relative;
}

.pylon-line {
  height: 4px;
  background: #334155;
  position: relative;
  border-radius: 2px;
}

.track-point {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.track-point.has-pylon {
  background: #6366f1;
  box-shadow: 0 0 10px #6366f1;
  border: 2px solid #fff;
}

.track-point.empty-spot {
  background: #475569;
  border: 2px dashed #94a3b8;
}

.pt-label {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
}

.pylon-math-summary {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
}

/* ===================================================
   视图 3：机甲机库 (Mech Hangar)
   =================================================== */
.hangar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.hangar-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.part-icon {
  font-size: 36px;
  background: rgba(255, 255, 255, 0.05);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.part-info {
  flex: 1;
}

.part-info h4 {
  font-size: 16px;
  margin-bottom: 2px;
}

.part-lv {
  color: var(--amber);
  font-size: 13px;
  margin-left: 6px;
}

.part-unit-link {
  font-size: 11px;
  color: var(--cyan);
  margin-bottom: 4px;
}

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

.btn-upgrade {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}
.btn-upgrade.active {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #000;
}
.btn-upgrade.disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ===================================================
   视图 4：学情透视看板 (Analytics)
   =================================================== */
.analytics-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .analytics-dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.kpi-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 4px;
}

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

.analytics-main-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.mastery-row {
  margin-bottom: 16px;
}

.m-info {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 6px;
}

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

.m-bar-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.diagnostic-panel {
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 18px;
  font-size: 14.5px;
  line-height: 1.8;
  margin-top: 20px;
}

.analytics-actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  justify-content: flex-end;
}

.btn-action-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
}
.btn-action-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ===================================================
   视图 5：错题显微镜 (Mistakes Book)
   =================================================== */
.mistakes-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.empty-mistakes {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.mistake-card {
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
}

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

.m-unit {
  font-size: 11px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--rose);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.m-name {
  font-size: 14px;
  font-weight: 600;
}

.m-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
}

.m-q {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 12px;
  color: #fff;
}

.m-answers {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13.5px;
}

.ans-line.wrong {
  color: #f87171;
  margin-bottom: 4px;
}
.ans-line.right {
  color: #34d399;
}

.m-expl {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.btn-clear-mistake {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--emerald);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.btn-clear-mistake:hover {
  background: var(--emerald);
  color: #000;
}

/* 打印样式适配 */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .game-header, .nav-tab-bar, .analytics-actions {
    display: none !important;
  }
  .app-container {
    padding: 0 !important;
  }
  .analytics-main-panel, .kpi-card {
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  .m-bar-bg {
    background: #eee !important;
  }
  .m-bar-fill {
    background: #333 !important;
  }
}
