/* 话话精灵 · 口语小课堂 —— 样式
   设计原则：暖色、大字、大按钮、圆角、动效克制（课堂投影要看得清） */

:root {
  --bg: #FFF6E9;
  --card: #FFFFFF;
  --ink: #4A3B2A;
  --muted: #9A8B7A;
  --primary: #FF8A5C;
  --primary-dark: #F4743B;
  --mint: #58C9B9;
  --mint-deep: #3BA898;
  --gold: #FFC94D;
  --line: #F2E5D0;
  --radius: 26px;
  --shadow: 0 6px 24px rgba(120, 90, 40, .10);
}

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

html { font-size: 17px; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg);
  background-image: radial-gradient(circle at 8% 6%, #FFE8C7 0, transparent 26%),
                    radial-gradient(circle at 94% 10%, #DDF3EC 0, transparent 24%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.mascot { width: 58px; height: 58px; animation: float 3.2s ease-in-out infinite; }
.brand h1 { font-size: 1.55rem; letter-spacing: 1px; }
.brand p { font-size: .85rem; color: var(--muted); letter-spacing: 3px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.demo-badge {
  background: var(--gold); color: #6B4E00;
  font-size: .85rem; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
}
.icon-btn {
  width: 44px; height: 44px; font-size: 1.2rem;
  border: 2px solid var(--line); border-radius: 14px;
  background: var(--card); cursor: pointer; transition: .15s;
}
.icon-btn:hover { border-color: var(--primary); transform: translateY(-1px); }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------- 标签导航 ---------- */
#tabs {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 4px 28px 14px; max-width: 1100px; margin: 0 auto;
}
#tabs button {
  font-family: inherit; font-size: 1.08rem; font-weight: 700;
  padding: 13px 26px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; transition: .15s;
}
#tabs button:hover { border-color: var(--primary); }
#tabs button.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(255, 138, 92, .35);
}

