/* ===== GLOBAL ===== */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-surface: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --border: #334155;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: all 0.3s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15,23,42,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
}

.logo-icon {
  font-size: 28px;
  color: var(--primary-light);
  line-height: 1;
}

.logo-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links { display: flex; gap: 8px; }

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-actions { display: flex; gap: 8px; }

.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
}

.btn-primary:hover { box-shadow: 0 4px 16px rgba(79,70,229,0.4); transform: translateY(-1px); }

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

.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }

.btn-lg { padding: 12px 28px; font-size: 16px; border-radius: var(--radius); }

.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-full { width: 100%; justify-content: center; margin-top: 8px; }

/* ===== PAGE SYSTEM ===== */
.page { display: none; padding-top: 64px; min-height: 100vh; }
.page.active { display: block; }

/* ===== HERO ===== */
.hero-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px;
  gap: 60px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79,70,229,0.15), transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
}

.hero-content { flex: 1; }

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(79,70,229,0.15);
  border: 1px solid rgba(79,70,229,0.3);
  border-radius: 100px;
  font-size: 13px;
  color: var(--primary-light);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 600px;
}

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

.hero-visual { flex: 1; min-height: 400px; position: relative; }

.hero-drone-container {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

/* ===== FEATURES ===== */
.features-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(79,70,229,0.15);
}

.feature-icon { font-size: 40px; margin-bottom: 16px; }

.feature-card h3 { font-size: 20px; margin-bottom: 12px; }

.feature-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }

/* ===== LANGUAGES ===== */
.languages-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px;
}

.languages-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.lang-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  cursor: pointer;
  transition: var(--transition);
}

.lang-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

