/* ==========================================================================
   小英同学 · AI 英语口语私教 —— 视觉样式
   面向 8-12 岁小学生：糖果配色 / 大圆角 / 大按钮 / 活泼动效
   ========================================================================== */

:root {
  --sky-1: #cdeaff;
  --sky-2: #e6f4ff;
  --sky-3: #fff4e0;

  --ink: #22355c;
  --ink-soft: #5b7295;
  --ink-faint: #93a6c2;

  --white: #ffffff;

  --blue: #3d8bff;
  --blue-deep: #2b6fe0;
  --purple: #9b6bff;
  --purple-deep: #7d4ff0;
  --pink: #ff6fa5;
  --orange: #ff9f43;
  --green: #35c26a;
  --green-deep: #25a355;
  --yellow: #ffc93c;
  --red: #ff5c72;

  --card: #ffffff;
  --card-line: #e4edfb;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --shadow-sm: 0 4px 12px rgba(52, 96, 168, 0.10);
  --shadow-md: 0 10px 26px rgba(52, 96, 168, 0.14);
  --shadow-lg: 0 18px 44px rgba(52, 96, 168, 0.20);

  --font: 'Baloo 2', 'Nunito', 'PingFang SC', 'Microsoft YaHei', 'HarmonyOS Sans SC',
    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* hidden 属性必须永远生效（防止被 display:flex/grid 等规则覆盖） */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 12% -8%, #d8f0ff 0%, rgba(216, 240, 255, 0) 60%),
    radial-gradient(900px 560px at 92% 4%, #ffe6f3 0%, rgba(255, 230, 243, 0) 58%),
    radial-gradient(1000px 700px at 50% 110%, #e5fff0 0%, rgba(229, 255, 240, 0) 62%),
    linear-gradient(170deg, var(--sky-2) 0%, var(--sky-1) 44%, var(--sky-3) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景装饰 ---------- */

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 100px;
  filter: blur(0.4px);
  box-shadow: 0 10px 30px rgba(120, 170, 230, 0.18);
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud::before { width: 56%; height: 150%; left: 6%; top: -64%; }
.cloud::after  { width: 40%; height: 118%; right: 8%; top: -44%; }

.c1 { width: 190px; height: 58px; top: 12%; left: -240px; animation: drift 46s linear infinite; }
.c2 { width: 140px; height: 44px; top: 34%; left: -240px; animation: drift 62s linear infinite 6s; }
.c3 { width: 230px; height: 66px; top: 62%; left: -300px; animation: drift 78s linear infinite 14s; }

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 340px)); }
}

.spark {
  position: absolute;
  color: #ffd76e;
  font-size: 22px;
  animation: twinkle 3.6s ease-in-out infinite;
  text-shadow: 0 0 12px rgba(255, 206, 84, 0.7);
}
.s1 { top: 9%;  left: 8%;  animation-delay: 0s; }
.s2 { top: 22%; right: 12%; animation-delay: 0.9s; font-size: 16px; }
.s3 { top: 70%; left: 6%;  animation-delay: 1.7s; font-size: 18px; }
.s4 { top: 52%; right: 5%; animation-delay: 2.4s; font-size: 26px; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.82) rotate(0deg); }
  50%      { opacity: 1;    transform: scale(1.14) rotate(18deg); }
}

/* ---------- 应用整体 ---------- */

.app {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 18px 190px;
}

/* ---------- 顶部栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border: 3px solid var(--white);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  box-shadow: var(--shadow-md);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-owl {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff2c9, #ffd97a);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.06), var(--shadow-sm);
  animation: bob 3.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-4px) rotate(3deg); }
}

.brand-text h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.5px;
  background: linear-gradient(92deg, var(--purple-deep), var(--blue) 55%, var(--green-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-faint);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scoreboard {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 19px;
  color: #8a5a00;
  background: linear-gradient(145deg, #fff6d6, #ffe293);
  border: 2.5px solid #ffd75e;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scoreboard.pop { transform: scale(1.22) rotate(-4deg); }

.score-star { font-size: 21px; }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--card-line);
  background: var(--white);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.icon-btn:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
}

.icon-btn.off { opacity: 0.42; filter: grayscale(1); }

/* ---------- 布局 ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.stage { display: flex; flex-direction: column; gap: 16px; }

.panel { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 通用卡片 ---------- */

