:root {
  --ink: #213029;
  --muted: #6f7f76;
  --soft: #f6f8f4;
  --panel: #ffffff;
  --line: #dfe8df;
  --green: #4f8f63;
  --green-soft: #eaf5ed;
  --earth: #a9683e;
  --earth-soft: #f6eadf;
  --blue: #4f79bd;
  --blue-soft: #eaf0fb;
  --yellow: #e8bb4c;
  --shadow: 0 14px 36px rgba(54, 76, 58, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--soft); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f6f8f4;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
button, input { font: inherit; }
.audio-archive-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.audio-archive-toolbar [hidden] { display: none; }
.audio-student-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.audio-student-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 86px; padding: 16px; text-align: left; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(54, 76, 58, .06); }
.audio-student-card:hover, .audio-student-card:focus-visible { border-color: var(--green); background: var(--green-soft); outline: none; }
.audio-student-card strong, .audio-student-card span { display: block; }
.audio-student-card span { margin-top: 6px; color: var(--muted); font-size: 13px; }
.audio-student-card .audio-student-count { flex: 0 0 auto; margin-top: 0; text-align: right; }
.audio-student-empty { padding: 24px 0; color: var(--muted); }
.audio-archive-list { border-top: 1px solid var(--line); }
.audio-session { border-bottom: 1px solid var(--line); padding: 16px 0; overflow-wrap: anywhere; }
.audio-session-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; line-height: 1.7; }
.audio-session-head span { color: var(--muted); }
.audio-session-meta { color: var(--muted); font-size: 13px; margin: 12px 0; }
.audio-turn { padding: 16px 0; border-top: 1px solid var(--line); }
.audio-turn p { margin: 8px 0; line-height: 1.6; }
.audio-turn audio { display: block; width: 440px; max-width: 100%; margin-top: 12px; }
.audio-playback-status { display: block; color: var(--muted); margin-top: 8px; }
.audio-save-status { padding: 10px 0; color: var(--muted); font-size: 14px; }
.audio-consent-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.audio-consent-actions > * { flex: 1 1 190px; min-width: 0; }
button { border: 0; cursor: pointer; }

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(54, 76, 58, .06);
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding-bottom: 0;
  border-bottom: 0;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
}
.brand strong, .partner-card strong { display: block; font-size: 15px; }
.brand span, .partner-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px;
  color: #5f7067;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}
.nav-item.active { color: var(--green); background: var(--green-soft); }
.nav-icon { width: 20px; text-align: center; }
.partner-card {
  display: grid;
  grid-template-columns: 36px 1fr 9px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #f8fbf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.partner-avatar, .friend-face {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--earth);
  border-radius: 50%;
  font-weight: 800;
}
.partner-avatar { width: 36px; height: 36px; }
.school-avatar {
  position: relative;
  overflow: hidden;
  background: #dbeaf7;
  border: 1px solid #c8d9ea;
}
.school-avatar span { position: absolute; display: block; }
.avatar-face {
  left: 50%;
  top: 9px;
  width: 18px;
  height: 18px;
  background: #f3c49b;
  border-radius: 50%;
  transform: translateX(-50%);
}
.avatar-face::before,
.avatar-face::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 2px;
  height: 2px;
  background: #344139;
  border-radius: 50%;
}
.avatar-face::before { left: 5px; }
.avatar-face::after { right: 5px; }
.avatar-hair {
  left: 50%;
  top: 6px;
  z-index: 1;
  width: 21px;
  height: 10px;
  background: #3f332a;
  border-radius: 12px 12px 5px 5px;
  transform: translateX(-50%);
}
.avatar-shirt {
  left: 50%;
  bottom: -2px;
  width: 26px;
  height: 16px;
  background: #4f79bd;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
}
.avatar-shirt::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 7px solid #fff;
}
.partner-card i { width: 9px; height: 9px; background: var(--green); border-radius: 50%; }
.partner-card i.offline { background: var(--yellow); }

.main-content { min-width: 0; flex: 1; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: rgba(246, 248, 244, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar span { display: block; color: var(--muted); font-size: 11px; }
.topbar strong { display: block; margin-top: 3px; font-size: 17px; }
.topbar-tools { display: flex; align-items: center; gap: 10px; }
.role-switch {
  display: inline-flex;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.role-switch button {
  min-height: 28px;
  padding: 0 10px;
  color: #66776e;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}
.role-switch button.active { color: #fff; background: var(--green); }
.auth-status {
  display: grid;
  gap: 2px;
  min-width: 118px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.auth-status span {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}
.auth-status strong {
  color: var(--ink);
  font-size: 13px;
}
.logout-button { min-height: 38px; }
.net-pill {
  padding: 6px 9px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 16px;
  font-weight: 800;
}
.net-pill.offline { color: #9d7630; background: #fff3cf; }
.offline-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: #66776e;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.offline-toggle input { accent-color: var(--green); }

.content-wrap { padding: 28px 32px 42px; }
.view { display: none; }
.view.active { display: block; animation: viewIn .2s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.panel, .stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.talk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.talk-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
}
.talk-panel::before,
.scene-guide-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--scene-artwork);
  background-position: center;
  background-size: cover;
  opacity: .2;
}
.talk-panel > *,
.scene-guide-panel > * {
  position: relative;
  z-index: 1;
}
.talk-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
}
#talkView .talk-head {
  grid-template-columns: 1fr;
}
.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
h1, h2, p { margin-top: 0; }
.talk-head h1, .page-heading h1 { margin: 5px 0 8px; font-size: 28px; line-height: 1.2; }
.talk-head p:not(.eyebrow), .page-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.rural-scene {
  position: relative;
  height: 138px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .10)),
    var(--scene-artwork, linear-gradient(#dceefa 0 58%, #eff7e8 58%));
  background-position: center;
  background-size: cover;
  border: 1px solid #d8e5d7;
  border-radius: 8px;
  box-shadow: inset 0 -28px 42px rgba(33, 48, 41, .08);
}
.rural-scene.dynamic-scene-active > span {
  display: none;
}
.scene-dynamic-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  border-radius: inherit;
}
.talk-panel > .scene-dynamic-canvas,
.scene-guide-panel > .scene-dynamic-canvas {
  opacity: .18;
}
.rural-scene > .scene-dynamic-canvas,
.selected-scene-visual > .scene-dynamic-canvas {
  opacity: 1;
}
.scene-3d-host {
  background: #eef7e8;
}
.selected-scene-visual.scene-3d-host {
  min-height: 360px;
}
.rural-scene.scene-3d-host {
  height: 245px;
  max-width: none;
}
.scene-3d-host > .scene-dynamic-canvas {
  display: none;
}
.scene-3d-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
.scene-xiaoya-overlay-frame {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 4;
  width: clamp(72px, 10vw, 108px);
  height: clamp(136px, 18vw, 176px);
  border: 0;
  background: transparent;
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(44, 78, 55, .26));
}
.rural-scene::after,
.selected-scene-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(33, 48, 41, .035));
}
.scene-3d-host::after {
  display: none;
}
.rural-scene > span { display: none; }
.sun { position: absolute; top: 18px; right: 26px; width: 30px; height: 30px; background: #f3c85a; border-radius: 50%; }
.hill { position: absolute; bottom: 38px; width: 170px; height: 74px; background: #9fcf9d; border-radius: 80px 80px 0 0; }
.hill-one { left: -22px; }
.hill-two { right: -35px; background: #87bd86; }
.road-line { position: absolute; left: 0; right: 0; height: 2px; background: rgba(79, 143, 99, .45); transform: rotate(-7deg); }
.line-one { bottom: 28px; }
.line-two { bottom: 15px; }
.house {
  position: absolute;
  left: 92px;
  bottom: 34px;
  width: 38px;
  height: 28px;
  background: #fff9ec;
  border: 2px solid #c99061;
}
.house::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -17px;
  border-left: 24px solid transparent;
  border-right: 24px solid transparent;
  border-bottom: 18px solid #b96d45;
}

.friend-strip {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  background: #fbf7f1;
  border: 1px solid #ead9c7;
  border-radius: 8px;
}
.friend-face { width: 46px; height: 46px; }
.friend-strip strong { display: block; font-size: 14px; }
.friend-strip span { display: block; margin-top: 4px; color: #7c6a5c; font-size: 12px; }

.xiaoya-avatar-card {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  background: rgba(246, 252, 242, .92);
  border: 1px solid #d9ead5;
  border-radius: 8px;
  box-shadow: 0 16px 30px rgba(72, 130, 84, .12);
}
.xiaoya-avatar-frame {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.75), rgba(255,255,255,0) 36%),
    linear-gradient(180deg, #f5fbef 0%, #e6f4ea 100%);
  border: 1px solid rgba(157, 206, 166, .45);
}
.xiaoya-avatar-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}
.xiaoya-avatar-copy h2 {
  margin: 6px 0 8px;
  color: #35504a;
  font-size: 20px;
  line-height: 1.25;
}
.xiaoya-avatar-copy p:not(.eyebrow) {
  margin: 0;
  color: #607067;
  font-size: 13px;
  line-height: 1.7;
}
.xiaoya-avatar-card[data-phase="listening"] {
  border-color: #9dcea6;
  background: rgba(241, 251, 242, .97);
}
.xiaoya-avatar-card[data-phase="agent_speaking"] {
  border-color: #b9d7ea;
  background: rgba(242, 249, 252, .96);
}
.xiaoya-avatar-card[data-phase="thinking"] {
  border-color: #e5d1a8;
  background: rgba(255, 250, 239, .95);
}
#sceneXiaoyaAvatarCard {
  display: none;
}
#sceneDialoguePanel .friend-strip,
#sceneFeedbackPanel {
  display: none;
}
#scenesView .scene-dialogue-panel .talk-panel {
  padding: 14px;
}
#scenesView .scene-dialogue-panel .talk-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
#scenesView .scene-dialogue-panel .talk-head > div:not(.rural-scene) {
  display: none;
}
#scenesView .scene-dialogue-panel .rural-scene {
  width: 100%;
  margin: 0;
}

