:root {
  --navy: #0c3f86;
  --navy-2: #1456b8;
  --teal: #1ec8b4;
  --teal-2: #14b3a4;
  --ink: #1c2434;
  --muted: #7b8798;
  --line: #e6ebf2;
  --card: #ffffff;
  --bg: #f3f6fb;
  --danger: #e25555;
  --shadow: 0 10px 28px rgba(18, 52, 110, 0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: #d7e2f2;
}
button, input { font: inherit; }
button { cursor: pointer; }
.stage-bg {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px 0;
}
.phone {
  width: min(430px, 100vw);
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(12, 40, 90, 0.18);
}
@media (max-width: 480px) {
  .stage-bg { padding: 0; }
  .phone { min-height: 100vh; box-shadow: none; }
}

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.nav {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 12px;
  color: #fff;
  background: linear-gradient(90deg, var(--navy), #1a63c5);
}
.nav h1 { margin: 0; text-align: center; font-size: 18px; font-weight: 650; }
.icon-btn, .text-btn {
  border: 0;
  background: transparent;
  color: inherit;
  min-width: 44px;
  min-height: 36px;
}
.icon-btn { font-size: 28px; line-height: 1; }
.text-btn { font-size: 15px; }
.nav-right { display: flex; justify-content: flex-end; }

.hero {
  background: linear-gradient(120deg, #0a3e8a 0%, #1aa7c8 100%);
  color: #fff;
  padding: 18px 22px 36px;
  position: relative;
  z-index: 0;
}
.hero h1 { margin: 8px 0 6px; font-size: 28px; }
.hero p { margin: 0; opacity: 0.9; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18);
  font-weight: 700;
}
.sheet {
  position: relative;
  z-index: 1;
  margin-top: -20px;
  background: #fff;
  border-radius: 28px 28px 0 0;
  min-height: 62vh;
  padding: 36px 22px 32px;
  flex: 1;
}
.sheet.flat { margin-top: 0; border-radius: 0; background: var(--bg); }

.progress {
  height: 10px;
  background: #e7edf5;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3ec6ff, var(--teal));
}
.progress-label { text-align: right; color: var(--navy-2); font-weight: 650; margin: 8px 0 0; }
.center-note { text-align: center; color: var(--muted); margin-top: 28px; }
.foot-note { margin-top: auto; text-align: center; color: #a0a8b5; font-size: 13px; }

label.field { display: block; margin-bottom: 14px; color: #4c586b; font-size: 14px; }
label.field input, .text-input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #e3e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 16px;
  background: linear-gradient(90deg, #20d0be, #14b7d8);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(20, 183, 190, 0.28);
}
.btn:disabled { opacity: 0.6; }
.btn.ghost {
  margin-top: 12px;
  background: #fff;
  color: var(--teal-2);
  border: 1px solid #b7efe8;
  box-shadow: none;
}
.btn.slim { width: auto; padding: 8px 14px; font-size: 13px; box-shadow: none; }
.err { color: var(--danger); text-align: center; min-height: 22px; margin: 12px 0; font-size: 14px; }
.pad { padding: 16px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  text-align: left;
  width: 100%;
  color: inherit;
}
.card.selected { border-color: var(--teal); }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.sub { color: var(--muted); font-size: 13px; margin: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #c5ceda; flex: none;
}
.card.selected .check { background: var(--teal); border-color: var(--teal); box-shadow: inset 0 0 0 4px #fff; }
.dock {
  margin-top: auto;
  padding: 12px 16px 20px;
  background: linear-gradient(180deg, rgba(243,246,251,0), var(--bg) 30%);
}

.home-top {
  background: linear-gradient(180deg, #0d4eae, #3d7ed6 70%, var(--bg));
  color: #fff;
  padding: 18px 16px 8px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(8, 40, 100, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}
.home-top h1 { margin: 18px 0 12px; font-size: 28px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 16px 16px; }
.tile {
  border: 0; border-radius: 18px; min-height: 148px; padding: 16px;
  text-align: left; color: var(--ink); background: #fff; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.tile b { display: block; font-size: 18px; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.teal { background: linear-gradient(145deg, #19c8b6, #7ee0a8); color: #fff; }
.tile.teal span, .tile.blue span { color: rgba(255,255,255,.85); }
.tile.blue { background: linear-gradient(145deg, #2f7dff, #79b7ff); color: #fff; }
.tile.warm { background: linear-gradient(180deg, #fff, #ffe8d4); }
.tile.cool { background: linear-gradient(180deg, #fff, #e7f3ff); }
.exit-link {
  display: block; margin: 8px auto 24px; background: none; border: 0; color: #2b6cb0;
}

.scene-card .cover {
  width: 92px; height: 68px; border-radius: 10px; object-fit: cover; background: #d9e4f5; flex: none;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  border: 0; border-radius: 999px; padding: 7px 12px; color: #fff; background: var(--teal);
  font-size: 13px;
}
.chip.alt { background: #7eb6ff; }
.chip.lock::before { content: "🔒 "; font-size: 11px; }

.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, #2a6fdb, #1ec8b4);
}
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }

.dialogue { background: linear-gradient(180deg, #12386f, #0c274d); color: #fff; min-height: 100vh; }
.dialogue .nav { background: transparent; }
.bubbles { padding: 8px 14px 180px; display: flex; flex-direction: column; gap: 12px; }
.bubble {
  background: #fff; color: var(--ink); border-radius: 18px; padding: 12px;
  box-shadow: var(--shadow);
}
.bubble header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bubble header b { font-size: 14px; }
.bubble .body { min-height: 72px; line-height: 1.55; }
.bubble .who-a { background: #2f6fe0; }
.bubble .who-b { background: #14b3a4; }
.talking { outline: 2px solid var(--teal); }
.ctrl {
  position: sticky; bottom: 0;
  margin-top: auto;
  background: linear-gradient(180deg, #12c4b4, #0aa89a);
  color: #fff;
  border-radius: 22px 22px 0 0;
  padding: 12px 14px 16px;
}
.ctrl-meta, .ctrl-tools { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; align-items: center; }
.record {
  width: 92px; height: 92px; border-radius: 50%; border: 0; margin: 10px auto 4px;
  display: grid; place-items: center; background: #fff; color: #e25555; font-weight: 700;
}
.record.active { background: #ffe1e1; }
.record:disabled { opacity: 0.45; }
.debug-box { width: 100%; margin: 4px 0 2px; text-align: left; }
.debug-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.debug-box .text-btn { color: #083044; font-size: 12px; padding: 0; }
.auto-peek { font-weight: 700; letter-spacing: 0.04em; opacity: 0.75; }
.auto-tool {
  width: 100%; margin-top: 4px; padding: 8px; border-radius: 10px;
  background: rgba(8, 48, 68, 0.08); font-size: 12px;
}
.auto-tool-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 6px; }
.auto-tag { font-weight: 700; color: #083044; }
.auto-status { margin: 0; font-size: 11px; opacity: 0.85; line-height: 1.4; }
.btn.slim.ghost { background: transparent; border: 1px solid rgba(8,48,68,0.25); color: #083044; }
.debug-log {
  list-style: none; margin: 4px 0 0; padding: 6px 8px; max-height: 108px; overflow: auto;
  background: rgba(8, 28, 48, 0.88); color: #e8f4ff; border-radius: 10px;
  font-size: 11px; line-height: 1.45;
}
.debug-log li { display: grid; grid-template-columns: 52px 64px 1fr; gap: 6px; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.debug-log time { color: #9fd7ff; }
.debug-log b { color: #7dffe1; font-weight: 600; }
.debug-log span { word-break: break-all; }
.hint { text-align: center; font-size: 12px; opacity: 0.9; margin: 0; }
.switch { display: flex; align-items: center; gap: 6px; }

.reader {
  background: linear-gradient(160deg, #0e6e78, #083044);
  color: #fff; min-height: 100vh;
}
.reader .nav { background: transparent; }
.article-card {
  margin: 12px 16px; background: #fff; color: var(--ink);
  border-radius: 22px; padding: 16px; min-height: 280px;
}
.sentence { margin: 8px 0; line-height: 1.6; color: #5c6778; }
.sentence.on { background: #1558b0; color: #fff; border-radius: 12px; padding: 6px 8px; }
.player { padding: 8px 16px 24px; }
.player .time { text-align: center; font-size: 13px; opacity: 0.85; }
.player-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.play-main {
  width: 68px; height: 68px; border-radius: 50%; border: 0; background: #2ad4e0; color: #fff; font-size: 22px;
}

.term-screen { background: linear-gradient(180deg, #16315f, #0d2144); color: #fff; min-height: 100vh; }
.term-card { margin: 18px 16px; background: #fff; color: var(--ink); border-radius: 18px; overflow: hidden; }
.term-card .tag { background: linear-gradient(90deg, #2458c8, #1ec8b4); color: #fff; padding: 8px 14px; }
.term-card .block { padding: 16px 14px; }
.term-card h2 { margin: 0 0 8px; }
.tools4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 18px 12px; text-align: center; font-size: 12px; }
.tools4 button { border: 0; background: transparent; color: #fff; }
.dot {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 6px;
  display: grid; place-items: center; background: #12315d; font-size: 18px;
}
.dot.main { background: var(--teal); }

.meet-panel {
  margin: 8px 16px 16px; padding: 14px;
  border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, #14c4b4, #3dcb7a);
}
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }

.sheet-mask {
  position: absolute; inset: 0; background: rgba(10, 24, 48, 0.45);
  display: flex; align-items: flex-end; z-index: 5;
}
.sheet-panel {
  width: 100%; background: #fff; color: var(--ink);
  border-radius: 18px 18px 0 0; padding: 16px; max-height: 70vh; overflow: auto;
}
.sheet-panel h3 { margin: 0 0 10px; }
.rank-row, .hist-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.score { margin-left: auto; color: #d4a017; font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(20, 28, 40, 0.92); color: #fff;
  padding: 10px 14px; border-radius: 999px; z-index: 20; max-width: 90vw;
}
.hidden { display: none !important; }
.comment-box { white-space: pre-wrap; line-height: 1.6; font-size: 14px; }