/* ---------- 主体 ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 0 28px 60px; }
.tab { display: none; }
.tab.active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 26px 30px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.card h2 { font-size: 1.3rem; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.hint { color: var(--muted); font-size: .95rem; line-height: 1.7; margin-top: 10px; }

/* ---------- 按钮 ---------- */
button { font-family: inherit; }
.btn-primary, .btn-secondary, .btn-ghost {
  border-radius: 999px; font-weight: 700; cursor: pointer; transition: .15s;
  border: none; padding: 14px 28px; font-size: 1.05rem;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(255,138,92,.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #E8D9C5; box-shadow: none; cursor: not-allowed; }
.btn-secondary { background: #EAF7F1; color: var(--mint-deep); }
.btn-secondary:hover { background: #D8F0E6; }
.btn-ghost { background: transparent; border: 2px solid var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary.big { font-size: 1.2rem; padding: 18px 40px; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.row.spread { justify-content: space-between; }
.row h2 { margin-bottom: 0; }

input, textarea, select {
  font-family: inherit; font-size: 1.05rem; color: var(--ink);
  border: 2px solid var(--line); border-radius: 16px;
  padding: 12px 16px; width: 100%; outline: none; transition: .15s;
  background: #FFFBF4;
}
input:focus, textarea:focus, select:focus { border-color: var(--mint); background: #fff; }
textarea { resize: vertical; line-height: 1.6; }

/* ---------- 评价台 ---------- */
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button {
  border: none; background: transparent; font-size: 1rem; font-weight: 700;
  padding: 9px 24px; border-radius: 999px; cursor: pointer; color: var(--muted);
}
.seg button.active { background: var(--mint); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.chips .chip-btn {
  border: 2px solid var(--line); background: #FFFBF4; color: var(--ink);
  font-size: 1rem; font-weight: 600; padding: 10px 20px; border-radius: 999px; cursor: pointer; transition: .15s;
}
.chips .chip-btn:hover { border-color: var(--mint); }
.chips .chip-btn.selected { background: var(--mint); border-color: var(--mint); color: #fff; }

.mic-wrap { display: flex; justify-content: center; margin: 6px 0 18px; }
.mic {
  width: 130px; height: 130px; border-radius: 50%;
  border: 4px solid #fff; background: var(--primary); color: #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(255,138,92,.35); transition: .15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.mic .mic-face { font-size: 2.2rem; line-height: 1; }
.mic:hover { transform: scale(1.04); }
.mic.listening { background: #E85D5D; animation: pulse 1.1s ease-out infinite; }
.mic.listening .mic-label::after { content: ""; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232,93,93,.45); }
  100% { box-shadow: 0 0 0 26px rgba(232,93,93,0); }
}
.mic.small {
  width: 58px; height: 58px; flex: none;
  font-size: 1.5rem; padding: 0;
}
.mic.small.listening { animation: pulse 1.1s ease-out infinite; }

/* ---------- 评价结果（四维百分制） ---------- */
.result { animation: fadeUp .35s ease; }
.total-row {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 4px 0 16px;
}
.total-num {
  font-size: 3.4rem; font-weight: 900; line-height: 1;
  color: var(--primary-dark); text-shadow: 0 3px 0 #FFE3D1;
}
.total-cap { font-weight: 800; font-size: 1rem; line-height: 1.5; }
.ref-tag {
  display: inline-block; background: var(--gold); color: #6B4E00;
  border-radius: 999px; padding: 2px 12px; font-size: .8rem; font-weight: 700;
}
.dim-row {
  display: flex; align-items: center; gap: 12px;
  background: #FFFBF4; border: 2px solid var(--line); border-radius: 16px;
  padding: 10px 16px; margin-bottom: 8px;
}
.dim-name { font-weight: 800; min-width: 5.8em; }
.dim-bar {
  flex: 1; height: 14px; background: #F2E8D8;
  border-radius: 999px; overflow: hidden;
}
.dim-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--gold));
  border-radius: 999px; transition: width .3s ease;
}
.dim-ctl { display: flex; align-items: center; gap: 8px; }
.dim-ctl button {
  width: 36px; height: 36px; border: none; border-radius: 12px;
  font-size: 1.2rem; font-weight: 900; color: #fff; cursor: pointer; transition: .1s;
}
.dim-ctl .plus2 { background: var(--mint); }
.dim-ctl .plus2:hover { background: var(--mint-deep); }
.dim-ctl .minus2 { background: #F0B7A0; }
.dim-ctl .minus2:hover { background: #E89B78; }
.dim-score { font-weight: 900; min-width: 4.6em; text-align: center; }
.ref-note {
  margin: 4px 0 4px; padding: 10px 14px;
  background: #FFF8EC; border: 2px dashed #F2D9A4; border-radius: 14px;
  font-size: .92rem; line-height: 1.7; color: var(--muted);
}

.bubble {
  display: flex; align-items: center; gap: 16px;
  background: #EAF7F1; border-radius: 22px; padding: 18px 22px; margin-bottom: 14px;
}
.mascot-mini { width: 62px; height: 62px; flex: none; }
.bubble p { font-size: 1.5rem; font-weight: 700; color: #1F6B58; line-height: 1.5; }

.dims { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dims .dim {
  background: #FFF3DF; color: #8A6A1F; font-weight: 700; font-size: .98rem;
  padding: 8px 16px; border-radius: 999px; letter-spacing: 1px;
}

.advice {
  background: #FFF8EC; border: 2px dashed #F2D9A4; border-radius: 18px;
  padding: 14px 18px; font-size: 1.1rem; line-height: 1.6; margin-bottom: 14px;
}
.badge {
  display: inline-block; background: linear-gradient(135deg, #FFC94D, #FF9E5C);
  color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: 2px;
  padding: 10px 26px; border-radius: 999px; margin-bottom: 6px;
  box-shadow: 0 4px 14px rgba(255,158,92,.4);
}

.loading {
  text-align: center; font-size: 1.2rem; color: var(--muted); font-weight: 700;
  padding: 30px 0;
}
.loading span {
  display: inline-block; width: 12px; height: 12px; margin: 0 4px;
  background: var(--gold); border-radius: 50%; animation: bounce 1s infinite;
}
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- 接龙 / 故事 ---------- */
.chain-flow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #FFFBF4; border: 2px solid var(--line); border-radius: 18px;
  padding: 16px 18px; min-height: 64px; margin: 10px 0;
  font-size: 1.05rem; line-height: 1.4;
}
.chain-flow.empty { color: var(--muted); }
.chain-flow .chip { padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: 1.15rem; }
.chain-flow .chip.kid { background: #E3F0FF; color: #2E6BB0; }
.chain-flow .chip.ai { background: #DFF5EE; color: #1F6B58; }
.chain-flow .chip.hint { background: #FFF1E3; color: #B0631F; border: 2px dashed #F2C48D; }
.chain-flow .arrow { color: #D8C8AE; font-weight: 800; }

.turn {
  display: inline-block; background: var(--gold); color: #6B4E00;
  font-size: 1.1rem; font-weight: 800; padding: 8px 20px; border-radius: 999px; margin-bottom: 10px;
}

.chain-msg {
  background: #EAF7F1; border-radius: 16px; padding: 12px 18px;
  font-size: 1.15rem; font-weight: 700; color: #1F6B58; margin-top: 12px;
}

.story-line {
  background: #FFFBF4; border: 2px solid var(--line); border-radius: 16px;
  padding: 12px 18px; margin-top: 10px; font-size: 1.1rem; line-height: 1.6;
}
.story-line.ai { background: #DFF5EE; border-color: #BCE6DA; font-weight: 700; color: #1F6B58; }
.story-line .num { color: var(--muted); font-weight: 800; margin-right: 8px; }

.story-result {
  background: #FFF8EC; border: 2px solid #F2D9A4; border-radius: 18px;
  padding: 20px 24px; margin-top: 16px; animation: fadeUp .3s ease;
}
.story-result h3 { font-size: 1.4rem; margin-bottom: 10px; color: #B0631F; }
.story-result p { font-size: 1.15rem; line-height: 1.9; }

/* ---------- 课堂工具 ---------- */
.pick-result {
  margin-top: 18px; text-align: center; background: #FFF3DF;
  border-radius: 18px; padding: 22px;
}
.pick-result .who { font-size: 2.6rem; font-weight: 900; color: #B0631F; letter-spacing: 4px; }
.pick-result .what { font-size: 1.1rem; color: var(--muted); margin-top: 6px; font-weight: 700; }

#groups { display: flex; flex-direction: column; gap: 12px; }
.group {
  display: flex; align-items: center; gap: 12px;
  background: #FFFBF4; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px;
}
.group .gname {
  flex: 1; font-size: 1.15rem; font-weight: 800; outline: none;
  padding: 6px 10px; border-radius: 10px;
}
.group .gname:focus { background: #fff; box-shadow: 0 0 0 2px var(--mint); }
.group .score { font-size: 1.9rem; font-weight: 900; color: var(--primary-dark); min-width: 64px; text-align: center; }
.group .plus, .group .minus {
  width: 52px; height: 52px; border-radius: 16px; border: none; cursor: pointer;
  font-size: 1.5rem; font-weight: 900; color: #fff; transition: .1s;
}
.group .plus { background: var(--mint); }
.group .plus:hover { background: var(--mint-deep); }
.group .minus { background: #F0B7A0; }
.group .minus:hover { background: #E89B78; }
.group .del {
  width: 38px; height: 38px; flex: none;
  border: none; border-radius: 12px; background: transparent;
  color: #C9B8A3; font-size: 1.3rem; cursor: pointer; transition: .1s;
}
.group .del:hover { color: #E85D5D; background: #FFF0EE; }

/* ---------- 记录 ---------- */
.records { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.rec-total { font-size: 1.3rem; font-weight: 900; color: var(--primary-dark); }
.rec-total small { font-size: .8rem; color: var(--muted); font-weight: 700; }
.rec-dims { font-size: .9rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.rec {
  background: #FFFBF4; border: 2px solid var(--line); border-radius: 16px;
  padding: 12px 18px;
}
.rec .meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.rec .rec-time { color: var(--muted); font-size: .9rem; }
.rec .rec-mode { background: #E3F0FF; color: #2E6BB0; font-size: .85rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.rec .rec-topic { background: #DFF5EE; color: #1F6B58; font-size: .85rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.rec .rec-stars { color: var(--gold); font-size: 1.05rem; letter-spacing: 2px; }
.rec p { font-size: 1rem; line-height: 1.6; }

/* ---------- 对话台 ---------- */
.chat-flow {
  max-height: 46vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 8px 4px; margin-bottom: 8px;
}
.chat-line { max-width: 86%; }
.chat-line .who { display: block; font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.chat-line p {
  display: inline-block; padding: 14px 18px; border-radius: 18px;
  font-size: 1.15rem; line-height: 1.6; text-align: left;
}
.chat-line.ai { align-self: flex-start; }
.chat-line.ai p { background: #DFF5EE; color: #1F6B58; font-weight: 600; border-top-left-radius: 4px; }
.chat-line.kid { align-self: flex-end; text-align: right; }
.chat-line.kid p { background: #E3F0FF; color: #2E6BB0; font-weight: 600; border-top-right-radius: 4px; }

.group-count { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.group-count select { width: auto; padding: 8px 14px; font-weight: 800; }

.task-card {
  background: #FFF8EC; border: 2px dashed #F2D9A4; border-radius: 18px;
  padding: 16px 20px; margin-top: 14px; font-size: 1.05rem; line-height: 1.9;
  animation: fadeUp .25s ease;
}
.task-card b { color: #B0631F; }

/* ---------- 口语小游戏 ---------- */
.streak-bar { font-weight: 800; color: var(--mint-deep); margin-bottom: 10px; letter-spacing: 1px; }
.word-cards { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.word-card {
  background: #FFF3D6; border: 3px solid var(--gold); border-radius: 18px;
  font-size: 1.3rem; font-weight: 800; color: #8A5A00; padding: 14px 24px;
  box-shadow: var(--shadow); animation: fadeUp .25s ease;
}
.game-stars { font-size: 1.6rem; letter-spacing: 6px; margin-bottom: 4px; }
#gameJudge { animation: fadeUp .25s ease; }

/* ---------- 弹窗 / 提示 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(74, 59, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  width: 560px; max-width: 100%; padding: 30px 34px; max-height: 92vh; overflow: auto;
}
.modal-card h2 { margin-bottom: 18px; }
.modal-card label { display: block; font-weight: 700; font-size: .98rem; margin-bottom: 14px; }
.modal-card input { margin-top: 6px; }

.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #4A3B2A; color: #fff; font-size: 1rem; font-weight: 700;
  padding: 13px 26px; border-radius: 999px; z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: fadeUp .2s ease;
}
.toast.warn { background: #E85D5D; }

.hidden { display: none !important; }

.site-foot { text-align: center; padding: 8px 0 26px; }
.site-foot a { color: var(--muted); font-size: .85rem; text-decoration: none; }
.site-foot a:hover { color: var(--primary); }

/* 投屏时再放大一点 */
@media (min-width: 1400px) { html { font-size: 19px; } }
