:root {
  --bg: #0d1117;
  --card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #238636;
  --accent-hover: #2ea043;
  --danger: #da3633;
  --danger-hover: #f85149;
  --warning: #d29922;
  --info: #58a6ff;
  --blue: #2f81f7;
  --blue-hover: #388bfd;
}

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

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: 32px;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #0d1117;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* ==================== 顶部导航 ==================== */
.navbar {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #161b22;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.nav-brand svg {
  color: var(--info);
  flex-shrink: 0;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab-btn.active {
  color: #58a6ff;
  background: rgba(88, 166, 255, 0.12);
  border-color: rgba(88, 166, 255, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-pip-btn {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
  white-space: nowrap;
}

.nav-pip-btn:hover {
  background: #30363d;
  color: #fff;
}

/* ==================== 页面布局与基础卡片 ==================== */
.wrapper {
  width: 100%;
  max-width: 1340px;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 20px;
  margin: 18px auto 0;
  padding: 0 16px;
}

.card {
  min-width: 0;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  overflow: hidden;
}

h2 {
  font-size: 15px;
  margin-bottom: 14px;
  color: #fff;
  font-weight: 600;
}

.video-container {
  position: relative;
  background: #05070a;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  min-height: 220px;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.screen-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 14px;
  background: radial-gradient(circle at center, #101623 0%, #05070a 100%);
  user-select: none;
}

.monitor-icon {
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.25);
  flex-shrink: 0;
}

.placeholder-title {
  font-size: 13px;
  color: #8b949e;
  margin-bottom: 6px;
  line-height: 1.5;
}

.placeholder-sub {
  font-size: 14px;
  color: #fff;
  font-weight: bold;
  margin-bottom: 8px;
  line-height: 1.5;
}

.badge-rec {
  color: #3fb950;
  font-size: 12px;
  font-weight: normal;
  background: rgba(63, 185, 80, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 4px;
  display: inline-block;
}

.badge-warn {
  color: #d29922;
  font-weight: bold;
}

.placeholder-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.btn-center-screen {
  background: #3b82f6;
  border: 1px solid #60a5fa;
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: all 0.2s ease;
}

.btn-center-screen:hover:not(:disabled) {
  background: #2563eb;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5);
}

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

.btn-center-screen:disabled {
  background: #21262d;
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.placeholder-footer {
  position: absolute;
  bottom: 10px;
  font-size: 11px;
  color: #484f58;
}

.field {
  margin-bottom: 15px;
}

label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  background: #090d13;
  border: 1px solid var(--border);
  color: #fff;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--info);
}

.action-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #21262d;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:disabled {
  background: #21262d;
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.test-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.btn-test {
  font-size: 13px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.btn-test-lie {
  background: #3c1417;
  border-color: #632327;
  color: #ff9999;
}

.btn-test-lie:hover {
  background: #4f1b1f;
  color: #ffffff;
}

.btn-test-dc {
  background: #142841;
  border-color: #204169;
  color: #8cc4ff;
}

.btn-test-dc:hover {
  background: #1b3557;
  color: #ffffff;
}

.btn-pip {
  background: #21262d;
  border: 1px solid var(--border);
  color: #c9d1d9;
  font-size: 13px;
  padding: 11px 18px;
  border-radius: 8px;
}

.btn-pip:hover {
  background: #30363d;
  color: #fff;
}

/* 默认通用数据统计栅格 */
.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stat-item {
  background: #090d13;
  padding: 10px 6px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-val {
  font-size: 15px;
  font-weight: bold;
  color: var(--info);
  font-variant-numeric: tabular-nums;
}

.stat-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.alarm-banner {
  display: none;
  margin-top: 16px;
  padding: 14px;
  border-radius: 6px;
  background: rgba(218, 54, 51, 0.15);
  border: 1px solid var(--danger);
  text-align: center;
  color: #ff7b72;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.pill-green {
  background: rgba(35, 134, 54, 0.25);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.pill-yellow {
  background: rgba(210, 153, 34, 0.25);
  color: #d29922;
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.pill-red {
  background: rgba(218, 54, 51, 0.25);
  color: #ff7b72;
  border: 1px solid rgba(218, 54, 51, 0.3);
}

/* ==================== 教程区域 ==================== */
.tutorial-card {
  grid-column: 1 / -1;
  margin-top: 8px;
  background: #161b22;
  border: 1px solid #30363d;
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #21262d;
  padding-bottom: 12px;
  margin-bottom: 18px;
  gap: 10px;
}

.tutorial-header h2 {
  margin-bottom: 0;
  font-size: 16px;
  color: #f0f6fc;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tutorial-box {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 18px 20px;
}

.tutorial-box h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #21262d;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: #e6edf3;
  line-height: 1.65;
}

.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
}

.step-num.android {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
  border: 1px solid #238636;
}

.step-num.ios {
  background: rgba(88, 166, 255, 0.2);
  color: #58a6ff;
  border: 1px solid #1f6feb;
}

.step-text strong {
  color: #ffffff;
  font-weight: 600;
}

.code-tag {
  background: #0d1117;
  border: 1px solid #38bdf8;
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

/* ==================== 模态弹窗 ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 16px;
}

.modal-content {
  background: #161b22;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 440px;
  max-width: 100%;
  padding: 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.modal-title {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-err {
  font-size: 12px;
  color: #ff7b72;
  min-height: 18px;
  margin-top: 8px;
  margin-bottom: 12px;
}

/* ===================================================
   【核心美化】经验统计大屏与折线图看板强化
   =================================================== */

/* 1. 大屏主容器：渐变底色与顶部微光饰条 */
#experienceScreen {
  background: linear-gradient(180deg, #161b22 0%, #0d1117 100%) !important;
  border: 1px solid #30363d !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
  padding: 22px !important;
  position: relative;
  overflow: hidden;
}

#experienceScreen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8 25%, #3fb950 75%, transparent);
  opacity: 0.85;
}

#experienceScreen h2 {
  font-size: 17.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
}

/* 2. 统计大屏操作胶囊按钮 */
#experienceScreen .btn-secondary {
  background: #21262d !important;
  border: 1px solid #363c45 !important;
  color: #c9d1d9 !important;
  border-radius: 20px !important;
  padding: 5px 14px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#experienceScreen .btn-secondary:hover:not(:disabled) {
  background: #30363d !important;
  color: #ffffff !important;
  border-color: #58a6ff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.2) !important;
}

#experienceScreen .btn-secondary:disabled {
  background: #161b22 !important;
  border-color: #21262d !important;
  color: #484f58 !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

/* 3. 经验目标设定盒 */
.exp-goal-box {
  background: rgba(9, 13, 19, 0.85) !important;
  border: 1px solid rgba(48, 54, 61, 0.75) !important;
  border-radius: 10px !important;
  padding: 14px 18px !important;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.exp-goal-box input[type="number"] {
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  border-radius: 8px !important;
  color: #38bdf8 !important;
  font-family: ui-monospace, SFMono-Regular, monospace !important;
  font-weight: 700 !important;
  padding: 7px 12px !important;
  transition: all 0.2s ease;
}

.exp-goal-box input[type="number"]:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25) !important;
}

#experienceGoalSave {
  background: #238636 !important;
  border: 1px solid #2ea043 !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 7px 16px !important;
  transition: all 0.2s ease !important;
}

#experienceGoalSave:hover {
  background: #2ea043 !important;
  box-shadow: 0 4px 14px rgba(46, 160, 67, 0.35) !important;
}

/* 目标经验进度条霓虹流光渐变 */
#experienceGoalProgress {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: #0d1117;
  border-radius: 6px;
  overflow: hidden;
  height: 8px !important;
  margin-top: 12px !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

#experienceGoalProgress::-webkit-progress-bar {
  background-color: #0d1117;
  border-radius: 6px;
}