.scene-mobile-mode #scenesView {
  min-height: 100dvh;
}

.scene-needs-landscape::before {
  content: "请横屏查看完整场景";
  position: fixed;
  left: 50%;
  top: 14px;
  z-index: 80;
  width: min(320px, calc(100vw - 28px));
  padding: 10px 12px;
  color: #fff;
  background: rgba(33, 48, 41, .9);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(33, 48, 41, .22);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.chat-window {
  display: grid;
  gap: 12px;
  min-height: 250px;
  max-height: 390px;
  overflow: auto;
  margin-top: 18px;
  padding: 16px;
  background: #f9fbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.chat-window:empty { display: none; }
#sceneChatWindow {
  display: grid;
  min-height: 116px;
  max-height: 300px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(250,253,248,.96));
  border-color: #d8ead5;
  box-shadow: 0 12px 24px rgba(78, 126, 89, .10);
}
#sceneDialogueVisual #sceneDialogueBubble {
  position: absolute;
  left: 12px;
  right: clamp(104px, 15vw, 146px);
  bottom: 12px;
  z-index: 5;
  display: grid;
  gap: 7px;
  min-height: 0;
  max-height: 48%;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}
#sceneDialogueVisual #sceneChatWindow {
  min-height: 0;
  max-height: 94px;
  margin: 0;
  padding: 0;
  overflow: auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  scrollbar-width: thin;
}
#sceneChatWindow:empty {
  display: grid;
}
#sceneChatWindow:empty::before {
  content: "对话会显示在这里。点开始后，阿禾的话会先出现在这个对话框里。";
  display: block;
  padding: 12px;
  color: #5f7067;
  background: #fff;
  border: 1px solid #e2eee0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.65;
}
#sceneDialogueVisual #sceneChatWindow:empty::before {
  padding: 9px 10px;
  background: rgba(255, 255, 255, .66);
  border-color: rgba(226, 238, 224, .74);
  box-shadow: 0 8px 18px rgba(39, 68, 48, .14);
  font-size: 12px;
  line-height: 1.5;
  backdrop-filter: blur(2px);
}
#sceneDialogueVisual #sceneChatWindow .message {
  max-width: 100%;
}
#sceneDialogueVisual #sceneChatWindow .message small {
  margin-bottom: 3px;
  color: rgba(45, 76, 62, .82);
}
#sceneDialogueVisual #sceneChatWindow .bubble {
  padding: 8px 10px;
  background: rgba(255, 255, 255, .72);
  border-color: rgba(226, 238, 224, .78);
  box-shadow: 0 8px 18px rgba(39, 68, 48, .14);
  font-size: 12px;
  line-height: 1.45;
  backdrop-filter: blur(2px);
}
#sceneDialogueVisual .scene-voice-controls {
  display: flex;
  gap: 6px;
  margin: 0;
}
#sceneDialogueVisual .scene-voice-controls .main-speak-button,
#sceneDialogueVisual .scene-voice-controls .secondary-button {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
  box-shadow: 0 8px 18px rgba(39, 68, 48, .14);
}
#sceneDialogueVisual .scene-voice-controls .secondary-button {
  background: rgba(255, 255, 255, .74);
  border-color: rgba(226, 238, 224, .78);
}
#sceneDialogueVisual #sceneVoiceHint {
  margin: 0;
  padding: 6px 8px;
  color: rgba(45, 76, 62, .9);
  background: rgba(255, 255, 255, .54);
  border: 1px solid rgba(226, 238, 224, .62);
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.35;
  backdrop-filter: blur(2px);
}
.message { max-width: 82%; }
.message.agent { justify-self: start; }
.message.student { justify-self: end; text-align: right; }
.message.feedback { max-width: 100%; justify-self: stretch; }
.message small { display: block; margin-bottom: 5px; color: #859389; font-size: 10px; }
.message-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.bubble {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #45534b;
  background: #fff;
  border: 1px solid #e5eee3;
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}
.message.student .bubble { color: #fff; background: var(--green); border-color: var(--green); }
.message.feedback .bubble { display: block; color: #725f4e; background: #fff9ef; border-color: #eadcc8; }
.translate-btn {
  color: var(--blue);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}
.replay-btn {
  color: #35504a;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}
.translation-box {
  margin-top: 6px;
  padding: 8px 10px;
  color: #5f6f66;
  background: #eef5fb;
  border: 1px solid #d7e4f5;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
}

.feedback-panel {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 13px;
  background: #f4fbf3;
  border: 1px solid #dbeedb;
  border-radius: 8px;
}
.feedback-panel span { display: block; color: #6c876f; font-size: 10px; }
.feedback-panel strong { display: block; margin-top: 4px; color: var(--green); font-size: 24px; }
.review-panel { grid-template-columns: 110px minmax(0, 1fr); }
.review-panel p { grid-column: 1 / -1; margin: 0; color: #607067; font-size: 12px; line-height: 1.7; }

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.main-speak-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(79, 143, 99, .20);
}
.main-speak-button.listening { background: #bd5a43; }
.mic-dot { width: 13px; height: 13px; background: #fff; border-radius: 50%; }
.main-speak-button.listening .mic-dot { animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .45; } }
@keyframes levelCelebrate {
  0% { transform: scale(1); }
  18% { transform: scale(1.01); }
  35% { transform: scale(1.018); }
  100% { transform: scale(1); }
}
.secondary-button {
  min-height: 40px;
  padding: 0 13px;
  color: #52645a;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}
.dialogue-summary {
  margin-top: 16px;
  padding: 16px;
  background: #fffaf2;
  border: 1px solid #edd9bb;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(160, 125, 72, .10);
}
.dialogue-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.dialogue-summary-head h2 { margin: 6px 0 0; font-size: 18px; }
.dialogue-summary-head strong { color: #c5793f; font-size: 26px; }
.dialogue-summary p {
  margin: 10px 0 0;
  color: #6d665b;
  font-size: 13px;
  line-height: 1.7;
}
.summary-dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.summary-dimension {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fff;
  border: 1px solid #eadcc8;
  border-radius: 8px;
}
.summary-dimension-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.summary-dimension-head strong {
  color: #4f5f55;
  font-size: 13px;
}
.summary-dimension-head span {
  color: #c5793f;
  font-size: 14px;
  font-weight: 900;
}
.summary-dimension p {
  margin: 0;
  color: #5d6b61;
  font-size: 12px;
  line-height: 1.6;
}
.summary-dimension small {
  color: #7a8279;
  font-size: 11px;
  line-height: 1.5;
}
.history-item.session-summary {
  border-color: #edd9bb;
  background: #fffaf2;
}
.history-item.session-summary strong { color: #b87d45; }
.hidden { display: none !important; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(246, 248, 244, .88), rgba(234, 245, 237, .94)),
    url("./assets/scenes/bus.svg") center / cover no-repeat;
}
.auth-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 24px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(33, 48, 41, .22);
}
.auth-card h2 {
  margin: 0;
  font-size: 26px;
}
.auth-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.auth-role-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.auth-role-tabs button {
  min-height: 42px;
  color: #53675b;
  background: #f8fbf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}
.auth-role-tabs button.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}
.auth-field {
  display: grid;
  gap: 7px;
  color: #53675b;
  font-size: 12px;
  font-weight: 800;
}
.auth-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.auth-submit { width: 100%; }
.auth-form { display: grid; gap: 14px; }
.auth-card .auth-switch { display: flex; align-items: center; justify-content: center; gap: 6px; }
.auth-switch button { padding: 4px 6px; border: 0; background: transparent; color: var(--green); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.auth-card button:disabled { cursor: wait; opacity: .65; }
.auth-remember { display: flex; align-items: center; gap: 8px; color: #53675b; font-size: 13px; }
.auth-remember input { width: 18px; height: 18px; accent-color: var(--green); }
.app-shell.auth-locked { visibility: hidden; }
.hint-line { margin-top: 12px; color: #87958c; font-size: 11px; line-height: 1.6; }

.side-stack { display: grid; gap: 16px; }
.growth-map-layout, .analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: start;
}
.growth-tree-panel, .friendship-panel, .chart-panel, .history-panel, .diary-panel, .teacher-panel, .survey-summary-panel { padding: 18px; }
.growth-tree { display: grid; gap: 16px; }
.growth-tree-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  gap: 16px;
  align-items: stretch;
  padding: 16px;
  background: linear-gradient(180deg, #f8fcf7 0%, #f3faf2 100%);
  border: 1px solid #dbe8d9;
  border-radius: 8px;
}
.growth-tree-unity-stage {
  display: grid;
  align-content: start;
  gap: 10px;
}
.growth-tree-unity-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 280px;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  background: linear-gradient(180deg, #dff0ff 0%, #f4fbf2 64%, #e7f3df 100%);
  border: 1px solid #d9e7d4;
  border-radius: 8px;
}
.growth-tree-unity-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  min-width: 100%;
  min-height: 100%;
  border: 0;
}
.growth-tree-fallback {
  position: absolute;
  inset: 0;
  padding: 12px;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #dff0ff 0%, #f4fbf2 64%, #e7f3df 100%);
}
.growth-tree-fallback .growth-tree-scene {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}
.mobile-tree-preview-active .growth-tree-fallback {
  display: block;
}
.mobile-tree-preview-active .growth-tree-scene {
  min-height: 100%;
  overflow: hidden;
}
.growth-tree-fallback-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: #5b6c62;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(215, 228, 213, .95);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11px;
}
.growth-tree-unity-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 9px;
  color: #35504a;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(215, 228, 213, .95);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
.growth-tree-scene {
  position: relative;
  min-height: 200px;
  overflow: hidden;
  background: linear-gradient(180deg, #dff0ff 0%, #f4fbf2 64%, #e7f3df 100%);
  border: 1px solid #d9e7d4;
  border-radius: 8px;
}
.tree-stage-svg {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  width: min(82%, 420px);
  height: min(82%, 440px);
  display: block;
  overflow: visible;
  transform: translateX(-50%);
}
.growth-tree-scene span { position: absolute; display: block; }
.tree-sun {
  top: 18px;
  right: 18px;
  width: 26px;
  height: 26px;
  background: #f0c64b;
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(240, 198, 75, .16);
}
.tree-cloud {
  top: 28px;
  width: 34px;
  height: 16px;
  background: rgba(255, 255, 255, .92);
  border-radius: 999px;
}
.tree-cloud::before,
.tree-cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.tree-cloud::before { left: 4px; top: -8px; width: 18px; height: 18px; }
.tree-cloud::after { right: 4px; top: -6px; width: 14px; height: 14px; }
.cloud-one { left: 18px; transform: scale(.95); }
.cloud-two { left: 54px; top: 42px; transform: scale(.78); opacity: .88; }
.tree-hill {
  bottom: 0;
  width: 150px;
  height: 72px;
  background: #c8e2b9;
  border-radius: 120px 120px 0 0;
}
.hill-one { left: -10px; background: #c6dfb5; }
.hill-two { right: -8px; width: 128px; height: 62px; background: #b7d8a3; }
.tree-shadow {
  left: 50%;
  bottom: 22px;
  width: 84px;
  height: 16px;
  background: rgba(88, 117, 81, .18);
  border-radius: 50%;
  transform: translateX(-50%);
}
.tree-seed {
  left: 50%;
  bottom: 33px;
  width: 22px;
  height: 16px;
  background: #8a6543;
  border-radius: 50% 50% 46% 46%;
  box-shadow: inset -3px -2px 0 rgba(72, 44, 24, .18);
  transform: translateX(-50%);
}
.sprout-shadow {
  width: 96px;
  height: 18px;
  bottom: 24px;
}
.sprout-seed {
  bottom: 28px;
  width: 34px;
  height: 15px;
  opacity: .5;
}
.tree-sprout-stem {
  left: 50%;
  bottom: 36px;
  width: 10px;
  height: 72px;
  background: linear-gradient(90deg, #4f9d58 0%, #8fd589 58%, #4d9855 100%);
  border-radius: 999px;
  box-shadow: inset -2px 0 0 rgba(28, 111, 55, .16);
  transform: translateX(-50%);
}
.tree-sprout-leaf {
  bottom: 72px;
  width: 48px;
  height: 25px;
  background: radial-gradient(circle at 35% 35%, #b4e58b 0%, #69b965 68%, #4c9a58 100%);
  border-radius: 100% 14px 100% 14px;
  box-shadow: inset -4px -4px 0 rgba(39, 119, 58, .13), 0 4px 8px rgba(69, 125, 78, .12);
}
.sprout-leaf-left {
  left: calc(50% - 50px);
  transform: rotate(-20deg);
  transform-origin: right center;
}
.sprout-leaf-right {
  left: calc(50% + 2px);
  transform: scaleX(-1) rotate(-20deg);
  transform-origin: left center;
}
.tree-sprout-tip {
  left: 50%;
  bottom: 101px;
  width: 18px;
  height: 22px;
  background: radial-gradient(circle at 35% 28%, #c5ee99 0%, #77c76d 72%);
  border-radius: 100% 12px 100% 12px;
  transform: translateX(-50%) rotate(45deg);
}
.tree-trunk {
  left: 50%;
  bottom: 38px;
  width: 34px;
  height: 112px;
  background: linear-gradient(90deg, #68452e 0%, #9a6a42 48%, #754c31 100%);
  border-radius: 15px 15px 8px 8px;
  transform: translateX(-50%);
}
.tree-trunk::before,
.tree-trunk::after {
  content: none;
  position: absolute;
}
.tree-branch {
  width: 84px;
  height: 13px;
  background: #805538;
  border-radius: 999px;
}
.branch-left { left: 52px; bottom: 106px; transform: rotate(-34deg); transform-origin: left center; }
.branch-right { right: 42px; bottom: 112px; transform: rotate(34deg); transform-origin: right center; }
.branch-back { left: 50%; bottom: 138px; width: 58px; transform: translateX(-50%) rotate(-78deg); }
.tree-canopy,
.tree-flower,
.tree-fruit {
  width: 76px;
  height: 58px;
  border-radius: 50%;
  transform-origin: center;
}
.tree-canopy {
  background: radial-gradient(circle at 35% 25%, #78b979 0%, #4f8f63 58%, #39754e 100%);
  box-shadow: inset -8px -8px 0 rgba(23, 82, 46, .14), 0 5px 0 rgba(48, 106, 65, .08);
  scale: var(--tree-canopy-scale, 1);
}
.canopy-1 { left: 50%; bottom: 134px; width: 92px; height: 72px; transform: translateX(-50%); }
.canopy-2 { left: 36px; bottom: 116px; transform: rotate(-8deg); }
.canopy-3 { right: 30px; bottom: 118px; transform: rotate(8deg); }
.canopy-4 { left: 56px; bottom: 158px; width: 86px; height: 66px; }
.canopy-5 { right: 50px; bottom: 162px; width: 88px; height: 68px; }
.canopy-6 { left: 50%; bottom: 186px; width: 82px; height: 64px; transform: translateX(-50%); }
.canopy-7 { left: 88px; bottom: 188px; width: 66px; height: 54px; }
.canopy-8 { right: 82px; bottom: 190px; width: 68px; height: 56px; }
.tree-flower,
.tree-fruit { width: 18px; height: 18px; }
.tree-flower {
  background: #f6d0da;
  box-shadow: 0 0 0 5px rgba(246, 208, 218, .26);
}
.tree-flower::before,
.tree-fruit::before {
  content: "";
  position: absolute;
  inset: 5px;
  background: #fff;
  border-radius: 50%;
}
.flower-a { left: 73px; bottom: 166px; }
.flower-b { right: 72px; bottom: 166px; }
.tree-fruit {
  background: #d98a47;
  box-shadow: 0 0 0 5px rgba(217, 138, 71, .18);
}
.fruit-a { left: 95px; bottom: 155px; width: 16px; height: 16px; }
.fruit-b { right: 96px; bottom: 155px; width: 16px; height: 16px; }
.tree-stage-seed .tree-trunk,
.tree-stage-seed .tree-branch,
.tree-stage-seed .tree-canopy,
.tree-stage-seed .tree-flower,
.tree-stage-seed .tree-fruit { opacity: 0; transform: scale(.34); }
.tree-stage-sprout .tree-seed {
  opacity: .42;
  bottom: 28px;
  width: 30px;
  height: 14px;
  background: #8b6b46;
  transform: translateX(-50%);
}
.tree-stage-sprout .tree-trunk { display: none; }
.tree-stage-seedling .tree-seed,
.tree-stage-young-tree .tree-seed,
.tree-stage-small-tree .tree-seed,
.tree-stage-big-tree .tree-seed { opacity: 0; }
.tree-stage-sprout .tree-trunk {
  bottom: 38px;
  width: 9px;
  height: 62px;
  background: linear-gradient(90deg, #6ab66e 0%, #8bd082 55%, #4f9b59 100%);
  border-radius: 999px;
  transform: translateX(-50%);
}
.tree-stage-sprout .tree-trunk::before,
.tree-stage-sprout .tree-trunk::after {
  content: "";
  position: absolute;
  bottom: 30px;
  width: 36px;
  height: 19px;
  background: radial-gradient(circle at 35% 35%, #a9dc84 0%, #65ad62 70%);
  border-radius: 100% 12px 100% 12px;
  box-shadow: inset -3px -3px 0 rgba(46, 121, 64, .14);
}
.tree-stage-sprout .tree-trunk::before {
  right: 4px;
  transform: rotate(-22deg);
  transform-origin: right center;
}
.tree-stage-sprout .tree-trunk::after {
  left: 4px;
  transform: scaleX(-1) rotate(-22deg);
  transform-origin: left center;
}
.tree-stage-sprout .tree-branch,
.tree-stage-sprout .tree-canopy,
.tree-stage-sprout .tree-flower,
.tree-stage-sprout .tree-fruit { opacity: 0; transform: scale(.56); }
.tree-stage-seedling .tree-trunk {
  bottom: 38px;
  width: 18px;
  height: 88px;
  border-radius: 12px 12px 8px 8px;
  transform: translateX(-50%);
}
.tree-stage-seedling .tree-branch { opacity: 0; }
.tree-stage-seedling .canopy-4,
.tree-stage-seedling .canopy-5,
.tree-stage-seedling .canopy-6,
.tree-stage-seedling .canopy-7,
.tree-stage-seedling .canopy-8 { opacity: 0; transform: scale(.66); }
.tree-stage-seedling .tree-flower,
.tree-stage-seedling .tree-fruit { opacity: 0; transform: scale(.72); }
.tree-stage-young-tree .tree-trunk {
  width: 26px;
  height: 104px;
  border-radius: 14px 14px 8px 8px;
}
.tree-stage-young-tree .branch-back,
.tree-stage-young-tree .canopy-7,
.tree-stage-young-tree .canopy-8 { opacity: 0; transform: scale(.76); }
.tree-stage-young-tree .tree-fruit { opacity: 0; transform: scale(.82); }
.tree-stage-small-tree .tree-fruit { opacity: 0; transform: scale(.9); }
.tree-stage-seed .tree-sun { box-shadow: 0 0 0 10px rgba(240, 198, 75, .08); }
.tree-stage-sprout { --tree-canopy-scale: 0; }
.tree-stage-seedling { --tree-canopy-scale: .84; }
.tree-stage-young-tree { --tree-canopy-scale: .96; }
.tree-stage-small-tree { --tree-canopy-scale: 1.04; }
.tree-stage-big-tree { --tree-canopy-scale: 1.1; }
.growth-tree-copy h2 { margin: 0 0 8px; font-size: 22px; }
.growth-tree-copy p { margin: 0; color: #5b6c62; font-size: 13px; line-height: 1.7; }
.growth-tree-hero.level-celebrate {
  animation: levelCelebrate 1.8s ease;
  box-shadow: 0 0 0 1px rgba(111, 175, 123, .26), 0 12px 28px rgba(111, 175, 123, .16);
}
.tree-level-card {
  margin-top: 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tree-level-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}
.tree-level-card p {
  color: #53645b;
  font-size: 12px;
  line-height: 1.6;
}
.tree-level-card span {
  display: block;
  margin-top: 6px;
  color: #6e7d73;
  font-size: 11px;
  line-height: 1.6;
}
.growth-tree-sky-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .08;
  pointer-events: none;
}
.growth-tree-stage-rail {
  position: absolute;
  left: 16px;
  bottom: 62px;
  display: flex;
  gap: 10px;
  color: #6a8f59;
  opacity: .7;
  font-size: 14px;
  pointer-events: none;
}
.rail-arrow { text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.tree-meter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  color: #708273;
  font-size: 12px;
}
.tree-meter b { color: var(--green); font-size: 18px; }
.tree-progress {
  height: 10px;
  overflow: hidden;
  margin-top: 12px;
  background: #e3eee0;
  border-radius: 999px;
}
.tree-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6cab78 0%, #4f8f63 100%);
  border-radius: inherit;
}
.growth-node-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.growth-node {
  min-height: 112px;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.growth-node span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-weight: 800;
}
.growth-node.locked { opacity: .58; }
.growth-node.locked span { background: #9aa8a0; }
.growth-node strong { display: block; font-size: 14px; }
.growth-node p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.friendship-panel p { color: #5b6c62; font-size: 13px; line-height: 1.75; }
.mood-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  background: #fff9ef;
  border: 1px solid #eadcc8;
  border-radius: 8px;
}
.mood-panel strong { color: #725f4e; font-size: 13px; }
.mood-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.mood-options button {
  min-height: 38px;
  padding: 0 8px;
  color: #5d6e64;
  background: #fff;
  border: 1px solid #e3d6c4;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}
.mood-panel span {
  color: #8b7968;
  font-size: 11px;
}
.survey-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(33, 48, 41, .34);
}
.survey-card {
  width: min(780px, 100%);
  max-height: min(86vh, 780px);
  overflow: auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(33, 48, 41, .24);
}
.survey-card h2 { margin: 5px 0 8px; font-size: 22px; }
.survey-card p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.7; }
.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(33, 48, 41, .38);
}
.feedback-card {
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 22px;
  background: #fffaf2;
  border: 1px solid #edd9bb;
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(33, 48, 41, .24);
}
.feedback-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.feedback-modal-head h2 { margin: 5px 0 0; font-size: 22px; }
.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #52645a;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}
.feedback-score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 13px;
  background: #f4fbf3;
  border: 1px solid #dbeedb;
  border-radius: 8px;
}
.feedback-score-line span { color: #6c876f; font-size: 12px; font-weight: 800; }
.feedback-score-line strong { color: var(--green); font-size: 28px; }
.feedback-card > p:not(.eyebrow) {
  margin: 12px 0 0;
  color: #5d6b61;
  font-size: 13px;
  line-height: 1.75;
}
.feedback-card .summary-dimensions { margin-top: 14px; }
.feedback-encouragement {
  padding: 12px;
  background: #fff;
  border: 1px solid #eadcc8;
  border-radius: 8px;
}
.feedback-card .main-speak-button {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}
.survey-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.survey-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.survey-item strong {
  color: #43554b;
  font-size: 13px;
  line-height: 1.5;
}
.survey-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.survey-options label {
  display: grid;
  gap: 5px;
  place-items: center;
  min-height: 48px;
  padding: 7px;
  color: #607067;
  background: #fff;
  border: 1px solid #dfe8df;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.survey-options input { accent-color: var(--green); }
.chart-box {
  min-height: 260px;
  margin-top: 12px;
  overflow: hidden;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}
.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
}
.chart-main {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
}
.chart-side-data {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e2ebe2;
  border-radius: 8px;
}
.chart-side-data small {
  color: #738278;
  font-size: 11px;
  font-weight: 900;
}
.chart-side-item {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
  background: #f8fbf8;
  border: 1px solid #ecf1ec;
  border-radius: 8px;
}
.chart-side-item span {
  color: #637169;
  font-size: 11px;
  font-weight: 800;
}
.chart-side-item strong {
  color: var(--metric-color);
  font-size: 18px;
  font-weight: 900;
}
.chart-grid line { stroke: #dfe8df; stroke-width: 1; }
.chart-axis-label,
.chart-x-label {
  fill: #84928a;
  font-size: 11px;
  font-weight: 800;
}
.chart-line polyline {
  fill: none;
  stroke: var(--line-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-line circle { fill: var(--line-color); stroke: #fff; stroke-width: 2; }
.chart-value-label {
  fill: var(--line-color);
  font-size: 13px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fbfcfb;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px 0;
  color: #607067;
  font-size: 12px;
  font-weight: 800;
}
.chart-legend span { display: inline-flex; gap: 6px; align-items: center; }
.chart-legend i { width: 10px; height: 10px; border-radius: 50%; }
.chart-data-table {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
  min-width: 0;
}
.chart-data-head,
.chart-data-row {
  display: grid;
  grid-template-columns: minmax(72px, .9fr) repeat(var(--metric-count, 3), minmax(58px, 1fr));
  gap: 6px;
  align-items: center;
}
.chart-data-head {
  color: #738278;
  font-size: 11px;
  font-weight: 900;
}
.chart-data-row {
  min-height: 34px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2ebe2;
  border-radius: 8px;
}
.chart-data-row strong {
  color: var(--ink);
  font-size: 12px;
}
.chart-data-row span {
  color: var(--metric-color);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.history-list, .diary-list, .flag-list, .scene-top-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.history-item, .diary-item, .flag-item, .scene-top-item, .intervention-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #5a6b61;
  font-size: 12px;
  line-height: 1.55;
}

.research-metrics-panel { margin-top: 16px; }
.research-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.research-metric {
  min-height: 74px;
  padding: 12px;
  border: 1px solid #dfe8df;
  background: #f8fbf7;
  border-radius: 6px;
}
.research-metric span, .research-metric small { display: block; color: #718076; font-size: 11px; line-height: 1.45; }
.research-metric strong { display: block; margin: 4px 0; color: var(--green); font-size: 21px; }
.data-quality-badge { color: #6b7e72; font-size: 11px; }
@media (max-width: 820px) {
  .research-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.history-item strong, .flag-item strong, .scene-top-item strong, .intervention-box strong { color: var(--ink); font-size: 13px; }
.survey-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.survey-summary div {
  padding: 12px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.survey-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.survey-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-size: 18px;
}
.flag-item.warning { background: #fff4ef; border-color: #edd2c7; }
.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #64756b;
  font-size: 12px;
  font-weight: 800;
}
.heatmap-legend span {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.heatmap-legend .low, .heat-cell.low { background: #bfe7c8; }
.heatmap-legend .mid, .heat-cell.mid { background: #ffe0a3; }
.heatmap-legend .high, .heat-cell.high { background: #ee9b8a; }
.heatmap-table {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
}
.heatmap-row {
  display: grid;
  grid-template-columns: 82px repeat(8, 58px);
  gap: 7px;
  align-items: center;
}
.heatmap-row strong, .heatmap-row span {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #516258;
  font-size: 12px;
}
.heatmap-header span { color: var(--muted); font-weight: 800; }
.heat-cell.none { background: #f2f5f1; }
.student-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.student-selector button {
  min-height: 34px;
  padding: 0 12px;
  color: #5d6e64;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}
.student-selector button.active { color: #fff; background: var(--green); border-color: var(--green); }
.student-learning-summary {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
}
.student-profile-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  background: #f8fbf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.student-profile-card strong {
  color: var(--ink);
  font-size: 17px;
}
.student-profile-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.student-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.student-summary-grid div {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.student-summary-grid span,
.student-survey-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.student-summary-grid strong {
  color: var(--ink);
  font-size: 20px;
}
.student-survey-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.student-survey-row span {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.level-distribution {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.level-pill {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.level-pill strong {
  color: var(--ink);
  font-size: 14px;
}
.level-pill span {
  color: var(--muted);
  font-size: 12px;
}
.level-pill em {
  color: var(--green);
  font-size: 22px;
  font-style: normal;
  font-weight: 900;
}
.level-pill.current {
  border-color: #90c39b;
  background: #f3faf4;
}
.form-row {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #607067;
  font-size: 12px;
  font-weight: 800;
}
.form-row input, .form-row textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}
.report-preview {
  margin-top: 16px;
  padding: 16px;
  color: #4e5f55;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.75;
}
.scene-dialogue-grid {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}
.scene-dialogue-grid.scene-setup-compact {
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}
.scene-dialogue-grid.scene-setup-compact .scene-guide-panel {
  display: none;
}
.scene-dialogue-grid.scene-setup-compact .scene-picker-panel {
  padding: 12px;
}
.scene-dialogue-grid.scene-setup-compact .scene-list {
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
}
.scene-dialogue-grid.scene-setup-compact .scene-button {
  grid-template-columns: 56px minmax(0, 1fr);
  min-height: 74px;
  padding: 8px;
}
.scene-dialogue-grid.scene-setup-compact .scene-thumb {
  width: 56px;
}
.scene-dialogue-grid.scene-setup-compact .panel-header {
  margin-bottom: 4px;
}
.scene-dialogue-grid.scene-setup-compact .panel-header .eyebrow {
  margin-bottom: 2px;
}
.scene-dialogue-grid.scene-setup-compact .panel-header h2 {
  font-size: 14px;
}
.scene-picker-panel, .phrase-panel, .achievement-panel { padding: 18px; }
.scene-guide-panel {
  position: relative;
  overflow: hidden;
  padding: 20px;
}
.scene-guide-goal {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.selected-scene-visual {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  margin: 0 0 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .12)),
    var(--scene-artwork, linear-gradient(#dceefa 0 58%, #eff7e8 58%));
  background-position: center;
  background-size: cover;
  border: 1px solid #d8e5d7;
  border-radius: 8px;
  box-shadow: inset 0 -34px 54px rgba(33, 48, 41, .08);
}
.first-scene-help {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.first-scene-help h3 {
  margin: 0 0 10px;
  color: #53675b;
  font-size: 13px;
}
.scene-start-button { margin-top: 16px; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.panel-header h2 { margin: 4px 0 0; font-size: 15px; }
.scene-list, .phrase-list, .badge-list { display: grid; gap: 8px; margin-top: 14px; }
.scene-button {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px;
  color: #4a5b51;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}
.scene-button.active { border-color: #9dcea6; background: #f2faf3; }
.scene-button.locked {
  opacity: .58;
  cursor: not-allowed;
}
.scene-button strong, .phrase-card strong { font-size: 13px; }
.scene-button span, .phrase-card span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.scene-thumb {
  position: relative;
  width: 92px;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  background-color: #eaf4ec;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid #d9e6d9;
  border-radius: 8px;
  box-shadow: inset 0 -14px 22px rgba(33, 48, 41, .08);
}
.scene-thumb-3d iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  transform: scale(1.02);
  transform-origin: center;
}
.scene-button-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.scene-button-copy strong,
.scene-button-copy span,
.scene-button-copy em {
  display: block;
}
.scene-button em {
  color: #9d7630;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.textbook-file-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.textbook-layout {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(0, 1.28fr);
  gap: 16px;
  align-items: start;
}
.textbook-unit-panel,
.textbook-lesson-panel {
  padding: 18px;
}
.textbook-unit-list,
.textbook-lesson-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.textbook-unit-button,
.textbook-lesson-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  color: #4a5b51;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}
.textbook-unit-button {
  justify-content: space-between;
}
.textbook-unit-button.active,
.textbook-lesson-button.active {
  color: var(--green);
  background: var(--green-soft);
  border-color: #9dcea6;
}
.textbook-unit-button span,
.textbook-lesson-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.textbook-unit-button strong,
.textbook-lesson-button strong {
  font-size: 13px;
}
.textbook-unit-button small,
.textbook-lesson-button small,
.textbook-lesson-button em {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.textbook-unit-button em,
.textbook-lesson-button em {
  flex: 0 0 auto;
  font-style: normal;
}
.textbook-lesson-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.textbook-lesson-header h2 {
  margin: 5px 0 7px;
  font-size: 21px;
}
.textbook-lesson-header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.textbook-page-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: #8b6a37;
  background: var(--earth-soft);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}
.textbook-lesson-number {
  flex: 0 0 72px;
  color: #6b8c72;
  font-size: 11px;
  font-weight: 800;
}
.textbook-lesson-button em {
  margin-left: auto;
}
.textbook-lesson-detail {
  margin-top: 16px;
  padding: 16px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.textbook-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.textbook-detail-head h3 {
  margin: 5px 0 6px;
  font-size: 17px;
}
.textbook-detail-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.textbook-start-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  font-size: 12px;
}
.textbook-goal-line {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  color: #53675b;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
}
.textbook-goal-line strong {
  flex: 0 0 auto;
  color: var(--green);
}
.textbook-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.textbook-resource-grid h4 {
  margin: 0 0 8px;
  color: #53675b;
  font-size: 12px;
}
.textbook-chip-list,
.textbook-phrase-list {
  display: grid;
  gap: 7px;
}
.textbook-chip {
  display: grid;
  gap: 3px;
  padding: 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
}
.textbook-chip b,
.textbook-phrase-list strong {
  color: var(--ink);
  font-size: 12px;
}
.textbook-phrase-list > div {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.textbook-phrase-list span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.phrase-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page-heading { margin-bottom: 18px; }
.module-grid, .tech-grid, .progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.module-card, .tech-card { padding: 18px; }
.module-card h2, .tech-card h2 { margin: 7px 0; font-size: 16px; }
.module-card p, .tech-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.module-card ul { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; color: #586a60; font-size: 12px; }
.module-card li::before { content: "· "; color: var(--green); font-weight: 800; }
.tech-card span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--earth);
  border-radius: 8px;
  font-weight: 800;
}
.stat-card { padding: 18px; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 8px; color: var(--green); font-size: 30px; }
.badge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.badge-item.locked { opacity: .55; }
.badge-item strong { display: block; font-size: 13px; }
.badge-item span { color: var(--muted); font-size: 11px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  padding: 10px 14px;
  color: #fff;
  background: #26352d;
  border-radius: 8px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: .2s;
  font-size: 12px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .talk-grid, .scene-dialogue-grid, .textbook-layout, .module-grid, .tech-grid, .growth-map-layout, .analytics-grid { grid-template-columns: 1fr; }
  .textbook-resource-grid { grid-template-columns: 1fr; }
  .growth-tree-hero { grid-template-columns: 1fr; }
  .growth-tree-unity-frame { aspect-ratio: 4 / 5; min-height: 420px; }
  .growth-node-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .talk-head { grid-template-columns: 1fr; }
  .rural-scene { max-width: 360px; }
  .sidebar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .main-nav { justify-content: flex-start; }
  .partner-card { width: 100%; }
  .student-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-selector button { flex: 1 1 150px; }
}

@media (max-width: 720px) {
  .sidebar {
    padding: 14px;
  }
  .brand { align-items: flex-start; }
  .brand-mark { width: 34px; height: 34px; font-size: 16px; }
  .brand strong { font-size: 13px; }
  .brand span { font-size: 10px; }
  .main-nav { gap: 6px; }
  .nav-item { min-height: 36px; padding: 0 10px; font-size: 12px; }
  .partner-card { grid-template-columns: 30px 1fr; padding: 9px; }
  .partner-card i { display: none; }
  .partner-avatar { width: 30px; height: 30px; }
  .topbar {
    height: auto;
    display: grid;
    gap: 10px;
    padding: 14px;
  }
  .topbar-tools { flex-wrap: wrap; }
  .content-wrap { padding: 16px 14px 28px; }
  .talk-panel { padding: 14px; }
  .talk-head h1, .page-heading h1 { font-size: 22px; }
  #scenesView .page-heading {
    margin-bottom: 10px;
  }
  #scenesView .page-heading p:not(.eyebrow) {
    display: none;
  }
  #scenesView .scene-picker-panel {
    padding: 10px;
  }
  #scenesView .scene-list {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 8px;
  }
  #scenesView .scene-button {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 58px;
    padding: 7px;
    gap: 7px;
  }
  #scenesView .scene-thumb {
    width: 44px;
  }
  #scenesView .scene-button strong {
    font-size: 11px;
    line-height: 1.25;
  }
  #scenesView .scene-button span {
    font-size: 10px;
    line-height: 1.32;
  }
  .scene-dialogue-panel .talk-head {
    gap: 12px;
  }
  .selected-scene-visual.scene-3d-host {
    min-height: 285px;
  }
  .rural-scene.scene-3d-host {
    height: 245px;
    max-width: none;
  }
  .scene-xiaoya-overlay-frame {
    right: 8px;
    bottom: 2px;
    width: 76px;
    height: 140px;
  }
  .scene-dialogue-panel .friend-strip {
    display: none;
  }
  .scene-dialogue-panel .chat-window {
    min-height: 118px;
    max-height: 260px;
    padding: 12px;
  }
  #sceneDialogueVisual #sceneDialogueBubble {
    left: 8px;
    right: 90px;
    bottom: 10px;
    max-height: 52%;
    min-height: 0;
    padding: 0;
  }
  #sceneDialogueVisual #sceneChatWindow {
    max-height: 88px;
  }
  #sceneDialogueVisual #sceneChatWindow .bubble {
    font-size: 11px;
    line-height: 1.38;
  }
  #sceneDialogueVisual .scene-voice-controls {
    grid-template-columns: 1fr;
    display: grid;
  }
  #sceneDialogueVisual .scene-voice-controls .main-speak-button,
  #sceneDialogueVisual .scene-voice-controls .secondary-button {
    width: 100%;
    min-height: 32px;
    padding: 0 8px;
    font-size: 10px;
  }
  #sceneDialogueVisual #sceneVoiceHint {
    font-size: 9px;
    line-height: 1.3;
  }
  body.scene-mobile-mode {
    background: #edf5e9;
  }
  body.scene-mobile-mode .sidebar,
  body.scene-mobile-mode .topbar {
    display: none;
  }
  body.scene-mobile-mode .content-wrap {
    padding: 0;
  }
  body.scene-mobile-mode #scenesView {
    min-height: 100dvh;
    padding: 8px;
  }
  body.scene-mobile-mode #scenesView .page-heading {
    display: none;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact {
    margin-bottom: 8px;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact .scene-picker-panel {
    max-height: 28dvh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact .scene-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel .talk-panel {
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel .rural-scene.scene-3d-host {
    height: min(62dvh, 520px);
    min-height: 340px;
    border-radius: 8px;
  }
  .growth-tree-unity-frame { aspect-ratio: 3 / 4; min-height: 66vh; max-height: 82vh; }
  .mobile-tree-preview-active { overflow: hidden; }
  .growth-tree-fallback { padding: 8px; }
  .growth-tree-fallback .growth-tree-scene {
    min-height: 100%;
    transform: scale(.88);
    transform-origin: center bottom;
  }
  .growth-node-grid { grid-template-columns: 1fr; }
  .growth-tree-copy h2 { font-size: 19px; }
  .mood-options { grid-template-columns: 1fr; }
  .survey-summary { grid-template-columns: 1fr; }
  .survey-card { padding: 16px; }
  .survey-options { grid-template-columns: 1fr; }
  .friend-strip { grid-template-columns: 38px 1fr; padding: 11px; }
  .friend-face { width: 38px; height: 38px; }
  .xiaoya-avatar-card { grid-template-columns: 1fr; padding: 12px; }
  .xiaoya-avatar-frame {
    min-height: 360px;
    aspect-ratio: 4 / 5;
  }
  .chat-window { min-height: 230px; padding: 12px; }
  .message { max-width: 96%; }
  .message-actions { margin-left: 6px; }
  .feedback-panel { grid-template-columns: 1fr; }
  .first-scene-help { grid-template-columns: 1fr; }
  .voice-controls { display: grid; }
  .main-speak-button, .secondary-button { width: 100%; }
  .textbook-lesson-header,
  .textbook-detail-head,
  .textbook-goal-line { display: grid; }
  .textbook-page-badge,
  .textbook-start-button { width: 100%; }
  .textbook-lesson-button { align-items: flex-start; }
  .textbook-lesson-number { flex-basis: 58px; }
  .progress-grid { grid-template-columns: 1fr; }
  .student-summary-grid { grid-template-columns: 1fr; }
  .dialogue-summary-head { flex-direction: column; }
  .summary-dimensions { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) and (orientation: landscape) {
  body.scene-mobile-mode {
    width: 100dvw;
    height: 100dvh;
    overflow: hidden;
    background: #edf5e9;
  }
  body.scene-mobile-mode .app-shell {
    width: 100dvw;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  body.scene-mobile-mode .sidebar,
  body.scene-mobile-mode .topbar {
    display: none;
  }
  body.scene-mobile-mode .main-content,
  body.scene-mobile-mode .content-wrap {
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
  }
  body.scene-mobile-mode #scenesView {
    position: fixed;
    left: 0;
    top: 0;
    display: grid;
    grid-template-columns: minmax(150px, 24vw) minmax(0, 1fr);
    gap: 8px;
    width: 100dvw;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 8px;
    background: #edf5e9;
  }
  body.scene-mobile-mode #scenesView .page-heading {
    display: none;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact {
    display: block;
    min-height: 0;
    height: 100%;
    margin: 0;
    overflow: hidden;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact .scene-picker-panel {
    height: 100%;
    max-height: none;
    overflow: auto;
    padding: 8px;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact .scene-list,
  body.scene-mobile-mode #scenesView .scene-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  body.scene-mobile-mode #scenesView .scene-button {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 56px;
    padding: 6px;
  }
  body.scene-mobile-mode #scenesView .scene-thumb {
    width: 48px;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel {
    min-height: 0;
    overflow: hidden;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel .talk-panel {
    height: 100%;
    min-height: 0;
    overflow: visible;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel .talk-head {
    height: 100%;
    min-height: 0;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel .rural-scene.scene-3d-host {
    height: calc(100dvh - 16px);
    min-height: 0;
    border-radius: 8px;
  }
  body.scene-mobile-mode .scene-xiaoya-overlay-frame {
    right: 10px;
    bottom: 4px;
    width: clamp(66px, 11vw, 90px);
    height: clamp(118px, 26vh, 150px);
  }
  body.scene-mobile-mode #sceneDialogueVisual #sceneDialogueBubble {
    left: 10px;
    right: clamp(92px, 16vw, 124px);
    bottom: 10px;
    max-height: 54%;
  }
  body.scene-mobile-mode #sceneDialogueVisual #sceneChatWindow {
    max-height: 100px;
  }
}

@media (max-width: 1024px) and (orientation: portrait) {
  body.scene-mobile-mode {
    width: 100dvw;
    height: 100dvh;
    overflow: hidden;
    background: #edf5e9;
  }
  body.scene-mobile-mode .app-shell {
    width: 100dvw;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  body.scene-mobile-mode .sidebar,
  body.scene-mobile-mode .topbar {
    display: none;
  }
  body.scene-mobile-mode .main-content,
  body.scene-mobile-mode .content-wrap {
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
  }
  body.scene-mobile-mode.scene-needs-landscape::before {
    display: none;
  }
  body.scene-mobile-mode #scenesView {
    position: fixed;
    left: 0;
    top: 0;
    display: grid;
    grid-template-columns: minmax(150px, 24vw) minmax(0, 1fr);
    gap: 8px;
    width: 100dvh;
    height: 100dvw;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
    background: #edf5e9;
    transform: rotate(90deg) translateY(-100%);
    transform-origin: left top;
  }
  body.scene-mobile-mode #scenesView .page-heading {
    display: none;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact {
    display: block;
    min-height: 0;
    height: 100%;
    margin: 0;
    overflow: hidden;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact .scene-picker-panel {
    height: 100%;
    max-height: none;
    overflow: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
  }
  body.scene-mobile-mode .scene-dialogue-grid.scene-setup-compact .scene-list,
  body.scene-mobile-mode #scenesView .scene-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  body.scene-mobile-mode #scenesView .scene-button {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 56px;
    padding: 6px;
  }
  body.scene-mobile-mode #scenesView .scene-thumb {
    width: 48px;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel {
    min-height: 0;
    overflow: hidden;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel .talk-panel {
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel .talk-head {
    height: 100%;
    min-height: 0;
  }
  body.scene-mobile-mode #scenesView .scene-dialogue-panel .rural-scene.scene-3d-host {
    height: calc(100dvw - 16px);
    min-height: 0;
    border-radius: 8px;
  }
  body.scene-mobile-mode .scene-xiaoya-overlay-frame {
    right: 10px;
    bottom: 4px;
    width: clamp(66px, 11vw, 90px);
    height: clamp(118px, 26vw, 150px);
  }
  body.scene-mobile-mode #sceneDialogueVisual #sceneDialogueBubble {
    left: 10px;
    right: clamp(92px, 16vw, 124px);
    bottom: 10px;
    max-height: 54%;
  }
  body.scene-mobile-mode #sceneDialogueVisual #sceneChatWindow {
    max-height: 100px;
  }
}

/* Tencent final-assessment cards share one layout across student and teacher pages. */
.tencent-score-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin:14px 0;}
.tencent-score-grid .research-metric{min-width:0;}
.tencent-score-grid small{white-space:normal;overflow-wrap:anywhere;}
.tencent-score-compact{gap:8px;}
.tencent-score-compact .research-metric{padding:10px;}
.tencent-score-compact strong{font-size:20px;}
@media(max-width:720px){.tencent-score-grid{grid-template-columns:1fr;}}

/* account-security-v49 */
.password-input-row { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.password-input-row input { flex: 1; width: 0; min-width: 0; }
.password-toggle { flex: 0 0 auto; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--green); font: inherit; font-size: 13px; cursor: pointer; }
.password-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.account-password-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; }
.account-password-dialog::backdrop { background: rgb(24 43 34 / 45%); }
.account-password-card { padding: 24px; }
.account-password-card h2 { margin: 0; }
.account-password-card > p { margin: 0; line-height: 1.6; }
.account-password-card fieldset { display: grid; gap: 16px; margin: 0; padding: 0; min-width: 0; border: 0; }
.password-change-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.password-change-actions button { min-height: 44px; }
.topbar-tools { flex-wrap: wrap; }
@media(max-width: 480px) { .account-password-card { padding: 18px; } .password-toggle { padding: 8px; } }
