:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1c2433;
  --ink-soft: #5a6577;
  --line: #e3e8f0;
  --brand: #1d4ed8;
  --brand-dark: #14328f;
  --brand-soft: #e8efff;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --customer: #eef2ff;
  --employee: #e7f7ee;
  --shadow: 0 6px 24px rgba(20, 50, 143, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .logo { font-weight: 800; font-size: 18px; color: var(--brand-dark); letter-spacing: 0.5px; }
.topbar .logo span { color: var(--brand); }
.topbar nav a { margin-left: 18px; color: var(--ink-soft); font-size: 14px; }
.topbar nav a:hover { color: var(--brand); }

.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }
.page-title { font-size: 24px; font-weight: 800; margin: 6px 0 4px; }
.page-sub { color: var(--ink-soft); margin-bottom: 22px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card h3 { margin: 0 0 12px; font-size: 16px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f3c9c9; }
.btn.danger:hover { background: #fdeaea; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.lg { padding: 13px 22px; font-size: 16px; }
.btn.sm { padding: 6px 13px; font-size: 13px; border-radius: 9px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

input[type=text], input[type=password], input[type=number], input[type=email],
input[type=tel], input[type=search], input[type=url], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff;
}
/* 密码框：与文本输入框完全一致的外观（含光标/占位符），避免浏览器默认边框 */
input[type=password] { -webkit-appearance: none; appearance: none; }
input[type=password]::-ms-reveal, input[type=password]::-ms-clear { display: none; }
input::placeholder, textarea::placeholder { color: #9aa6b8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 6px; }

.tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); margin-right: 6px; }

.notice { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.notice.warn { background: #fff5e6; color: #92500a; border: 1px solid #f3d9a8; }
.notice.info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #c9dbff; }

.scenario-card { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.scenario-card:hover { transform: translateY(-2px); }
.scenario-card .meta { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
.scenario-card .title { font-size: 17px; font-weight: 700; }

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }

/* 演练对话 */
.chat { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: 78%; padding: 11px 14px; border-radius: 14px; font-size: 15px; white-space: pre-wrap; }
.bubble.customer { background: var(--customer); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.employee { background: var(--employee); align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble .who { font-size: 11px; color: var(--ink-soft); margin-bottom: 3px; }
.bubble .listening-tag { color: #b45309; font-weight: 600; margin-left: 6px; font-size: 10px; opacity: .9; }
.bubble.live-employee { opacity: .82; }

.controls { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.mic-state { font-size: 13px; color: var(--ink-soft); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #bbb; margin-right: 6px; vertical-align: middle; }
.dot.live { background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.score-big { font-size: 46px; font-weight: 800; }
.score-ring { --p: 0; width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--p)*1%), #e6ebf5 0);
  display: flex; align-items: center; justify-content: center; }
.score-ring .inner { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.dim-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.dim-row:last-child { border-bottom: none; }
.dim-name { width: 90px; font-weight: 700; font-size: 14px; }
.dim-bar { flex: 1; height: 10px; background: #eef1f7; border-radius: 999px; overflow: hidden; }
.dim-bar > i { display: block; height: 100%; background: var(--brand); }
.dim-score { width: 46px; text-align: right; font-weight: 700; }
.dim-comment { color: var(--ink-soft); font-size: 13px; margin: 4px 0 0; }
.bullets { margin: 6px 0 0; padding-left: 18px; }
.bullets li { margin: 4px 0; }

.empty { text-align: center; color: var(--ink-soft); padding: 40px 0; }

.pass-flag { font-size: 13px; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.pass-flag.pass { background: #e7f7ee; color: var(--ok); }
.pass-flag.fail { background: #fdeaea; color: var(--bad); }

/* 脚本流程（环节）编辑器 */
.stage-num { flex: 0 0 26px; width: 26px; height: 26px; line-height: 26px; text-align: center; background: var(--blue); color: #fff; border-radius: 8px; font-weight: 700; font-size: 14px; }
.fld-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin: 12px 0 5px; }
.obj-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 8px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 8px 0; background: #fbfdff; }
.obj-row .o-obj { font-weight: 600; }
.obj-row .o-resp { min-height: 52px; }

/* 识别状态条（诊断用，大白话显示识别到底发生了什么） */
.recog-log {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f5f7fa;
  border-left: 3px solid var(--link);
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
  min-height: 18px;
}
.recog-log.warn { border-left-color: #e6a23c; background: #fdf6ec; color: #9a6a00; }
.recog-log.bad { border-left-color: var(--bad); background: #fdeaea; color: var(--bad); }
.recog-log.ok { border-left-color: #67c23a; background: #f0f9eb; color: #3a7a1a; }

/* —— 左右并排布局：左=演练对话，右=教练提示（等高，底部齐平）—— */
.rehearse-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: stretch;        /* 两栏等高，底部始终齐平 */
  min-height: 540px;           /* 扩大教练区占位，保证充足提示空间 */
  margin-bottom: 18px;
}
.rehearse-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
/* 对话窗口：紧凑占位，长对话内部滚动 */
.rehearse-left .controls { margin: 0; }
.rehearse-left .chat {
  flex: 1 1 auto;
  min-height: 160px;           /* 缩小对话区默认占位 */
  max-height: 62vh;
  gap: 10px;
  padding: 4px 2px;
}
.rehearse-left .recog-log { margin-top: 0; }

/* 教练提示面板（右侧，等高填充、内部独立滚动） */
.coach-panel {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 60%);
  border-color: #d9e4fb;
  padding: 16px;
}
.coach-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex: 0 0 auto; }
.coach-title { font-size: 16px; font-weight: 800; color: var(--brand-dark); }
.coach-body {
  flex: 1 1 auto;              /* 填满剩余高度：内容无论长短都与对话底部齐平 */
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.coach-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 4px 16px rgba(20,50,143,.06); min-height: 140px;
  flex: 0 0 auto;
}
.coach-empty { color: var(--ink-soft); font-size: 13.5px; line-height: 1.7; }
.coach-loading { color: var(--brand); font-size: 13.5px; font-weight: 600; }
.coach-phase { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.coach-phase.phase-sug { background: #e8efff; color: var(--brand-dark); }
.coach-phase.phase-fb { background: #e7f7ee; color: #15803d; }
.coach-phase.phase-stage { background: #fff3e0; color: #92500a; }
.coach-tip-title { font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.5; margin-bottom: 8px; }
.coach-points { margin: 4px 0 0; padding-left: 18px; }
.coach-points li { margin: 5px 0; font-size: 13.5px; line-height: 1.65; color: var(--ink); }
.coach-watch { margin-top: 10px; font-size: 13px; line-height: 1.6; color: #9a3412; background: #fff7ed; border-left: 3px solid var(--warn); padding: 7px 10px; border-radius: 0 8px 8px 0; }
.coach-watch b { color: var(--bad); }
.coach-next { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--brand-dark); background: var(--brand-soft); border-left: 3px solid var(--brand); padding: 7px 10px; border-radius: 0 8px 8px 0; }
.coach-next b { color: var(--brand); }

/* 标题/副标题（阶段上下文提示） */
.coach-title-sm { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }

.coach-history-wrap { margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.coach-history-wrap > summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.coach-history { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.coach-history .history-item {
  background: #fbfdff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.coach-history .history-item .coach-card { border: none; box-shadow: none; padding: 0; min-height: 0; background: transparent; }

/* ---------------- 演练记录页（趋势/明细/总结） ---------------- */
.fld-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 0 0 4px; }
.sub-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 0 0 8px; }

/* 场景筛选 chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  transition: all .12s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-n { font-size: 11px; background: rgba(0,0,0,.08); color: inherit; padding: 1px 7px; border-radius: 999px; }
.chip.active .chip-n { background: rgba(255,255,255,.25); }

/* 趋势图头部：标题与全选/清空同行，压缩场景选择占位 */
.trend-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chips-compact { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-compact .chip { padding: 4px 11px; font-size: 12.5px; font-weight: 600; border-radius: 999px; }
.chips-compact .chip-n { padding: 0 6px; }
.btn.sm.ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn.sm.ghost:hover { border-color: var(--brand); color: var(--brand); background: transparent; }

/* 图表容器 */
.chart-wrap { position: relative; height: 320px; margin-top: 12px; }
.chart-wrap.short { height: 260px; }
.doughnut-wrap { position: relative; height: 240px; }
.bar-wrap { position: relative; height: 240px; }

/* 记录表格 */
.rec-table { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rec-grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.rec-grid th, .rec-grid td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.rec-grid th { background: #f7f9fc; color: var(--ink-soft); font-weight: 700; font-size: 12.5px; }
.rec-grid tbody tr:last-child td { border-bottom: none; }
.rec-grid tbody tr:hover { background: #f5f8ff; }
.rec-time { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.rec-go { color: var(--brand); font-weight: 700; text-align: right; white-space: nowrap; }

/* 场景总结 */
.summary-body { margin-top: 12px; }
.summary-head { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.summary-head .stat {
  flex: 1 1 90px; min-width: 84px; background: #f7f9fc; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 10px; text-align: center;
}
.summary-head .stat-n { font-size: 24px; font-weight: 800; color: var(--brand-dark); }
.summary-head .stat-l { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.summary-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.summary-sug { margin-top: 18px; }
.sug-item { border-left: 3px solid var(--bad); background: #fff6f6; border-radius: 0 10px 10px 0; padding: 10px 12px; margin: 8px 0; }
.sug-head { font-size: 14px; }
.sug-badge { font-size: 11px; font-weight: 700; color: #fff; background: var(--bad); padding: 2px 8px; border-radius: 999px; margin-left: 4px; }
.sug-sub { font-size: 12px; color: var(--ink-soft); margin-left: 6px; }
.sug-tip { font-size: 13.5px; line-height: 1.65; color: var(--ink); margin-top: 4px; }
.sug-ok { color: var(--ok); font-weight: 600; padding: 8px 0; }

@media (max-width: 860px) {
  .rehearse-layout { grid-template-columns: 1fr; }
  .coach-panel { position: static; max-height: none; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .summary-charts { grid-template-columns: 1fr; }
}

/* ---------------- 顶栏用户与激活态 ---------------- */
.topbar nav a.active { color: var(--brand); font-weight: 700; }
.topbar .who { margin-left: 14px; color: var(--ink-soft); font-size: 13px; }

/* ---------------- 标签 / 徽标 ---------------- */
.tag { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.ok { background: #e7f7ee; color: var(--ok); }
.badge.bad { background: #fdeaea; color: var(--bad); }
.badge.sys { background: var(--brand-soft); color: var(--brand); }

/* ---------------- 后台：模块卡 / 统计卡 ---------------- */
.module-card { display: block; text-decoration: none; color: inherit; position: relative; transition: border-color .15s, transform .15s; }
.module-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.module-card .title { font-size: 17px; font-weight: 700; }
.module-card .meta { color: var(--ink-soft); font-size: 13px; margin: 6px 0 12px; }
.module-card .tag { position: absolute; right: 18px; top: 18px; }
.stat-card { padding: 18px; text-align: center; }
.stat-card .stat-n { font-size: 26px; font-weight: 800; color: var(--brand-dark); }
.stat-card .stat-l { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------------- 后台：角色权限矩阵 ---------------- */
.role-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.role-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.perm-item input { width: auto; margin: 0; }

/* ============================================================
   视觉优化层（前台 · 演练场景列表 / 演练详情）
   —— 追加在文件末尾，用于覆盖上方早期规则；后台已有语义保持不变
   ============================================================ */

/* ---------- 1. 全局排版与留白 ---------- */
body {
  background: #f4f6fb linear-gradient(180deg, #f6f8fd 0%, #eef2f9 100%) fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: 1080px; padding: clamp(20px, 2.6vw, 34px) clamp(16px, 2.4vw, 28px) 72px; }
.page-title { font-size: clamp(21px, 2.2vw, 25px); line-height: 1.35; letter-spacing: -0.2px; margin: 2px 0 8px; }
.page-sub { font-size: 14.5px; line-height: 1.75; max-width: 68ch; margin-bottom: 0; }
.page-hero { margin: 0 0 22px; }
.page-hero .page-sub { margin-bottom: 0; }

/* ---------- 2. 顶栏（窄屏不断字、导航换行） ---------- */
.topbar {
  gap: 16px; padding: 12px clamp(14px, 2.6vw, 30px);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  box-shadow: 0 1px 0 rgba(20, 50, 143, 0.06);
}
.topbar .logo { font-size: 17px; white-space: nowrap; line-height: 1.25; }
.topbar nav { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.topbar nav a {
  margin: 0; padding: 6px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft); white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.topbar nav a:hover { color: var(--brand); background: var(--brand-soft); }
.topbar nav a.active { color: #fff; background: var(--brand); font-weight: 700; }
.topbar nav a.active:hover { color: #fff; background: var(--brand-dark); }
.topbar .who {
  margin: 0 0 0 8px; padding-left: 14px; border-left: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}

/* ---------- 3. 按钮（文字绝不换行、禁用态可读） ---------- */
.btn {
  justify-content: center; white-space: nowrap; line-height: 1.2;
  padding: 10px 18px; border-radius: 10px;
  transition: background .15s ease, color .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .1s ease;
}
.btn:hover { box-shadow: 0 3px 10px rgba(29, 78, 216, 0.12); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary { box-shadow: 0 4px 14px rgba(29, 78, 216, 0.24); }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(20, 50, 143, 0.28); }
.btn.primary:active { box-shadow: none; }
.btn.sm { padding: 8px 14px; border-radius: 9px; }
.btn.lg { padding: 13px 26px; border-radius: 12px; }
.btn:disabled { opacity: .5; box-shadow: none; transform: none; cursor: not-allowed; }
.btn.primary:disabled { background: #c3cee6; border-color: #c3cee6; color: #fff; opacity: 1; }

/* ---------- 4. 达标线徽章（列表页 / 详情页共用，永不竖排挤压） ---------- */
.sc-pass {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 78px; padding: 10px 14px; border-radius: 14px;
  background: var(--brand-soft); border: 1px solid #d4e1ff; color: var(--brand-dark);
}
.sc-pass b { font-size: 22px; font-weight: 800; line-height: 1.1; }
.sc-pass span { font-size: 11px; font-weight: 600; letter-spacing: .5px; opacity: .82; white-space: nowrap; }

/* ---------- 5. 场景列表页 ---------- */
.sc-list { display: grid; gap: 16px; }
.sc-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 26px; align-items: center;
  padding: 22px 26px; margin-bottom: 0; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.sc-card:hover, .sc-card:focus-visible {
  transform: translateY(-2px); border-color: #c6d8fb;
  box-shadow: 0 14px 34px rgba(20, 50, 143, 0.13); outline: none;
}
.sc-card:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft), 0 14px 34px rgba(20, 50, 143, 0.13); }
.sc-card:hover .btn.primary { background: var(--brand-dark); border-color: var(--brand-dark); }

.sc-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sc-title { margin: 0; font-size: 18px; font-weight: 750; line-height: 1.5; letter-spacing: -.1px; color: var(--ink); }

.sc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sc-key { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; color: var(--brand-dark); opacity: .85; }
.sc-val {
  margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--ink-soft);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.sc-goal .sc-val { color: var(--ink); }

.sc-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-meta .pill {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: #f4f7fc; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
}

.sc-side {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding-left: 26px; border-left: 1px dashed var(--line);
}
.sc-side .btn { width: 100%; }

/* ---------- 6. 演练详情页：场景信息头 ---------- */
.rh-card { padding: 22px 26px; }
.rh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.rh-topmain { min-width: 0; }
.rh-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; color: var(--brand); margin-bottom: 7px; }
.rh-title { margin: 0; font-size: clamp(19px, 1.9vw, 23px); font-weight: 800; line-height: 1.42; letter-spacing: -.2px; color: var(--ink); }

.rh-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.rh-role { background: #f7f9fd; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; }
.rh-role .k, .rh-goal .k { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; color: var(--brand-dark); opacity: .85; margin-bottom: 6px; }
.rh-role .v, .rh-goal .v { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.rh-goal { margin-top: 12px; padding: 13px 18px; border-radius: 0 12px 12px 0; background: var(--brand-soft); border-left: 3px solid var(--brand); }

/* ---------- 7. 演练详情页：控制区（双行，按钮不换行） ---------- */
.rehearse-layout { gap: 16px; min-height: clamp(420px, 54vh, 540px); }
.rehearse-left { padding: 18px; gap: 14px; }
.rehearse-left .controls { flex-direction: column; align-items: stretch; gap: 12px; margin: 0; }
.ctl-left { display: flex; align-items: center; gap: 12px; width: 100%; }
.ctl-select {
  width: auto; min-width: 190px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600;
}
.ctl-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mic-state {
  display: inline-flex; align-items: center; white-space: nowrap; margin-left: auto;
  padding: 6px 12px; border-radius: 999px;
  background: #f4f7fc; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft);
}
.ctl-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; width: 100%; }
.ctl-actions .btn { width: 100%; }

/* ---------- 按住说话（PTT）：按住才采音，从源头挡住旁人插话 ---------- */
.ptt-bar { margin-top: 12px; }
.ptt-btn {
  width: 100%; flex-direction: column; gap: 3px;
  padding: 15px 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ptt-btn .ptt-label { font-size: 16px; font-weight: 700; }
.ptt-btn small {
  white-space: normal; font-size: 12px; font-weight: 400; color: var(--ink-soft); line-height: 1.5;
}
.ptt-btn:hover { border-color: var(--brand); color: var(--brand); }
.ptt-btn.holding,
.ptt-btn.holding:hover {
  background: var(--bad); border-color: var(--bad); color: #fff;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}
.ptt-btn.holding small { color: rgba(255, 255, 255, 0.88); }
.ptt-tip {
  margin-top: 8px; padding: 8px 12px; border-radius: 8px;
  background: #f0f9eb; border-left: 3px solid #67c23a;
  font-size: 12.5px; line-height: 1.6; color: #3a7a1a;
}

/* ---------- 8. 对话区空态 + 教练区留白 ---------- */
.chat:empty::before {
  content: "点击下方「开始演练」，AI 客户将以电话形式与你实时对话。";
  margin: auto; max-width: 26ch; text-align: center;
  font-size: 13.5px; line-height: 1.9; color: var(--ink-soft); opacity: .9;
}
.coach-panel { padding: 18px; }

/* ---------- 9. 响应式 ---------- */
@media (max-width: 900px) {
  .rehearse-layout { grid-template-columns: 1fr; min-height: 0; }
}
@media (max-width: 720px) {
  .sc-card { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .sc-side {
    flex-direction: row; justify-content: space-between; align-items: center;
    padding: 16px 0 0; border-left: none; border-top: 1px dashed var(--line);
  }
  .sc-side .btn { width: auto; }
  .rh-top { gap: 14px; }
  .rh-roles { grid-template-columns: 1fr; }
  .ctl-left { flex-wrap: wrap; }
  .ctl-select { flex: 1 1 170px; min-width: 0; }
  .mic-state { margin-left: 0; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .topbar .logo { font-size: 15.5px; }
  .topbar nav { width: 100%; justify-content: flex-start; gap: 2px; }
  .topbar nav a { padding: 5px 9px; font-size: 12.5px; }
  .topbar .who { display: none; }
  .wrap { padding: 16px 13px 56px; }
  .card { padding: 16px; }
  .sc-card, .rh-card, .rehearse-left, .coach-panel { padding: 15px; }
  .ctl-actions { grid-template-columns: 1fr 1fr; }
}

/* ---------- 10. 客户严格度 & 未化解异议提示 ---------- */

/* 严格度下拉：与灵敏度下拉同排；窄屏由 .ctl-select 的 flex 规则自动换行 */
.ctl-left select#difficulty { min-width: 116px; }

/* 未化解异议提示条（教练面板：环节标签下方、教练内容上方） */
.coach-pending {
  flex: 0 0 auto;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #f2d8ae;
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  background: #fff8ec;
}
.coach-pending .cp-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: #8a5108;
}
.coach-pending .cp-head.ok { color: #10683a; }
.coach-pending .cp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); flex: 0 0 auto;
  animation: cp-pulse 1.6s ease-in-out infinite;
}
.coach-pending .cp-dot.ok { background: var(--ok); animation: none; }
@keyframes cp-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }
@media (prefers-reduced-motion: reduce) { .coach-pending .cp-dot { animation: none } }

.coach-pending .cp-list {
  margin: 7px 0 0; padding-left: 18px;
  font-size: 12.5px; line-height: 1.55; color: var(--ink);
}
.coach-pending .cp-list li { margin-bottom: 3px; }
.coach-pending .cp-list li:last-child { margin-bottom: 0; }
.coach-pending .cp-tip {
  margin-top: 8px; padding-top: 7px; border-top: 1px dashed #f0dcc0;
  font-size: 12px; color: var(--ink-soft);
}
.coach-pending .cp-note { margin-top: 6px; font-size: 12px; color: #8a5108; }

@media (max-width: 720px) {
  .coach-pending { padding: 9px 11px; }
  .coach-pending .cp-list { font-size: 12px; }
}

/* 第 11 节：语音不可用提示条（红色，用于把"识别不到声音"的真实原因显式挂出来） */
.notice.bad {
  background: #fdeaea;
  color: var(--bad);
  border: 1px solid #f5c2c2;
  line-height: 1.6;
}
.notice.bad b { color: #a11c1c; }
/* 语音自检通过（绿色提示条） */
.notice.ok {
  background: #f0f9eb;
  color: #3a7a1a;
  border: 1px solid #c8e6b7;
  line-height: 1.6;
}
.notice.ok b { color: #2f6a13; }
/* 语音问题提示条内的操作要点列表 */
.notice .nv-list { margin: 8px 0 0; padding-left: 18px; }
.notice .nv-list li { margin-bottom: 3px; }
.notice .nv-list li:last-child { margin-bottom: 0; }

