/* ============ 五谷短视频文案助手 · 手机端样式（浅底大字 / 克制工具风） ============
   配色只有一个强调色（蓝）。黄色只留给「警告 / 未保存」这类状态。 */
:root {
  --blue: #2D7FF9;
  --blue-d: #1C63D2;
  --blue-tint: #EDF4FF;
  --blue-line: #CFE1FB;
  --amber: #B45309;
  --paper: #F4F6F9;
  --card: #FFFFFF;
  --ink: #17212F;
  --ink-2: #5A6879;
  --ink-3: #8B98A8;
  --line: #E7EBF1;
  --line-2: #EEF1F6;
  --dash: #E9EEF5;
  --fill: #F2F5F9;
  --ok: #1C63D2;
  --bad: #C0392B;
  --r: 16px;
  --r-sm: 11px;
  --sh: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --pt-bg: #0B1220;
  --pt-hd: #131D2C;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  font-family: -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

button, input, textarea { font-family: inherit; font-size: 17px; color: inherit; }
input, textarea { -webkit-appearance: none; appearance: none; }
.chip:focus-visible, .btn:focus-visible, .tab:focus-visible, .token-chip:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}

/* ---------- 登录 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 200;
  background: linear-gradient(165deg, #2D7FF9 0%, #1C63D2 56%, #0E3A78 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 28px; overflow-y: auto;
  overscroll-behavior: contain;
}
.mask[hidden] { display: none; }
.login-box { width: 100%; max-width: 380px; margin: auto; }
.login-logo {
  width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 18px;
  background: rgba(255, 255, 255, .16); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .38);
}
.login-logo .bi { font-size: 27px; }
.login-box h1 { color: #fff; font-size: 21px; text-align: center; margin: 0 0 6px; font-weight: 600; letter-spacing: .5px; }
.login-tip { color: rgba(255, 255, 255, .72); text-align: center; margin: 0 0 8px; font-size: 15px; }
.login-err { color: #FFE0DA; text-align: center; margin-top: 16px; font-size: 15px; min-height: 22px; line-height: 1.5; }

/* ---------- 锁屏式数字键盘 ---------- */
.pin-dots {
  display: flex; justify-content: center; align-items: center;
  gap: 15px; min-height: 18px; margin: 14px 0 4px;
}
.pin-dots i {
  width: 13px; height: 13px; border-radius: 50%; display: block;
  border: 1.5px solid rgba(255, 255, 255, .6);
  transition: background .12s, transform .12s;
}
.pin-dots i.on { background: #fff; border-color: #fff; transform: scale(1.08); }
.pin-dots.pin-shake { animation: pinShake .32s ease; }
@media (prefers-reduced-motion: reduce) { .pin-dots.pin-shake { animation: none; } }
@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
}

.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px 20px; width: 100%; max-width: 288px; margin: 18px auto 0;
  user-select: none; -webkit-user-select: none;
}
.key {
  aspect-ratio: 1 / 1; min-height: 58px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 29px; font-weight: 500; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; cursor: pointer;
  transition: background .1s, transform .06s;
}
.key:active { background: rgba(255, 255, 255, .42); transform: scale(.93); }
.key-del { background: transparent; font-size: 25px; }
.key-ok {
  aspect-ratio: auto; min-height: 0; background: transparent;
  font-size: 17px; font-weight: 600; letter-spacing: 1px; color: #fff;
}
.key-ok:active { background: transparent; transform: none; opacity: .6; }

/* 改密码那一页是白底卡片，键盘要换成浅色 */
.keypad.light { gap: 12px 14px; max-width: 260px; margin: 14px auto 16px; }
.keypad.light .key { background: var(--fill); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-size: 25px; min-height: 52px; }
.keypad.light .key:active { background: var(--blue-tint); }
.keypad.light .key-del { background: transparent; box-shadow: none; color: var(--blue-d); font-size: 22px; }
.keypad.light .key-ok { background: transparent; box-shadow: none; color: var(--blue-d); font-size: 16px; }
.keypad.light .key-ok:active { opacity: .55; }

