/* ═══════════════════════════════════════════════════════════
   浙工大心理学在线实验平台  —  公共样式
   www.cloud-bridge.cn
   ═══════════════════════════════════════════════════════════ */

/* ── CSS 变量 ─────────────────────────────────────────────── */
:root {
  /* 背景 */
  --bg-deep:      #090916;
  --bg-primary:   #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card:      rgba(255,255,255,0.05);

  /* 边框 */
  --border:       rgba(255,255,255,0.10);
  --border-hover: rgba(255,255,255,0.22);

  /* 文字 */
  --text-primary:   #ffffff;
  --text-secondary: rgba(255,255,255,0.70);
  --text-muted:     rgba(255,255,255,0.40);

  /* 强调色 */
  --accent-purple: #a855f7;
  --accent-blue:   #3b82f6;
  --accent-green:  #22c55e;
  --accent-orange: #f97316;
  --accent-cyan:   #06b6d4;

  /* 实验专属色（按 experiments/ 子目录顺序） */
  --exp-01: #a855f7;   /* 速度知觉  */
  --exp-02: #3b82f6;   /* 工作记忆  */
  --exp-03: #22c55e;   /* 注意力分配 */
  --exp-04: #f97316;   /* 预留      */
  --exp-05: #06b6d4;   /* 预留      */

  /* 尺寸 */
  --nav-h:   60px;
  --r-sm:     8px;
  --r-md:    12px;
  --r-lg:    20px;
  --r-xl:    28px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px  rgba(0,0,0,0.25);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.45);

  /* 动效 */
  --tr: 0.2s ease;
  --tr-slow: 0.4s ease;

  /* 字体 */
  --font: 'PingFang SC','Hiragino Sans GB','Microsoft YaHei',
          system-ui,-apple-system,'Helvetica Neue',sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input  { font-family: var(--font); outline: none; }

/* ── 导航栏（实验页共用） ───────────────────────────────────── */
.exp-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(9,9,22,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
}
.exp-nav .back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  transition: var(--tr);
  white-space: nowrap;
  flex-shrink: 0;
}
.exp-nav .back-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.exp-nav .exp-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
}
.exp-nav .progress-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 140px;
  justify-content: flex-end;
}
.exp-nav .progress-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.exp-nav .progress-bar {
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  overflow: hidden;
}
.exp-nav .progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent, var(--accent-purple));
  transition: width 0.4s ease;
}

/* 实验内容区（留出导航栏高度） */
.exp-body {
  padding-top: var(--nav-h);
  height: 100vh;
  overflow: hidden;
}

/* ── 通用按钮 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  transition: transform var(--tr), box-shadow var(--tr), opacity var(--tr);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #6d28d9);
  color: #fff;
  box-shadow: 0 4px 12px rgba(168,85,247,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168,85,247,0.5); }

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

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--r-lg); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--r-sm); }

/* ── 模态框（主页详情） ───────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity var(--tr-slow);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--tr-slow);
  position: relative;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 50%; color: var(--text-muted); font-size: 16px;
  cursor: pointer; transition: var(--tr);
}
.modal-close:hover { background: rgba(255,255,255,0.15); color: var(--text-primary); }
.modal-box h2 { font-size: 20px; margin-bottom: 20px; }
.modal-box h3 { font-size: 14px; color: var(--accent-purple); letter-spacing: 1px; text-transform: uppercase; margin: 20px 0 8px; }
.modal-box p, .modal-box li { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.modal-box ul { padding-left: 18px; }
.modal-box li { margin-bottom: 4px; }

/* ── 标签 ────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ── 实验内页：居中内容卡片 ──────────────────────────────── */
.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.screen.hidden { display: none; }
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 56px;
  max-width: 580px;
  width: 100%;
  text-align: center;
}
.content-card h1 { font-size: 26px; margin-bottom: 12px; }
.content-card .subtitle { color: var(--text-secondary); font-size: 15px; line-height: 1.7; margin-bottom: 32px; }
.content-card .action-row { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }

/* ── 滚动条 ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
