:root {
  --bg: #FBFAF8;
  --surface: #FFFFFF;
  --border: #E3E0D8;
  --text: #2C2C2A;
  --muted: #6B6A64;
  --faint: #9A9890;
  --primary: #185FA5;
  --primary-soft: #E6F1FB;
  --amber: #854F0B;
  --amber-soft: #FAEEDA;
  --green: #3B6D11;
  --green-soft: #EAF3DE;
  --red: #A32D2D;
  --red-soft: #FCEBEB;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 20px 64px; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 26px;
}
.brand { font-size: 15px; font-weight: 500; letter-spacing: .01em; }
.brand span { color: var(--faint); font-weight: 400; margin-left: 8px; font-size: 13px; }
.topbar .spacer { flex: 1; }
.pill {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 500;
}
.pill.warn { background: var(--amber-soft); color: var(--amber); }

h1 { font-size: 22px; font-weight: 500; line-height: 1.4; margin-bottom: 8px; }
h2 { font-size: 15px; font-weight: 500; margin-bottom: 14px; }
h3 { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 10px; letter-spacing: .02em; }
p.lead { color: var(--muted); font-size: 14px; margin-bottom: 28px; max-width: 62ch; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card.selectable { cursor: pointer; transition: border-color .15s, background .15s; }
.card.selectable:hover { border-color: #C9C5B9; }
.card.active { border-color: var(--primary); background: var(--primary-soft); }
.card h4 { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.card p { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

button {
  font: inherit; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 18px; font-size: 13.5px; transition: background .15s, border-color .15s;
  /* 移动端关键：消除 300ms 点击延迟和双击缩放，否则按钮"点不到/不灵敏" */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:hover { border-color: #C9C5B9; }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
button.primary:hover { background: #134B85; }
button.ghost { background: transparent; color: var(--muted); border-color: transparent; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* 座位区 */
.seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 640px) { .seats { grid-template-columns: 1fr; } }

.seat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 14px; text-align: center; position: relative; transition: border-color .2s, box-shadow .2s;
}
.seat.speaking { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.seat.you { background: var(--primary-soft); border-color: #B5D4F4; }
.seat.examiner { background: #F5F4EF; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 500; background: var(--primary-soft); color: var(--primary);
}
.seat.examiner .avatar { background: #E5E2D8; color: #5F5E5A; }
.seat-name { font-size: 13.5px; font-weight: 500; }
.seat-role { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); margin-right: 5px; vertical-align: middle;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* 进度与计时 */
.progress { display: flex; gap: 5px; margin-bottom: 16px; }
.progress i { flex: 1; height: 3px; background: var(--border); border-radius: 2px; }
.progress i.done { background: var(--primary); }
.progress i.now { background: var(--primary); opacity: .55; }

.meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text); }
.timer.urgent { color: var(--red); }

/* 对话区 */
.transcript {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; max-height: 300px; overflow-y: auto; margin-bottom: 16px;
}
.turn { margin-bottom: 13px; font-size: 13.5px; }
.turn:last-child { margin-bottom: 0; }
.turn .who {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); margin-bottom: 3px;
}
.turn.examiner .who { color: #5F5E5A; }
.turn.candidate .who { color: var(--primary); }
.turn .what { color: var(--text); }
.turn.candidate .what { color: #1F4E7E; }
.empty { color: var(--faint); font-size: 13px; text-align: center; padding: 20px 0; }

.promptbox {
  background: var(--amber-soft); border: 1px solid #FAC775; border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px;
}
.promptbox .k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); margin-bottom: 4px; }
.promptbox .v { font-size: 14px; }

.inputrow { display: flex; gap: 10px; }
.inputrow input {
  flex: 1; font: inherit; font-size: 14px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
}
.inputrow input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* 报告 */
.scorehero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
}
.bigscore { font-size: 46px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.bigscore small { font-size: 16px; color: var(--faint); font-weight: 400; margin-left: 4px; }
.gradebadge {
  font-size: 13px; padding: 5px 12px; border-radius: 999px; font-weight: 500;
  background: var(--green-soft); color: var(--green);
}
.gradebadge.low { background: var(--amber-soft); color: var(--amber); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-weight: 500; color: var(--faint); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; padding: 0 10px 8px 0; border-bottom: 1px solid var(--border);
}
td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.desc { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 3px; }

.calc {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  color: var(--muted); background: #F5F4EF; border-radius: 8px; padding: 12px 14px;
  line-height: 1.8; white-space: pre-wrap;
}

.notice {
  border-left: 3px solid var(--amber); background: var(--amber-soft);
  padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 12.5px; color: #633806; margin-bottom: 16px;
}
.notice.blue { border-color: var(--primary); background: var(--primary-soft); color: #134B85; }

.hidden { display: none !important; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.small { font-size: 12px; color: var(--faint); }

/* 顶部 tab */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 9px 16px; font-size: 13.5px; color: var(--muted); margin-bottom: -1px;
}
.tab:hover { color: var(--text); border-color: transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* 开关行 */
.switchrow { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switchrow input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.switchrow strong { display: block; font-size: 13.5px; font-weight: 500; }
.switchrow em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.55; }

/* 难点选择 */
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
}
.chip:hover { border-color: #C9C5B9; color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }

/* 目标句 */
.target {
  font-size: 19px; line-height: 1.7; letter-spacing: .005em;
  font-family: Georgia, "Times New Roman", serif;
  padding: 6px 0 2px;
}

/* 逐词结果 */
.wordresult { font-size: 18px; line-height: 2.2; font-family: Georgia, serif; }
.w { display: inline-block; padding: 0 3px; border-radius: 4px; margin-right: 2px; }
.w.ok { color: var(--green); }
.w.bad { color: var(--red); background: var(--red-soft); text-decoration: underline wavy rgba(163,45,45,.45); }
.w.gone { color: var(--faint); background: #F5F4EF; text-decoration: line-through; }
.w .heard { font-size: 11.5px; font-family: -apple-system, sans-serif; color: var(--red); display: block; line-height: 1.1; margin-top: -2px; }

.statrow { display: flex; gap: 28px; flex-wrap: wrap; margin: 14px 0 6px; }
.stat .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }

.recording { background: var(--red-soft) !important; border-color: var(--red) !important; color: var(--red) !important; }

/* 训练模式：逐项体检 */
.checkrow { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.checkrow:last-child { border-bottom: none; }
.checkrow .mark { width: 18px; flex: none; font-size: 15px; font-weight: 500; text-align: center; line-height: 1.5; }
.checkrow.pass .mark { color: var(--green); }
.checkrow.fail .mark { color: var(--red); }
.ctitle { font-size: 13.5px; margin-bottom: 3px; }
.tier { font-size: 10px; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: 1px; font-weight: 400; }
.tier.core { background: var(--amber-soft); color: var(--amber); }
.tier.plus { background: var(--primary-soft); color: var(--primary); }
.cval { font-size: 11.5px; color: var(--faint); margin-left: 8px; }
.ctip { font-size: 12.5px; color: var(--muted); line-height: 1.65; }

/* 学习档案 */
.dossier { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.dossier .head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.dossier .head h2 { margin: 0; }
.dossier .head .n { font-size: 12px; color: var(--faint); }
.weakitem {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--border);
}
.weakitem:first-of-type { border-top: none; }
.weakitem .info { flex: 1; min-width: 0; }
.weakitem .name { font-size: 13.5px; font-weight: 500; }
.weakitem .name .rate { font-weight: 400; color: var(--red); font-size: 12px; margin-left: 8px; }
.weakitem .adv { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 3px; }
.weakitem button { flex: none; align-self: center; font-size: 12px; padding: 6px 13px; }

.strongrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.strongtag {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--green-soft); color: var(--green);
}

.sparkline { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-top: 8px; }
.sparkline i {
  width: 12px; background: var(--primary-soft); border-radius: 2px 2px 0 0; display: block;
  border-top: 2px solid var(--primary);
}
.sparkline i.b1 { height: 25%; }
.sparkline i.b2 { height: 50%; }
.sparkline i.b3 { height: 75%; }
.sparkline i.b4 { height: 100%; }

.dossier .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* 阅读与写作 */
.passagebox {
  background: #F5F4EF; border-radius: 8px; padding: 14px 16px;
  font-size: 14px; line-height: 1.9; font-family: Georgia, "Times New Roman", serif;
  margin-bottom: 14px; white-space: pre-line;
}
.signbox {
  border: 2px solid #5F5E5A; border-radius: 6px; padding: 14px 18px;
  text-align: center; font-weight: 500; font-size: 15px; letter-spacing: .04em;
  line-height: 1.7; margin-bottom: 14px; background: #FFFDF8;
}
.blankmark {
  display: inline-block; background: var(--primary); color: #fff; font-size: 11px;
  padding: 0 5px; border-radius: 3px; margin: 0 2px; font-family: -apple-system, sans-serif;
  vertical-align: 1px;
}
.rwitem { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 18px; }
.rwitem:last-of-type { border-bottom: none; }
.rwq { font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
.rwopts { display: flex; flex-direction: column; gap: 7px; }
.opt {
  text-align: left; font-size: 13.5px; line-height: 1.6; padding: 10px 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.opt .ol {
  flex: none; font-size: 11.5px; font-weight: 500; color: var(--faint);
  width: 16px; padding-top: 2px;
}
.opt.picked { border-color: var(--primary); background: var(--primary-soft); }
.opt.picked .ol { color: var(--primary); }
.opt.correct { border-color: var(--green); background: var(--green-soft); }
.opt.correct .ol { color: var(--green); }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .ol { color: var(--red); }
.opt:disabled { cursor: default; opacity: 1; }

.rwmark { font-weight: 500; margin-right: 6px; }
.rwmark.ok { color: var(--green); }
.rwmark.no { color: var(--red); }

.rwexp {
  font-size: 12.5px; color: var(--muted); line-height: 1.75;
  background: #FAF9F5; border-left: 2px solid var(--border);
  padding: 10px 14px; border-radius: 0 6px 6px 0; margin-top: 10px;
}
.rwexp strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 11px; letter-spacing: .05em; }

.blankinput {
  font: inherit; font-size: 14px; font-family: Georgia, serif;
  border: none; border-bottom: 2px solid var(--primary);
  background: #fff; padding: 1px 4px; margin: 0 3px; text-align: center;
  border-radius: 3px 3px 0 0;
}
.blankinput:focus { outline: none; background: var(--primary-soft); }
.blankinput.ok { border-color: var(--green); background: var(--green-soft); }
.blankinput.no { border-color: var(--red); background: var(--red-soft); }

.draftbox {
  width: 100%; min-height: 210px; font: inherit; font-size: 14.5px;
  font-family: Georgia, "Times New Roman", serif; line-height: 1.85;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); resize: vertical;
}
.draftbox:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
strong.ok { color: var(--green); }
strong.low { color: var(--amber); }

/* 听力 */
.lsplayer {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.lsrate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lsrate .chip { font-size: 12px; padding: 4px 11px; }

.qnum {
  display: inline-block; min-width: 20px; height: 20px; line-height: 20px;
  text-align: center; border-radius: 4px; background: var(--primary-soft);
  color: var(--primary); font-size: 11.5px; font-weight: 500;
  margin-right: 8px; vertical-align: 1px; font-family: -apple-system, sans-serif;
}
.smallbtn { font-size: 12px; padding: 4px 10px; margin-left: 10px; }

.ls-script { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.ls-script .sline { display: flex; gap: 12px; font-size: 13.5px; line-height: 1.7; }
.ls-script .who {
  flex: none; width: 62px; color: var(--primary); font-size: 11.5px;
  font-weight: 500; padding-top: 2px; text-align: right;
  font-family: -apple-system, sans-serif;
}
.ls-script .what { flex: 1; font-family: Georgia, "Times New Roman", serif; }

.faint { color: var(--faint); }

/* 语音按钮：加大热区，方便手指点。Apple 建议最小点击目标 44pt */
#micBtn, #drillMic {
  min-height: 46px;
  min-width: 132px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 500;
}
#micBtn:active, #drillMic:active {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* 主操作按钮（说完了/交卷）也加大，孩子手指点不飘 */
.inputrow .primary,
#lsSubmit,
#rwSubmit {
  min-height: 46px;
  padding: 12px 24px;
  font-size: 15px;
}

/* 语音陪练 */
.coach-main { padding: 20px; }
.coach-status { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--border); flex: none; transition: background .2s;
}
.dot.on { background: var(--green); }
.dot.pending { background: var(--amber); animation: blink 1s infinite; }
.dot.speaking { background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
@keyframes blink { 50% { opacity: .35; } }

.coach-talk {
  min-height: 260px; max-height: 52vh; overflow-y: auto;
  background: #FAF9F5; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.coach-empty { color: var(--faint); font-size: 13px; text-align: center; margin: auto; line-height: 1.7; }
.cline { display: flex; gap: 10px; align-items: flex-start; }
.cwho {
  flex: none; font-size: 11px; font-weight: 500; padding: 2px 9px; border-radius: 999px;
  margin-top: 2px; font-family: -apple-system, sans-serif;
}
.cline.user .cwho { background: var(--primary-soft); color: var(--primary); }
.cline.assistant .cwho { background: var(--green-soft); color: var(--green); }
.cwhat { font-size: 14px; line-height: 1.7; font-family: Georgia, "Times New Roman", serif; word-break: break-word; }

.coach-actions { justify-content: center; }
.coach-tip { text-align: center; color: var(--faint); margin-top: 12px; line-height: 1.6; }