.lang-icon {
  height: 140px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.lang-icon pre {
  background: #1a1a2e;
  padding: 16px;
  border-radius: 6px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lang-icon code { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

.lang-blockly {
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
}

.block {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  width: fit-content;
}

.block-motion { background: #4a90d9; }
.block-control { background: #f5a623; }
.block-sensor { background: #7ed321; }

.lang-python { background: #1a1a2e; }
.lang-cpp { background: #1a1a2e; }

.lang-card h3 { font-size: 18px; margin-bottom: 8px; }
.lang-card p { color: var(--text-secondary); font-size: 14px; }

/* ===== PARTNERS ===== */
.partners-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

.partners-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.partner-badge {
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.partner-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== SIMULATOR ===== */
.simulator-layout {
  display: flex;
  height: 100vh;
  padding-top: 64px;
  box-sizing: border-box;
}

.simulator-controls {
  width: 320px;
  min-width: 260px;
  max-width: 320px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

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

.controls-header h2 { font-size: 18px; }

.sim-status {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--success);
  color: white;
}

.sim-status.idle { background: var(--text-muted); }
.sim-status.flying { background: var(--success); animation: pulse 1.5s ease infinite; }
.sim-status.error { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.control-group h3 {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.track-selector, .view-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.track-btn, .view-btn {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.track-btn:hover, .track-btn.active,
.view-btn:hover, .view-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.flight-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.ctrl-btn {
  padding: 10px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-family: inherit;
}

.ctrl-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.sim-info {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 12px;
}

.info-label { color: var(--text-muted); }
.info-value { font-weight: 600; color: var(--accent); }

.simulator-viewport {
  flex: 1;
  position: relative;
  background: #0a0a1a;
  overflow: hidden;
}

.viewport-overlay {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: var(--text-muted);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 12px;
  z-index: 10;
  pointer-events: none;
}

/* ===== COMPETITION DASHBOARD (赛事级仪表盘) ===== */
.comp-dashboard {
  background: linear-gradient(135deg, #1a1a3e 0%, #16213e 100%);
  border: 1px solid rgba(79, 70, 229, 0.3);
  border-radius: var(--radius);
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.comp-dashboard::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4f46e5, #06b6d4, transparent);
}

.comp-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comp-dash-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: #e0e7ff;
  letter-spacing: 0.5px;
}

.comp-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 6px;
}

.dash-item {
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
}

.dash-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-bottom: 1px;
}

.dash-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #e2e8f0;
}

.dash-timer .dash-value { color: #06b6d4; }
.dash-lap .dash-value { color: #a78bfa; }
.dash-score .dash-value { color: #22c55e; }
.dash-penalty .dash-value { color: #ef4444; }

/* 检查点进度条 */
.cp-progress-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.cp-progress-label {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
}

.cp-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.cp-progress-track::after {
  content: '';
  position: absolute;
  top: 0; left: 0; height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.cp-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  font-family: 'Courier New', monospace;
  min-width: 32px;
  text-align: right;
}

/* 比赛操作按钮 */
.comp-actions {
  display: flex;
  gap: 4px;
}

.comp-btn {
  flex: 1;
  padding: 5px 8px;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.comp-btn-start {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  box-shadow: 0 2px 10px rgba(79,70,229,0.3);
}

.comp-btn-start:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(79,70,229,0.4); }
.comp-btn-start:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.comp-btn-reset {
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.1);
}

.comp-btn-reset:hover { background: rgba(255,255,255,0.15); color: #e2e8f0; }

/* 状态 - 比赛模式 */
.sim-status.racing {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  animation: pulse 0.8s ease infinite;
}

.sim-status.finished {
  background: linear-gradient(135deg, #f59e0b, #22c55e);
}

/* ===== 飞行控制增强 ===== */
.flight-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.ctrl-btn {
  padding: 8px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  font-family: inherit;
  user-select: none;
}

.ctrl-btn:hover {
  background: rgba(79,70,229,0.25);
  border-color: rgba(79,70,229,0.4);
  transform: scale(1.05);
}

.ctrl-btn:active {
  background: rgba(79,70,229,0.4);
  transform: scale(0.95);
}

.ctrl-empty { visibility: hidden; }

.ctrl-takeoff { color: #22c55e; }
.ctrl-land { color: #ef4444; }
.ctrl-reset { color: #f59e0b; }
.ctrl-trail { color: #818cf8; }
.ctrl-trail.trail-active { background: rgba(79,70,229,0.25); border-color: rgba(79,70,229,0.5); color: #a5b4fc; }
.ctrl-trail.trail-off { color: #64748b; opacity: 0.6; }
.ctrl-up { color: #06b6d4; }
.ctrl-down { color: #06b6d4; }
.ctrl-rotate-l { color: #a78bfa; }
.ctrl-rotate-r { color: #a78bfa; }

/* ===== 3D 视口 HUD 叠加 ===== */
.race-hud {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 20;
}

.hud-timer {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Courier New', monospace;
  font-size: 42px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 0 30px rgba(6,182,212,0.5), 0 2px 10px rgba(0,0,0,0.8);
  letter-spacing: 3px;
}

.hud-cp-progress {
  position: absolute;
  bottom: 40px;
  left: 10%;
  right: 10%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.hud-cp-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #22c55e);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.hud-score {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: 700;
  color: rgba(34,197,94,0.9);
  text-shadow: 0 0 20px rgba(34,197,94,0.3);
}

/* ===== 比赛结果弹窗 ===== */
.race-result-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.race-result-card {
  background: linear-gradient(135deg, #1e1e3f 0%, #1a1a3e 100%);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 20px;
  padding: 36px 48px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  animation: resultSlideIn 0.4s ease;
}

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

.race-result-icon {
  font-size: 64px;
  margin-bottom: 8px;
  animation: trophyPulse 1.5s ease infinite;
}

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

.race-result-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffd700, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.race-result-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.race-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  font-size: 15px;
}

.race-stat .stat-label { color: #94a3b8; }
.race-stat .stat-value { font-weight: 700; color: #e2e8f0; font-family: 'Courier New', monospace; }
.race-stat.penalty .stat-value { color: #ef4444; }

.race-result-card .comp-btn-start {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

/* ===== 赛道上信息增强 ===== */
.track-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.track-btn:hover, .track-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.edit-track-btn {
  font-size: 12px;
}

/* ===== EDITOR ===== */
.editor-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.editor-tabs { display: flex; gap: 4px; }

.editor-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.editor-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.editor-tab.active { color: var(--text); background: rgba(255,255,255,0.08); }

.editor-actions { display: flex; gap: 6px; align-items: center; }

/* ===== Connection Mode Toggle ===== */
.connection-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 4px;
}

.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.toggle-btn:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
}

.toggle-btn.active {
  color: var(--text);
  background: var(--bg-surface);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.toggle-btn.active[data-mode="hardware"] {
  color: var(--accent);
}

.toggle-icon { font-size: 14px; }

.editor-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ===== 左编程区 ===== */
.editor-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 400px;
  min-height: 0;
}

.editor-left-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 12px 0;
  background: #1a1a2a;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.left-tab {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  font-family: inherit;
}

.left-tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.left-tab.active { color: var(--text); background: #1e1e2e; border: 1px solid rgba(255,255,255,0.06); border-bottom-color: #1e1e2e; }

.editor-area {
  flex: 1;
  display: none;
  position: relative;
  min-height: 0;
}

.editor-area.active {
  display: flex;
  flex-direction: column;
}

#blocklyDiv {
  flex: 1;
  background: #1e1e1e;
  min-height: 0;
}

#monacoDiv {
  flex: 1;
  min-height: 0;
}

/* 运行按钮条 */
.editor-runbar {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: #1a1a2a;
  border-top: 1px solid rgba(255,255,255,0.06);
  gap: 6px;
}

.editor-run-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== 右仿真区 ===== */
.editor-right {
  width: 420px;
  min-width: 380px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg);
}

.editor-sim-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.editor-sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15,23,42,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.editor-sim-header h3 { font-size: 14px; font-weight: 600; }

.badge-status {
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-status.running { background: var(--success); color: white; }
.badge-status.stopped { background: var(--text-muted); color: white; }

.editor-sim-viewport {
  flex: 1;
  background: #0a0a1a;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

/* 仿真快捷控制条 */
.editor-sim-controls {
  display: flex;
  justify-content: center;
  gap: 3px;
  padding: 6px 8px;
  background: rgba(15,23,42,0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.editor-sim-controls .ctrl-btn {
  width: 36px;
  height: 32px;
  padding: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

/* 输出日志 */
.editor-output {
  height: 180px;
  min-height: 120px;
  background: rgba(15,23,42,0.95);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
}

.editor-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.output-log {
  flex: 1;
  padding: 6px 14px;
  overflow-y: auto;
  font-size: 12px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.log-entry { padding: 2px 0; white-space: nowrap; }

.log-entry.log-info { color: var(--info); }
.log-entry.log-success { color: var(--success); }
.log-entry.log-error { color: var(--danger); }
.log-entry.log-warn { color: var(--warning); }

/* ===== COMPETITION ===== */
.competition-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comp-header-content h1 { font-size: 32px; margin-bottom: 8px; }
.comp-header-content p { color: var(--text-secondary); }

.competition-tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.comp-tab {
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-family: inherit;
}

.comp-tab:hover { color: var(--text); }
.comp-tab.active { color: var(--primary-light); border-bottom-color: var(--primary-light); }

.competition-list {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.competition-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: var(--transition);
}

.competition-card:hover { border-color: var(--primary); }
.competition-card.featured { border-color: var(--primary); }

.comp-card-badge {
  position: absolute;
  top: -1px;
  right: 24px;
  padding: 4px 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 0 0 8px 8px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.comp-card-header { margin-bottom: 12px; }

.comp-card-header h3 { font-size: 18px; margin-bottom: 8px; }

.comp-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.comp-card-body { margin-bottom: 16px; }

.comp-prize {
  font-size: 15px;
  font-weight: 600;
  color: var(--warning);
  margin-bottom: 8px;
}

.comp-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.comp-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(79,70,229,0.12);
  color: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.2);
}

.comp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.countdown-label { font-size: 12px; color: var(--text-muted); display: block; }
.countdown-value { font-size: 16px; font-weight: 700; color: var(--accent); }

/* ===== RANKING ===== */
.ranking-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ranking-header h1 { font-size: 32px; }

.ranking-filters { display: flex; gap: 8px; }

.rank-filter {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.ranking-table-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.ranking-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
}

.ranking-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.ranking-table td {
  padding: 14px 16px;
  background: var(--bg-card);
  font-size: 14px;
}

.ranking-table tr td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.ranking-table tr td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.ranking-table tr:hover td { background: rgba(79,70,229,0.06); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
}

.rank-badge.gold { background: linear-gradient(135deg, #f59e0b, #f97316); color: white; }
.rank-badge.silver { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.rank-badge.bronze { background: linear-gradient(135deg, #d97706, #92400e); color: white; }

.player-cell { font-weight: 600; }
.player-avatar { margin-right: 8px; }

.score-cell { font-weight: 700; color: var(--accent); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 20px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body { padding: 24px; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.footer-brand { flex: 1; }
.footer-brand .logo-icon { font-size: 24px; }
.footer-brand span { font-size: 18px; font-weight: 700; }
.footer-brand p { color: var(--text-muted); font-size: 13px; margin-top: 8px; }

.footer-links { display: flex; gap: 48px; }

.footer-col h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .simulator-layout { flex-direction: column; }
  .simulator-controls { width: 100%; min-width: auto; border-right: none; border-bottom: 1px solid var(--border); max-height: 300px; }
  .editor-sidebar { display: none; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-actions .btn { padding: 6px 12px; font-size: 12px; }
  .mobile-menu-btn { display: block; }
  .hero-section { flex-direction: column; padding: 40px 16px; }
  .hero-actions { flex-direction: column; }
  .hero-visual { min-height: 250px; }
  .editor-tabs { overflow-x: auto; }
  .footer-content { flex-direction: column; }
  .footer-links { flex-wrap: wrap; gap: 24px; }
  .competition-header { flex-direction: column; gap: 16px; align-items: flex-start; }
  .ranking-header { flex-direction: column; gap: 16px; align-items: flex-start; }
  .ranking-filters { width: 100%; }
  .rank-filter { flex: 1; }
  .editor-right { width: 100%; min-width: 0; }
  .editor-left { min-width: 0; }
  .editor-main { flex-direction: column; }
}

/* ===== ADMIN GEAR ===== */
.admin-gear {
  font-size: 18px !important;
  padding: 8px 10px !important;
  line-height: 1;
}

/* ===== 3D TRACK EDITOR (Ardot Design) ===== */
.editor3d-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  background: #0F0F23;
  overflow: hidden;
}

/* 顶栏 */
.editor3d-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  min-height: 56px;
  padding: 0 20px;
  background: #1E1C35;
  border-bottom: 1px solid rgba(76, 29, 149, 0.5);
}

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

.editor3d-logo {
  font-family: 'Russo One', sans-serif;
  font-size: 22px;
  color: #E2E8F0;
  letter-spacing: 0.5px;
}

.editor3d-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor3d-name-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  color: #94A3B8;
  white-space: nowrap;
}

.editor3d-name-input {
  width: 170px;
  height: 34px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #27273B;
  color: #E2E8F0;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.editor3d-name-input:focus {
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.4);
}

.editor3d-name-input::placeholder {
  color: #94A3B8;
}

.editor3d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 34px;
  border-radius: 4px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.editor3d-btn-primary {
  background: #7C3AED;
  color: #FFFFFF;
  border: none;
}

.editor3d-btn-primary:hover {
  background: #6D28D9;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.editor3d-btn-outline {
  background: #27273B;
  color: #E2E8F0;
  border: 1px solid #4C1D95;
}

.editor3d-btn-outline:hover {
  border-color: #7C3AED;
  color: #A78BFA;
}

.editor3d-btn-new {
  background: transparent;
  color: #A78BFA;
  border: 1px dashed #4C1D95;
}

.editor3d-btn-new:hover {
  border-color: #7C3AED;
  background: rgba(124, 58, 237, 0.1);
}

/* 主体区 */
.editor3d-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左侧工具栏 */
.editor3d-toolbar {
  display: flex;
  flex-direction: column;
  width: 56px;
  min-width: 56px;
  padding: 12px 0;
  background: #1E1C35;
  border-right: 1px solid rgba(76, 29, 149, 0.3);
  align-items: center;
  gap: 4px;
}

.editor3d-tool-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: #1E1C35;
  color: #94A3B8;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Chakra Petch', sans-serif;
}

.editor3d-tool-btn:hover {
  background: #27273B;
  color: #E2E8F0;
}

.editor3d-tool-btn.active {
  background: #27273B;
  color: #7C3AED;
  box-shadow: inset 0 0 0 1px #7C3AED;
}

/* 3D 视口 */
.editor3d-viewport {
  flex: 1;
  position: relative;
  background: #0F0F23;
  overflow: hidden;
}

.editor3d-viewport canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.editor3d-viewport-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  color: #94A3B8;
  opacity: 0.5;
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
  z-index: 10;
}

/* 右侧面板 */
.editor3d-rightpanel {
  width: 280px;
  min-width: 280px;
  background: #1E1C35;
  border-left: 1px solid rgba(76, 29, 149, 0.3);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.editor3d-panel-section {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(76, 29, 149, 0.2);
}

.editor3d-panel-title {
  font-family: 'Russo One', sans-serif;
  font-size: 15px;
  color: #E2E8F0;
  margin-bottom: 4px;
}

.editor3d-panel-subtitle {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #A78BFA;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.editor3d-panel-divider {
  height: 1px;
  background: #4C1D95;
  margin: 8px 0;
}

.editor3d-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #27273B;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 600;
}

.editor3d-proplist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
}

/* 属性列表项 */
.prop-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0F0F23;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
}

.prop-list-item:hover {
  border-color: #7C3AED;
}

.prop-list-item.active {
  border-color: #7C3AED;
  background: rgba(124, 58, 237, 0.15);
}

.prop-list-dot {
  font-size: 10px;
  line-height: 1;
}

.prop-list-label {
  flex: 1;
  color: #E2E8F0;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 500;
}

.prop-list-coord {
  color: #94A3B8;
  font-family: monospace;
  font-size: 11px;
}

/* 属性面板详情 */
.editor3d-properties {
  min-height: 100px;
}

.prop-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  color: #94A3B8;
  text-align: center;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
}

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

.prop-section {
  margin-bottom: 8px;
}

.prop-section-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #E2E8F0;
}

.prop-section-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #A78BFA;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prop-divider {
  height: 1px;
  background: #4C1D95;
  margin: 8px 0;
}

.prop-xyz-row {
  display: flex;
  gap: 6px;
}

.prop-xyz-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prop-xyz-field label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11px;
  color: #94A3B8;
  font-weight: 600;
}

.prop-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 4px;
  background: #27273B;
  color: #E2E8F0;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  outline: none;
}

.prop-input:focus {
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.4);
}

.prop-type-selector {
  display: flex;
  gap: 8px;
}

.prop-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 6px;
  background: #27273B;
  color: #E2E8F0;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  border: 1px solid #4C1D95;
}

.prop-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #EF4444;
  color: #FFFFFF;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.prop-delete-btn:hover {
  background: #DC2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* 检查点类型副工具栏 */
.editor3d-subtoolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  background: #1E1C35;
  border-right: 1px solid rgba(76, 29, 149, 0.3);
  border-top: 1px solid rgba(76, 29, 149, 0.15);
  width: 56px;
  min-width: 56px;
}

.editor3d-subtool-btn {
  width: 36px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94A3B8;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor3d-subtool-btn:hover {
  background: #27273B;
}

.editor3d-subtool-btn.active {
  background: rgba(124, 58, 237, 0.2);
  color: #A78BFA;
  box-shadow: inset 0 0 0 1px #7C3AED;
}

/* 朝向切换按钮 */
.prop-orientation-toggle {
  display: flex;
  gap: 6px;
}

.prop-orientation-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #4C1D95;
  background: transparent;
  color: #94A3B8;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.prop-orientation-btn:hover {
  color: #E2E8F0;
  background: rgba(255,255,255,0.04);
}

.prop-orientation-btn.active {
  background: rgba(124, 58, 237, 0.2);
  color: #A78BFA;
  border-color: #7C3AED;
}

/* 编辑���底部按钮 */
.editor3d-panel-actions {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  border-top: 1px solid rgba(76, 29, 149, 0.2);
}

/* 赛道列表浮层 */
.editor3d-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.editor3d-overlay-content {
  background: #1E1C35;
  border: 1px solid #4C1D95;
  border-radius: 12px;
  width: 420px;
  max-width: 90vw;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.editor3d-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(76, 29, 149, 0.3);
}

.editor3d-overlay-header h3 {
  font-family: 'Russo One', sans-serif;
  font-size: 18px;
  color: #E2E8F0;
}

.editor3d-overlay-close {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.editor3d-overlay-close:hover {
  color: #E2E8F0;
}

.editor3d-overlay .track-list {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 难度选择器（保留原有样式名，颜色适配 3D 主题） */
.editor3d-panel-section .difficulty-selector {
  display: flex;
  gap: 4px;
}

.editor3d-panel-section .diff-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #4C1D95;
  background: transparent;
  color: #94A3B8;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Chakra Petch', sans-serif;
  text-align: center;
}

.editor3d-panel-section .diff-btn:hover {
  color: #E2E8F0;
  background: rgba(255,255,255,0.04);
}

.editor3d-panel-section .diff-btn.active[data-difficulty="beginner"] {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  border-color: #22c55e;
}

.editor3d-panel-section .diff-btn.active[data-difficulty="intermediate"] {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  border-color: #f59e0b;
}

.editor3d-panel-section .diff-btn.active[data-difficulty="advanced"] {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  border-color: #ef4444;
}

/* ===== ADMIN DASHBOARD ===== */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.admin-header {
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.admin-desc {
  color: var(--text-secondary);
  font-size: 15px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.admin-tab {
  padding: 10px 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-family: inherit;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary-light);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.admin-stats strong {
  color: var(--text);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.admin-table td {
  padding: 12px 14px;
  background: var(--bg-card);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.admin-table tr:hover td {
  background: rgba(79,70,229,0.04);
}

.admin-user-avatar {
  font-size: 22px;
  display: inline-block;
  line-height: 1;
}

.admin-user-name {
  font-weight: 600;
}

.admin-role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.admin-role-badge.role-学生 {
  background: rgba(6,182,212,0.12);
  color: var(--accent);
  border: 1px solid rgba(6,182,212,0.2);
}

.admin-role-badge.role-教师 {
  background: rgba(79,70,229,0.12);
  color: var(--primary-light);
  border: 1px solid rgba(79,70,229,0.2);
}

.admin-role-badge.role-管理员 {
  background: rgba(245,158,11,0.12);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.2);
}

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

.admin-track-name {
  font-weight: 600;
}

.admin-diff-badge {
  font-weight: 600;
  font-size: 13px;
}

/* 赛事配置表单 */
.admin-comp-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-comp-row {
  display: flex;
  gap: 24px;
}

.admin-comp-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-comp-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.admin-checkbox-group {
  display: flex;
  gap: 16px;
  padding: 8px 0;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.admin-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.admin-comp-actions {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.edit-track-btn {
  font-size: 12px;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}

.edit-track-btn:hover {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* ===== RESPONSIVE for 3D Track Editor & Admin ===== */
@media (max-width: 1024px) {
  .editor3d-body { flex-direction: column; }
  .editor3d-toolbar { width: 100%; min-width: auto; flex-direction: row; padding: 4px 8px; border-right: none; border-bottom: 1px solid rgba(76, 29, 149, 0.3); justify-content: center; }
  .editor3d-rightpanel { width: 100%; min-width: auto; border-left: none; border-top: 1px solid rgba(76, 29, 149, 0.3); max-height: 300px; }
  .editor3d-topbar { flex-wrap: wrap; height: auto; padding: 8px 16px; gap: 8px; }
  .editor3d-topbar-right { flex-wrap: wrap; }
  .editor3d-name-input { width: 120px; }
  .admin-comp-row { flex-direction: column; }
}

@media (max-width: 768px) {
  .admin-header h1 { font-size: 22px; }
  .admin-tabs { overflow-x: auto; }
  .admin-tab { white-space: nowrap; }
  .admin-comp-form { padding: 16px; }
}