.card {
  background: var(--card);
  border: 3px solid var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.card-title {
  margin: 0 0 12px;
  font-size: 16.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

/* ---------- 老师形象卡 ---------- */

.tutor-card {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 3px solid var(--white);
  background:
    radial-gradient(520px 220px at 8% 0%, #efe6ff 0%, rgba(239, 230, 255, 0) 62%),
    radial-gradient(520px 240px at 96% 100%, #e2f7ff 0%, rgba(226, 247, 255, 0) 60%),
    var(--white);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.tutor-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.owl-avatar {
  position: relative;
  width: 152px;
  height: 152px;
  display: grid;
  place-items: center;
}

.owl-glow {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 107, 255, 0.30) 0%, rgba(155, 107, 255, 0) 68%);
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50%      { transform: scale(1.12); opacity: 1; }
}

.owl-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px dashed rgba(61, 139, 255, 0.38);
  animation: spin 16s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.owl-emoji {
  position: relative;
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  font-size: 62px;
  border-radius: 50%;
  background: linear-gradient(150deg, #fffaf0, #ffeec9);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.05), var(--shadow-md);
  transition: transform 0.25s;
  z-index: 1;
}

/* 老师说话时嘴巴动 */
.tutor-card.speaking .owl-emoji {
  animation: talk 0.42s ease-in-out infinite;
}

@keyframes talk {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50%      { transform: scale(1.1) rotate(2deg); }
}

/* 老师思考时 */
.tutor-card.thinking .owl-emoji { animation: think 1.1s ease-in-out infinite; }

@keyframes think {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-8px) rotate(6deg); }
}

/* 学生说话时老师侧耳倾听 */
.tutor-card.listening .owl-emoji { animation: listen 0.9s ease-in-out infinite; }

@keyframes listen {
  0%, 100% { transform: scale(1.02) rotate(6deg); }
  50%      { transform: scale(1.06) rotate(11deg); }
}

.tutor-status {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  min-height: 32px;
  line-height: 1.4;
}

/* ---------- 老师对话气泡 ---------- */

.speech-bubble {
  position: relative;
  padding: 20px 22px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #f4f0ff 0%, #eef6ff 100%);
  border: 3px solid #e2dcff;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 50%;
  margin-top: -13px;
  width: 0;
  height: 0;
  border: 13px solid transparent;
  border-right-color: #e2dcff;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  left: -9px;
  top: 50%;
  margin-top: -11px;
  width: 0;
  height: 0;
  border: 11px solid transparent;
  border-right-color: #f2f1ff;
}

.bubble-en {
  margin: 0;
  font-size: 25px;
  line-height: 1.42;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.2px;
}

.bubble-en .hl {
  background: linear-gradient(transparent 58%, #ffe27a 58%);
  border-radius: 4px;
  padding: 0 3px;
}

.bubble-zh {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.5;
}

.replay-btn {
  align-self: flex-start;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2.5px solid #cfd9ff;
  background: var(--white);
  color: var(--blue-deep);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s, background 0.18s;
}

.replay-btn:hover { transform: translateY(-2px); background: #f2f6ff; }

/* ---------- 纠错结果展示 ---------- */

.corrections {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.correction-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: #fff8f9;
  border: 2.5px solid #ffdde3;
  animation: popIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.c-wrong {
  color: var(--red);
  font-weight: 800;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  font-size: 15px;
}

.c-arrow { color: var(--ink-faint); font-weight: 800; }

.c-right {
  color: var(--green-deep);
  font-weight: 900;
  font-size: 16px;
  background: #e8fbef;
  padding: 1px 7px;
  border-radius: 7px;
}

.c-reason {
  flex-basis: 100%;
  font-size: 12.8px;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.55;
}

.c-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: #ffe6ee;
  color: #d2386a;
}

/* ---------- 对话记录 ---------- */

.chat-panel {
  background: var(--card);
  border: 3px solid var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 380px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  font-weight: 800;
  font-size: 14.5px;
  background: linear-gradient(96deg, #eef4ff, #f7f0ff);
  border-bottom: 2.5px solid var(--card-line);
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 0.16s, color 0.16s;
}

.text-btn:hover { background: #e6eeff; color: var(--blue-deep); }

.chat-log {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 11px;
  scroll-behavior: smooth;
}

.chat-log::-webkit-scrollbar { width: 9px; }
.chat-log::-webkit-scrollbar-thumb {
  background: #d7e3f7;
  border-radius: 999px;
  border: 2px solid #fff;
}

.msg {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.58;
  font-weight: 600;
  word-break: break-word;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.msg .msg-tag {
  display: block;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.66;
  margin-bottom: 4px;
}

.msg.ai {
  align-self: flex-start;
  background: linear-gradient(150deg, #f3f0ff, #eef7ff);
  border: 2.5px solid #e5e0ff;
  border-bottom-left-radius: 6px;
}

.msg.me {
  align-self: flex-end;
  background: linear-gradient(150deg, #e6fbef, #e4f4ff);
  border: 2.5px solid #c8f0d8;
  border-bottom-right-radius: 6px;
}

.msg .micro {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 600;
  white-space: pre-line;
}

.msg .mini-say {
  margin-top: 7px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--blue-deep);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- 模式按钮 ---------- */

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 13px 8px;
  border-radius: var(--radius-md);
  border: 3px solid var(--card-line);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.mode-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.mode-icon { font-size: 25px; line-height: 1.1; }
.mode-name { font-size: 14.5px; font-weight: 800; color: var(--ink); }
.mode-desc { font-size: 11px; font-weight: 600; color: var(--ink-faint); }

.mode-btn.active {
  border-color: var(--purple);
  background: linear-gradient(160deg, #f6f1ff, #eef6ff);
  box-shadow: 0 8px 20px rgba(125, 79, 240, 0.20);
  transform: translateY(-2px);
}

.mode-btn.active .mode-name { color: var(--purple-deep); }

/* ---------- 年级 / 话题 ---------- */

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  margin: 12px 0 8px;
}

.field-label:first-of-type { margin-top: 0; }

.hint { font-weight: 600; color: var(--ink-faint); font-size: 11.5px; }

.grade-row, .topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 2.5px solid var(--card-line);
  background: var(--white);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s;
}

.chip:hover { border-color: var(--blue); color: var(--blue-deep); transform: translateY(-2px); }

.chip.active {
  background: linear-gradient(150deg, var(--blue), var(--purple));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(61, 139, 255, 0.32);
}

.tag {
  padding: 7px 13px;
  border-radius: 999px;
  border: 2.5px dashed #d8e4f7;
  background: #fbfdff;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s;
}

.tag:hover { border-color: var(--orange); color: #d97a00; }

.tag.active {
  background: linear-gradient(150deg, #fff1d9, #ffe3ea);
  border-style: solid;
  border-color: var(--orange);
  color: #c96a00;
}

/* ---------- 任务卡 ---------- */

.task-card { border-color: #fff4d6; }

.task-empty {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-faint);
  font-weight: 600;
  line-height: 1.65;
}

.task-view { animation: popIn 0.3s ease both; }

.target-sentence {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--purple-deep);
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, #f7f2ff, #eef8ff);
  border: 2.5px dashed #ddd3ff;
}

.mini-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 2.5px solid #dbe4f5;
  background: var(--white);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s;
}

.mini-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.mini-btn.primary {
  background: linear-gradient(150deg, var(--blue), var(--purple));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(61, 139, 255, 0.28);
}

.mini-btn.ghost { background: #f7faff; border-style: dashed; }

.mini-btn.wide { width: 100%; padding: 13px; font-size: 15px; }

/* ---------- 输入控件 ---------- */

.type-area, .type-input {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 2.5px solid #dbe4f5;
  background: #fbfdff;
  outline: none;
  resize: vertical;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.type-area:focus, .type-input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(61, 139, 255, 0.14);
}

.type-area::placeholder, .type-input::placeholder { color: #a9b9d3; font-weight: 600; }

/* ---------- 填空 ---------- */

.fill-clue {
  margin: 0 0 8px;
  font-size: 12.8px;
  font-weight: 700;
  color: var(--ink-faint);
}

.fill-sentence {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.6;
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, #fff8e6, #fff1f6);
  border: 2.5px dashed #ffd9a8;
}

.fill-sentence .blank {
  display: inline-block;
  min-width: 82px;
  border-bottom: 3.5px solid var(--orange);
  color: var(--orange);
  text-align: center;
  font-weight: 900;
  margin: 0 4px;
}

.fill-answer-row {
  display: flex;
  gap: 9px;
  margin-bottom: 11px;
}

.fill-answer-row .type-input { flex: 1; }

/* ---------- 提示卡 ---------- */

.tip-card {
  background: linear-gradient(160deg, #fffdf3, #fff8fb);
  border-color: #ffefc9;
}

.tip-block {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  border: 2.5px solid #ffebb8;
  font-size: 13.2px;
  font-weight: 600;
  line-height: 1.62;
  color: var(--ink-soft);
  margin-bottom: 9px;
}

.tip-block:last-child { margin-bottom: 0; }

.tip-block strong { color: #c98a00; font-weight: 800; }

/* 老师的鼓励（情绪价值区块） */
.tip-block.praise {
  background: linear-gradient(150deg, #fff5f9, #fff0f5);
  border-color: #ffd3e3;
}
.tip-block.praise strong { color: #d2386a; }

.tip-block.warm {
  background: linear-gradient(150deg, #fff8f0, #fff4e6);
  border-color: #ffdfb8;
}
.tip-block.warm strong { color: #d97a00; }

.tip-sound {
  display: inline-block;
  font-family: 'Consolas', 'Courier New', monospace;
  background: #ffe9c9;
  color: #b06a00;
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 800;
}

/* ---------- 单词卡 ---------- */

.word-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.word-chip {
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(150deg, #e9f7ff, #f0eaff);
  border: 2.5px solid #dbe7ff;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--blue-deep);
  cursor: pointer;
  transition: transform 0.18s;
}

.word-chip:hover { transform: translateY(-2px) scale(1.05); }

/* ---------- 底部操作坞 ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 14px 18px 16px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.97) 62%, rgba(255, 255, 255, 0));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dock-inner {
  display: flex;
  align-items: center;
  gap: 22px;
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 74px;
  padding: 9px 0;
  border-radius: var(--radius-md);
  border: 3px solid var(--card-line);
  background: var(--white);
  font-family: var(--font);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, border-color 0.18s;
}

.dock-btn:hover { transform: translateY(-3px); border-color: var(--blue); }

.dock-btn.hidden { visibility: hidden; pointer-events: none; }

.dock-label { font-size: 11px; font-weight: 800; color: var(--ink-soft); }

/* 大话筒 */
.mic-btn {
  position: relative;
  width: 104px;
  height: 104px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(150deg, var(--blue), var(--purple-deep));
  box-shadow: 0 12px 32px rgba(93, 92, 240, 0.42), inset 0 -6px 0 rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}

.mic-btn:hover { transform: translateY(-4px) scale(1.04); }

.mic-btn:disabled {
  background: linear-gradient(150deg, #d3dcec, #bcc9de);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.mic-icon { font-size: 42px; z-index: 2; }

.mic-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.7);
  opacity: 0;
}

.mic-btn.recording { background: linear-gradient(150deg, #ff7a94, #ff4d6d); }

.mic-btn.recording .mic-ring {
  opacity: 1;
  animation: ripple 1.3s ease-out infinite;
}

@keyframes ripple {
  0%   { transform: scale(1);    opacity: 0.9; }
  100% { transform: scale(1.75); opacity: 0; }
}

.mic-btn.recording .mic-icon { animation: talk 0.6s ease-in-out infinite; }

.dock-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  min-height: 20px;
  text-align: center;
}

/* ---------- 实时字幕 ---------- */

.live-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 620px;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(34, 53, 92, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  animation: popIn 0.24s ease both;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5c72;
  flex-shrink: 0;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.24; } }

.live-text { line-height: 1.4; }

/* ---------- 打字输入条 ---------- */

.type-bar {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 660px;
  animation: popIn 0.24s ease both;
}

.type-bar .type-input { flex: 1; }

/* ---------- 设置弹窗 ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(34, 53, 92, 0.42);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 470px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 3px solid var(--white);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-title { margin: 0 0 18px; font-size: 21px; }

.modal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 2px solid #f1f5fc;
}

.modal-label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.modal-select {
  flex: 1.15;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 2.5px solid #dbe4f5;
  background: #fbfdff;
  outline: none;
  cursor: pointer;
}

.modal-range { flex: 1; accent-color: var(--purple); cursor: pointer; }

.range-val {
  width: 38px;
  text-align: right;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--purple-deep);
}

/* 开关 */
.switch { position: relative; width: 54px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d5dfee;
  cursor: pointer;
  transition: background 0.22s;
}

.slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch input:checked + .slider { background: linear-gradient(96deg, var(--blue), var(--purple)); }
.switch input:checked + .slider::before { transform: translateX(24px); }

.modal-note {
  margin: 16px 0 18px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: #f4f8ff;
  border: 2.5px solid #e0eaff;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.7;
}

.modal-note p { margin: 0 0 6px; }
.modal-note p:last-child { margin-bottom: 0; }

.server-status.ok { color: var(--green-deep); font-weight: 800; }
.server-status.bad { color: var(--red); font-weight: 800; }

.modal-actions { display: flex; gap: 10px; }

/* ---------- 加载遮罩 ---------- */

.loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(3px);
}

.loading[hidden] { display: none; }

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 42px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--white);
}

.loading-owl { font-size: 52px; animation: bob 1.1s ease-in-out infinite; }

.loading-box p {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-soft);
}

/* ---------- 彩带 ---------- */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 11px;
  height: 15px;
  border-radius: 3px;
  animation: fall linear forwards;
}

@keyframes fall {
  0%   { transform: translateY(-12vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(760deg); opacity: 0; }
}

/* ---------- 星星飞起 ---------- */

.flying-star {
  position: fixed;
  z-index: 96;
  font-size: 30px;
  pointer-events: none;
  animation: flyUp 0.95s ease-out forwards;
}

@keyframes flyUp {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 1; }
  100% { transform: translate(var(--dx), -160px) scale(1.5); opacity: 0; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .chat-panel { max-height: 300px; }
}

@media (max-width: 620px) {
  .app { padding: 12px 12px 200px; }

  .brand-text h1 { font-size: 19px; }
  .brand-text p { font-size: 11px; }
  .brand-owl { width: 44px; height: 44px; font-size: 25px; }

  .tutor-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 18px;
  }

  .speech-bubble::before,
  .speech-bubble::after { display: none; }

  .bubble-en { font-size: 20px; }
  .owl-avatar { width: 118px; height: 118px; }
  .owl-emoji { width: 84px; height: 84px; font-size: 48px; }

  .mic-btn { width: 88px; height: 88px; }
  .mic-icon { font-size: 35px; }

  .dock-inner { gap: 12px; }
  .dock-btn { width: 62px; font-size: 17px; }

  .target-sentence, .fill-sentence { font-size: 17px; }
}

/* ---------- 无障碍：减少动效 ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