.pw-note { font-size: 14px; color: var(--ink-2); margin: 0 0 12px; line-height: 1.6; }
.pin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; border-radius: 11px; background: var(--fill);
  box-shadow: inset 0 0 0 1.5px transparent; margin-bottom: 8px; cursor: pointer;
}
.pin-row.on { background: var(--blue-tint); box-shadow: inset 0 0 0 1.5px var(--blue); }
.pin-name { font-size: 15px; color: var(--ink-2); }
.pin-row.on .pin-name { color: var(--blue-d); font-weight: 600; }
.pin-row .pin-dots { margin: 0; gap: 8px; min-height: 11px; flex: none; }
.pin-row .pin-dots i { width: 10px; height: 10px; border-color: var(--blue-line); }
.pin-row .pin-dots i.on { background: var(--blue); border-color: var(--blue); }

/* ---------- 按钮 ---------- */
.btn {
  border: 0; border-radius: var(--r-sm); padding: 13px 17px;
  background: var(--fill); color: var(--ink); font-weight: 600; cursor: pointer;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.985); }
.btn-major { background: var(--blue); color: #fff; width: 100%; font-size: 18px; padding: 15px; }
.btn-ghost { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-go {
  display: block; width: 100%; margin: 2px 0 14px;
  background: var(--blue); color: #fff; font-size: 20px; font-weight: 700;
  padding: 17px; border-radius: 14px; letter-spacing: 4px; cursor: pointer;
  box-shadow: 0 2px 10px rgba(45, 127, 249, .26);
}
.btn-go:active { transform: scale(.99); }
.btn-go[disabled] { background: #B7C4D4; box-shadow: none; }
.btn-small { padding: 10px 14px; font-size: 15px; border-radius: 10px; }
.btn-tiny { padding: 8px 13px; font-size: 14px; border-radius: 9px; font-weight: 600; }
.btn-dark { background: var(--ink); color: #fff; }
.wide { width: 100%; display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  padding-top: calc(11px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.token-chip {
  margin-left: auto; border: 1px solid var(--line); background: #fff; color: var(--ink-3);
  font-size: 13px; padding: 6px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.token-chip b { color: var(--blue-d); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- 页面与卡片 ---------- */
.page { display: none; padding: 12px 12px 26px; max-width: 680px; margin: 0 auto; }
.page.on { display: block; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh); padding: 13px 14px 15px; margin-bottom: 10px;
}
.card-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; flex-wrap: wrap; }
.card-t { font-size: 17.5px; font-weight: 700; letter-spacing: .2px; }
.optional { font-size: 12.5px; color: var(--ink-3); margin-left: 2px; }
.step {
  width: 22px; height: 22px; border-radius: 7px; background: var(--blue-tint); color: var(--blue-d);
  font-size: 13px; font-weight: 700; display: grid; place-items: center; flex: none;
  font-variant-numeric: tabular-nums;
}
.sep-line { height: 1px; background: var(--line-2); margin: 13px 0; }
.loading { color: var(--ink-3); font-size: 15px; padding: 10px 2px; }

/* ---------- 折叠卡（参考爆款、改密码） ---------- */
.foldable .card-hd { margin-bottom: 11px; cursor: pointer; }
.foldable.collapsed { padding-bottom: 13px; }
.foldable.collapsed .card-hd { margin-bottom: 0; }
.fold-body { overflow: hidden; max-height: 900px; transition: max-height .22s ease; }
.foldable.collapsed .fold-body { max-height: 0; }
.fold-arrow { color: var(--ink-3); font-size: 17px; flex: none; margin-left: auto; transition: transform .18s; }
.foldable.collapsed .fold-arrow { transform: rotate(-90deg); }
.fold-tag {
  margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--blue-d);
  background: var(--blue-tint); border-radius: 999px; padding: 3px 9px; white-space: nowrap;
  max-width: 45%; overflow: hidden; text-overflow: ellipsis;
}
.fold-tag:empty { display: none; }
.fold-tag:not(:empty) ~ .fold-arrow { margin-left: 7px; }

/* ---------- 选项 chips ---------- */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 10px 14px; font-size: 16px; cursor: pointer; line-height: 1.3;
  transition: border-color .12s, background .12s;
}
.chip.on { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-d); font-weight: 700; }
.chip small { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.chip.on small { color: var(--blue-d); font-weight: 400; }
.plat-tip { font-size: 13.5px; color: var(--ink-2); margin-top: 10px; line-height: 1.55; }
.form-hint { font-size: 13.5px; color: var(--ink-2); margin-top: 9px; line-height: 1.5; }
/* 时长有 11 档，chip 稍微收一点，免得在小屏上占掉大半屏 */
#durWrap { gap: 7px; }
#durWrap .chip { padding: 9px 12px; font-size: 15px; }
.grp-label { font-size: 13px; color: var(--ink-2); font-weight: 600; margin: 0 0 8px; }
.grp-sub { margin-left: 7px; font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.sep-line + .grp-label { margin-top: 0; }

/* ---------- 她自己加的条目（能加能删，存服务器） ---------- */
.chip.own { border-style: dashed; border-color: var(--blue-line); padding-right: 32px; }
.chip.own.on { border-color: var(--blue); }
.chip.own .cx {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 21px; height: 21px; line-height: 20px; text-align: center; border-radius: 50%;
  background: var(--fill); color: var(--ink-2); font-size: 16px; font-weight: 400; cursor: pointer;
}
.chip.own.on .cx { background: #fff; color: var(--blue-d); }
.own-add { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.own-add .own-in { flex: 1; min-width: 0; width: auto; margin: 0; padding: 9px 12px; font-size: 15px; }
.own-add .btn-tiny { flex: none; background: var(--blue-tint); color: var(--blue-d); }
.own-add .btn-tiny[disabled] { opacity: .55; }

/* ---------- 卖点（两栏各至少点一个 + 自己写） ---------- */
#sellWrap .grp-label { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
#sellWrap .sep-line { margin: 12px 0; }
#sellWrap .chip { padding: 9px 13px; font-size: 15.5px; }
.sell-hint { font-size: 13.5px; color: var(--ink-2); margin-top: 11px; line-height: 1.55; }

/* ---------- 输入框（再交代一句、单句改写要求都用它） ---------- */
.search {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm);
  padding: 12px 14px; margin-bottom: 10px;
}
.search:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 127, 249, .12); }

/* ---------- AI 现编的那一批案例 ---------- */
.daily-strip { background: var(--blue-tint); border-radius: 12px; padding: 10px 11px; margin-top: 10px; }
.daily-strip .d-hd { font-size: 13.5px; color: var(--blue-d); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.daily-chips { gap: 8px; }
.daily-strip .chip { background: #fff; font-size: 15px; padding: 9px 12px; border-color: transparent; }
.daily-strip .chip.on { background: #fff; border-color: var(--blue); color: var(--blue-d); }

/* ---------- 再交代一句 ---------- */
.quick-notes { margin-bottom: 9px; }
.quick-notes .chip { font-size: 15px; padding: 8px 13px; border-radius: 999px; }
#btnNotesShuffle { background: var(--blue-tint); color: var(--blue-d); margin-bottom: 10px; }

/* ---------- 参考爆款 ---------- */
.ref-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.file-btn { display: inline-block; font-size: 15px; padding: 10px 14px; }
.ref-hint { font-size: 13px; color: var(--ink-3); flex: 1; min-width: 140px; line-height: 1.5; }
.ref-text { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; resize: vertical; line-height: 1.6; background: #fff; }
.ref-text:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 127, 249, .12); }
.ref-progress { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--blue-d); margin-bottom: 9px; }
.ref-progress[hidden] { display: none; }
/* 参考强度：只有贴了爆款稿才出现，选完把这一档的做法念给她听 */
.ref-strength[hidden] { display: none; }
.ref-strength .grp-label { margin-top: 12px; }
.ref-strength .chip { padding: 9px 13px; font-size: 15.5px; }
.ref-strength-tip { font-size: 13px; color: var(--ink-3); line-height: 1.55; margin-top: 8px; }
.spin { display: inline-block; font-size: 17px; line-height: 1; animation: sp .9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* ---------- 结果 ---------- */
.gen-tip { text-align: center; color: var(--ink-2); font-size: 15px; margin: -6px 0 14px; min-height: 22px; }
.result-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--blue-tint); border: 1px solid var(--blue-line);
  border-radius: 13px; padding: 10px 12px; margin-bottom: 8px;
}
.token-line { font-size: 13px; color: var(--ink-2); margin-right: auto; line-height: 1.45; }
.token-line b { color: var(--blue-d); font-weight: 700; font-variant-numeric: tabular-nums; }
.res-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.res-actions .btn { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.res-actions .btn-dark { background: var(--blue); color: #fff; box-shadow: none; }
.res-actions .btn[disabled] { opacity: .45; }

.edit-bar { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.edit-tip { font-size: 12.5px; color: var(--ink-3); flex: 1; line-height: 1.45; }
.save-state { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.save-state.ok { color: var(--blue-d); }
.save-state.warn { color: var(--amber); }
.save-state.bad { color: var(--bad); }
#btnSaveNow { background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--blue-d); }

.rc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh); margin-bottom: 10px; overflow: hidden;
}
.rc-hd {
  display: flex; align-items: center; gap: 8px; padding: 10px 13px;
  background: #fff; border-bottom: 1px solid var(--line-2);
}
.rc-name { font-size: 15.5px; font-weight: 700; }
.rc-name::before { content: ""; display: inline-block; width: 3px; height: 14px; background: var(--blue); border-radius: 2px; margin-right: 7px; vertical-align: -2px; }
.rc-copy { margin-left: auto; border: 0; background: var(--fill); color: var(--blue-d); font-size: 13.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.rc-bd { padding: 12px 13px 14px; font-size: 17px; }
.rc-bd .lines > div { padding: 3px 0; border-bottom: 1px dashed var(--dash); line-height: 1.7; }
.rc-bd .lines > div:last-child { border-bottom: 0; }
.rc-bd .num { color: var(--ink-3); margin-right: 5px; }
.rc-bd .tx { line-height: 1.7; }
.rc-bd.hook { font-size: 21px; font-weight: 700; line-height: 1.55; }
.rc-bd.tags { color: var(--blue-d); font-weight: 600; word-break: break-all; }
.rc-bd.cover div { padding: 5px 0; }
.rc-bd.cover b { font-size: 20px; letter-spacing: 1px; }
.rc-bd.cover em { display: block; font-size: 13px; color: var(--ink-2); font-style: normal; }
.rc-empty { color: var(--ink-3); font-size: 15px; }

/* ---------- 逐句编辑 ---------- */
.li { display: flex; align-items: flex-start; gap: 4px; }
.li .num { flex: none; width: 20px; text-align: right; color: var(--ink-3); font-size: 13.5px; padding-top: 10px; }
.one { display: flex; align-items: flex-start; gap: 4px; }
textarea.ed {
  flex: 1; min-width: 0; display: block; width: 100%;
  border: 1px dashed transparent; border-radius: 9px; background: transparent;
  padding: 7px 8px; font: inherit; line-height: 1.65; color: inherit;
  resize: none; overflow: hidden;
}
textarea.ed::placeholder { color: var(--ink-3); }
textarea.ed:focus { outline: 0; border: 1.5px solid var(--blue); background: #fff; }
textarea.ed.big { font-size: 21px; font-weight: 700; line-height: 1.55; }
.rc-bd.cover textarea.ed { font-size: 20px; letter-spacing: 1px; font-weight: 700; }
.rc-bd.tags textarea.ed { color: var(--blue-d); font-weight: 600; }
.mi {
  flex: none; margin-top: 7px; border: 1px solid var(--line); background: #fff;
  color: var(--blue-d); font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer;
}
.mi:active { transform: scale(.94); }
textarea.ed.flash { animation: flash 1s ease; }
@keyframes flash { 0% { background: #D9E9FF; } 100% { background: transparent; } }

table.board { width: 100%; border-collapse: collapse; font-size: 15px; }
table.board th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12.5px; padding: 0 6px 7px; border-bottom: 1px solid var(--line); }
table.board td { padding: 6px 5px; border-bottom: 1px dashed var(--dash); vertical-align: top; line-height: 1.5; }
table.board tr:last-child td { border-bottom: 0; }
table.board td.t { white-space: nowrap; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; width: 62px; padding-left: 0; }
table.board td.g { width: 40px; padding-right: 0; text-align: right; }
table.board textarea.ed { font-size: 15px; padding: 5px 6px; line-height: 1.5; }
table.board textarea.ed.tiny { font-size: 14px; padding: 5px 2px; }
table.board textarea.ed.say { color: var(--ink-2); }

/* ---------- 单句 AI 重写面板 ---------- */
.rf {
  background: var(--blue-tint); border: 1px solid var(--blue-line); border-radius: 12px;
  padding: 11px 12px 12px; margin: 6px 0 10px;
}
table.board .rf { margin: 2px 0 6px; }
.rf-hd { font-size: 13.5px; font-weight: 700; color: var(--blue-d); margin-bottom: 9px; }
.rf-hints { gap: 7px; margin-bottom: 9px; }
.rf-hints .chip { font-size: 14px; padding: 6px 11px; border-radius: 999px; border-color: transparent; background: #fff; }
.rf-in { font-size: 15px; padding: 10px 12px; margin-bottom: 9px; }
.rf-btns { display: flex; gap: 8px; justify-content: flex-end; }
.rf-btns .btn-major { width: auto; font-size: 15px; padding: 9px 18px; border-radius: 10px; }
.rf-btns .btn-major[disabled] { opacity: .6; }
.rf-btns .rf-no { background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }

/* 稿子的最底下那句合规提醒（固定灰字，不写进口播） */
.say-note { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; padding: 11px 13px; background: var(--fill); border-radius: 12px; }
.say-note i { margin-right: 5px; color: var(--ink-3); }

/* ---------- 历史 ---------- */
.his { border-bottom: 1px solid var(--line-2); padding: 12px 2px; cursor: pointer; }
.his:last-child { border-bottom: 0; }
.his-t { font-size: 16px; font-weight: 600; line-height: 1.45; }
.his-m { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.his-p { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }
.his-del { float: right; border: 0; background: none; color: #AAB6C4; font-size: 14px; padding: 0 2px 0 12px; }

/* ---------- 设置 ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat { background: var(--fill); border-radius: 12px; padding: 12px 13px; }
.stat-k { font-size: 12.5px; color: var(--ink-2); }
.stat-v { font-size: 23px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-note { font-size: 13px; color: var(--ink-3); margin-top: 11px; line-height: 1.6; }
.tips { margin: 0; padding-left: 19px; font-size: 15px; color: var(--ink-2); line-height: 1.85; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(10px);
}
.tab {
  flex: 1; border: 0; background: none; padding: 7px 0 6px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab::after { content: ""; width: 16px; height: 3px; border-radius: 2px; background: transparent; }
.tab.on { color: var(--blue); font-weight: 700; }
.tab.on::after { background: var(--blue); }
.tab .bi { font-size: 21px; line-height: 1.3; }

/* ---------- 提词器 ---------- */
.prompter {
  position: fixed; inset: 0; z-index: 150; background: var(--pt-bg); color: #fff;
  display: flex; flex-direction: column;
}
.prompter[hidden] { display: none; }
/* 横屏：手机关了「自动旋转」时页面不会跟着转，这里自己把整块面板转 90 度，
   宽高对调（100vh × 100vw）再居中，看上去就是一块真正的横屏。 */
.prompter.landscape {
  inset: auto; top: 50%; left: 50%;
  width: 100vh; height: 100vw;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
}
.pt-top {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  padding-top: calc(9px + env(safe-area-inset-top)); background: var(--pt-hd); flex: none; flex-wrap: wrap;
}
.pt-title { font-size: 14px; color: #7A8798; margin: auto; }
.pt-togs { display: flex; gap: 7px; }
.pt-x { border: 1px solid #2A3B52; background: none; color: #C3D0E0; border-radius: 9px; padding: 7px 12px; font-size: 14.5px; cursor: pointer; }
.pt-x.on { border-color: var(--blue); background: rgba(45, 127, 249, .22); color: #fff; font-weight: 700; }

/* 录像时才出来：上半是摄像头（镜像，看着像照镜子），下面照常念稿 */
.pt-cam { position: relative; flex: none; height: 33vh; background: #05080E; overflow: hidden; border-bottom: 1px solid #1D293A; }
.pt-cam[hidden] { display: none; }
.pt-cam video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.pt-cam-off {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center; font-size: 15px; line-height: 1.65; color: #C3D0E0; background: #101A28;
}
.pt-cam-off[hidden] { display: none; }

.pt-body { flex: 1; overflow-y: auto; padding: 18px 18px 34px; scroll-behavior: smooth; }
.pt-cap { font-size: 15px; color: #6B7A8C; margin-bottom: 12px; }
.pt-inner { font-size: 30px; line-height: 1.85; font-weight: 600; }
.pt-inner .p-line { padding: 11px 0; color: #6B7A8C; border-bottom: 1px solid #16202C; }
.pt-inner .p-line.cur { color: #fff; }
.pt-inner .p-line.done { color: #3D4A57; }
/* 单句模式：一次只露一句，撑满整块屏、居中，字号由 JS 加大一档 */
.pt-body.single { display: flex; overflow: hidden; padding: 10px 18px; }
.pt-inner.single {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  text-align: center; line-height: 1.5;
}
.pt-inner.single .p-line { border: 0; padding: 0; color: #fff; }
.pt-inner.single .pt-cap { margin-bottom: auto; }
.pt-inner.single .pt-count { margin-top: auto; font-size: 15px; font-weight: 400; color: #48586A; }

.pt-ctrl {
  display: flex; align-items: center; gap: 7px; padding: 9px 12px;
  padding-bottom: calc(9px + env(safe-area-inset-bottom)); background: var(--pt-hd); flex: none; flex-wrap: wrap;
}
.pt-btn { border: 1px solid #2A3B52; background: none; color: #DCE6F2; border-radius: 10px; padding: 10px 14px; font-size: 15.5px; cursor: pointer; }
.pt-btn[disabled] { opacity: .5; }
.pt-btn.big { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; min-width: 84px; }
.pt-speed { display: flex; gap: 6px; margin-left: auto; }
.pt-speed button { border: 1px solid #2A3B52; background: none; color: #94A3B4; border-radius: 8px; padding: 8px 10px; font-size: 14px; cursor: pointer; }
.pt-speed button.on { border-color: var(--blue); color: #fff; background: rgba(45, 127, 249, .22); }
.pt-rec { color: #FFA79E; border-color: #4A2733; background: #2A1418; }
.pt-rec .bi { margin-right: 4px; }
.pt-rec.on { background: #D93B30; border-color: #D93B30; color: #fff; font-weight: 700; }

.pt-recbar {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; flex: none;
  background: #2A1418; color: #FFD9D3; font-size: 14px;
  padding-bottom: calc(9px + env(safe-area-inset-bottom));
}
.pt-recbar[hidden] { display: none; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #FF5A4A; flex: none; animation: recPulse 1.1s ease-in-out infinite; }
#recTime { font-size: 16px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.rec-tip { color: #B98D87; flex: 1; line-height: 1.4; }
@keyframes recPulse { 50% { opacity: .22; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }

/* ---------- 提示条 / 确认框 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(17, 28, 44, .95); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 15.5px; max-width: 84vw; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 300; line-height: 1.55;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #8B2A20; }

.confirm-mask { position: fixed; inset: 0; z-index: 250; background: rgba(12, 22, 38, .5); display: grid; place-items: center; padding: 26px; }
.confirm-mask[hidden] { display: none; }
.confirm-box { background: #fff; border-radius: 18px; padding: 22px 20px 16px; width: 100%; max-width: 340px; box-shadow: 0 12px 32px rgba(12, 22, 38, .22); }
.confirm-msg { font-size: 17.5px; line-height: 1.65; margin-bottom: 18px; color: var(--ink); }
.confirm-btns { display: flex; gap: 10px; }
.confirm-btns .btn { flex: 1; }
.confirm-btns .btn-major { font-size: 17px; letter-spacing: 1px; }

/* 打字光标 */
.caret::after { content: "▋"; color: var(--blue); animation: blink 1s steps(2) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

@media (min-width: 560px) {
  html, body { font-size: 18px; }
  .page { padding: 16px 16px 30px; }
  .pt-cam { height: 40vh; }
}