#experienceGoalProgress::-webkit-progress-value {
  background: linear-gradient(90deg, #388bfd 0%, #3fb950 100%);
  box-shadow: 0 0 10px rgba(63, 185, 80, 0.65);
  border-radius: 6px;
  transition: width 0.35s ease;
}

#experienceGoalProgress::-moz-progress-bar {
  background: linear-gradient(90deg, #388bfd 0%, #3fb950 100%);
  border-radius: 6px;
}

/* 4. 统计大屏 6 大核心指标卡片 */
#experienceScreen .stats {
  gap: 12px !important;
}

#experienceScreen .stat-item {
  background: #090d13 !important;
  border: 1px solid #21262d !important;
  border-radius: 10px !important;
  padding: 14px 10px !important;
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#experienceScreen .stat-item:hover {
  transform: translateY(-2px);
  border-color: #388bfd !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55) !important;
}

/* 每个卡片顶部的精巧主题高光条 */
#experienceScreen .stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
}

#experienceScreen .stat-item:nth-child(1)::before { background: #e6edf3; } /* 当前经验: 纯白 */
#experienceScreen .stat-item:nth-child(2)::before { background: #38bdf8; } /* 经验进度: 天蓝 */
#experienceScreen .stat-item:nth-child(3)::before { background: #3fb950; } /* 累计净增: 鲜绿 */
#experienceScreen .stat-item:nth-child(4)::before { background: #d29922; } /* 近10分净增: 金橙 */
#experienceScreen .stat-item:nth-child(5)::before { background: #58a6ff; } /* 预估时速: 亮蓝 */
#experienceScreen .stat-item:nth-child(6)::before { background: #ff7b72; } /* 预计升级: 珊瑚红 */

