/* ===== 全局基础 ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans SC", "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #eaeaea;
  background: #0b1020;
  display: flex;
  flex-direction: column;
}
.hidden { display: none !important; }
.red { color: #ff6b6b; }
.green { color: #69f36b; }
b { font-weight: 700; }

/* ===== 顶部导航栏（两页通用） ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #111827;
  color: #fff;
  border-bottom: 1px solid #1f2937;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .2px;
}
.nav-buttons { display: flex; gap: 10px; margin-left: auto; }
.nav-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #1f2937;
  color: #e5e7eb;
  cursor: pointer;
  transition: transform .05s ease, background .2s, border-color .2s;
}
.nav-btn:hover { background: #243042; }
.nav-btn:active { transform: translateY(1px); }
.nav-btn.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #fff;
}

/* ===== index 页面相关（保持原有功能；可忽略若未使用） ===== */
.stage {
  position: relative;
  flex: 1;
  background: linear-gradient(135deg, #0b1020 0%, #101a3a 100%);
  min-height: 480px;
}
#game {
  width: 100%;
  height: calc(100vh - 64px); /* 顶栏约 64px */
  display: block;
  cursor: crosshair;
}
.hud {
  position: absolute;
  top: 12px; left: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  backdrop-filter: blur(2px);
  font-size: 14px;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
}
.overlay .card {
  background: #111827;
  border: 1px solid #243042;
  color: #e5e7eb;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.footer {
  padding: 10px 16px;
  color: #9ca3af;
  background: #0c1224;
  border-top: 1px solid #1f2937;
}

/* ===== 反应力页面 ===== */
#reactionMain {
  flex: 1;
  min-height: calc(100vh - 64px);  /* 占满网站可视区（扣掉顶栏） */
  background: #34517c;             /* 蓝色背景 */
  color: #ddd;                      /* 全局灰白字 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.panel {
  width: min(960px, 92vw);
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
  text-align: center;
}

.intro-text {
  line-height: 1.8;
  font-size: 16px;
  margin: 0 0 18px 0;
}

.big-btn {
  padding: 18px 34px;
  font-size: 20px;
  border-radius: 14px;
  border: 1px solid #2563eb;
  background: #3b82f6;
  color: white;
  cursor: pointer;
  transition: transform .05s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 8px 18px rgba(59,130,246,.35);
}
.big-btn:hover { filter: brightness(1.05); }
.big-btn:active { transform: translateY(1px); }

.ghost-btn {
  padding: 12px 18px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
}
.ghost-btn:hover { background: rgba(255,255,255,.07); }

/* 测试舞台区域 */
.test-stage {
  position: relative;
  width: min(1200px, 92vw);
  height: min(720px, calc(100vh - 120px));
  background: rgba(0,0,0,.12);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
}

/* 间隙层：倒计时 + 折线图（仅间隙显示） */
.interval-layer {
  position: relative;
  width: 100%;
  height: 100%; /* 固定高度，避免页面滚动 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #34517c;
}

/* 倒计时数字（大号、灰白） */
.countdown {
  font-size: 64px;            /* ≥ 50px */
  font-weight: 800;
  line-height: 1;

  color: #e5e7eb;             /* 灰白色 */
  text-shadow: 0 4px 12px rgba(0,0,0,.35);
  user-select: none;
}

/* 折线图卡片 */
.chart-card {
   width: 80%;
  max-width: 2000px;
  height: 50%; /* 固定高度 */
  margin-top: 10px;
}
.time-list {
  margin-top: 8px;
  font-size: 14px;
  color: #f3f4f6;
  text-align: left;
  white-space: pre-wrap;
}

/* 刺激物（红→绿的圆） */
.stimulus {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 300px;          /* 更大 */
  height: 300px;
  border-radius: 50%;
  background: red;
  box-shadow: 0 14px 40px rgba(0,0,0,.35), inset 0 0 0 6px rgba(255,255,255,.08);
  cursor: pointer;
  transition: background .08s linear, transform .05s ease;
}
.stimulus:active { transform: scale(.99); }

/* 结果区 */
.result-title { margin: 6px 0 8px; }
.result-text  { margin: 0 0 16px; font-size: 18px; }
.result-actions { display: flex; gap: 10px; justify-content: center; }

/* 小屏优化 */
@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .nav-buttons { width: 100%; justify-content: flex-end; }
  .countdown { font-size: 52px; }
  .stimulus { width: 180px; height: 180px; }
}
.nav-btn.nav-ghost{
  background: transparent;
  border: 1px solid #444;
  color: #bbb;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
}
.nav-btn.nav-ghost:hover{
  color:#fff;
  border-color:#666;
  background: rgba(255,255,255,0.04);
}
.ad-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #111;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-close {
  position: absolute;
  right: 5px;
  top: 5px;
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 1001;
}
