* { box-sizing: border-box; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  margin: 0;
  background: #f7f7f8;
  color: #1f1f1f;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}
header h1 { font-size: 20px; margin: 0; }
.current-task-float { position: fixed; z-index: 9000; right: 18px; top: 82px; width: 240px; padding: 12px 14px; background: rgba(255,255,255,.97); border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 8px 28px rgba(15,23,42,.16); color: #334155; font-size: 13px; }
.current-task-float-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.current-task-float .progress-bar { height: 7px; margin: 0; }
.current-task-float .progress-fill { background: #2563eb; }
.current-task-float-section + .current-task-float-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
@media(max-width:760px){header{flex-wrap:wrap;gap:10px}.current-task-float{right:10px;top:auto;bottom:12px;width:210px}}
.link { color: #2563eb; text-decoration: none; font-size: 14px; }
.link:hover { text-decoration: underline; }

main { max-width: 960px; margin: 0 auto; padding: 24px 16px 80px; }
.subtitle { color: #666; margin-top: 0; }

h2 { margin: 28px 0 12px; font-size: 17px; color: #333; }

/* 任务卡片 */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.task-card {
  background: #fff; border: 1px solid #e5e5e5; border-radius: 10px;
  padding: 14px 16px; cursor: pointer; transition: box-shadow .15s, transform .1s;
}
.task-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.task-card.disabled { opacity: .55; cursor: not-allowed; }
.task-card.disabled:hover { box-shadow: none; transform: none; }
.task-id { font-weight: 700; color: #2563eb; font-size: 13px; letter-spacing: .3px; }
.task-name { margin: 6px 0 10px; font-size: 15px; line-height: 1.35; }
.task-meta { margin-bottom: 8px; }
.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: #eef2ff; color: #3730a3; margin-right: 6px;
}
.task-status { font-size: 12px; color: #888; }
.task-retest-btn { margin-top: 10px; padding: 6px 12px; border: 1px solid #2563eb; border-radius: 7px; background: #fff; color: #2563eb; font-size: 13px; cursor: pointer; }
.task-retest-btn:hover { background: #eff6ff; }
.btn-link.btn-danger { color: #dc2626; border-color: #fecaca; }
.btn-link.btn-danger:hover { background: #fef2f2; }

/* 介绍/准备屏 */
.screen { max-width: 640px; margin: 40px auto 0; background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 28px 30px; }
.screen h2 { margin-top: 0; }
.screen p { line-height: 1.7; color: #333; }
.screen .qtitle { font-size: 18px; font-weight: 700; color: #111; }
.btn {
  display: inline-block; margin-top: 18px; padding: 11px 26px; font-size: 15px;
  background: #2563eb; color: #fff; border: none; border-radius: 8px; cursor: pointer;
}
.btn:hover:not(:disabled) { background: #1d4ed8; }

/* 刺激舞台 */
.stim-stage {
  position: relative; height: 420px; background: #111; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.stim-placeholder { color: #cbd5e1; font-size: 22px; text-align: center; }
.hint { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #94a3b8; font-size: 14px; }
.hint b { color: #fff; }
.cue {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(239, 68, 68, .85); opacity: 0; pointer-events: none;
  transition: opacity .04s;
}
.cue.show { opacity: 1; }

/* 结果页 */
.container { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; }
.toolbar { margin: 16px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar select { padding: 6px 10px; font-size: 14px; }
.toolbar button { padding: 7px 16px; font-size: 14px; cursor: pointer; border: 1px solid #ccc; border-radius: 6px; background: #fff; }
.toolbar button:hover { background: #f4f4f4; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat-card { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 14px 16px; }
.stat-card .k { font-size: 12px; color: #888; margin-bottom: 6px; }
.stat-card .v { font-size: 22px; font-weight: 700; color: #111; }
.stat-card .v small { font-size: 12px; color: #888; font-weight: 400; }

.table-wrap { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 16px; margin: 16px 0; overflow-x: auto; }
.table-wrap h3 { margin-top: 0; }
.results-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.results-table th, .results-table td { border: 1px solid #eee; padding: 6px 10px; text-align: left; white-space: nowrap; }
.results-table th { background: #fafafa; }
.num { text-align: right; }
.good { color: #16a34a; }
.bad { color: #dc2626; }

/* ===== 首页 ===== */
.landing { max-width: 720px; margin: 90px auto 0; text-align: center; padding: 0 16px; }
.landing-title { font-size: 34px; margin-bottom: 8px; }
.landing-sub { color: #666; margin-bottom: 48px; }
.landing-options { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.landing-card {
  display: block; width: 260px; padding: 32px 24px; background: #fff;
  border: 1px solid #e5e5e5; border-radius: 14px; text-decoration: none; color: #1f1f1f;
  transition: box-shadow .15s, transform .1s;
}
.landing-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.landing-icon { font-size: 40px; margin-bottom: 14px; }
.landing-label { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.landing-desc { font-size: 14px; color: #888; }

/* ===== 按钮行 ===== */
.btn-row { display: flex; gap: 12px; margin-top: 20px; }
.btn-secondary { background: #fff; color: #2563eb; border: 1px solid #2563eb; }
.btn-secondary:hover { background: #eef2ff; }
.muted { color: #888; font-size: 13px; }

/* 查看响应按钮 */
.btn-link { border: none; background: none; color: #2563eb; cursor: pointer; font-size: 13px; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 12px; max-width: 780px; width: 92%; max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #eee; }
.modal-title { font-weight: 700; font-size: 16px; }
.modal-close { border: none; background: none; font-size: 24px; cursor: pointer; color: #888; line-height: 1; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.session-block { margin-bottom: 18px; }
.session-time { font-weight: 600; margin-bottom: 8px; color: #333; }

/* 特殊引擎:纵向布局 / 长按 / 序列 */
.stim-stage.col { flex-direction: column; gap: 18px; }
.hold-bar { height: 20px; background: #333; border-radius: 10px; overflow: hidden; width: min(480px, 80%); }
.hold-fill { width: 0; height: 100%; background: #22c55e; transition: width 60ms linear; }
.hold-signal { text-align: center; font-size: 20px; color: #fff; }
.hold-signal.ready { color: #22c55e; font-weight: 700; }
.seq-row { display: flex; gap: 16px; justify-content: center; }
.seq-box { width: 64px; height: 64px; border-radius: 12px; background: #334155; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; transition: background .12s; }
.seq-box.on { background: #2563eb; }

/* 实时敲击计数器 */
.press-count { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 18px; font-variant-numeric: tabular-nums; background: rgba(0,0,0,.55); padding: 6px 16px; border-radius: 20px; z-index: 6; }

/* 注册表单 */
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; text-align: left; }
.form label { font-size: 14px; color: #555; }
.form input, .form select { padding: 10px 12px; font-size: 15px; border: 1px solid #ccc; border-radius: 8px; }
.form-msg { color: #dc2626; font-size: 14px; min-height: 18px; }

/* 进度条 */
.progress-header { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px; padding: 16px 20px; margin-bottom: 8px; }
.progress-header .who { font-size: 16px; margin: 0 0 6px; }
.progress-bar { height: 10px; background: #eee; border-radius: 5px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: #16a34a; border-radius: 5px; transition: width .3s; }
.question-progress { background: #f8fafc; border: 1px solid #dbe3ec; border-radius: 12px; padding: 14px 16px; margin-bottom: 22px; }
.question-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #475569; font-size: 14px; }
.question-progress-current { margin-top: 12px; }
.question-progress .progress-bar { height: 8px; margin-top: 6px; }
.question-progress .progress-fill-current { background: #2563eb; }

/* 已完成任务卡片 */
.task-card.done { border-color: #16a34a; background: #f0fdf4; }
.task-card.done .task-status { color: #16a34a; font-weight: 600; }

/* 视图切换 */
.view-toggle { margin: 8px 0 16px; }
.view-toggle button { padding: 8px 18px; font-size: 14px; cursor: pointer; border: 1px solid #ccc; border-radius: 6px; background: #fff; margin-right: 8px; }
.view-toggle button.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 按任务检索 */
.task-search { margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.task-search input { flex: 1; max-width: 440px; padding: 8px 12px; font-size: 14px; border: 1px solid #ccc; border-radius: 6px; }
.task-search button { padding: 8px 16px; font-size: 14px; cursor: pointer; border: 1px solid #ccc; border-radius: 6px; background: #fff; }
.task-search button:hover { background: #f4f4f4; }

/* 须知页 */
.consent-text p { line-height: 1.8; margin: 0 0 12px; text-align: left; }
.consent-decl { background: #f8fafc; border: 1px solid #e5e5e5; border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.7; color: #555; margin: 12px 0; max-height: 200px; overflow-y: auto; text-align: left; }
.consent-check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; font-size: 14px; cursor: pointer; text-align: left; }
.consent-check input { margin-top: 3px; }
.consent-note { font-size: 13px; color: #b45309; margin: 4px 0 0; text-align: left; }
button[disabled] { opacity: .45; cursor: not-allowed; }

/* 题目/任务说明 */
.read-warn {
  display: flex; align-items: center; gap: 10px;
  background: #fff6eb; border: 1px solid #f3d0b0; border-radius: 10px;
  padding: 12px 16px; margin: 0 0 16px;
  color: #1f1f1f; font-size: 15px; line-height: 1.65; text-align: left;
}
.read-warn-icon { flex: none; color: #e11d1d; font-weight: 800; font-size: 20px; line-height: 1; letter-spacing: -1px; }
.instruction, .instruct { background: #eef2ff; border-left: 3px solid #2563eb; padding: 10px 14px; border-radius: 6px; font-size: 15px; line-height: 1.7; text-align: left; color: #1e3a8a; margin: 0 0 12px; }
.btn-exit { padding: 6px 12px; font-size: 13px; border: 1px solid #dc2626; border-radius: 6px; background: #fff; color: #dc2626; cursor: pointer; margin-right: 14px; }
.btn-exit:hover { background: #fef2f2; }
.btn-home { padding: 6px 12px; font-size: 13px; border: 1px solid #2563eb; border-radius: 6px; background: #fff; color: #2563eb; cursor: pointer; margin-right: 14px; }
.btn-home:hover { background: #eef2ff; }
.btn-end { padding: 6px 12px; font-size: 13px; border: 1px solid #999; border-radius: 6px; background: #fff; color: #555; cursor: pointer; }
.btn-end:hover { background: #f4f4f4; }

/* 大按钮反应 + 准备倒计时 + 序列键盘 */
.response-btn { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); width: 150px; height: 150px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 20px; font-weight: 700; border: 4px solid #fff; cursor: pointer; z-index: 8; -webkit-tap-highlight-color: transparent; box-shadow: 0 4px 16px rgba(0,0,0,.3); user-select: none; }
.response-btn:active { background: #1d4ed8; }
.prep-count { text-align: center; font-size: 60px; font-weight: 700; color: #2563eb; margin: 16px 0; line-height: 1; }
.seq-key { width: 64px; height: 64px; border-radius: 12px; background: #2563eb; color: #fff; font-size: 26px; font-weight: 700; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.seq-key:active { background: #1d4ed8; }

/* 检测引擎媒体播放:视频占满舞台,按钮在舞台下方 */
.stim-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.control-row { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 16px; }
.control-row .hint { color: #555; font-size: 14px; margin: 0; }
.control-row .response-btn { position: static; transform: none; }
.control-row .prep-count { font-size: 44px; margin: 0; }

/* 麦克风任务:黑框 + 朗读稿件滚动区 */
.htp-mic-shell {
  position: relative; max-width: 640px; margin: 20px auto 0;
  background: #111; border-radius: 12px; padding: 20px 22px;
  color: #e5e5e5; display: flex; flex-direction: column; gap: 14px;
}
.htp-mic-instruction { color: #cbd5e1; font-size: 14px; line-height: 1.6; text-align: left; }
.htp-mic-script {
  max-height: 340px; overflow-y: auto;
  background: #1a1a1a; border: 1px solid #333; border-radius: 8px;
  padding: 14px 16px; color: #e5e5e5; font-size: 15px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word; text-align: left;
}
.htp-mic-meter { height: 8px; background: #333; border-radius: 4px; overflow: hidden; }
.htp-mic-meter span { display: block; height: 100%; width: 0; background: #22c55e; transition: width 60ms linear; }
.htp-mic-state { color: #94a3b8; font-size: 14px; }
.htp-mic-stop { align-self: flex-start; padding: 8px 18px; font-size: 14px; border: 1px solid #dc2626; border-radius: 6px; background: transparent; color: #dc2626; cursor: pointer; }
.htp-mic-stop:hover { background: rgba(220, 38, 38, 0.12); }
.demo-badge{position:absolute;z-index:5;top:14px;left:14px;padding:8px 14px;border-radius:999px;background:#f0d94a;color:#121820;font-weight:700;box-shadow:0 2px 8px rgba(0,0,0,.25)}