#experienceScreen .stat-val {
  font-family: ui-monospace, "SF Pro Display", SFMono-Regular, monospace !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

#experienceScreen .stat-desc {
  font-size: 11.5px !important;
  color: #8b949e !important;
  font-weight: 500 !important;
  margin-top: 5px !important;
}

/* 5. 折线图外层卡片框体 */
#experienceChart {
  border-radius: 8px !important;
  background: #080c14 !important;
  border: 1px solid #21262d !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6) !important;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 992px) {
  .wrapper {
    grid-template-columns: 1fr;
    margin: 14px auto 0;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 12px 14px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    overflow: hidden;
  }

  .nav-brand {
    font-size: 15px;
    justify-content: center;
    width: 100%;
    max-width: 100%;
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #090d13;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 4px;
  }

  .nav-tab-btn {
    justify-content: center;
    padding: 8px 0;
    font-size: 13px;
    border-radius: 6px;
  }

  .nav-tab-btn.active {
    background: #21262d;
    color: #58a6ff;
    border-color: rgba(88, 166, 255, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }

  .nav-actions {
    display: none;
  }

  .wrapper {
    padding: 0 10px;
    margin-top: 10px;
    max-width: 100%;
  }

  .card {
    padding: 14px;
    max-width: 100%;
  }

  .video-container {
    aspect-ratio: 16 / 9;
    min-height: 190px;
  }

  .btn-center-screen {
    font-size: 13px;
    padding: 8px 18px;
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .placeholder-footer {
    font-size: 10px;
  }

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

  .stat-item:last-child:nth-child(odd) {
    grid-column: span 2;
  }

  .stat-item {
    padding: 8px 6px;
  }

  .stat-val {
    font-size: 14px;
  }

  .tutorial-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tutorial-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tutorial-header h2 {
    font-size: 14px;
    line-height: 1.5;
  }

  .tutorial-box {
    padding: 14px;
  }

  .step-item {
    font-size: 12.5px;
  }

  .modal-content {
    padding: 18px;
  }

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

  .modal-desc {
    font-size: 12px;
  }

  /* 移动端统计大屏适配微调 */
  #experienceScreen {
    padding: 14px !important;
  }

  #experienceScreen .stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  #experienceScreen .stat-item {
    padding: 10px 8px !important;
  }

  #experienceScreen .stat-val {
    font-size: 15px !important;
  }
}

@media (max-width: 480px) {
  .test-btn-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}