@font-face {
  font-family: "LXGW WenKai Local";
  src: url("/static/fonts/LXGWWenKai-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 纸与墨 Paper & Ink：暖纸底、墨线、唯一一点橙 */
  --bg-color: #f5f1ea;
  --paper-color: #f5f1ea;
  --panel-color: #faf8f3;
  --text-color: #2f2b27;
  --muted-color: #8a8478;
  --line-color: #e3ded4;
  --ink-color: #1c1a17;
  --paper-deep: #f4f0e9;
  --paper-bright: #fdfcf9;
  --paper-shadow: 3px 3px 0 #e3ded4;
  --accent-color: #d9570f;
  --accent-deep: #993c1d;
  --accent-soft: rgba(217, 87, 15, 0.08);
  --mark-color: rgba(217, 87, 15, 0.15);
  --selection-color: rgba(217, 87, 15, 0.2);
  --shadow: 0 10px 24px rgba(85, 72, 60, 0.04);
  --rail-dark: #f0edea;
  --rail-dark-2: rgba(255, 252, 247, 0.32);
  --rail-dark-3: rgba(255, 252, 247, 0.52);
  --rail-gold: #d7b675;
  --rail-gold-soft: rgba(215, 182, 117, 0.12);
  --rail-text: #5a4d42;
  --rail-muted: #9b9187;
  --rail-radius: 8px;
  --rail-width: 58px;
  --chat-width: 66vw;
  --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --reading-font: "Georgia", "Iowan Old Style", "Times New Roman", "Songti SC", "Noto Serif SC", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--ui-font);
  line-height: 1.75;
  overflow: hidden;
}

body.idea-inspecting,
body.idea-inspecting * {
  cursor: crosshair !important;
}

::selection {
  background: var(--selection-color);
}

::highlight(listening-follow-word) {
  background: rgba(226, 99, 95, 0.22);
  color: #111111;
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

::highlight(listening-follow-sentence) {
  background: rgba(226, 99, 95, 0.22);
  color: #111111;
  text-decoration: none;
}

.product-cover[hidden] {
  display: none !important;
}

body.auth-gate-active .shell,
body.auth-gate-active #googooWelcome,
body.auth-gate-active #googooVoiceDock,
body.auth-gate-active #ideaInspectOverlay {
  display: none !important;
}

/* ============================================================
   封面 · 纸与墨 (Paper & Ink)
   暖纸底色 + 墨线手绘插画 + 衬线大标题 + 全局唯一一点橙
   ============================================================ */

.product-cover {
  --ink: #1c1a17;
  --ink-soft: #6f6a61;
  --paper: #faf8f4;
  --paper-deep: #f0ece4;
  --paper-line: #e3ded4;
  --accent: #d9570f;
  --serif: "Georgia", "Times New Roman", "Songti SC", "STSong", serif;
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(72px, 13vw) minmax(420px, 1fr) minmax(0, 1.15fr);
  min-height: 100vh;
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
}

.ink-rail {
  position: relative;
  background: var(--paper-deep);
  border-right: 1px solid var(--paper-line);
}

.ink-rail-plant {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(96px, 70%);
}

.ink-rail-spiral {
  position: absolute;
  top: 16vh;
  left: 50%;
  transform: translateX(-50%) rotate(-12deg);
  width: 34px;
  opacity: 0.8;
}

.ink-center {
  display: flex;
  flex-direction: column;
  padding: 34px clamp(28px, 5vw, 72px);
  background: var(--paper);
}

.ink-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
}

.ink-brand-mark {
  display: inline-flex;
  width: 30px;
  height: 30px;
}

.ink-brand-mark img {
  width: 100%;
  height: 100%;
}

.ink-form {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(380px, 100%);
  align-self: center;
}

.ink-form h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 2.6vw, 2.5rem);
  letter-spacing: 0.01em;
  margin: 0 0 22px;
  text-align: center;
}

.ink-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid var(--paper-line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ink-btn:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(28, 26, 23, 0.07);
}

.ink-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.ink-btn-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.ink-btn-mail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.ink-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--accent);
}

.ink-login-link {
  display: none;
}

.ink-stage {
  position: relative;
  background: var(--paper-deep);
  border-left: 1px solid var(--paper-line);
  padding: clamp(36px, 6vh, 72px) clamp(32px, 4vw, 64px);
  overflow: hidden;
}

.ink-headline h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: 0.005em;
  margin: 0 0 18px;
}

.ink-headline p {
  margin: 0;
  font-size: 1.02rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.ink-bird {
  position: absolute;
  right: clamp(8px, 4vw, 64px);
  bottom: 0;
  width: clamp(320px, 34vw, 520px);
  max-width: 86%;
}

.ink-stage-star {
  position: absolute;
  left: 12%;
  bottom: 30%;
  width: 26px;
  opacity: 0.75;
  transform: rotate(18deg);
}

@media (max-width: 1100px) {
  .product-cover {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ink-rail {
    display: none;
  }

  .ink-center {
    padding-bottom: 12px;
  }

  .ink-form {
    margin: 48px 0 32px;
  }

  .ink-stage {
    border-left: none;
    border-top: 1px solid var(--paper-line);
    min-height: 46vh;
  }

  .ink-bird {
    width: min(380px, 70vw);
  }
}

.shell {
  position: fixed;
  inset: 6px;
  width: auto;
  height: auto;
  margin: 0;
}

.auth-dock {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 42;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.auth-pill {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(206, 187, 169, 0.72);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.82);
  color: #7a6656;
  font-size: 0.8rem;
  box-shadow: 0 10px 28px rgba(116, 90, 67, 0.08);
  backdrop-filter: blur(12px);
}

.auth-pill:hover {
  border-color: rgba(186, 137, 101, 0.58);
  color: #9b6542;
}

/* 想法/设置 收进头像菜单后，原顶栏触发按钮隐藏（保留 DOM 供面板定位与 JS 守卫） */
#ideaDockToggle,
#googooSettingsBtn {
  display: none;
}

/* 右上角统一为圆形头像按钮 */
.auth-avatar-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(206, 187, 169, 0.72);
  border-radius: 50%;
  background: rgba(255, 252, 247, 0.92);
  color: #7a6656;
  font-family: Georgia, "Songti SC", serif;
  font-size: 0.92rem;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(116, 90, 67, 0.1);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.auth-avatar-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(116, 90, 67, 0.16);
}

.auth-avatar-btn.authenticated {
  border-color: rgba(217, 87, 15, 0.4);
  color: var(--accent-deep);
}

.auth-avatar-btn.has-photo {
  border-color: rgba(217, 87, 15, 0.5);
}

.auth-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.auth-avatar-img[hidden] {
  display: none;
}

.auth-avatar-initials[hidden] {
  display: none;
}

.auth-menu-icon {
  display: inline-block;
  width: 1.2em;
  margin-right: 7px;
  text-align: center;
  opacity: 0.8;
}

.googoo-settings-shell {
  position: relative;
}

.googoo-settings-btn {
  width: 36px;
  min-width: 36px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.16rem;
  line-height: 1;
}

.googoo-settings-btn.active {
  border-color: rgba(217, 87, 15, 0.32);
  background: rgba(255, 246, 236, 0.96);
  color: var(--accent-color);
}

.googoo-settings-panel {
  position: absolute;
  top: 40px;
  right: 0;
  width: min(318px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(218, 205, 192, 0.86);
  border-radius: 18px;
  background: #fffaf4;
  box-shadow: 0 22px 56px rgba(88, 70, 55, 0.18);
}

.googoo-settings-panel[hidden] {
  display: none !important;
}

.googoo-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.googoo-settings-head div {
  display: grid;
  gap: 3px;
}

.googoo-settings-head span,
.googoo-settings-panel label span {
  color: #9b8778;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
}

.googoo-settings-head strong {
  color: #4b4038;
  font-size: 1rem;
  line-height: 1.2;
}

.googoo-settings-head button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #947865;
  font-size: 1rem;
}

.googoo-settings-panel label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.googoo-settings-panel select {
  width: 100%;
  min-height: 38px;
  padding: 0 34px 0 11px;
  border: 1px solid rgba(214, 198, 183, 0.9);
  border-radius: 12px;
  background: #fffdf8;
  color: #5d5148;
  font: inherit;
  font-size: 0.84rem;
  outline: none;
}

.googoo-settings-panel select:focus {
  border-color: rgba(217, 87, 15, 0.36);
  box-shadow: 0 0 0 3px rgba(217, 87, 15, 0.08);
}

.googoo-settings-provider {
  color: #a18d7e;
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
}

.googoo-settings-preview {
  width: 100%;
  min-height: 38px;
  margin-top: 14px;
  border: 1px solid rgba(217, 87, 15, 0.2);
  border-radius: 12px;
  background: #f7e8df;
  color: #8b3d29;
  font-size: 0.84rem;
  font-weight: 850;
}

.googoo-settings-preview:hover {
  border-color: rgba(217, 87, 15, 0.34);
  background: #f4dfd4;
}

.auth-menu {
  position: absolute;
  top: 40px;
  right: 0;
  min-width: 232px;
  padding: 10px;
  border: 1px solid rgba(218, 205, 192, 0.8);
  border-radius: 16px;
  background: #fffaf4;
  box-shadow: 0 18px 42px rgba(88, 70, 55, 0.14);
}

.auth-menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px 10px;
}

.auth-menu-head strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 1rem;
  color: var(--ink-color);
}

.auth-menu-head small {
  font-size: 0.74rem;
  color: #9c8b7c;
}

.auth-credit-card {
  margin: 0 0 8px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f6efe6;
  border: 1px solid rgba(217, 87, 15, 0.12);
}

.auth-credit-card[hidden] {
  display: none;
}

.auth-credit-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.auth-credit-label {
  font-size: 0.82rem;
  color: #7b6656;
}

.auth-credit-value {
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.34rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.auth-credit-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: #a08b78;
}

#authAdminBtn {
  color: var(--accent-deep);
  font-weight: 600;
}

.auth-menu button {
  width: 100%;
  min-height: 32px;
  border-radius: 10px;
  color: #7b6656;
  font-size: 0.8rem;
  text-align: left;
}

.auth-menu button:hover {
  background: #f3ebe2;
}

.auth-dialog[hidden] {
  display: none;
}

.auth-dialog,
.admin-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
}

.admin-dialog[hidden] {
  display: none;
}

.admin-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(62, 52, 44, 0.2);
  backdrop-filter: blur(10px);
}

.admin-card {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 26px 26px 20px;
  border: 1px solid rgba(222, 204, 187, 0.86);
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdf8 0%, #fbf2e8 100%);
  box-shadow: 0 34px 90px rgba(75, 59, 44, 0.22);
}

.admin-close {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 1.4rem;
  color: #9c8b7c;
  background: none;
}

.admin-card-head h2 {
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.3rem;
  color: var(--ink-color);
}

.admin-card-head p {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #9c8b7c;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  flex-wrap: wrap;
}

.admin-secondary-btn {
  padding: 6px 14px;
  border: 1px solid var(--line-color);
  border-radius: 999px;
  background: #fff;
  color: #7b6656;
  font-size: 0.8rem;
}

.admin-summary {
  font-size: 0.78rem;
  color: #8a7665;
}

.admin-family-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-empty {
  padding: 28px;
  text-align: center;
  color: #a08b78;
  font-size: 0.86rem;
}

.admin-family-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) minmax(200px, 2fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-color);
  border-radius: 14px;
  background: #fffdfa;
}

.admin-family-row.is-low {
  border-color: rgba(217, 87, 15, 0.4);
  background: #fff6ef;
}

.admin-family-id strong {
  display: block;
  font-size: 0.92rem;
  color: var(--ink-color);
}

.admin-family-id small {
  font-size: 0.72rem;
  color: #a08b78;
}

.admin-family-stats {
  display: flex;
  gap: 16px;
}

.admin-family-stats span {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.admin-family-stats em {
  font-style: normal;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-color);
}

.admin-family-stats small {
  font-size: 0.66rem;
  color: #a08b78;
}

.admin-family-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-grant-btn {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(217, 87, 15, 0.3);
  background: #fff;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-grant-btn:hover {
  background: var(--accent-color);
  color: #fff;
}

.admin-grant-custom {
  border-color: var(--line-color);
  color: #7b6656;
}

.admin-exempt-tag {
  font-size: 0.72rem;
  color: #a08b78;
}

.admin-status-text {
  margin-top: 12px;
  min-height: 18px;
  font-size: 0.8rem;
  color: var(--accent-deep);
}

.auth-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(62, 52, 44, 0.2);
  backdrop-filter: blur(10px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid rgba(222, 204, 187, 0.86);
  border-radius: 26px;
  background: linear-gradient(180deg, #fffdf8 0%, #fbf2e8 100%);
  box-shadow: 0 34px 90px rgba(75, 59, 44, 0.22);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #947865;
  font-size: 1rem;
}

.auth-card-head {
  padding-right: 32px;
}

.auth-eyebrow {
  margin: 0 0 8px;
  color: #b17d55;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 0 0 8px;
  color: #4b4038;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.auth-card p {
  margin: 0;
  color: #95867a;
  font-size: 0.86rem;
  line-height: 1.6;
}

.auth-google-btn,
.auth-primary-btn,
.auth-secondary-btn {
  min-height: 42px;
  border-radius: 14px;
  font-size: 0.9rem;
}

.auth-google-btn {
  width: 100%;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  border: 1px solid rgba(214, 198, 183, 0.9);
  background: #fffaf4;
  color: #5d5148;
}

.auth-google-mark {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #efe2d5;
  color: #9b6542;
  font-weight: 800;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #b0a398;
  font-size: 0.76rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(218, 205, 192, 0.72);
}

.auth-fields {
  display: grid;
  gap: 12px;
}

.auth-fields label {
  display: grid;
  gap: 6px;
  color: #7d6d60;
  font-size: 0.78rem;
}

.auth-fields input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(213, 197, 182, 0.92);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.82);
  color: #4f443d;
  font: inherit;
  outline: none;
}

.auth-fields input:focus {
  border-color: rgba(190, 129, 87, 0.72);
  box-shadow: 0 0 0 3px rgba(220, 150, 103, 0.12);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.auth-primary-btn {
  background: #b9855f;
  color: #fffaf4;
}

.auth-secondary-btn {
  border: 1px solid rgba(204, 181, 162, 0.88);
  background: transparent;
  color: #8d6c55;
}

.auth-status-text {
  min-height: 22px;
  margin-top: 14px !important;
  color: #9b6542 !important;
}

.auth-legal-copy {
  margin-top: 12px !important;
  color: #aa9b8f !important;
  font-size: 0.74rem !important;
}

.auth-legal-copy a {
  color: #9b6542;
  text-decoration: none;
}

.auth-legal-copy a:hover {
  text-decoration: underline;
}

.workspace-home-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1.5px solid var(--ink-color);
  border-radius: 50%;
  background: var(--paper-bright);
  color: var(--ink-color);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.workspace-home-btn svg {
  width: 18px;
  height: 18px;
}

.workspace-home-btn:hover {
  transform: translateY(-1px);
  box-shadow: 2px 3px 0 #e3ded4;
}

.workspace-home-btn[hidden] {
  display: none !important;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(58px, var(--rail-width)) 1px minmax(520px, 1fr) 1px minmax(320px, var(--chat-width));
  gap: 0;
  height: 100%;
  padding-top: 10px;
}

/* 看片 = 左内容 + 右 GooGoo */
.workspace-layout[data-view-mode="video"] {
  grid-template-columns: minmax(480px, 1fr) 1px minmax(330px, 0.46fr);
}

.workspace-layout[data-view-mode="video"] .rail,
.workspace-layout[data-view-mode="video"] #resizeLeft {
  display: none;
}

/* 阅读 = 专注单列：不要右边聊天（要讨论/复述去「讨论」标签） */
.workspace-layout[data-view-mode="read"] {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-layout[data-view-mode="read"] .rail,
.workspace-layout[data-view-mode="read"] #resizeLeft,
.workspace-layout[data-view-mode="read"] #resizeRight,
.workspace-layout[data-view-mode="read"] .chat-panel {
  display: none;
}

/* 讨论 = 进入即专注：去掉左边会话栏，只留内容 + 右聊天 */
.workspace-layout[data-view-mode="input"] {
  grid-template-columns: minmax(340px, 1fr) 1px minmax(420px, var(--chat-width));
}

.workspace-layout[data-view-mode="input"] .rail,
.workspace-layout[data-view-mode="input"] #resizeLeft {
  display: none;
}

.workspace-layout[data-view-mode="pronunciation"] {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-layout[data-view-mode="pronunciation"] .rail,
.workspace-layout[data-view-mode="pronunciation"] #resizeLeft,
.workspace-layout[data-view-mode="pronunciation"] #resizeRight,
.workspace-layout[data-view-mode="pronunciation"] .chat-panel {
  display: none;
}

/* 自由探索 / 通用导师 = 纯聊天：只留聊天区，居中专注，没有阅读栏 */
.workspace-layout[data-view-mode="tutor"] {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-layout[data-view-mode="tutor"] .rail,
.workspace-layout[data-view-mode="tutor"] #resizeLeft,
.workspace-layout[data-view-mode="tutor"] .center-stack,
.workspace-layout[data-view-mode="tutor"] #resizeRight {
  display: none;
}

.workspace-layout[data-view-mode="tutor"] .chat-panel {
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
}

.workspace-layout[data-view-mode="video"] .center-stack,
.workspace-layout[data-view-mode="pronunciation"] .center-stack {
  min-width: 0;
}

.workspace-layout[data-view-mode="video"] .reading-panel {
  overflow: hidden;
  border-color: rgba(36, 32, 29, 0.9);
  background: #10100f;
}

/* 跟读与阅读/讨论同纸感：面板框也走亮底，别再露深色边 */
.workspace-layout[data-view-mode="pronunciation"] .reading-panel {
  overflow: hidden;
}

.study-home {
  position: relative;
  height: 100%;
  padding: 58px 22px 18px;
  display: block;
  overflow: auto;
}

.study-home[hidden] {
  display: none;
}

.study-home-main {
  width: min(1380px, 100%);
  min-height: 0;
  display: grid;
  gap: 16px;
  margin: 0 auto;
  padding-bottom: 22px;
}

.study-home-minimal .study-home-main {
  max-width: 1080px;
}

.study-home-logo {
  order: 1;
  display: grid;
  place-items: center;
  padding: 14px 20px 2px;
  text-align: center;
}

.study-start-copy h1 {
  margin: 0;
  color: #2f2924;
  font-size: clamp(2rem, 4.2vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.study-start-shortcuts {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
  color: #7d7066;
  font-size: 0.88rem;
  font-weight: 850;
}

.study-start-shortcuts span,
.course-subject kbd {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.study-start-shortcuts kbd,
.course-subject kbd {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(194, 170, 148, 0.68);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.9);
  color: #7f604c;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
}

/* 今天页顺序由 DOM 决定：hero -> 学科卡 -> 成长折叠区 */

.study-home-minimal .study-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-home-minimal .course-grid {
  grid-template-columns: 1fr;
}

.learning-plan-materials-list[hidden] {
  display: none !important;
}

.study-home-minimal .course-card-featured {
  grid-template-columns: 130px minmax(0, 1fr);
}

body[data-workspace-mode="home"] .view-mode-switch .view-mode-btn:not([data-mode="home"]) {
  opacity: 0.58;
}

/* 留白即容器：区块不再包大面板，卡片才是实体 */
.study-section {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.study-metric-card,
.course-card {
  border: 1px solid var(--line-color);
  background: var(--paper-bright);
  box-shadow: none;
}

.course-card {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink-color);
  box-shadow: 4px 5px 0 #e3ded4;
}

.study-kicker {
  margin: 0 0 8px;
  color: #8f684f;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
}

.study-section h2,
.course-mode-card h2 {
  margin: 0;
  color: #342c27;
  line-height: 1.12;
  letter-spacing: 0;
}

.course-card p,
.study-report-empty,
.course-mode-summary {
  margin: 10px 0 0;
  color: #7a7068;
  font-size: 0.92rem;
  line-height: 1.7;
}

.study-section {
  min-height: 0;
  padding: 20px;
  border-radius: 20px;
}

.study-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.study-section h2 {
  font-size: 1.2rem;
}

/* 导入状态是系统信息，对孩子无意义：极淡小字，不抢痕迹的戏 */
.study-sync-badge {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b8b1a4;
  font-size: 0.72rem;
  font-weight: 400;
  white-space: nowrap;
}

.study-heatmap-section {
  background: transparent;
  padding-top: 6px;
  padding-bottom: 6px;
}

.study-heatmap-head {
  align-items: flex-start;
}

.study-heatmap-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.study-heatmap-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.study-heatmap-summary span,
.study-heatmap-summary button {
  min-width: 92px;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  justify-content: start;
  column-gap: 4px;
  row-gap: 2px;
  padding: 7px 11px;
  border: 1px solid var(--line-color);
  border-radius: 12px;
  background: var(--paper-bright);
  font: inherit;
  text-align: left;
}

.study-heatmap-summary button {
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.study-heatmap-summary button:hover {
  transform: translateY(-1px);
  box-shadow: 2px 3px 0 #e3ded4;
}

.study-heatmap-summary small {
  grid-column: 1 / -1;
  color: var(--muted-color);
  font-size: 0.68rem;
  font-weight: 500;
}

.study-heatmap-summary strong {
  color: var(--ink-color);
  font-size: 1.2rem;
  line-height: 1;
}

.study-heatmap-summary em {
  color: var(--muted-color);
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 400;
}

.study-heatmap {
  width: 100%;
  padding: 2px 0 4px;
}

.study-year-heatmap {
  --heat-cell: clamp(5px, 0.46vw, 7px);
  --heat-gap: 3px;
  display: grid;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.study-heatmap-months {
  min-width: 720px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  column-gap: clamp(4px, 0.75vw, 10px);
}

.study-heatmap-month {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.study-heatmap-month-label {
  color: rgba(83, 73, 63, 0.72);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.study-heatmap-month-grid {
  display: grid;
  grid-template-columns: repeat(7, var(--heat-cell));
  grid-auto-rows: var(--heat-cell);
  gap: var(--heat-gap);
  justify-content: center;
}

.study-heatmap-cell {
  appearance: none;
  justify-self: center;
  width: var(--heat-cell);
  height: var(--heat-cell);
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #ebe5d9;
  box-shadow: none;
  cursor: pointer;
}

.study-heatmap-cell:hover,
.study-heatmap-cell:focus-visible {
  transform: scale(1.38);
  box-shadow: 0 0 0 2px var(--paper-bright), 0 2px 8px rgba(74, 100, 76, 0.3);
  outline: none;
}

/* 水墨绿：像宣纸上洇开的淡墨到浓墨 */
.study-heatmap-cell.heat-1 {
  background: #dde4d0;
}

.study-heatmap-cell.heat-2 {
  background: #b5c6a6;
}

.study-heatmap-cell.heat-3 {
  background: #7d9a74;
}

.study-heatmap-cell.heat-4 {
  background: #475f49;
}

.study-heatmap-cell.today {
  outline: 1.5px solid var(--ink-color);
  outline-offset: 1px;
}

.study-heatmap-cell.future {
  opacity: 0.38;
}

.study-heatmap-cell.has-record {
  box-shadow: inset 0 0 0 1px rgba(25, 107, 61, 0.16);
}

.study-heatmap-legend {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(83, 73, 63, 0.68);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.study-heatmap-legend .study-heatmap-cell {
  cursor: default;
  pointer-events: none;
}


.study-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.study-metric-card {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 18px;
  border-radius: 18px;
}

.study-metric-card[data-archive-open] {
  cursor: pointer;
}

.study-metric-card[data-archive-open]:hover {
  border-color: rgba(63, 127, 113, 0.42);
  transform: translateY(-1px);
}

.study-metric-card span,
.course-subject,
.ability-model-grid span {
  color: #8a8179;
  font-size: 0.78rem;
  font-weight: 800;
}

.study-metric-card strong {
  color: #2d2925;
  font-size: 2.2rem;
  line-height: 1;
}

.study-metric-card small {
  color: #9d9186;
  font-size: 0.76rem;
}

.study-plan-section {
  overflow: visible;
}

.content-library-head {
  align-items: center;
}

.content-library-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.content-library-actions input,
#markdownFile {
  display: none;
}

.content-upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-align: center;
}

.study-secondary-btn,
.course-open-btn {
  min-height: 36px;
  border: 1.5px solid var(--ink-color);
  border-radius: 999px;
  background: var(--paper-bright);
  color: var(--ink-color);
  font-weight: 500;
  font-size: 0.88rem;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.study-secondary-btn:hover,
.course-open-btn:hover {
  background: var(--paper-bright);
  transform: translateY(-1px);
  box-shadow: 2px 3px 0 #e3ded4;
}

.content-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.content-library-card {
  min-height: 180px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(211, 198, 185, 0.68);
  border-left-width: 4px;
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.72);
  text-align: center;
}

/* 不同学科用左侧色条 + 浅底色区分 */
.content-library-card.subject-english {
  border-left-color: #d9570f;
  background: linear-gradient(180deg, rgba(217, 87, 15, 0.06), rgba(255, 250, 242, 0.72) 60%);
}

.content-library-card.subject-chinese {
  border-left-color: #4c7e69;
  background: linear-gradient(180deg, rgba(76, 126, 105, 0.08), rgba(255, 250, 242, 0.72) 60%);
}

.content-library-card.subject-math {
  border-left-color: #5b6bb0;
  background: linear-gradient(180deg, rgba(91, 107, 176, 0.08), rgba(255, 250, 242, 0.72) 60%);
}

.content-library-card-head {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.content-library-cover {
  width: min(100%, 220px);
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(76, 126, 105, 0.94), rgba(226, 163, 58, 0.76)),
    linear-gradient(180deg, rgba(255, 250, 244, 0.2), transparent);
  color: #fffaf4;
  font-size: 0.86rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 244, 0.28);
  overflow: hidden;
}

.content-library-cover.has-image {
  background: #f6efe6;
}

.content-library-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.content-library-cover.plan-cover {
  width: 64px;
  height: 48px;
  border-radius: 10px;
}

.content-library-title {
  margin: 0;
  min-width: 0;
  color: #332d28;
  font-size: 1rem;
  line-height: 1.22;
  font-weight: 900;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.content-library-title strong {
  display: block;
  color: #332d28;
  font-size: 0.98rem;
  line-height: 1.25;
}

.content-library-title small,
.content-library-meta,
.learning-plan-material-meta {
  color: #8e7d70;
  font-size: 0.76rem;
  line-height: 1.4;
}

.content-library-preview {
  margin: 0;
  color: #6f6258;
  font-size: 0.86rem;
  line-height: 1.55;
}

.content-library-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.content-library-metrics span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid rgba(211, 198, 185, 0.58);
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.74);
}

.content-library-metrics small,
.learning-plan-material-body small {
  display: block;
  color: #9a897b;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.content-library-metrics strong {
  display: block;
  color: #4f4036;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  /* 保证所有字看得清：允许换行，不截断 */
  white-space: normal;
  overflow-wrap: anywhere;
}

.content-library-card-actions,
.learning-plan-material-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.content-library-card-actions {
  grid-template-columns: 1fr;
}

.content-library-card-actions button,
.learning-plan-material-actions button {
  min-height: 30px;
  border: 1px solid rgba(194, 170, 148, 0.72);
  border-radius: 10px;
  background: rgba(255, 250, 244, 0.92);
  color: #6e5847;
  font-size: 0.78rem;
  font-weight: 850;
}

.content-library-card-actions .is-added {
  border-color: rgba(87, 139, 111, 0.42);
  background: rgba(230, 244, 235, 0.84);
  color: #436b55;
}

.content-library-empty,
.learning-plan-empty {
  padding: 18px;
  border: 1px dashed rgba(185, 163, 144, 0.58);
  border-radius: 14px;
  color: #8d7b6c;
  font-size: 0.88rem;
  line-height: 1.6;
}

.learning-plan-materials {
  margin: 18px 4px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.learning-plan-materials-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #332d28;
  font-size: 0.9rem;
}

.learning-plan-materials-head span {
  color: #8e7d70;
  font-size: 0.78rem;
  font-weight: 850;
}

.learning-plan-materials-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.learning-plan-material-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(211, 198, 185, 0.64);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.82);
}

.learning-plan-material-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.learning-plan-material-body strong {
  color: #332d28;
  font-size: 0.94rem;
  line-height: 1.25;
}

.learning-plan-material-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 112, 101, 0.14);
}

.learning-plan-material-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4b9c84, #e2a33a);
}

.reading-visual-card {
  margin: 34px 0;
  padding: 0;
  border: 1px solid rgba(211, 198, 185, 0.52);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.72);
  overflow: hidden;
}

.reading-visual-card img {
  width: 100%;
  max-height: min(360px, 44vh);
  display: block;
  object-fit: cover;
}

.reading-visual-card figcaption {
  padding: 10px 14px 12px;
  color: #7b6c60;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

/* 学科卡竖排：一行一科，信息呼吸感 */
.course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 880px;
  margin-inline: auto;
  width: 100%;
}

.course-card {
  min-height: 96px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
}

.course-cover {
  position: relative;
  display: grid;
  place-items: end center;
  align-self: stretch;
  min-height: 100%;
  padding: 0 0 9px;
  overflow: hidden;
  border-right: 1px solid var(--line-color);
  background-color: var(--paper-deep);
  background-position: center 30%;
  background-repeat: no-repeat;
  background-size: 50%;
}

.course-abbr {
  display: inline-grid;
  min-width: 32px;
  height: 24px;
  padding: 0 8px;
  place-items: center;
  border: 1.5px solid var(--ink-color);
  border-radius: 8px;
  background: var(--paper-bright);
  color: var(--ink-color);
  font-family: Georgia, "Songti SC", serif;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
}

.course-abbr-pbl {
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.course-cover-reading {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' fill='none' stroke='%231c1a17' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><path d='M60 38 C49 30 33 28 22 33 L22 86 C33 81 49 83 60 91 C71 83 87 81 98 86 L98 33 C87 28 71 30 60 38 Z' fill='%23fdfcf9'/><path d='M60 39 L60 90'/><path d='M31 46 L51 43 M31 56 L51 54 M31 66 L51 64 M69 43 L89 46 M69 54 L89 56 M69 64 L89 66' stroke-width='3'/></svg>");
}

.course-cover-video {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' fill='none' stroke='%231c1a17' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><rect x='22' y='34' width='76' height='54' rx='10' fill='%23fdfcf9'/><path d='M44 24 L60 34 L76 24' stroke-width='3.5'/><path d='M52 50 L72 61 L52 72 Z' fill='%231c1a17' stroke='none'/></svg>");
}

.course-cover-video.has-course-thumbnail {
  background-image: var(--course-cover-image);
  background-size: cover;
  background-position: center;
}

.course-cover-chinese {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' fill='none' stroke='%231c1a17' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><path d='M78 16 L94 32' stroke-width='5'/><path d='M74 20 L52 50 L62 60 L90 36 Z' fill='%23fdfcf9'/><path d='M52 50 L40 74 L62 60 Z' fill='%231c1a17' stroke='none'/><path d='M20 96 Q 48 86 98 93' stroke-width='6'/></svg>");
}

.course-cover-math {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' fill='none' stroke='%231c1a17' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><circle cx='52' cy='22' r='7' fill='%23fdfcf9'/><path d='M48 28 L32 84 M56 28 L72 84'/><path d='M32 84 Q 52 95 72 84' stroke-width='3' stroke-dasharray='2 7'/><path d='M82 62 L104 92 L82 92 Z' fill='%23fdfcf9' stroke-width='3.5'/></svg>");
}

.course-cover-pbl {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' fill='none' stroke='%231c1a17' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><path d='M24 92 L24 40 L60 24 L96 40 L96 92' /><path d='M24 92 L96 92' stroke-width='5'/><rect x='44' y='60' width='32' height='32' fill='%23fdfcf9'/><path d='M52 60 L52 92 M68 60 L68 92'/><path d='M40 44 L60 36 L80 44' stroke-width='3'/><circle cx='60' cy='20' r='5' fill='%23fdfcf9'/></svg>");
}

/* 自由探索（旗舰入口）：指南针图 + 暖橙底，从一排学科卡里跳出来 */
.course-cover-tutor {
  background-color: #f6e4d4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120' fill='none' stroke='%231c1a17' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><circle cx='60' cy='60' r='38' fill='%23fdfcf9'/><path d='M60 34 L70 60 L60 86 L50 60 Z' fill='%23e5793a' stroke='none'/><path d='M60 34 L70 60 L50 60 Z' fill='%231c1a17' stroke='none'/><circle cx='60' cy='60' r='4' fill='%231c1a17' stroke='none'/></svg>");
}

.course-card-tutor {
  box-shadow: inset 0 0 0 1.5px rgba(229, 121, 58, 0.55);
}

/* 创作工作室 · 音乐卡：暖橙底 + 音符 emoji 当封面 */
.course-cover-music {
  background-color: #f3e7d6;
}

.course-cover-music .course-abbr {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
}

.course-card-make {
  box-shadow: inset 0 0 0 1.5px rgba(229, 121, 58, 0.4);
}

/* PBL 长任务卡：换个不同于橙色旗舰卡的边框色（绿=成长/项目） */
.course-card[data-course-card="pbl-longtask"] {
  box-shadow: inset 0 0 0 1.5px rgba(58, 138, 74, 0.5);
}

/* 音乐工作室弹窗 */
.music-studio-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.music-studio-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(40, 33, 26, 0.42);
}

.music-studio-panel {
  position: relative;
  width: min(560px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 22px 24px 26px;
  border-radius: 16px;
  background: var(--paper, #fffaf4);
  box-shadow: 0 24px 60px rgba(40, 33, 26, 0.28);
}

.music-studio-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.music-studio-head h2 {
  margin: 2px 0 4px;
  font-size: 1.25rem;
}

.music-studio-sub {
  color: var(--ink-soft, #6b5f52);
  font-size: 0.86rem;
}

.music-prompt {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid var(--paper-line, rgba(36, 32, 29, 0.2));
  border-radius: 10px;
  background: #fff;
  font: inherit;
  resize: vertical;
}

.music-studio-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.music-ctrl {
  font-size: 0.86rem;
  color: var(--ink-soft, #6b5f52);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.music-ctrl select {
  font: inherit;
  padding: 3px 6px;
  border-radius: 7px;
  border: 1px solid var(--paper-line, rgba(36, 32, 29, 0.2));
}

.music-generate-btn {
  margin-left: auto;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-orange, #e5793a);
  color: #fffaf4;
  font-weight: 720;
  cursor: pointer;
}

.music-generate-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.music-status {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft, #6b5f52);
}

.music-result {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.music-result audio {
  width: 100%;
}

.music-again-btn {
  align-self: flex-start;
  padding: 6px 14px;
  border: 1.5px solid var(--brand-orange, #e5793a);
  border-radius: 999px;
  background: transparent;
  color: var(--brand-orange, #e5793a);
  font-weight: 680;
  cursor: pointer;
}

/* 🎵 PBL 聊天下方的工具条 + 内联音频 */
.composer-tools {
  display: flex;
  gap: 8px;
  padding: 2px 2px 8px;
}

/* 关键：display:flex 会盖过 [hidden] 的 display:none → 必须显式让 hidden 生效，
   否则音乐工具条在研究/英语等非 PBL 聊天里也会冒出来 */
.composer-tools[hidden] {
  display: none;
}

.composer-tool-btn {
  padding: 5px 14px;
  border: 1.5px solid var(--brand-orange, #e5793a);
  border-radius: 999px;
  background: transparent;
  color: var(--brand-orange, #e5793a);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.composer-tool-btn:hover {
  background: rgba(229, 121, 58, 0.08);
}

.composer-tool-btn.music-go {
  background: var(--brand-orange, #e5793a);
  color: #fffaf4;
}

.composer-tool-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.chat-audio {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.course-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 14px 14px 16px;
}

.course-title {
  margin: 0;
  color: #332d28;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-hint {
  color: #8a7c6e;
  font-size: 0.8rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 学科卡进度：一行关键数字 + 一条贯穿到按钮前的长进度条 */
.course-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
}

.course-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--paper-deep, #ece5db);
  overflow: hidden;
}

.course-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-color);
  transition: width 0.4s ease;
}

.course-stats {
  min-width: 0;
  color: #8a7c6e;
  font-size: 0.8rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-stats strong {
  color: #5b5048;
  font-weight: 700;
}

/* 圆形进入按钮：贴在长条右侧，图形示意"进入"，不写字 */
.course-enter-btn {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-right: 16px;
  border: none;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 12px rgba(229, 121, 58, 0.26);
}

.course-enter-btn svg {
  width: 22px;
  height: 22px;
}

.course-enter-btn:hover {
  transform: translateX(2px) scale(1.05);
  box-shadow: 0 7px 18px rgba(229, 121, 58, 0.36);
}

.course-enter-btn:active {
  transform: scale(0.95);
}

/* 首页「我的 / 资料库」切换 */
.home-view[hidden] {
  display: none;
}

.home-view-toggle {
  /* 顶到与右上角头像同一高度 */
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  width: fit-content;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid rgba(211, 198, 185, 0.7);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.8);
}

.home-view-tab {
  padding: 7px 22px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #8a7c6e;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-view-tab.active {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 3px 10px rgba(229, 121, 58, 0.26);
}

.library-divider-head {
  margin: 26px 0 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(211, 198, 185, 0.5);
}

.library-divider-head .study-kicker {
  margin: 0;
}

.library-divider-head .growth-fold-count {
  margin-left: 8px;
  color: var(--muted-color, #9a8d7f);
  font-style: normal;
  font-size: 0.82rem;
}

.weekly-plan-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(211, 198, 185, 0.6);
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.72);
}

.weekly-plan-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.weekly-plan-head .study-kicker {
  margin: 0;
}

.weekly-plan-head strong {
  color: #342c27;
  font-size: 0.92rem;
}

.weekly-plan-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.weekly-plan-day {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(194, 170, 148, 0.5);
  border-radius: 12px;
  background: rgba(247, 241, 234, 0.72);
}

.weekly-plan-day.today {
  border-color: rgba(63, 127, 113, 0.48);
  background: rgba(236, 246, 232, 0.78);
}

.weekly-plan-day strong {
  color: #302a25;
  font-size: 0.92rem;
}

.weekly-plan-day span {
  color: #8f684f;
  font-size: 0.72rem;
  font-weight: 900;
}

.weekly-plan-day small {
  color: #6f665f;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.35;
}

.weekly-plan-day p {
  margin: 0;
  color: #6f665f;
  font-size: 0.8rem;
  line-height: 1.45;
}

.study-archive-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.study-archive-section .study-section-head {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.study-archive-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.study-archive-links button {
  width: 100%;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: rgba(247, 241, 234, 0.82);
  color: #403832;
  text-align: left;
}

.study-archive-links button:hover {
  background: rgba(236, 246, 232, 0.86);
}

.study-archive-links span {
  font-weight: 900;
}

.study-archive-links small {
  color: #8b8179;
  font-size: 0.76rem;
  line-height: 1.35;
}

.study-report-slot {
  min-height: 112px;
}

.study-report-card {
  width: 100%;
  min-height: 132px;
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(194, 170, 148, 0.72);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.94), rgba(239, 247, 240, 0.88));
  color: #403832;
  text-align: left;
  box-shadow: 0 12px 28px rgba(92, 72, 55, 0.08);
}

.study-report-card:hover {
  border-color: rgba(158, 99, 60, 0.48);
  transform: translateY(-1px);
}

.study-report-card-label {
  color: #8f684f;
  font-size: 0.72rem;
  font-weight: 900;
}

.study-report-card strong {
  color: #2f2924;
  font-size: 0.98rem;
  line-height: 1.25;
}

.study-report-card small {
  color: #81766e;
  font-size: 0.74rem;
  font-weight: 760;
}

.study-report-card p {
  margin: 0;
  color: #6d625b;
  font-size: 0.82rem;
  line-height: 1.55;
}

.study-report-card-action {
  justify-self: start;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #3f7f71;
  color: #fffaf4;
  font-size: 0.74rem;
  font-weight: 900;
}

.ability-model-section {
  margin-bottom: 8px;
}

.ability-model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ability-model-grid article {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 16px;
  border: 1px solid rgba(194, 170, 148, 0.54);
  border-radius: 14px;
  background: rgba(247, 241, 234, 0.78);
}

.ability-model-grid strong {
  color: #3f7f71;
  font-size: 1.08rem;
  line-height: 1.2;
}

.ability-model-grid small {
  color: #7c7168;
  font-size: 0.78rem;
  line-height: 1.45;
}
/* ① 阅读收尾闸 */
.finish-gate {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 24px;
}
.finish-gate[hidden] { display: none; }
.finish-gate-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(38, 32, 28, 0.4);
  backdrop-filter: blur(10px);
}
.finish-gate-panel {
  position: relative;
  width: min(460px, 92vw);
  background: #fffdf9;
  border: 1px solid rgba(60, 52, 44, 0.12);
  border-radius: 18px;
  padding: 22px 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}
.finish-gate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.finish-gate-head strong { font-size: 1.05rem; color: #2c2620; }
.finish-gate-x {
  border: 0; background: transparent; font-size: 1.3rem; line-height: 1;
  color: #8a8073; cursor: pointer; padding: 2px 6px;
}
.finish-step-title { font-size: 1rem; font-weight: 600; color: #2c2620; margin: 0 0 6px; }
.finish-step-hint { font-size: 0.84rem; color: #8a8073; margin: 0 0 14px; }
.finish-audio-status { font-size: 0.84rem; color: #6b5; min-height: 20px; margin: 10px 0; color: #6b6256; }
.finish-step .study-primary-btn { display: inline-flex; margin-right: 8px; margin-top: 6px; }
.finish-step .study-primary-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.finish-quiz-progress { font-size: 0.8rem; color: #8a8073; margin-bottom: 8px; }
.finish-quiz-word {
  font-size: 1.5rem; font-weight: 600; color: #2c2620; text-align: center;
  padding: 14px; background: rgba(224, 136, 63, 0.08); border-radius: 12px; margin-bottom: 14px;
}
.finish-quiz-options { display: flex; flex-direction: column; gap: 8px; }
.finish-quiz-option {
  text-align: left; padding: 11px 14px; border: 1px solid rgba(60, 52, 44, 0.18);
  border-radius: 11px; background: #fff; color: #3d3833; cursor: pointer; font: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.finish-quiz-option:hover { background: rgba(224, 136, 63, 0.08); border-color: rgba(224, 136, 63, 0.4); }
.finish-quiz-option.is-wrong { border-color: #d9534f; background: rgba(217, 83, 79, 0.08); }
.finish-quiz-feedback { font-size: 0.84rem; color: #d9534f; min-height: 20px; margin-top: 10px; }
.reading-finish-chip { font-weight: 600; }

.study-report-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.study-report-dialog[hidden] {
  display: none;
}

.study-report-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(38, 32, 28, 0.34);
  backdrop-filter: blur(10px);
}

.study-report-panel {
  position: relative;
  z-index: 1;
  width: min(840px, 100%);
  max-height: min(780px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(211, 198, 185, 0.78);
  border-radius: 20px;
  background: #fffaf4;
  box-shadow: 0 26px 80px rgba(62, 48, 38, 0.22);
}

.study-report-panel-head {
  min-height: 92px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(211, 198, 185, 0.6);
}

.study-report-panel-head h2 {
  margin: 0;
  color: #342c27;
  font-size: 1.35rem;
  line-height: 1.25;
}

.study-report-meta {
  display: block;
  margin-top: 7px;
  color: #81766e;
  font-size: 0.82rem;
  font-weight: 760;
}

.study-report-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(194, 170, 148, 0.7);
  border-radius: 999px;
  background: rgba(247, 241, 234, 0.92);
  color: #6e5847;
  font-size: 1.15rem;
  font-weight: 900;
}

.study-report-body {
  overflow: auto;
  padding: 22px 24px 28px;
}

.study-report-body pre {
  margin: 0;
  white-space: pre-wrap;
  color: #342c27;
  font-family: var(--reading-font);
  font-size: 1rem;
  line-height: 1.72;
}


.daily-review-detail {
  display: grid;
  gap: 16px;
  color: #342c27;
}

.daily-review-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(194, 170, 148, 0.58);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.94), rgba(236, 246, 232, 0.82));
}

.daily-review-kicker {
  display: block;
  margin-bottom: 8px;
  color: #8f684f;
  font-size: 0.74rem;
  font-weight: 900;
}

.daily-review-hero strong {
  display: block;
  color: #3f7f71;
  font-size: 2.4rem;
  line-height: 1;
}

.daily-review-hero p,
.daily-review-grid p {
  margin: 8px 0 0;
  color: #6d625b;
  font-size: 0.92rem;
  line-height: 1.65;
}

.daily-review-mini-grid,
.daily-review-formula {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.daily-review-mini-grid span,
.daily-review-formula span {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(211, 198, 185, 0.68);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.72);
}

.daily-review-mini-grid b,
.daily-review-formula b {
  color: #342c27;
  font-size: 1.18rem;
}

.daily-review-mini-grid small,
.daily-review-formula small {
  color: #81766e;
  font-size: 0.72rem;
  font-weight: 900;
}

.daily-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.daily-review-grid article,
.daily-review-section {
  padding: 16px;
  border: 1px solid rgba(211, 198, 185, 0.62);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.76);
}

.daily-review-grid h3,
.daily-review-section h3 {
  margin: 0 0 10px;
  color: #342c27;
  font-size: 0.95rem;
}

.daily-review-formula {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.daily-review-explain {
  margin: 0 0 12px;
  color: #6d625b;
  font-size: 0.9rem;
  line-height: 1.65;
}

.daily-review-score-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.daily-review-score-list article {
  min-height: 116px;
  display: grid;
  gap: 5px;
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(211, 198, 185, 0.68);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.76);
}

.daily-review-score-list b {
  color: #3f7f71;
  font-size: 1.28rem;
  line-height: 1;
}

.daily-review-score-list strong {
  color: #342c27;
  font-size: 0.86rem;
}

.daily-review-score-list p {
  margin: 0;
  color: #6d625b;
  font-size: 0.8rem;
  line-height: 1.48;
}

.daily-report-list,
.daily-vocab-list,
.daily-child-utterances {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily-report-card {
  border: 1px solid rgba(194, 170, 148, 0.62);
  border-radius: 13px;
  background: rgba(255, 252, 247, 0.82);
  overflow: hidden;
}

.daily-report-card summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.daily-report-card summary span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.daily-report-card summary strong {
  color: #342c27;
  font-size: 0.92rem;
}

.daily-report-card summary small,
.daily-vocab-item small,
.daily-child-utterances span {
  color: #8f684f;
  font-size: 0.72rem;
  font-weight: 900;
}

.daily-report-card summary b {
  color: #3f7f71;
  font-size: 0.76rem;
  white-space: nowrap;
}

.daily-report-card > p {
  margin: 0;
  padding: 0 14px 12px;
  color: #6d625b;
  font-size: 0.86rem;
  line-height: 1.58;
}

.daily-report-markdown {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-top: 1px solid rgba(211, 198, 185, 0.58);
  background: rgba(247, 241, 234, 0.78);
  color: #423a34;
  font: 0.84rem/1.68 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.daily-vocab-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-vocab-item {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(211, 198, 185, 0.64);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.72);
}

.daily-vocab-item div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.daily-vocab-item strong {
  color: #342c27;
  font-size: 1rem;
}

.daily-vocab-item div span {
  color: #8f8a84;
  font-size: 0.78rem;
}

.daily-vocab-item p,
.daily-vocab-item blockquote,
.daily-child-utterances blockquote,
.daily-child-utterances p {
  margin: 0;
  color: #5f554d;
  font-size: 0.86rem;
  line-height: 1.58;
}

.daily-vocab-item blockquote,
.daily-child-utterances blockquote {
  padding-left: 10px;
  border-left: 3px solid rgba(63, 127, 113, 0.28);
}

.daily-child-utterances li {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(247, 241, 234, 0.78);
}

.daily-review-events {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily-review-events li {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(247, 241, 234, 0.78);
}

.daily-review-events strong {
  color: #3f7f71;
  font-size: 0.88rem;
}

.daily-review-events span {
  color: #8f684f;
  font-size: 0.72rem;
  font-weight: 900;
}

.daily-review-events p {
  margin: 0;
  color: #5f554d;
  font-size: 0.88rem;
  line-height: 1.58;
}

.daily-review-empty {
  color: #81766e;
  font-weight: 760;
}

.inline-action-btn {
  min-height: 34px;
  margin-top: 8px;
  padding: 0 13px;
  border: 1px solid rgba(194, 170, 148, 0.78);
  border-radius: 999px;
  background: #fffaf4;
  color: #6e5847;
  font-size: 0.82rem;
  font-weight: 900;
}

.inline-action-btn:hover {
  border-color: rgba(63, 127, 113, 0.5);
  color: #3f7f71;
}

.vocabulary-dialog {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 24px;
}

.vocabulary-dialog[hidden] {
  display: none;
}

.vocabulary-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(38, 32, 28, 0.34);
  backdrop-filter: blur(10px);
}

.vocabulary-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(820px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(211, 198, 185, 0.78);
  border-radius: 20px;
  background: #fffaf4;
  box-shadow: 0 26px 80px rgba(62, 48, 38, 0.22);
}

.vocabulary-panel-head {
  min-height: 92px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(211, 198, 185, 0.6);
}

.vocabulary-panel-head h2 {
  margin: 0;
  color: #342c27;
  font-size: 1.35rem;
  line-height: 1.25;
}

.vocabulary-count {
  display: block;
  margin-top: 7px;
  color: #81766e;
  font-size: 0.82rem;
  font-weight: 760;
}

.vocabulary-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vocabulary-tools input {
  width: min(260px, 34vw);
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(194, 170, 148, 0.7);
  border-radius: 999px;
  background: rgba(247, 241, 234, 0.92);
  color: #342c27;
  font: inherit;
  font-size: 0.84rem;
}

.vocabulary-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(194, 170, 148, 0.7);
  border-radius: 999px;
  background: rgba(247, 241, 234, 0.92);
  color: #6e5847;
  font-size: 1.15rem;
  font-weight: 900;
}

.vocabulary-body {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 22px;
  background: #fffaf4;
}

.vocabulary-list {
  display: grid;
  gap: 10px;
}

.vocabulary-item {
  min-height: 116px;
  display: grid;
  gap: 9px;
  padding: 15px 16px;
  border: 1px solid rgba(194, 170, 148, 0.52);
  border-radius: 14px;
  background: rgba(247, 241, 234, 0.74);
}

.vocabulary-word-row {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.vocabulary-word-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #2f2924;
  font-size: 1.22rem;
  line-height: 1.15;
}

.vocabulary-word-row span {
  color: #81766e;
  font-size: 0.78rem;
  font-weight: 780;
  white-space: nowrap;
}

.vocabulary-item p {
  margin: 0;
  color: #4f4740;
  font-size: 0.92rem;
  line-height: 1.55;
}

.vocabulary-item blockquote {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid rgba(63, 127, 113, 0.45);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.76);
  color: #6d625b;
  font-size: 0.82rem;
  line-height: 1.55;
}

.vocabulary-item footer {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.vocabulary-item footer span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(236, 246, 232, 0.78);
  color: #4f7f73;
  font-size: 0.74rem;
  font-weight: 820;
}

.vocabulary-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: #81766e;
  text-align: center;
}

/* ── 笔记本：笔记记录 + 生词库复习 ─────────────────────── */
.notebook-tabs { display: flex; gap: 6px; margin-top: 6px; }
.notebook-tab {
  padding: 5px 12px;
  border: 1px solid rgba(194, 170, 148, 0.5);
  border-radius: 999px;
  background: transparent;
  color: #81766e;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.notebook-tab.active {
  background: var(--accent, #d9570f);
  border-color: var(--accent, #d9570f);
  color: #fff;
}
.notebook-pane {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 22px;
  background: #fffaf4;
}
.notebook-pane[hidden] { display: none; }

.notebook-notes-list { display: grid; gap: 10px; }
.notebook-note {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px 15px;
  border: 1px solid rgba(194, 170, 148, 0.52);
  border-left: 3px solid #e3c75a;
  border-radius: 14px;
  background: #fffdf3;
}
.notebook-note-text {
  margin: 0;
  padding-right: 26px;
  color: #3a342e;
  font-size: 0.96rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notebook-note-quote {
  margin: 0;
  padding: 8px 11px;
  border-left: 3px solid rgba(217, 87, 15, 0.35);
  border-radius: 8px;
  background: rgba(247, 241, 234, 0.7);
  color: #6d625b;
  font-size: 0.82rem;
  line-height: 1.55;
}
.notebook-note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.notebook-note-src {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: none;
  border-radius: 999px;
  background: rgba(236, 246, 232, 0.78);
  color: #4f7f73;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notebook-note-src.is-static { cursor: default; }
.notebook-note-date { color: #a59a8f; font-size: 0.72rem; white-space: nowrap; }
.notebook-note-del {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: #9a9088;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.notebook-note-del:hover { background: rgba(217, 87, 15, 0.14); color: var(--accent-deep, #993c1d); }

/* 生词库复习：翻卡 */
.notebook-review { display: grid; gap: 16px; place-items: center; padding: 12px 4px; }
.review-progress { color: #81766e; font-size: 0.8rem; font-weight: 700; }
.review-card {
  width: min(420px, 100%);
  min-height: 200px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px 22px;
  border: 1px solid rgba(194, 170, 148, 0.52);
  border-radius: 18px;
  background: rgba(247, 241, 234, 0.74);
  text-align: center;
  cursor: pointer;
}
.review-card-word { color: #2f2924; font-size: 1.8rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.review-card-hint { color: #a59a8f; font-size: 0.78rem; }
.review-card-meaning { color: #4f4740; font-size: 1rem; line-height: 1.6; }
.review-card-context {
  margin: 0;
  padding: 8px 11px;
  border-left: 3px solid rgba(63, 127, 113, 0.4);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.8);
  color: #6d625b;
  font-size: 0.82rem;
  line-height: 1.5;
}
.review-actions { display: flex; gap: 10px; }
.review-btn {
  padding: 7px 18px;
  border: 1px solid rgba(194, 170, 148, 0.5);
  border-radius: 999px;
  background: #fffdf7;
  color: #5f5349;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.review-btn.primary { background: var(--accent, #d9570f); border-color: var(--accent, #d9570f); color: #fff; }

.course-mode-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.course-mode-dialog[hidden] {
  display: none;
}

.course-mode-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgba(53, 43, 35, 0.22);
  backdrop-filter: blur(10px);
}

.course-mode-card {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: 26px;
  border: 1px solid rgba(221, 205, 190, 0.88);
  border-radius: 24px;
  background: #fffaf4;
  box-shadow: 0 34px 100px rgba(74, 58, 43, 0.24);
}

.course-mode-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #8a7667;
}

.course-mode-card h2 {
  padding-right: 34px;
  font-size: 1.7rem;
}

.course-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.course-mode-option {
  min-height: 108px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(208, 191, 174, 0.86);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf9, #f6efe7);
  color: #352d27;
  text-align: left;
}

.course-mode-option:hover {
  border-color: rgba(80, 136, 116, 0.52);
  background: linear-gradient(180deg, #fbfffb, #edf6f0);
}

.course-mode-option span {
  font-size: 1rem;
  font-weight: 900;
}

.course-mode-option small {
  color: #82776e;
  font-size: 0.8rem;
  line-height: 1.5;
}

.rail,
.center-stack,
.chat-panel {
  min-height: 0;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--rail-text);
}

.rail-head {
  min-height: 38px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.rail-title-block {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.rail-title {
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.08rem;
  line-height: 1.12;
  font-weight: 900;
  color: var(--rail-text);
}

.rail-subtitle {
  color: var(--rail-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.rail-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rail-new-focus {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(189, 175, 160, 0.28);
  border-radius: var(--rail-radius);
  background: rgba(255, 252, 247, 0.26);
  color: rgba(91, 78, 67, 0.82);
  font-size: 0.88rem;
  font-weight: 900;
}

.rail-new-focus:hover {
  border-color: rgba(189, 175, 160, 0.42);
  background: rgba(255, 252, 247, 0.44);
}

.rail-toggle-button {
  min-width: 24px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--rail-muted);
  font-size: 1rem;
  opacity: 0.72;
}

.rail-toggle-button:hover {
  background: rgba(215, 182, 117, 0.1);
  color: var(--rail-text);
  opacity: 1;
}

.rail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rail-muted);
}

.rail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.focus-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rail-item {
  width: 100%;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 1px solid #ddd8d2;
  border-radius: 12px;
  background: #f8f5f1;
  text-align: left;
}

.rail-item:hover {
  background: #f2ede7;
}

.rail-item.active {
  border-color: rgba(217, 87, 15, 0.22);
  background: rgba(217, 87, 15, 0.08);
}

.rail-item-title {
  font-size: 0.92rem;
  line-height: 1.4;
}

.rail-item-meta {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted-color);
}

.focus-card-shell {
  position: relative;
  width: 100%;
}

.focus-card {
  width: 100%;
  min-height: 52px;
  padding: 9px 56px 9px 10px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(188, 176, 163, 0.22);
  border-radius: var(--rail-radius);
  background: rgba(255, 252, 247, 0.18);
  text-align: left;
  box-shadow: none;
}

.focus-card:hover,
.focus-card-shell:hover .focus-card {
  border-color: rgba(188, 176, 163, 0.34);
  background: rgba(255, 252, 247, 0.36);
}

.focus-card.active,
.focus-card-shell.active .focus-card {
  border-color: rgba(217, 87, 15, 0.16);
  background: rgba(217, 87, 15, 0.045);
}

.focus-title {
  min-width: 0;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.28;
  color: var(--rail-text);
}

.focus-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--rail-muted);
  font-size: 0.78rem;
  opacity: 0.72;
}

.focus-menu-button {
  position: absolute;
  top: 8px;
  right: 30px;
  width: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--rail-muted);
  font-size: 0.74rem;
  line-height: 1;
  opacity: 0.72;
}

.focus-menu-button:hover,
.focus-menu-button[aria-expanded="true"] {
  background: rgba(215, 182, 117, 0.1);
  color: var(--rail-text);
  opacity: 1;
}

.focus-menu {
  position: absolute;
  top: 31px;
  right: 8px;
  z-index: 18;
  width: 118px;
  padding: 5px;
  border: 1px solid #ded3c7;
  border-radius: 10px;
  background: #fbf7f1;
  box-shadow: 0 8px 20px rgba(85, 72, 60, 0.08);
}

.focus-menu[hidden] {
  display: none !important;
}

.focus-menu button {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #675a50;
  font-size: 0.75rem;
  text-align: left;
}

.focus-menu button:hover {
  background: #f0e8df;
}

.focus-delete:hover {
  background: rgba(215, 182, 117, 0.1);
  color: var(--rail-text);
  opacity: 1;
}

.workspace-layout.rail-compact .rail {
  align-items: center;
  gap: 10px;
  padding: 12px 6px;
  border-radius: 0;
}

.workspace-layout.rail-compact .rail-head,
.workspace-layout.rail-compact .rail-section,
.workspace-layout.rail-compact .focus-list {
  width: 100%;
  align-items: center;
}

.workspace-layout.rail-compact .rail-title-block,
.workspace-layout.rail-compact .rail-label,
.workspace-layout.rail-compact .focus-title,
.workspace-layout.rail-compact .focus-context {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.workspace-layout.rail-compact .rail-head {
  justify-content: center;
  min-height: 24px;
}

.workspace-layout.rail-compact .rail-head-actions {
  flex-direction: column;
}

.workspace-layout.rail-compact .rail-new-focus {
  width: 36px;
  min-height: 34px;
  padding: 0;
  font-size: 0;
}

.workspace-layout.rail-compact .rail-new-focus::before {
  content: "+";
  font-size: 1rem;
  line-height: 1;
}

.workspace-layout.rail-compact .focus-card-shell {
  width: 36px;
}

.workspace-layout.rail-compact .focus-card {
  min-height: 36px;
  padding: 0;
  justify-content: center;
}

.workspace-layout.rail-compact .focus-card::before {
  content: attr(data-short);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--rail-text);
}

.workspace-layout.rail-compact .focus-delete {
  top: -5px;
  right: -5px;
  width: 14px;
  min-width: 14px;
  height: 14px;
  font-size: 0.6rem;
  background: rgba(255, 252, 247, 0.48);
  border-color: rgba(188, 176, 163, 0.2);
}

.workspace-layout.rail-compact .focus-menu-button {
  top: -5px;
  right: 12px;
  width: 14px;
  min-width: 14px;
  height: 14px;
  font-size: 0.56rem;
  background: rgba(255, 252, 247, 0.48);
}

.workspace-layout.rail-compact .focus-menu {
  top: 18px;
  right: -3px;
}

.resize-handle {
  position: relative;
  min-height: 0;
  cursor: col-resize;
  opacity: 1;
  background: #ded7cf;
}

.resize-handle::before {
  content: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 2px;
  height: 100%;
  border-radius: 999px;
  background: rgba(216, 211, 206, 0.95);
}

.resize-handle:hover::before,
.resize-handle.dragging::before {
  background: transparent;
}

.center-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
}

.panel {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper-color);
  box-shadow: none;
}

.reading-panel,
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.reading-panel {
  position: relative;
  overflow: hidden;
}

.notes-panel {
  display: none;
}

.titlebar {
  min-height: 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--paper-color);
  border-bottom: 1px solid var(--line-color);
}

.titlebar #readingFlowToggleBtn,
.titlebar #organizeToggleBtn,
.titlebar label[for="markdownFile"] {
  display: none !important;
}

/* 报告态：复用 input 布局，但播放(朗读)按钮对报告无意义 → 隐藏 */
.workspace-layout[data-report="1"] .titlebar #listeningCardBtn {
  display: none;
}

/* ① 报告态：报告下方的上一页/下一页翻页按钮对报告无意义 → 隐藏 */
.workspace-layout[data-report="1"] #readingPageControls {
  display: none !important;
}

.workspace-layout[data-view-mode="video"] .titlebar #listeningCardBtn,
.workspace-layout[data-view-mode="video"] .titlebar #readingFlowToggleBtn,
.workspace-layout[data-view-mode="video"] .titlebar #organizeToggleBtn,
.workspace-layout[data-view-mode="video"] .titlebar #bookProgressInline,
.workspace-layout[data-view-mode="video"] .titlebar label[for="markdownFile"],
.workspace-layout[data-view-mode="video"] .toc-shell,
.workspace-layout[data-view-mode="video"] #readingPageControls,
.workspace-layout[data-view-mode="video"] #organizeOverlay,
.workspace-layout[data-view-mode="video"] #readingExplainCard,
.workspace-layout[data-view-mode="pronunciation"] .titlebar #listeningCardBtn,
.workspace-layout[data-view-mode="pronunciation"] .titlebar #readingFlowToggleBtn,
.workspace-layout[data-view-mode="pronunciation"] .titlebar #organizeToggleBtn,
.workspace-layout[data-view-mode="pronunciation"] .titlebar #bookProgressInline,
.workspace-layout[data-view-mode="pronunciation"] .titlebar label[for="markdownFile"],
.workspace-layout[data-view-mode="pronunciation"] .toc-shell,
.workspace-layout[data-view-mode="pronunciation"] #readingPageControls,
.workspace-layout[data-view-mode="pronunciation"] #organizeOverlay,
.workspace-layout[data-view-mode="pronunciation"] #readingExplainCard {
  display: none !important;
}

.titlebar-chat {
  display: none;
}

.panel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 18px;
  border-bottom: 1px solid #e4dfd9;
  background: transparent;
}

.panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.panel-meta {
  font-size: 0.92rem;
  color: var(--muted-color);
}

.googoo-welcome[hidden] {
  display: none !important;
}

.googoo-welcome-reply[hidden],
.googoo-welcome-transcript[hidden] {
  display: none !important;
}

.googoo-welcome {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  background: #fbfaf8;
}

.googoo-welcome-reply {
  width: min(640px, calc(100vw - 40px));
  min-height: 104px;
  display: grid;
  gap: 10px;
  padding: 20px 24px;
  border: 1px solid rgba(96, 79, 65, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 70px rgba(84, 68, 53, 0.1);
  color: #4f453d;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.googoo-welcome-reply:hover {
  border-color: rgba(231, 122, 56, 0.3);
  box-shadow: 0 26px 76px rgba(188, 83, 34, 0.14);
  transform: translateY(-1px);
}

.googoo-welcome-reply-name,
.googoo-welcome-reply-action {
  color: #9a6b50;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
}

.googoo-welcome-reply strong {
  display: -webkit-box;
  overflow: hidden;
  color: #403832;
  font-size: clamp(1rem, 1.55vw, 1.22rem);
  font-weight: 760;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.googoo-welcome-orb {
  position: relative;
  width: clamp(142px, 10vw, 186px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: #e77a38;
  box-shadow: 0 28px 70px rgba(188, 83, 34, 0.16);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.googoo-welcome-orb span {
  position: absolute;
  inset: 27%;
  border-radius: inherit;
  background: #fbfaf8;
}

.googoo-welcome-orb:hover,
.googoo-welcome-voice:hover {
  transform: translateY(-1px);
}

.googoo-welcome[data-state="listening"] .googoo-welcome-orb,
.googoo-welcome[data-state="thinking"] .googoo-welcome-orb,
.googoo-welcome[data-state="speaking"] .googoo-welcome-orb {
  animation: googoo-breathe 1.65s ease-in-out infinite;
}

.googoo-welcome[data-state="listening"] .googoo-welcome-orb::after,
.googoo-welcome[data-state="thinking"] .googoo-welcome-orb::after,
.googoo-welcome[data-state="speaking"] .googoo-welcome-orb::after {
  content: "";
  position: absolute;
  inset: -20px;
  border: 2px solid rgba(231, 122, 56, 0.2);
  border-radius: inherit;
  animation: googoo-ring 1.3s ease-out infinite;
}

.googoo-welcome-transcript {
  width: min(520px, calc(100vw - 40px));
  min-height: 70px;
  display: grid;
  gap: 7px;
  padding: 14px 18px;
  border: 1px solid rgba(96, 79, 65, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: #5b5148;
}

.googoo-welcome-transcript span {
  color: #9a8e84;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.1;
}

.googoo-welcome-transcript strong {
  display: -webkit-box;
  overflow: hidden;
  min-height: 24px;
  color: #4e463e;
  font-size: 0.94rem;
  font-weight: 760;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.googoo-welcome-voice {
  min-width: 270px;
  min-height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 34px;
  border: 1px solid rgba(96, 79, 65, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 40px rgba(84, 68, 53, 0.08);
  color: #62594f;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.googoo-welcome[data-state="listening"] .googoo-welcome-voice {
  border-color: rgba(231, 122, 56, 0.34);
  box-shadow: 0 20px 50px rgba(188, 83, 34, 0.12);
}

.googoo-welcome-voice strong {
  min-width: 74px;
  color: #5a5148;
  font-size: 1.02rem;
  line-height: 1.2;
  font-weight: 850;
  text-align: center;
}

.googoo-welcome-mic,
.googoo-welcome-enter {
  width: 22px;
  color: #8f867e;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.googoo-voice-dock {
  position: fixed;
  left: 22px;
  bottom: 24px;
  z-index: 38;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: left 240ms cubic-bezier(0.2, 0.8, 0.3, 1.1), top 200ms ease;
}

.googoo-voice-dock[hidden] {
  display: none !important;
}

.googoo-voice-dock.is-dragging {
  cursor: grabbing;
  transition: none;
}

.googoo-voice-orb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1.5px solid #1c1a17;
  border-radius: 50%;
  background: #fdfcf9;
  box-shadow: 3px 3px 0 #e3ded4;
  cursor: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.googoo-voice-orb img {
  width: 36px;
  height: 36px;
  pointer-events: none;
  transform: translateX(-2px);
}

.googoo-voice-dock:hover .googoo-voice-orb {
  transform: translateY(-2px);
  box-shadow: 4px 5px 0 #e3ded4;
}

/* 自由探索（导师）页：GooGoo 是这页的主角 → 放大、固定在"左边框与聊天内容的中间"
   聊天区 max 860px 居中：左边空白 = (100vw - 860px)/2，取其中点放 GooGoo，再减半个头像宽居中 */
body[data-workspace-mode="tutor"] .googoo-voice-dock {
  left: calc((100vw - 860px) / 4 - 54px) !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%);
  cursor: pointer;
}

/* 自由探索页左上角返回（聊天区标题栏里），其他模式隐藏 */
.tutor-back-btn {
  display: none;
}

body[data-workspace-mode="tutor"] .tutor-back-btn {
  display: inline-flex;
}

body[data-workspace-mode="tutor"] .titlebar-chat {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-workspace-mode="tutor"] .googoo-voice-orb {
  width: 108px;
  height: 108px;
}

body[data-workspace-mode="tutor"] .googoo-voice-orb img {
  width: 68px;
  height: 68px;
}

/* 窄屏放不下左侧大头像就先收起，避免压住聊天区 */
@media (max-width: 1080px) {
  body[data-workspace-mode="tutor"] .googoo-voice-dock {
    display: none !important;
  }
}

.googoo-voice-dock[data-state="listening"] .googoo-voice-orb {
  border-color: #d9570f;
}

.googoo-voice-orb::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(217, 87, 15, 0);
}

.googoo-voice-dock[data-state="listening"] .googoo-voice-orb::after,
.googoo-voice-dock[data-state="thinking"] .googoo-voice-orb::after,
.googoo-voice-dock[data-state="speaking"] .googoo-voice-orb::after {
  animation: googoo-ring 1.28s ease-out infinite;
}

.googoo-voice-dock[data-state="thinking"] .googoo-voice-orb,
.googoo-voice-dock[data-state="speaking"] .googoo-voice-orb {
  animation: googoo-breathe 1.8s ease-in-out infinite;
}

@keyframes googoo-ring {
  0% {
    transform: scale(0.86);
    border-color: rgba(217, 87, 15, 0.4);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.36);
    border-color: rgba(217, 87, 15, 0);
    opacity: 0;
  }
}

@keyframes googoo-breathe {
  50% {
    transform: scale(1.035);
    box-shadow: 0 18px 38px rgba(217, 87, 15, 0.3);
  }
}

.creator-dock {
  position: relative;
  z-index: 1;
  width: auto;
}

.creator-pill {
  min-height: 32px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
}

.creator-pill:hover {
  border-color: rgba(186, 137, 101, 0.58);
  color: #9b6542;
}

.creator-pill[aria-expanded="true"] {
  border-color: rgba(217, 87, 15, 0.32);
  background: rgba(255, 246, 236, 0.96);
  color: var(--accent-color);
}

.creator-pill-name {
  font-size: 0.8rem;
  font-weight: 760;
  letter-spacing: 0;
}

.idea-popover {
  position: absolute;
  top: 40px;
  right: 0;
  width: min(304px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid rgba(188, 176, 163, 0.3);
  border-radius: 12px;
  background: rgba(243, 239, 233, 0.98);
  color: var(--text-color);
  box-shadow: 0 18px 42px rgba(85, 72, 60, 0.12);
  backdrop-filter: blur(12px);
  transform-origin: top right;
}

.idea-popover[hidden] {
  display: none !important;
}

.idea-status {
  font-size: 0.76rem;
  color: var(--muted-color);
}

.idea-compose-card,
.idea-target-card,
.idea-toolbar,
.idea-feedback-head,
.idea-list {
  margin-left: 12px;
  margin-right: 12px;
}

.idea-compose-card {
  margin-top: 12px;
}

.idea-input-row {
  display: block;
}

.idea-input-row textarea,
.idea-compose-card textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid rgba(188, 176, 163, 0.32);
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.58);
  color: var(--text-color);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.62;
  box-shadow: none;
}

.idea-input-row textarea::placeholder,
.idea-compose-card textarea::placeholder {
  color: #a49b92;
}

.idea-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.idea-feedback-head {
  margin-top: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-color);
  letter-spacing: 0.03em;
}

.idea-target-card {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(188, 176, 163, 0.3);
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.34);
  box-shadow: none;
}

.idea-target-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.idea-target-label {
  font-size: 0.72rem;
  color: var(--muted-color);
}

.idea-inline-close {
  min-width: 14px;
  width: 14px;
  height: 14px;
  padding: 0;
  color: var(--muted-color);
  font-size: 0.78rem;
  line-height: 1;
}

.idea-target-text {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-color);
  word-break: break-word;
}

.idea-toolbar {
  margin-top: 8px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.idea-tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0;
  color: #776c61;
  font-size: 0.78rem;
}

.idea-tool-link:hover {
  color: var(--accent-color);
}

.idea-tool-icon {
  font-size: 0.78rem;
}

.idea-submit-btn {
  min-height: 28px;
  padding: 0 0 0 8px;
  border: 0;
  background: transparent;
  color: var(--accent-color);
  font-size: 0.8rem;
  gap: 6px;
}

.idea-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 14px;
  max-height: 244px;
  overflow: auto;
}

.idea-item {
  position: relative;
  padding: 10px 11px 12px;
  border: 1px solid #d8cfc4;
  border-radius: 11px;
  background: #f9f3eb;
  box-shadow: none;
}

.idea-item-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding-right: 32px;
}

.idea-item-head-copy {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.idea-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 0.68rem;
  color: var(--muted-color);
}

.idea-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 17px;
  padding: 0 6px;
  border: 1px solid #d8cfc4;
  border-radius: 999px;
  background: #f4eee6;
  color: #766a5f;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

.idea-stage-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #b7aa9c;
}

.idea-stage-developing .idea-stage-dot {
  background: #d08a45;
}

.idea-stage-testing .idea-stage-dot {
  background: #6f9c8d;
}

.idea-stage-launched .idea-stage-dot {
  background: #65a86b;
}

.idea-stage-rejected .idea-stage-dot {
  background: #b76f5f;
}

.idea-item-text {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.58;
  white-space: pre-wrap;
  color: var(--text-color);
}

.idea-rejection-reason {
  margin: 7px 0 0;
  padding: 7px 9px;
  border: 1px solid #decfc2;
  border-radius: 9px;
  background: #f4eee6;
  color: #7b6255;
  font-size: 0.73rem;
  line-height: 1.5;
}

.idea-delete,
.idea-delete.icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 14px;
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 999px;
  background: transparent !important;
  border-color: transparent !important;
  color: var(--muted-color);
  font-size: 0.6rem;
  line-height: 1;
  opacity: 0.42;
  border: 0 !important;
  box-shadow: none !important;
}

.idea-delete:hover {
  background: rgba(217, 87, 15, 0.08);
  color: var(--accent-color);
  opacity: 0.9;
}

.idea-feedback-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.idea-feedback-item {
  padding: 8px 10px;
  border: 1px solid #d8cfc4;
  border-radius: 10px;
  background: #f4eee6;
}

.idea-item-target {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #d8cfc4;
  border-radius: 10px;
  background: #f4eee6;
}

.idea-target-block + .idea-target-block {
  margin-top: 8px;
}

.idea-item-target-label {
  margin: 0 0 4px;
  font-size: 0.7rem;
  color: var(--muted-color);
}

.idea-item-target-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-color);
  word-break: break-word;
}

.idea-target-image {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d8cfc4;
  border-radius: 9px;
  background: #fbf7f1;
  cursor: zoom-in;
}

.idea-screenshot-preview {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(58, 49, 42, 0.34);
}

.idea-screenshot-preview[hidden] {
  display: none !important;
}

.idea-screenshot-preview-image {
  max-width: min(920px, 92vw);
  max-height: 86vh;
  border: 1px solid #d8cfc4;
  border-radius: 16px;
  background: #f4eee6;
  box-shadow: 0 22px 64px rgba(58, 49, 42, 0.22);
}

.idea-screenshot-preview-close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 28px;
  height: 28px;
  border: 1px solid #d8cfc4;
  border-radius: 999px;
  background: #f4eee6;
  color: #62564c;
  font-size: 0.86rem;
}

.idea-feedback-toggle,
.idea-feedback-toggle.icon-button {
  position: absolute;
  top: 8px;
  right: 26px;
  min-width: 14px;
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 999px;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--muted-color);
  font-size: 0.52rem;
  line-height: 1;
  opacity: 0.42;
  border: 0 !important;
  box-shadow: none !important;
}

.idea-feedback-toggle:hover {
  color: var(--accent-color);
  border-color: transparent;
  opacity: 0.9;
}

.idea-feedback-compose[hidden] {
  display: none !important;
}

.idea-feedback-input {
  width: 100%;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #d8cfc4;
  border-radius: 10px;
  background: #fbf7f1;
  color: var(--text-color);
  font: inherit;
}

.idea-feedback-send {
  margin-top: 8px;
  min-height: 28px;
  padding: 0 11px;
  border-color: #d8cfc4;
  background: #eee5db;
  color: var(--text-color);
}

.idea-inspect-overlay[hidden] {
  display: none !important;
}

.idea-inspect-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.idea-inspect-box {
  position: fixed;
  border: 2px solid rgba(249, 152, 60, 0.96);
  border-radius: 12px;
  background: rgba(249, 152, 60, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 196, 112, 0.22);
  pointer-events: none;
}

.reading-meta-bar {
  border-bottom: 0;
}

.book-progress-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: min(180px, 24vw);
  padding: 0 6px 0 0;
}

.book-progress-inline-copy {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.book-progress-inline-title {
  min-width: 34px;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6a5648;
  white-space: nowrap;
}

.book-progress-inline-meta {
  display: none;
}

.book-progress-inline-track {
  flex: 1 1 120px;
  min-width: 96px;
  max-width: 164px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(201, 157, 125, 0.18);
}

.book-progress-inline-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d6835f 0%, #e8aa76 100%);
  transition: width 180ms ease;
}

#markdownFile {
  display: none;
}

button,
.icon-button,
.composer-button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

button:active,
.icon-button:active,
.composer-button:active {
  transform: scale(0.98);
}

.icon-button,
.composer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border-color: #ddd8d2;
  background: #f5f2ee;
}

.chrome-button {
  border-color: #ddd8d2;
  background: #f5f2ee;
}

.reading-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #ddd8d2;
  border-radius: 999px;
  background: #f5f2ee;
  color: var(--muted-color);
  font-size: 0.82rem;
  cursor: pointer;
}

.reading-chip:hover {
  background: #ede8e2;
  border-color: #cfc8c1;
}

.reading-chip.is-playing,
.reading-chip.is-preparing {
  border-color: rgba(199, 103, 70, 0.26);
  background: #f4dfd4;
  color: #8b3d29;
}

.reading-chip.is-paused {
  border-color: #d8cfc4;
  background: #fbf7f1;
  color: #6f584a;
}

.reading-chip.active {
  border-color: #cfc4b8;
  background: #ebe4dc;
  color: #5a4536;
}

.reading-chip:disabled {
  opacity: 0.66;
  cursor: progress;
}

.icon-button:hover,
.composer-button:hover {
  background: #ede8e2;
  border-color: #cfc8c1;
}

.send-button {
  min-width: 40px;
  height: 38px;
  border-radius: 12px;
  border-color: rgba(217, 87, 15, 0.25);
  background: rgba(217, 87, 15, 0.08);
  color: var(--accent-color);
  font-size: 1rem;
}

.send-button:hover {
  background: rgba(217, 87, 15, 0.14);
}

.composer-send-button {
  align-self: end;
  width: 46px;
  min-width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d9570f;
  color: #fffaf4;
  box-shadow: 0 6px 16px rgba(217, 87, 15, 0.22);
  cursor: pointer;
  transition: transform 130ms ease, background 130ms ease, box-shadow 130ms ease;
}

.composer-send-button svg {
  width: 21px;
  height: 21px;
}

.composer-send-button:hover {
  background: #c24a1a;
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(217, 87, 15, 0.3);
}

.composer-send-button:active {
  transform: translateY(0);
}

.reading-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 14px 14px;
  overflow: hidden;
}

.reading-pane {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(164, 155, 146, 0.35) transparent;
  border: 0;
  border-radius: 12px;
  background: var(--bg-color);
}

.reading-resume-mark {
  display: none !important;
  position: fixed;
  z-index: 9;
  width: 10px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(217, 87, 15, 0.48);
  box-shadow: 0 0 0 2px rgba(244, 237, 229, 0.86), 0 5px 12px rgba(86, 60, 45, 0.14);
  opacity: 0.78;
}

.reading-resume-mark:hover {
  opacity: 1;
  transform: scaleX(1.12);
}

.reading-page-controls {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  width: auto;
  margin: 0;
  padding: 3px 5px;
  border: 1px solid rgba(60, 52, 44, 0.1);
  border-radius: 999px;
  background: rgba(247, 244, 238, 0.94);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(8px);
  transform: translateX(-50%);
}

/* 上方那条大进度条多余 —— 隐藏 */
.book-progress-inline { display: none !important; }

/* ① 软任务进度：学习方式那条下方一条浅条（听完半，抽查满） */
.reading-task-progress {
  height: 3px;
  margin: 6px 2px 0;
  border-radius: 999px;
  background: rgba(60, 52, 44, 0.1);
  overflow: hidden;
}
.reading-task-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent-color, #e0883f);
  transition: width .3s ease;
}

/* ④ 报告复盘：左阅读区里的报告视图（复用 reading-content 排版） */
.report-review-head {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-color);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.report-review-head strong { font-size: 1.05rem; }
.report-review-head small { color: #8a8073; font-size: 0.78rem; }

.report-actions {
  margin-bottom: 16px;
}

.report-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-orange, #e5793a);
  color: #fffaf4;
  font-size: 0.95rem;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(229, 121, 58, 0.26);
  transition: transform 120ms ease, box-shadow 160ms ease;
}

.report-generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(229, 121, 58, 0.34);
}

.report-empty-hint {
  color: var(--ink-soft, #6f6a61);
  font-size: 0.95rem;
  line-height: 1.6;
}

.report-generated-body {
  font-size: 1.02rem;
  line-height: 1.75;
}

.reading-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 20px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #a89c8c;
  background: transparent;
  transition: background 120ms ease, color 120ms ease;
}

.reading-page-btn:hover {
  background: rgba(60, 52, 44, 0.07);
  color: #6b6256;
  transform: none;
  box-shadow: none;
}

.reading-page-btn svg { width: 13px; height: 13px; display: block; }

.reading-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 20px;
  padding: 0 4px;
  border: 0;
  background: transparent;
}

.reading-page-input {
  width: 30px;
  height: 20px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #6b6256;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.reading-page-input:focus {
  background: transparent;
  box-shadow: none;
}

.reading-page-indicator {
  text-align: left;
  color: #a89c8c;
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 4px;
}

.video-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.video-header-actions[hidden] {
  display: none !important;
}

#videoFile,
#videoEmptyFile {
  display: none;
}

.video-header-status {
  max-width: 240px;
  overflow: hidden;
  color: #86796f;
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-load-chip {
  cursor: pointer;
}

.video-stage,
.pronunciation-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-color);
  color: var(--ink-color);
}

.video-stage[hidden],
.pronunciation-stage[hidden] {
  display: none !important;
}

.video-empty {
  flex: 1;
  display: grid;
  place-items: safe center;
  align-content: safe center;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 18px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.05), rgba(255, 252, 246, 0)),
    #171511;
}

.video-empty[hidden],
.video-processing[hidden],
.video-learning-layout[hidden],
.video-shell[hidden],
.video-caption-overlay[hidden] {
  display: none !important;
}

.video-empty-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid rgba(255, 248, 236, 0.22);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.08);
  color: #fff7e9;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.video-empty-button:hover,
.video-load-chip:hover {
  border-color: rgba(217, 87, 15, 0.28);
  color: var(--accent-color);
}

.video-processing {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.05), rgba(255, 252, 246, 0)),
    #171511;
}

.video-processing-card {
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 248, 236, 0.14);
  border-radius: 8px;
  background: rgba(15, 14, 12, 0.72);
}

.video-processing-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fff5e5;
  font-size: 0.9rem;
  font-weight: 800;
}

.video-processing-copy strong {
  font-size: 0.86rem;
}

.video-processing-track {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.13);
}

.video-processing-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #d9570f;
  transition: width 0.25s ease;
}

.video-processing-stage {
  margin-top: 12px;
  color: rgba(255, 248, 236, 0.62);
  font-size: 0.76rem;
  font-weight: 750;
}

.video-shell {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f0e0c;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.video-player {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #0f0e0c;
}

.video-player::cue {
  background: transparent;
  color: #fffaf2;
  font-family: var(--reading-font);
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.72);
}

.video-audio-fallback {
  display: none;
}

.video-caption-overlay {
  position: absolute;
  left: 50%;
  bottom: clamp(54px, 8.4%, 82px);
  z-index: 4;
  box-sizing: border-box;
  width: min(94%, 1180px);
  min-height: calc(var(--video-caption-size, 1.35rem) * 2.05);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 10px;
  background: transparent;
  color: #fffaf2;
  font-family: var(--reading-font);
  font-size: var(--video-caption-size, 1.35rem);
  font-weight: 780;
  line-height: 1;
  overflow: visible;
  text-align: center;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.88), 0 1px 2px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.video-caption-overlay.pending {
  color: rgba(255, 250, 242, 0.72);
  background: transparent;
  font-size: clamp(0.86rem, 1.35vw, 1.05rem);
}


.video-caption-line {
  max-width: none;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 0.64vw, 10px);
  white-space: nowrap;
  transform: scale(var(--video-caption-fit, 1));
  transform-origin: center bottom;
  will-change: transform;
}

.video-caption-word {
  appearance: none;
  min-width: 0;
  display: inline-grid;
  grid-template-rows: 0.86em 1.08em;
  justify-items: center;
  align-items: end;
  gap: 0;
  padding: 0 2px 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  text-shadow: inherit;
}

.video-caption-word:hover,
.video-caption-word.active {
  color: #ffe1b7;
  background: rgba(226, 122, 58, 0.18);
}

.video-caption-word.saved .video-caption-text {
  text-decoration: underline;
  text-decoration-color: #54d3aa;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
}

.video-caption-phonetic {
  min-height: 0.86em;
  color: rgba(255, 249, 238, 0.72);
  font-size: 0.42em;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 0.96;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.video-caption-text {
  display: block;
  color: inherit;
  font-size: 1em;
  font-weight: 840;
  letter-spacing: 0;
  line-height: 1.05;
}

.video-caption-punctuation {
  display: inline-flex;
  align-items: flex-end;
  height: 1.1em;
  margin: 0 -2px;
  color: rgba(255, 250, 242, 0.92);
  font-size: 0.9em;
  line-height: 1.05;
}

.video-caption-overlay.is-compressed .video-caption-line {
  gap: clamp(2px, 0.32vw, 6px);
}

.video-lookup-card {
  position: absolute;
  left: clamp(16px, 3vw, 34px);
  top: clamp(16px, 4vw, 34px);
  z-index: 8;
  width: min(380px, calc(100% - 32px));
  max-height: min(74%, 520px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(28, 35, 44, 0.94);
  color: #f8f2e8;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.video-lookup-card[hidden] {
  display: none;
}

.video-lookup-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-lookup-head div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.video-lookup-head span {
  color: rgba(248, 242, 232, 0.64);
  font-size: 0.72rem;
  font-weight: 850;
}

.video-lookup-head strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 1.18rem;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-lookup-head small {
  color: rgba(248, 242, 232, 0.58);
  font-size: 0.72rem;
  font-weight: 760;
}

.video-lookup-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.video-lookup-actions button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff7eb;
  font-size: 0.86rem;
  font-weight: 900;
}

.video-lookup-actions button:hover {
  border-color: rgba(226, 122, 58, 0.5);
  background: rgba(226, 122, 58, 0.2);
}

.video-lookup-body {
  min-height: 0;
  overflow: auto;
  padding: 14px 15px 16px;
  color: #ede6dc;
}

.video-lookup-body .reading-lookup-card {
  gap: 10px;
}

.video-lookup-body .reading-lookup-line,
.video-lookup-body .reading-lookup-sense-head,
.video-lookup-body .reading-lookup-phrase {
  color: #ede6dc;
}

.video-lookup-body .reading-lookup-label,
.video-lookup-body .reading-lookup-pos,
.video-lookup-body .reading-lookup-stream-label {
  color: rgba(237, 230, 220, 0.62);
}

.video-lookup-body .reading-lookup-meaning,
.video-lookup-body .reading-lookup-phrase strong,
.video-lookup-body .reading-lookup-example-en,
.video-lookup-body .reading-lookup-context p {
  color: #fff8ee;
}

.video-lookup-body .reading-lookup-sense {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.video-lookup-body .reading-lookup-example,
.video-lookup-body .reading-lookup-context,
.video-lookup-body .reading-lookup-phrase {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
}

.video-lookup-error {
  margin: 0;
  color: #ffd5c7;
  font-size: 0.88rem;
  line-height: 1.55;
}

.video-caption-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.62);
  color: #f6f0e8;
  backdrop-filter: blur(10px);
}

.video-caption-tools span {
  padding: 0 5px 0 8px;
  color: rgba(246, 240, 232, 0.72);
  font-size: 0.68rem;
  font-weight: 850;
}

.video-caption-tools button {
  min-width: 34px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff9f0;
  font-size: 0.74rem;
  font-weight: 900;
}

.video-caption-tools button:hover {
  border-color: rgba(226, 122, 58, 0.48);
  background: rgba(226, 122, 58, 0.22);
}

.video-learning-layout {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(300px, 360px);
  gap: 14px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    #10100f;
}

/* 自定义全屏：只放大「视频 + 右侧句子列表」（即本容器），不带聊天区 */
.video-learning-layout:fullscreen { width: 100vw; height: 100vh; padding: 16px; }
.video-learning-layout:-webkit-full-screen { width: 100vw; height: 100vh; padding: 16px; }

/* 自定义播放控制条——统一网站 UI（替代浏览器原生 controls） */
.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 11px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.66));
  color: #fff7e9;
}

.vc-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff7e9;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity .12s ease;
}

.vc-btn:hover { opacity: 1; }
.vc-i { width: 20px; height: 20px; }
.vc-i-pause, .vc-i-mute, .vc-i-fs-exit { display: none; }
.video-controls.is-playing .vc-i-play { display: none; }
.video-controls.is-playing .vc-i-pause { display: inline; }
.video-controls.is-muted .vc-i-vol { display: none; }
.video-controls.is-muted .vc-i-mute { display: inline; }
.video-learning-layout:fullscreen .vc-i-fs-enter { display: none; }
.video-learning-layout:fullscreen .vc-i-fs-exit { display: inline; }
.video-learning-layout:-webkit-full-screen .vc-i-fs-enter { display: none; }
.video-learning-layout:-webkit-full-screen .vc-i-fs-exit { display: inline; }

.vc-time {
  flex: none;
  min-width: 38px;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 247, 233, 0.82);
}

.vc-seek { flex: 1; }
.vc-volume { width: 70px; flex: none; }

.vc-seek,
.vc-volume {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 248, 236, 0.26);
}

.vc-seek {
  background: linear-gradient(to right,
    var(--accent-color, #e0883f) 0%,
    var(--accent-color, #e0883f) var(--vc-fill, 0%),
    rgba(255, 248, 236, 0.26) var(--vc-fill, 0%));
}

.vc-volume {
  background: linear-gradient(to right,
    rgba(255, 248, 236, 0.85) 0%,
    rgba(255, 248, 236, 0.85) var(--vc-vol, 100%),
    rgba(255, 248, 236, 0.26) var(--vc-vol, 100%));
}

.vc-seek::-webkit-slider-thumb,
.vc-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff7e9;
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.vc-seek::-moz-range-thumb,
.vc-volume::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff7e9;
  border: 0;
  cursor: pointer;
}

.video-learning-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

/* YouTube 嵌入播放器 */
.yt-shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
}

.yt-shell[hidden] {
  display: none;
}

.yt-player-mount {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 100%;
}

.yt-player-mount iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* YouTube 链接输入 */
.video-empty-yt {
  display: flex;
  gap: 8px;
  width: min(560px, 100%);
}

.video-empty-yt input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid rgba(196, 188, 178, 0.8);
  border-radius: 12px;
  font: inherit;
  background: #fffaf4;
}

.video-empty-or {
  margin: 10px 0;
  color: var(--muted-color, #9a8d7f);
  font-size: 0.85rem;
}

.video-empty-hint {
  margin-top: 8px;
  max-width: 560px;
  color: var(--muted-color, #9a8d7f);
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
}

.video-empty-button-ghost {
  background: transparent;
  color: var(--accent-color, #c2703d);
  border: 1px solid rgba(196, 188, 178, 0.8);
}

/* 「可看的视频」清单——孩子进试听直接看到、点开即看 */
.video-library-section {
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-library-section[hidden] { display: none !important; }

.video-library-head {
  color: #fff7e9;
  font-size: 1.02rem;
  font-weight: 800;
}

.video-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.video-library-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 16px;
  text-align: left;
  border: 1px solid rgba(255, 248, 236, 0.18);
  border-radius: 14px;
  background: rgba(255, 248, 236, 0.06);
  color: #fff7e9;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.video-library-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 248, 236, 0.12);
  border-color: rgba(255, 248, 236, 0.4);
}

.video-library-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-library-card-meta {
  font-size: 0.76rem;
  color: rgba(255, 247, 233, 0.6);
}

.video-add-panel {
  width: min(560px, 100%);
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.video-add-panel > .video-empty-yt,
.video-add-panel > .video-empty-or,
.video-add-panel > input,
.video-add-panel > label,
.video-add-panel > .video-empty-hint {
  margin-top: 10px;
}

.video-add-summary {
  cursor: pointer;
  color: rgba(255, 247, 233, 0.7);
  font-size: 0.82rem;
  font-weight: 700;
  list-style: none;
  padding: 6px 12px;
  border-radius: 999px;
}

.video-add-summary:hover { color: #fff7e9; }
.video-add-summary::-webkit-details-marker { display: none; }

/* 字幕句子里逐词可点 */
.cue-word {
  cursor: pointer;
  border-radius: 4px;
  padding: 0 1px;
  transition: background 0.12s ease, color 0.12s ease;
}

.cue-word:hover {
  background: rgba(229, 121, 58, 0.16);
  color: var(--accent-color, #c2703d);
}

.video-cue-time {
  border: none;
  background: transparent;
  color: var(--muted-color, #9a8d7f);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.video-cue-time:hover {
  color: var(--accent-color, #c2703d);
}

.video-drill-panel {
  min-height: 252px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #151515;
}

.video-drill-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.video-drill-stats div {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(112, 165, 143, 0.16);
  border-radius: 8px;
  background: #202621;
}

.video-drill-stats span,
.video-active-head,
.video-cue-panel-head span {
  color: #9fa89f;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.2;
}

.video-drill-stats strong {
  color: #f8f5ef;
  font-size: 1.46rem;
  line-height: 1;
}

.video-active-sentence {
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 4px 8px;
  text-align: center;
}

.video-active-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.video-active-text {
  max-width: min(860px, 94%);
  margin: 0;
  color: #fffaf3;
  font-size: clamp(1.7rem, 4vw, 3.35rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
}

.video-active-translation {
  margin: 0;
  color: #aeb7b0;
  font-size: clamp(0.92rem, 1.3vw, 1.08rem);
  line-height: 1.45;
}

.video-word-rail {
  width: min(920px, 96%);
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.video-word-chip,
.video-punctuation-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 8px;
}

.video-word-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #232323;
  color: #f9f5ef;
}

.video-word-chip:hover {
  border-color: rgba(74, 177, 143, 0.42);
  background: #1f2c27;
}

.video-word-chip.saved span {
  text-decoration: underline;
  text-decoration-color: #54d3aa;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
}

.video-word-chip span {
  font-size: 0.92rem;
  font-weight: 850;
}

.video-word-chip small {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(74, 177, 143, 0.15);
  color: #64d1ab;
  font-size: 0.62rem;
  font-weight: 850;
}

.video-punctuation-chip {
  color: #8f9690;
  padding: 0 2px;
}

.video-drill-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.video-drill-actions button,
.video-cue-panel-head button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #222;
  color: #f8f2e8;
  font-size: 0.78rem;
  font-weight: 850;
}

.video-drill-actions button:hover,
.video-cue-panel-head button:hover,
.video-cue-panel-head button.active {
  border-color: rgba(226, 122, 58, 0.42);
  background: #2d211a;
  color: #ffbd88;
}

.video-drill-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.video-cue-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #181818;
}

.video-cue-panel-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.video-cue-panel-head div {
  display: grid;
  gap: 4px;
}

.video-cue-panel-head strong {
  color: #f7f2ea;
  font-size: 0.94rem;
  line-height: 1.2;
}

.video-cue-panel-head button {
  min-width: 58px;
}

.video-cue-list {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.video-cue-item {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d5d8d3;
  text-align: left;
}

.video-cue-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.video-cue-item.active {
  border-color: rgba(226, 122, 58, 0.34);
  background: rgba(226, 122, 58, 0.12);
}

.video-cue-time {
  color: #88918d;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.55;
}

.video-cue-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.video-cue-copy strong {
  color: #f6f2ec;
  font-size: 0.88rem;
  line-height: 1.45;
}

.video-cue-copy small {
  color: #a2aaa5;
  font-size: 0.78rem;
  line-height: 1.45;
}

.video-cue-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  color: #a4aaa5;
}

.video-cue-empty strong {
  color: #f8f2e8;
  font-size: 0.95rem;
}

.pronunciation-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: clamp(16px, 1.8vw, 28px);
  background: var(--bg-color);
}

.pronunciation-main-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pronunciation-topline {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-color);
}

.pronunciation-topline div {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pronunciation-topline span,
.pronunciation-score-grid span {
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.2;
}

.pronunciation-topline strong {
  color: var(--ink-color);
  font-size: 0.9rem;
  line-height: 1.2;
}

.pronunciation-sync-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-color);
  font-size: 0.76rem;
  font-weight: 850;
}

.pronunciation-sync-btn:hover {
  border-color: rgba(226, 122, 58, 0.55);
  background: #fbeede;
  color: #c2561f;
}

.pronunciation-assessment-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
}

.pronunciation-visual-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 16 / 9;
  margin: 0;
  align-self: center;
  justify-self: start;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 62% 24%, rgba(236, 193, 91, 0.3), transparent 24%),
    linear-gradient(145deg, rgba(72, 116, 148, 0.8), rgba(25, 36, 46, 0.92));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

.pronunciation-preview-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pronunciation-preview-image[hidden] {
  display: none;
}

.pronunciation-preview-image:not([hidden]) + .pronunciation-visual-fallback {
  display: none;
}

.pronunciation-visual-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 24px;
  color: #f7f0e4;
}

.pronunciation-visual-fallback span {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(247, 240, 228, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
}

.pronunciation-visual-fallback strong {
  max-width: 260px;
  font-size: clamp(1.2rem, 2.3vw, 2rem);
  font-weight: 900;
  line-height: 1.04;
}

.pronunciation-challenge-panel {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  min-width: 0;
  min-height: min(620px, 100%);
  display: grid;
  /* ⑤ 全 auto 行 + 居中：句子→GooGoo圆按钮→"按Space"行→快捷键 作为一组居中，
     GooGoo 自然往下、"按Space"行紧贴 GooGoo 下方，不再被 1fr 撑出一大段空白。 */
  grid-template-rows: repeat(5, auto);
  align-content: center;
  gap: clamp(18px, 2.6vh, 30px);
  color: var(--ink-color);
}

.pronunciation-score-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
}

.pronunciation-stage.has-result .pronunciation-score-grid,
.pronunciation-stage.is-submitting .pronunciation-score-grid {
  display: grid;
}

.pronunciation-score-grid article {
  position: relative;
  min-height: 106px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 16px 20px;
  overflow: hidden;
  border: 1px solid var(--paper-line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(60, 50, 40, 0.08);
}

.pronunciation-score-grid article:first-child::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #137d6a;
  transform: translateY(-50%);
}

.pronunciation-score-grid article:first-child::before {
  content: "";
  position: absolute;
  right: 32px;
  top: 50%;
  z-index: 1;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid #55efc1;
  transform: translateY(-50%);
}

.pronunciation-score-grid strong {
  color: var(--ink-color);
  font-size: clamp(2rem, 3.4vw, 3.05rem);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: 0;
}

.pronunciation-score-grid article:not(:first-child) strong::after {
  content: "/100";
  margin-left: 4px;
  color: #8f98a6;
  font-size: 0.32em;
  font-weight: 850;
}

.pronunciation-sentence-wrap {
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 8px 0;
  text-align: center;
}

.pronunciation-sentence {
  max-width: min(880px, 100%);
  margin: 0;
  color: var(--ink-color);
  font-size: clamp(1.76rem, 3.3vw, 3.2rem);
  font-weight: 880;
  line-height: 1.16;
  letter-spacing: 0;
}

.pronunciation-stage.has-result .pronunciation-sentence {
  display: none;
}

.pronunciation-translation {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 1.35vw, 1.08rem);
  font-weight: 760;
  line-height: 1.45;
}

.pronunciation-translation[hidden],
.pronunciation-recognized[hidden] {
  display: none !important;
}

.pronunciation-recognized {
  justify-self: center;
  max-width: min(780px, 92%);
  padding: 8px 12px;
  border: 1px solid var(--paper-line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 760;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pronunciation-word-rail {
  width: min(900px, 100%);
  min-height: 96px;
  display: none;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(6px, 0.8vw, 12px);
  padding: 0 6px;
}

.pronunciation-stage.has-result .pronunciation-word-rail {
  display: flex;
}

.pronunciation-word {
  position: relative;
  min-width: 42px;
  display: inline-grid;
  justify-items: center;
  gap: 5px;
  padding: 0 1px 8px;
  border-bottom: 5px solid rgba(28, 26, 23, 0.16);
  color: var(--ink-color);
}

.pronunciation-word small {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #656b76;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
}

.pronunciation-word strong {
  font-size: clamp(2rem, 3.4vw, 3.45rem);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: 0;
}

.pronunciation-word.good {
  border-bottom-color: #2bb888;
  color: #0f7257;
}

.pronunciation-word.good small {
  background: #15b47f;
}

.pronunciation-word.ok {
  border-bottom-color: #e0ac17;
  color: #a87b00;
}

.pronunciation-word.ok small {
  background: #c9a400;
}

.pronunciation-word.needs-work {
  border-bottom-color: #f0535f;
  color: #d6313e;
}

.pronunciation-word.needs-work small {
  background: #ee444f;
}

.pronunciation-punctuation {
  display: inline-flex;
  align-items: flex-end;
  min-height: 54px;
  color: var(--ink-color);
  font-size: clamp(1.7rem, 2.7vw, 2.8rem);
  font-weight: 900;
}

.pronunciation-summary {
  min-height: 24px;
  max-width: min(760px, 96%);
  justify-self: center;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.45;
  text-align: center;
}

.pronunciation-recorder {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.pronunciation-stage.has-result:not(.is-recording):not(.is-submitting) .pronunciation-recorder {
  display: none;
}

.pronunciation-record-btn {
  position: relative;
  width: 88px;
  height: 88px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 14px 32px rgba(229, 121, 58, 0.32);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease;
}

.pronunciation-record-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(229, 121, 58, 0.42);
}

.pronunciation-record-logo {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 999px;
  pointer-events: none;
}

.pronunciation-record-btn.recording,
.pronunciation-record-btn.submitting {
  animation: googoo-breathe 1.2s ease-in-out infinite;
}

.pronunciation-record-btn.recording::after,
.pronunciation-record-btn.submitting::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 2px solid rgba(229, 121, 58, 0.45);
  border-radius: inherit;
  animation: googoo-ring 1.12s ease-out infinite;
}

.pronunciation-recorder strong {
  color: var(--ink-color);
  font-size: 1rem;
  font-weight: 900;
}

.pronunciation-recorder small {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 760;
}

.pronunciation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 46px);
  min-height: 42px;
}

.pronunciation-actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 850;
}

.pronunciation-actions button kbd {
  min-width: 42px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  background: var(--paper-deep);
  color: var(--ink-color);
  font: inherit;
  font-size: 0.74rem;
  line-height: 1;
  box-shadow: inset 0 -1px 0 rgba(28, 26, 23, 0.08);
}

.pronunciation-actions button:hover {
  color: var(--ink-color);
}

.pronunciation-actions button:hover kbd {
  border-color: rgba(226, 122, 58, 0.55);
  background: #fbeede;
  color: #c2561f;
}

.pronunciation-actions button:disabled,
.pronunciation-record-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.pronunciation-cue-panel {
  display: none;
}

.pronunciation-cue-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pronunciation-cue-list {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.pronunciation-cue-item {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: start;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d5d8d3;
  text-align: left;
}

.pronunciation-cue-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.pronunciation-cue-item.active {
  border-color: rgba(226, 122, 58, 0.34);
  background: rgba(226, 122, 58, 0.12);
}

.pronunciation-cue-time,
.pronunciation-cue-score {
  color: #88918d;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.55;
}

.pronunciation-cue-score {
  justify-self: end;
  min-width: 30px;
  text-align: right;
}

.pronunciation-cue-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pronunciation-cue-copy strong {
  color: #f6f2ec;
  font-size: 0.88rem;
  line-height: 1.45;
}

.pronunciation-cue-copy small {
  color: #a2aaa5;
  font-size: 0.78rem;
  line-height: 1.45;
}

.pronunciation-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  color: #a4aaa5;
}

.pronunciation-empty strong {
  color: #f8f2e8;
  font-size: 0.95rem;
}

.reading-mode-toast {
  position: sticky;
  top: 12px;
  z-index: 7;
  width: fit-content;
  max-width: min(360px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 7px 12px;
  border: 1px solid rgba(217, 87, 15, 0.16);
  border-radius: 999px;
  background: rgba(247, 241, 232, 0.96);
  color: #7c6d60;
  font-size: 0.76rem;
  line-height: 1.4;
  box-shadow: 0 6px 16px rgba(85, 72, 60, 0.08);
  pointer-events: none;
}

.reading-explain-card {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 8;
  width: min(448px, calc(100% - 36px));
  margin: 0;
  padding: 15px 17px 16px;
  border: 1px solid rgba(217, 87, 15, 0.13);
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.97);
  box-shadow: 0 14px 36px rgba(82, 68, 55, 0.13);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.reading-explain-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.reading-explain-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
}

.reading-explain-copy {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.reading-explain-title-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.reading-explain-word {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1rem;
  font-weight: 700;
  color: #5b4a3d;
}

.reading-explain-meta {
  font-size: 0.78rem;
  color: #8b7d71;
}

.reading-explain-body {
  margin-top: 14px;
  font-size: 0.86rem;
  line-height: 1.64;
  color: #5f5349;
  white-space: normal;
}

.reading-explain-body.plain-text {
  white-space: pre-wrap;
}

.reading-lookup-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7c6d60;
}

.reading-loading-label {
  letter-spacing: 0.01em;
}

.reading-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.reading-loading-dots span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(217, 87, 15, 0.72);
  animation: readingDotPulse 0.9s ease-in-out infinite;
}

.reading-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.reading-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes readingDotPulse {
  0%, 80%, 100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.reading-lookup-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reading-lookup-card-stable {
  min-height: 280px;
}

.reading-lookup-card-streaming {
  gap: 8px;
}

.reading-lookup-stream-label {
  color: #9a7662;
  font-size: 0.74rem;
  font-weight: 700;
}

.reading-lookup-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-height: 22px;
}

.reading-lookup-label {
  flex: 0 0 auto;
  color: #8b7d71;
  font-size: 0.76rem;
}

.reading-lookup-sense {
  min-height: 78px;
  padding-top: 0;
  border-top: 1px solid rgba(217, 87, 15, 0.08);
  transition: opacity 160ms ease;
}

.reading-lookup-sense-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-top: 10px;
}

.reading-lookup-pos {
  flex: 0 0 auto;
  min-width: 20px;
  color: #8b7d71;
  font-size: 0.76rem;
}

.reading-lookup-meaning {
  color: #4f4339;
  font-weight: 600;
}

.reading-lookup-example {
  min-height: 46px;
  margin-top: 8px;
  padding: 10px 12px 10px 30px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.58);
  color: #76695d;
  font-size: 0.8rem;
}

.reading-lookup-example p {
  margin: 0;
}

.reading-lookup-example-en {
  color: #5f5349;
}

.reading-lookup-example-zh {
  margin-top: 3px !important;
  color: #8a6b5c;
}

.reading-lookup-phrase {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(217, 87, 15, 0.07);
  color: #6d5548;
  font-size: 0.8rem;
}

.reading-lookup-phrase strong {
  font-weight: 650;
  color: #4f4339;
}

.reading-lookup-phrase-card {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(69, 142, 104, 0.22);
  border-radius: 12px;
  background: rgba(225, 244, 235, 0.72);
}

.reading-lookup-phrase-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.reading-lookup-phrase-head span {
  color: #4f8169;
  font-size: 0.72rem;
  font-weight: 800;
}

.reading-lookup-phrase-head strong {
  color: #284f40;
  font-size: 1rem;
}

.reading-lookup-phrase-card p {
  margin: 0;
  color: #5d746a;
  font-size: 0.78rem;
  font-weight: 700;
}

.reading-lookup-phrase-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reading-lookup-phrase-tokens span {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #32634f;
  font-size: 0.72rem;
  font-weight: 800;
}

.reading-lookup-context {
  min-height: 74px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(217, 87, 15, 0.08);
}

.reading-lookup-context.muted {
  color: #9b8d80;
}

.reading-lookup-context span {
  display: block;
  margin-bottom: 6px;
  color: #9a7662;
  font-size: 0.74rem;
  font-weight: 700;
}

.reading-lookup-context p {
  margin: 0;
  color: #55483e;
}

.reading-translation-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reading-translation-main,
.reading-translation-structure {
  padding: 12px 14px;
  border: 1px solid rgba(217, 87, 15, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.reading-translation-main span,
.reading-translation-section-title {
  display: block;
  margin-bottom: 6px;
  color: #9a7662;
  font-size: 0.74rem;
  font-weight: 700;
}

.reading-translation-main p,
.reading-translation-note,
.reading-translation-phrases p {
  margin: 0;
  color: #55483e;
}

.reading-translation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reading-translation-grid div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(217, 87, 15, 0.06);
}

.reading-translation-grid em {
  display: block;
  color: #9b8d80;
  font-style: normal;
  font-size: 0.68rem;
}

.reading-translation-grid strong {
  color: #4f4339;
  font-size: 0.78rem;
}

.reading-translation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.reading-translation-tags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(217, 87, 15, 0.08);
  color: #6d5548;
  font-size: 0.72rem;
}

.reading-translation-phrases {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.reading-translation-phrases strong {
  color: #4f4339;
}

.reading-translation-note {
  margin-top: 10px;
  color: #76695d;
  font-size: 0.78rem;
}

.reading-lookup-skeleton {
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(217, 87, 15, 0.06), rgba(217, 87, 15, 0.12), rgba(217, 87, 15, 0.06));
  background-size: 220% 100%;
  animation: readingSkeletonFlow 1.15s ease-in-out infinite;
}

.reading-lookup-skeleton.short {
  width: 62%;
  height: 16px;
}

@keyframes readingSkeletonFlow {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.reading-explain-inline-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: #8b7d71;
  font: inherit;
  font-size: 0.64rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reading-explain-inline-icon.is-playing {
  color: #b86348;
}

.reading-explain-inline-icon:disabled {
  opacity: 0.62;
}

.reading-explain-save {
  flex: 0 0 auto;
  min-width: 54px;
  height: 31px;
  padding: 0 13px;
  border: 1px solid rgba(217, 87, 15, 0.16);
  border-radius: 999px;
  background: rgba(217, 87, 15, 0.08);
  color: #825b47;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
}

.reading-explain-save[disabled] {
  opacity: 0.64;
}

.reading-explain-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(194, 170, 148, 0.58);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.86);
  color: #6e5847;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reading-explain-icon:hover {
  border-color: rgba(217, 87, 15, 0.34);
  background: rgba(217, 87, 15, 0.08);
}

.reading-explain-icon.danger {
  color: #a35d52;
}

.organize-overlay {
  position: absolute;
  top: 92px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 237, 234, 0.72);
  backdrop-filter: blur(5px);
  z-index: 6;
  pointer-events: auto;
}

.organize-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.organize-card {
  width: min(420px, calc(100% - 32px));
  padding: 18px 18px 16px;
  border: 1px solid #ddd8d2;
  border-radius: 16px;
  background: rgba(248, 245, 241, 0.95);
  box-shadow: 0 16px 34px rgba(85, 72, 60, 0.1);
}

.organize-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.organize-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.organize-progress-text {
  font-size: 0.82rem;
  color: var(--muted-color);
}

.organize-progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(217, 87, 15, 0.1);
}

.organize-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(217, 87, 15, 0.52), rgba(217, 87, 15, 0.92));
  transition: width 180ms ease;
  position: relative;
  overflow: hidden;
}

.organize-progress-bar.is-starting {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14) 0 10px,
      rgba(255, 255, 255, 0.02) 10px 20px
    ),
    linear-gradient(90deg, rgba(217, 87, 15, 0.42), rgba(217, 87, 15, 0.84));
  transition: width 260ms ease;
  background-size: 28px 28px, 100% 100%;
  animation: organizeProgressStripes 0.9s linear infinite;
}

.organize-progress-bar.is-starting::after {
  content: none;
}

@keyframes organizeProgressStripes {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 28px 0, 0 0;
  }
}

.organize-phase-text {
  margin: 12px 0 0;
  font-size: 0.84rem;
  color: var(--muted-color);
}

.organize-chunk-eta {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #8b7d71;
}

.organize-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.organize-action-btn {
  min-height: 30px;
  padding: 0 10px;
}

.toc-shell {
  position: absolute;
  top: 96px;
  bottom: 24px;
  left: 14px;
  width: 0;
  z-index: 4;
}

.toc-hotspot {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(217, 87, 15, 0.04), rgba(217, 87, 15, 0.12), rgba(217, 87, 15, 0.04));
  opacity: 0.22;
  transition: opacity 140ms ease, transform 140ms ease;
}

.toc-panel {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 220px;
  max-height: min(65vh, 560px);
  overflow: auto;
  padding: 12px;
  border: 1px solid #ddd8d2;
  border-radius: 14px;
  background: rgba(244, 240, 235, 0.96);
  box-shadow: 0 12px 28px rgba(85, 72, 60, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-8px);
  transition: opacity 140ms ease, transform 140ms ease;
  backdrop-filter: blur(10px);
}

.reading-panel:hover .toc-hotspot,
.toc-shell:hover .toc-hotspot {
  opacity: 0.78;
}

.toc-shell:hover .toc-panel,
.toc-panel:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.toc-panel-head {
  margin-bottom: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: var(--muted-color);
  line-height: 1.45;
}

.toc-item:hover {
  background: rgba(217, 87, 15, 0.08);
  color: var(--text-color);
}

.toc-item.active {
  background: rgba(217, 87, 15, 0.12);
  color: var(--accent-color);
}

.toc-item.level-2 {
  padding-left: 16px;
}

.toc-item.level-3,
.toc-item.level-4,
.toc-item.level-5,
.toc-item.level-6 {
  padding-left: 24px;
}

.reading-empty {
  padding: 30px;
  color: var(--muted-color);
}

.reading-content {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 42px 108px;
  overflow: visible;
  overflow-wrap: break-word;
  word-break: break-word;
  color: #101010;
  font-size: 1.48rem;
  font-family: var(--reading-font);
  font-weight: 400;
  letter-spacing: 0;
}

.workspace-layout[data-view-mode="read"] .reading-content {
  max-width: 860px;
  margin-inline: auto;
  font-size: 1.32rem;
}

.reading-content h1,
.reading-content h2,
.reading-content h3 {
  font-family: var(--reading-font);
  color: var(--ink-color);
}

.workspace-layout[data-view-mode="input"] .reading-content {
  max-width: 1080px;
}

.reading-content p {
  margin: 1.05em 0;
  line-height: 1.92;
  text-align: left;
}

.reading-pane[data-flow-mode="paged"] {
  scroll-behavior: auto;
  scroll-snap-type: none;
}

.reading-pane[data-flow-mode="paged"] .reading-content {
  max-width: 1180px;
  padding-top: 42px;
  padding-bottom: 86px;
}

.reading-pane[data-flow-mode="paged"] .reading-content > p,
.reading-pane[data-flow-mode="paged"] .reading-content > blockquote,
.reading-pane[data-flow-mode="paged"] .reading-content > ul,
.reading-pane[data-flow-mode="paged"] .reading-content > ol,
.reading-pane[data-flow-mode="paged"] .reading-content > h1,
.reading-pane[data-flow-mode="paged"] .reading-content > h2,
.reading-pane[data-flow-mode="paged"] .reading-content > h3 {
  scroll-snap-align: none;
}

.reading-locate-flash {
  border-radius: 12px;
  background: rgba(214, 131, 95, 0.12);
  box-shadow: 0 0 0 8px rgba(214, 131, 95, 0.08);
  transition: background 220ms ease, box-shadow 220ms ease;
}

.reading-resume-target {
  border-radius: 12px;
  background: rgba(215, 182, 117, 0.12);
  box-shadow: 0 0 0 10px rgba(215, 182, 117, 0.055);
  transition: background 260ms ease, box-shadow 260ms ease;
}

.reading-content h1,
.reading-content h2,
.reading-content h3,
.reading-content h4,
.reading-content h5,
.reading-content h6 {
  position: relative;
  color: #1a1a1a;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

.reading-content h1 {
  font-size: 1.8em;
  padding-bottom: 0.3em;
}

.reading-content h2 {
  font-size: 1.5em;
  padding-bottom: 0.2em;
}

.reading-content h3 {
  font-size: 1.25em;
}

.reading-content h4 {
  font-size: 1.1em;
}

.reading-content h5 {
  font-size: 1em;
}

.reading-content h6 {
  font-size: 0.95em;
  color: #555;
}

.reading-content > h1:first-child,
.reading-content > h2:first-child,
.reading-content > h3:first-child {
  margin-top: 0;
}

.reading-content strong {
  color: var(--accent-color);
  font-weight: 700;
}

.reading-content em {
  font-style: italic;
  color: #444;
}

.reading-content hr {
  border: 0;
  border-top: 1px solid var(--line-color);
  margin: 2.5em 0;
  height: 0;
}

.reading-content ul,
.reading-content ol {
  padding-left: 1.8em;
  margin: 0.8em 0;
}

.reading-content li {
  margin: 0.35em 0;
  line-height: 1.8;
}

.reading-content blockquote {
  margin: 1.5em 0;
  padding: 15px 20px 15px 25px;
  border-left: 4px solid var(--accent-color);
  background: #eae6e1;
  color: #444;
}

.reading-content blockquote p {
  margin: 0.5em 0;
}

.reading-content code {
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  margin: 0 2px;
  background: #e8e4df;
  border-radius: 3px;
  color: var(--accent-color);
}

.reading-content mark {
  background: var(--mark-color);
  color: var(--text-color);
  padding: 1px 4px;
  border-radius: 2px;
}

.saved-word-inline {
  position: relative;
  display: inline;
  margin: 0 2px;
  cursor: pointer;
}

.saved-word-highlight {
  display: inline;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(242, 208, 98, 0.38);
  box-shadow: inset 0 -1px 0 rgba(190, 146, 18, 0.18);
}

.saved-phrase-inline .saved-word-highlight {
  background: rgba(80, 184, 139, 0.18);
  box-shadow: inset 0 -2px 0 rgba(28, 153, 107, 0.42);
  text-decoration: underline;
  text-decoration-color: rgba(28, 153, 107, 0.42);
  text-underline-offset: 0.16em;
}

.saved-word-trigger {
  display: none !important;
  position: absolute;
  top: -0.48em;
  right: -0.82em;
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(217, 87, 15, 0.62);
  color: transparent;
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.saved-word-popover {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 4;
  width: min(448px, calc(100vw - 72px));
  max-width: 448px;
  padding: 15px 17px 16px;
  border: 1px solid #ddd1c4;
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.98);
  color: #5f5349;
  font-size: 0.86rem;
  line-height: 1.64;
  white-space: normal;
  box-shadow: 0 14px 36px rgba(82, 68, 55, 0.13);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateX(var(--saved-pop-shift, 0px)) translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.saved-word-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.saved-word-popover-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.saved-word-popover-word {
  font-size: 1rem;
  font-weight: 700;
  color: #5b4a3d;
}

.saved-word-popover-meta {
  color: #8b7d71;
  font-size: 0.78rem;
}

.saved-word-popover-body {
  white-space: normal;
}

.saved-word-upgrading {
  margin-top: 8px;
  color: #9a7662;
  font-size: 0.74rem;
  font-weight: 700;
}

.saved-word-popover-action {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: #8b7d71;
  font: inherit;
  font-size: 0.68rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.saved-word-popover-action.close {
  color: #9b6f5c;
  font-size: 0.82rem;
}

.saved-word-popover-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex: 0 0 auto;
}

.saved-word-unmark-action {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 1px solid rgba(198, 158, 132, 0.22);
  border-radius: 50%;
  background: #fbf7f1;
  color: #9b6f5c;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.saved-word-unmark-action:hover,
.saved-word-popover-action.close:hover {
  color: #7a4638;
}

.saved-word-danger-row {
  display: none;
  justify-content: flex-end;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(221, 209, 196, 0.64);
}

.saved-word-inline.show-danger .saved-word-danger-row {
  display: flex;
}

.saved-word-delete-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9b6f5c;
  font-size: 0.72rem;
  font-weight: 700;
}

.saved-word-delete-action:hover {
  color: #7a4638;
}

.saved-word-inline.open .saved-word-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateX(var(--saved-pop-shift, 0px)) translateY(0);
}

.saved-passage-inline {
  position: relative;
  display: inline;
}

.saved-passage-highlight {
  display: inline;
  border-bottom: 1px solid rgba(217, 87, 15, 0.34);
  background: rgba(242, 222, 193, 0.34);
}

.saved-passage-trigger {
  display: none;
  position: absolute;
  top: -0.42em;
  right: -0.72em;
  width: 5px;
  height: 5px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(156, 103, 72, 0.5);
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}

.saved-passage-popover {
  position: absolute;
  left: 50%;
  top: calc(100% + 9px);
  z-index: 4;
  width: min(360px, calc(100vw - 72px));
  padding: 11px 13px;
  border: 1px solid #ddd1c4;
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.98);
  color: #5f5349;
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: normal;
  box-shadow: 0 12px 28px rgba(82, 68, 55, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.saved-passage-popover-title {
  display: block;
  margin-bottom: 5px;
  color: #9a7662;
  font-size: 0.72rem;
  font-weight: 700;
}

.saved-passage-popover-text {
  display: block;
}

.saved-passage-inline.open .saved-passage-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateX(var(--saved-pop-shift, 0px)) translateY(0);
}

/* ── 中文阅读·选区三按钮小窗（划重点/写笔记/讨论） ───────── */
.zh-select-menu {
  position: fixed;
  z-index: 60;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--paper-line, #e3ded4);
  border-radius: 12px;
  background: var(--paper-bright, #fdfcf9);
  box-shadow: 0 10px 26px rgba(82, 68, 55, 0.18);
  transform: translateX(-50%);
}
.zh-select-menu[hidden] { display: none; }
.zh-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink, #1c1a17);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease;
}
.zh-select-btn:hover { background: var(--accent-soft, rgba(217, 87, 15, 0.08)); }
.zh-select-ico { font-size: 0.86rem; line-height: 1; }

/* 写笔记便签 */
.zh-notepad {
  position: fixed;
  z-index: 61;
  width: min(320px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid #e7d9a8;
  border-radius: 14px;
  background: #fff8d8;
  box-shadow: 0 14px 30px rgba(82, 68, 55, 0.2);
  transform: translateX(-50%);
}
.zh-notepad[hidden] { display: none; }
.zh-notepad-quote {
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid #e3c75a;
  color: #7a6a3a;
  font-size: 0.78rem;
  line-height: 1.5;
  max-height: 3em;
  overflow: hidden;
}
.zh-notepad-quote:empty { display: none; }
.zh-notepad-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e7d9a8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink, #1c1a17);
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.5;
  resize: none;
}
.zh-notepad-input:focus { outline: none; border-color: #d9b94a; }
.zh-notepad-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.zh-notepad-btn {
  padding: 5px 14px;
  border: none;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.zh-notepad-btn.subtle { background: rgba(0, 0, 0, 0.05); color: #6f6a61; }
.zh-notepad-btn.primary { background: var(--accent, #d9570f); color: #fff; }

/* 便签贴上后：高亮挂一点暖黄，区别于普通划重点 */
.saved-passage-inline.has-note .saved-passage-highlight {
  background: rgba(255, 236, 150, 0.5);
  border-bottom-color: rgba(217, 165, 15, 0.5);
}

/* 讨论焦点卡片（钉在聊天框上方） */
.zh-chat-focus {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--paper-line, #e3ded4);
  border-left: 3px solid var(--accent, #d9570f);
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.9);
}
.zh-chat-focus[hidden] { display: none; }
.zh-chat-focus-tag {
  flex: none;
  margin-top: 1px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft, rgba(217, 87, 15, 0.1));
  color: var(--accent-deep, #993c1d);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.zh-chat-focus-text {
  flex: 1;
  margin: 0;
  color: #5f5349;
  font-size: 0.8rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.zh-chat-focus-clear {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: #6f6a61;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

/* ── 中文·写作：左编辑器（铺满 reading-stage） ───────────── */
.writing-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 12px;
  background: var(--bg-color);
  overflow: hidden;
}
.writing-stage[hidden] { display: none; }
.writing-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 26px 8px;
}
.writing-title {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ink, #1c1a17);
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
}
.writing-title::placeholder { color: var(--ink-soft, #b3a89c); font-weight: 600; }
.writing-title:focus { outline: none; }
.writing-status {
  flex: none;
  color: var(--ink-soft, #9a9182);
  font-size: 0.74rem;
  white-space: nowrap;
}
.writing-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 26px 18px;
  border: none;
  background: transparent;
  color: var(--ink, #232019);
  font-family: inherit;
  font-size: 1.06rem;
  line-height: 2.05;
  resize: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(164, 155, 146, 0.35) transparent;
}
.writing-editor::placeholder { color: var(--ink-soft, #b3a89c); line-height: 1.8; }
.writing-editor:focus { outline: none; }
.writing-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 26px 16px;
  border-top: 1px solid var(--paper-line, #ece6dc);
}
.writing-wordcount {
  color: var(--ink-soft, #9a9182);
  font-size: 0.78rem;
}

/* 篇目切换 */
.writing-pieces { position: relative; flex: none; }
.writing-pieces-btn {
  padding: 4px 10px;
  border: 1px solid var(--paper-line, #e3ded4);
  border-radius: 999px;
  background: var(--paper-bright, #fdfcf9);
  color: var(--ink-soft, #6f6a61);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.writing-pieces-btn:hover { border-color: var(--accent, #d9570f); color: var(--ink, #1c1a17); }
.writing-pieces-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 240px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--paper-line, #e3ded4);
  border-radius: 12px;
  background: var(--paper-bright, #fdfcf9);
  box-shadow: 0 12px 28px rgba(82, 68, 55, 0.16);
}
.writing-pieces-menu[hidden] { display: none; }
.writing-piece-new {
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 4px;
  border: none;
  border-radius: 8px;
  background: var(--accent-soft, rgba(217, 87, 15, 0.1));
  color: var(--accent-deep, #993c1d);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.writing-piece-new:hover { background: rgba(217, 87, 15, 0.16); }
.writing-piece-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 8px;
}
.writing-piece-row.active { background: var(--accent-soft, rgba(217, 87, 15, 0.08)); }
.writing-piece-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--ink, #1c1a17);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}
.writing-piece-pick:hover { background: rgba(0, 0, 0, 0.04); border-radius: 8px; }
.writing-piece-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.writing-piece-date { flex: none; color: var(--ink-soft, #b3a89c); font-size: 0.72rem; }
.writing-piece-del {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft, #b3a89c);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.writing-piece-del:hover { background: rgba(217, 87, 15, 0.12); color: var(--accent-deep, #993c1d); }
.writing-piece-empty { padding: 8px 10px; color: var(--ink-soft, #b3a89c); font-size: 0.78rem; }

/* 写作态：藏掉阅读专属壳（试听/分页/智能整理/进度条/元信息） */
.workspace-layout[data-writing="1"] #readingFlowToggleBtn,
.workspace-layout[data-writing="1"] #listeningCardBtn,
.workspace-layout[data-writing="1"] #organizeToggleBtn,
.workspace-layout[data-writing="1"] #readingTaskProgress,
.workspace-layout[data-writing="1"] #bookProgressInline,
.workspace-layout[data-writing="1"] .reading-meta-bar { display: none !important; }

.inline-word-gloss-inline {
  position: relative;
  display: inline;
}

.inline-word-gloss-text {
  display: inline;
  border-bottom: 1px solid rgba(217, 87, 15, 0.2);
}

.inline-word-gloss-trigger {
  position: absolute;
  top: -0.68em;
  right: -0.62em;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(217, 87, 15, 0.12);
  color: #d9570f;
  font-size: 0.78rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(85, 72, 60, 0.08);
}

.inline-word-gloss-trigger.pending {
  background: rgba(217, 87, 15, 0.16);
}

.inline-word-gloss-popover {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  z-index: 4;
  min-width: 124px;
  max-width: 220px;
  padding: 6px 8px;
  border: 1px solid #ddd1c4;
  border-radius: 10px;
  background: rgba(247, 241, 232, 0.98);
  color: #8a7867;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: normal;
  box-shadow: 0 10px 18px rgba(85, 72, 60, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateX(var(--saved-pop-shift, 0px)) translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.inline-word-gloss-inline:hover .inline-word-gloss-popover,
.inline-word-gloss-inline:focus-within .inline-word-gloss-popover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.inline-word-gloss-popover.pending {
  color: #9b8e81;
}

.system-special-inline {
  display: inline;
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(217, 87, 15, 0.12);
  box-shadow: inset 0 -1px 0 rgba(217, 87, 15, 0.18);
  color: #8f3f2e;
}

.selection-tray {
  display: none !important;
}

.annotation-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 78px;
  max-height: 188px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid #ddd8d2;
  border-radius: 12px;
  background: rgba(244, 241, 237, 0.96);
  box-shadow: 0 10px 24px rgba(85, 72, 60, 0.08);
  z-index: 3;
  backdrop-filter: blur(8px);
}

.annotation-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.annotation-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-color);
}

.annotation-meta {
  font-size: 0.75rem;
  color: var(--muted-color);
}

.annotation-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.annotation-group-title {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.annotation-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
}

.annotation-item p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.annotation-item + .annotation-item {
  margin-top: 6px;
}

.annotation-empty {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted-color);
}

.tray-copy {
  flex: 1;
  min-width: 0;
}

.tray-label {
  margin: 0 0 2px;
  color: var(--muted-color);
  font-size: 0.84rem;
  line-height: 1.4;
}

.tray-text {
  margin: 0;
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray-actions {
  display: flex;
  gap: 8px;
}

.tray-actions .icon-button[disabled] {
  cursor: default;
  opacity: 0.72;
  background: rgba(227, 182, 64, 0.16);
  color: #7b6415;
  border-color: rgba(189, 139, 0, 0.16);
}

.chat-panel {
  border-color: rgba(221, 216, 210, 0.46);
  background: var(--bg-color);
  font-family: var(--ui-font);
}

.chat-panel .titlebar {
  min-height: 48px;
  border-bottom-color: rgba(228, 223, 217, 0.46);
}

.titlebar-chat {
  display: none;
}

.skill-active-label {
  display: none;
  max-width: 150px;
  overflow: hidden;
  color: rgba(110, 100, 91, 0.64);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-active-label.loaded {
  color: rgba(76, 112, 78, 0.78);
}

.skill-active-label.unloaded {
  color: rgba(150, 118, 92, 0.7);
}

.chat-menu-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.chat-menu-button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(196, 181, 166, 0.34);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.32);
  color: rgba(92, 77, 65, 0.62);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.chat-menu-button:hover,
.chat-menu-button[aria-expanded="true"] {
  border-color: rgba(188, 141, 115, 0.38);
  background: rgba(255, 248, 240, 0.72);
  color: #6a4c3c;
}

.skill-menu-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(320px, 72vw);
  padding: 14px;
  border: 1px solid rgba(211, 197, 183, 0.58);
  border-radius: 18px;
  background: rgba(248, 244, 238, 0.96);
  box-shadow: 0 18px 44px rgba(94, 78, 63, 0.12);
  backdrop-filter: blur(14px);
}

.skill-menu-head {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}

.skill-menu-head span,
.skill-picker-label {
  color: rgba(126, 111, 96, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.skill-menu-head strong {
  color: #4e4037;
  font-size: 0.92rem;
  line-height: 1.35;
}

.skill-picker {
  width: 100%;
  height: 36px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid rgba(204, 188, 172, 0.58);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.72);
  color: #53463d;
  font: inherit;
  font-size: 0.8rem;
  outline: none;
}

.skill-picker:focus {
  border-color: rgba(217, 87, 15, 0.34);
  box-shadow: 0 0 0 3px rgba(217, 87, 15, 0.08);
}

.skill-runtime-info {
  margin: 10px 0 0;
  color: rgba(126, 111, 96, 0.82);
  font-size: 0.73rem;
  line-height: 1.45;
}

.analysis-strip {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #e4dfd9;
  background: #f3efea;
}

.analysis-card {
  padding: 12px 14px;
  border: 1px solid #ddd8d2;
  border-radius: 12px;
  background: rgba(244, 240, 235, 0.85);
}

.analysis-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-color);
}

.analysis-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--accent-color);
}

.analysis-copy {
  margin: 6px 0 0;
  color: var(--muted-color);
  font-size: 0.86rem;
  line-height: 1.55;
}

.focus-mode {
  color: var(--accent-color);
  font-size: 0.92rem;
}

.focus-hint {
  color: var(--muted-color);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* ② 讨论·剧本现场：聊天区上方的角色框 */
.discussion-roles {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(60, 52, 44, 0.08);
}
.discussion-roles[hidden] { display: none; }
.discussion-roles::-webkit-scrollbar { display: none; }

.discussion-role {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 4px;
  border: 1px solid rgba(60, 52, 44, 0.14);
  border-radius: 999px;
  background: #fffdf9;
  color: #6b6256;
  cursor: pointer;
  font-size: 0.82rem;
  transition: border-color .12s ease, background .12s ease, transform .1s ease;
}
.discussion-role:hover { transform: translateY(-1px); border-color: rgba(224, 136, 63, 0.5); }
.discussion-role.is-active {
  border-color: var(--accent-color, #e0883f);
  background: rgba(224, 136, 63, 0.1);
  color: #4a2f12;
  font-weight: 600;
}
.discussion-role-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(60, 52, 44, 0.06);
  font-size: 0.95rem;
}
.discussion-role.is-active .discussion-role-avatar { background: rgba(224, 136, 63, 0.18); }
.discussion-role.is-add {
  color: #a89c8c;
  border-style: dashed;
  padding-left: 8px;
}
.discussion-role.is-add .discussion-role-avatar { background: transparent; font-size: 1.1rem; }

/* 自创角色右上角「×」删除（hover 才显形，免误点） */
.discussion-role-del {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #c0563b;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.discussion-role:hover .discussion-role-del { display: inline-flex; }
.discussion-role-del:hover { background: #d8693f; }

/* 角色向导：名字那步的推荐选项 */
.role-suggests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.role-suggest {
  padding: 4px 12px;
  border: 1px solid rgba(224, 136, 63, 0.4);
  border-radius: 999px;
  background: rgba(224, 136, 63, 0.08);
  color: #4a2f12;
  cursor: pointer;
  font-size: 0.85rem;
}
.role-suggest:hover { background: rgba(224, 136, 63, 0.16); }

.chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(164, 155, 146, 0.28) transparent;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reading-pane::-webkit-scrollbar,
.chat-log::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.reading-pane::-webkit-scrollbar-thumb,
.chat-log::-webkit-scrollbar-thumb {
  background: rgba(164, 155, 146, 0.34);
  border-radius: 999px;
}

.reading-pane::-webkit-scrollbar-thumb:hover,
.chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(144, 134, 124, 0.48);
}

.bubble {
  position: relative;
  max-width: 94%;
  padding: 14px 16px;
  border-radius: 16px;
  border: none;
  line-height: 1.8;
  font-size: 0.95rem;
}

.bubble:has(.listening-card) {
  overflow: visible;
  z-index: 3;
}

/* 报告生成后在聊天里露出的可点卡片（别让报告石沉大海） */
.chat-report-card {
  align-self: flex-start;
  max-width: 94%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 4px;
  padding: 10px 14px;
  border: 1px solid rgba(224, 136, 63, 0.4);
  border-radius: 14px;
  background: rgba(224, 136, 63, 0.08);
  color: #4a2f12;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background .12s ease;
}

.chat-report-card:hover { background: rgba(224, 136, 63, 0.16); }
.chat-report-card span[aria-hidden] { font-size: 1.2rem; }
.chat-report-card-text { display: flex; flex-direction: column; line-height: 1.3; }
.chat-report-card-text small { color: #8a6a44; font-size: 0.78rem; }

/* C：家长端「孩子的学习」面板 + 未读红点 */
.family-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e0533f;
  color: #fff;
  font-size: 0.72rem;
  font-style: normal;
  vertical-align: middle;
}

.family-report-list { display: flex; flex-direction: column; gap: 8px; }

.family-report-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0.5px solid rgba(60, 56, 51, 0.16);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background .12s ease;
}

.family-report-row:hover { background: #f7f4ef; }

.family-report-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

.family-report-row.is-unread .family-report-dot { background: #e0533f; }
.family-report-main { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.family-report-main small { color: #8a8178; font-size: 0.78rem; }
.family-empty { color: #8a8178; font-size: 0.86rem; margin: 4px 0; }

.bubble.user {
  align-self: flex-end;
  max-width: 78%;
  padding: 10px 14px;
  background: #efece7;
  border-radius: 16px 16px 4px 16px;
  color: #3d3833;
}

.bubble.assistant {
  align-self: flex-start;
  max-width: 100%;
  background: transparent;
  padding: 4px 0 4px 30px;
  color: #2f2b27;
}

.bubble.assistant::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 19px;
  height: 19px;
  background: url("/static/googoo-logo.svg") center / contain no-repeat;
}

.bubble.assistant.streaming {
  background: transparent;
}

.bubble.assistant.streaming .assistant-reply::after,
.bubble.assistant.streaming > :last-child::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent-color);
  animation: thinking-bounce 1s infinite ease-in-out;
  vertical-align: baseline;
}

.listening-chip {
  border-color: rgba(217, 87, 15, 0.16);
  min-height: 24px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

/* 跟读按钮 → 播放/暂停图标钮（进度条旁） */
.listening-icon-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(217, 87, 15, 0.4);
  background: rgba(255, 250, 244, 0.92);
  color: var(--accent-color);
}

.listening-icon-btn:hover:not(:disabled) {
  background: var(--accent-color);
  color: #fffaf4;
}

.listening-icon-btn svg {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
}

.listening-icon-btn .listening-icon-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.listening-icon-btn .listening-icon-spinner {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(217, 87, 15, 0.28);
  border-top-color: var(--accent-color);
  display: none;
  animation: listening-spin 0.7s linear infinite;
}

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

/* 默认：显示播放 ▶；播放中：显示暂停 ⏸；准备中：显示转圈 */
.listening-icon-btn .listening-icon-pause { display: none; }
.listening-icon-btn.is-playing .listening-icon-play { display: none; }
.listening-icon-btn.is-playing .listening-icon-pause { display: block; }
.listening-icon-btn.is-preparing .listening-icon-play,
.listening-icon-btn.is-preparing .listening-icon-pause { display: none; }
.listening-icon-btn.is-preparing .listening-icon-spinner { display: block; }
.listening-icon-btn.is-playing {
  background: var(--accent-color);
  color: #fffaf4;
}

/* 图标钮用自己的转圈，不要旧的条状 shimmer */
.listening-icon-btn.is-preparing::after { content: none; }

/* 数学复用阅读工作台，但是单一学习区：去掉英语阅读专属的壳
   （播放/跟读、阅读进度条、分页/滚动切换、智能整理）。一页一题的翻页保留。 */
.workspace-layout[data-subject="math"] #listeningCardBtn,
.workspace-layout[data-subject="math"] #bookProgressInline,
.workspace-layout[data-subject="math"] #readingFlowToggleBtn,
.workspace-layout[data-subject="math"] #organizeToggleBtn {
  display: none !important;
}

.listening-chip.is-preparing {
  position: relative;
  overflow: hidden;
}

.listening-chip.is-preparing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 246, 0.58), transparent);
  transform: translateX(-115%);
  animation: listening-chip-wait 1.15s ease-in-out infinite;
}

@keyframes listening-chip-wait {
  to {
    transform: translateX(115%);
  }
}

.listening-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: auto;
}

.listening-card-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.listening-card-actions {
  display: none;
}

.listening-card-actions {
  opacity: 0.92;
}

.listening-card-main label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #846e60;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.listening-card-main select {
  min-height: 26px;
  max-width: 148px;
  padding: 0 24px 0 9px;
  border: 1px solid rgba(143, 106, 82, 0.14);
  border-radius: 8px;
  background: #fbf7f1;
  color: #6f584a;
  font: inherit;
  font-size: 0.76rem;
  outline: none;
}

.listening-card-action {
  min-height: 26px;
  border: 1px solid rgba(198, 158, 132, 0.24);
  background: #f8efe8;
  color: #8b4a35;
  border-radius: 10px;
  padding: 3px 10px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.listening-card-action.primary {
  border-color: rgba(198, 104, 70, 0.22);
  background: #f7e8df;
  color: #8b3d29;
  min-width: 82px;
}

.listening-card-action.subtle {
  color: #9a8374;
}

.listening-card-action.is-active,
.listening-card-action.is-paused,
.listening-card-action.is-playing {
  border-color: rgba(199, 103, 70, 0.24);
  background: #f4dfd4;
  color: #8b3d29;
}

.listening-card-settings {
  position: relative;
}

.listening-card-settings summary {
  list-style: none;
  min-height: 26px;
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(198, 158, 132, 0.24);
  border-radius: 10px;
  background: #f8efe8;
  color: #8b4a35;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.listening-card-settings summary::-webkit-details-marker {
  display: none;
}

.listening-card-settings[open] summary {
  border-color: rgba(199, 103, 70, 0.22);
  background: #f4dfd4;
  color: #8b3d29;
}

.listening-card-settings-panel {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  z-index: 12;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 10px;
  border: 1px solid rgba(198, 158, 132, 0.22);
  border-radius: 14px;
  background: #fbf7f1;
  box-shadow: 0 12px 26px rgba(82, 68, 55, 0.10);
}

.listening-card-action.compact {
  justify-self: start;
  min-height: 26px;
  padding: 3px 9px;
  font-size: 0.74rem;
}

.listening-card-action:hover {
  transform: translateY(-1px);
  border-color: rgba(199, 103, 70, 0.28);
  background: rgba(255, 249, 243, 0.94);
}

.listening-card-action:disabled {
  opacity: 0.52;
  cursor: wait;
}

.listening-response-prompt {
  color: #6f584a;
  font-weight: 700;
}

.bubble.thinking {
  border: none;
  background: transparent;
}

.thinking-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.thinking-loader {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 24px;
}

.thinking-loader span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-color);
  animation: thinking-bounce 1s infinite ease-in-out;
}

.thinking-loader span:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-loader span:nth-child(3) {
  animation-delay: 0.3s;
}

.thinking-text {
  color: var(--muted-color);
  font-size: 0.9rem;
}

.streaming-head {
  margin-bottom: 4px;
}

.assistant-reply {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-reply p,
.assistant-reply ul,
.assistant-reply ol,
.assistant-reply blockquote {
  margin: 0;
}

.streaming-text {
  white-space: pre-wrap;
}

/* 通用导师推荐视频：每行一个搜索词 + 去 YouTube/B站 搜 按钮 */
.video-rec {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--paper-line, rgba(36, 32, 29, 0.16));
  border-radius: 10px;
  background: var(--paper, #fffaf4);
}

.video-rec-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.video-rec-q {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 640;
  color: var(--ink-color, #2e251f);
}

.video-rec-btn {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--brand-orange, #e5793a);
  background: var(--brand-orange, #e5793a);
  color: #fffaf4;
  font-size: 0.84rem;
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 140ms ease;
}

.video-rec-btn:hover {
  filter: brightness(1.06);
}

.video-rec-btn-bili {
  background: transparent;
  color: var(--brand-orange, #e5793a);
}

/* 深检索回复卡片：真实视频卡 + 论文/电子书 + 折叠资料来源 */
.research-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.rc-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rc-label {
  font-size: 0.82rem;
  font-weight: 760;
  color: var(--ink-soft, #6b5f52);
}

.rc-videos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rc-video {
  display: flex;
  flex-direction: column;
  width: 190px;
  border: 1px solid var(--paper-line, rgba(36, 32, 29, 0.16));
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper, #fffaf4);
  text-decoration: none;
  transition: box-shadow 140ms ease, transform 140ms ease;
}

.rc-video:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(60, 50, 40, 0.12);
}

.rc-video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.rc-video-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px 9px;
}

.rc-video-title {
  font-size: 0.84rem;
  font-weight: 640;
  line-height: 1.3;
  color: var(--ink-color, #2e251f);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rc-video-chan {
  font-size: 0.74rem;
  color: var(--brand-orange, #e5793a);
  font-weight: 680;
}

.rc-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.rc-row > .rc-item,
.rc-row > .rc-source {
  flex: 1 1 auto;
  min-width: 0;
}

.rc-save {
  flex: 0 0 auto;
  width: 28px;
  align-self: center;
  border: 1.5px solid var(--brand-orange, #e5793a);
  border-radius: 8px;
  background: transparent;
  color: var(--brand-orange, #e5793a);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  padding: 5px 0;
}

.rc-save:hover {
  background: var(--brand-orange, #e5793a);
  color: #fffaf4;
}

.rc-save.rc-saved {
  border-color: #3a8a4a;
  color: #3a8a4a;
  background: transparent;
  cursor: default;
}

.rc-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid var(--paper-line, rgba(36, 32, 29, 0.16));
  border-radius: 9px;
  background: var(--paper, #fffaf4);
  text-decoration: none;
}

.rc-item:hover {
  border-color: var(--brand-orange, #e5793a);
}

.rc-item-t {
  font-size: 0.88rem;
  font-weight: 660;
  color: var(--ink-color, #2e251f);
}

.rc-item-sub {
  font-size: 0.78rem;
  color: var(--ink-soft, #6b5f52);
}

.rc-sources {
  border-top: 1px dashed var(--paper-line, rgba(36, 32, 29, 0.2));
  padding-top: 8px;
}

.rc-sources > summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft, #6b5f52);
  list-style: none;
}

.rc-source {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 2px;
  text-decoration: none;
  color: var(--ink-color, #2e251f);
}

.rc-source:hover .rc-source-t {
  color: var(--brand-orange, #e5793a);
  text-decoration: underline;
}

.rc-source-n {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--paper-deep, #efe7da);
  font-size: 0.72rem;
  font-weight: 700;
}

.rc-source-t {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-source-badge {
  flex: 0 0 auto;
  color: #3a8a4a;
  font-weight: 800;
}

.assistant-reply ul,
.assistant-reply ol {
  padding-left: 18px;
}

.assistant-reply li + li {
  margin-top: 4px;
}

.bubble code {
  background: #e8e4df;
  color: var(--accent-color);
  border-radius: 3px;
  padding: 2px 5px;
}

.composer {
  display: grid;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 8px;
  border: 1px solid rgba(221, 216, 210, 0.58);
  border-radius: 16px;
  background: rgba(248, 244, 239, 0.82);
}

.composer-selection {
  display: none !important;
  min-height: 24px;
  margin-bottom: 0;
  position: relative;
  padding: 4px 22px 4px 9px;
  width: 104px;
  max-width: 104px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid rgba(176, 141, 108, 0.2);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.74);
  box-shadow: none;
}

.composer-selection[hidden] {
  display: none !important;
}

.composer-selection-copy {
  width: 66px;
  max-width: 66px;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.composer-selection-text {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.25;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-selection .icon-button {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 14px;
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted-color);
}

textarea {
  width: 100%;
  resize: none;
  min-height: 58px;
  border: 1px solid rgba(221, 216, 210, 0.62);
  border-radius: 11px;
  background: rgba(255, 252, 247, 0.78);
  color: var(--text-color);
  padding: 9px 11px;
  font: inherit;
  line-height: 1.7;
}

.composer-input-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 44px;
  align-items: center; /* 按钮与输入框垂直居中对齐，bigread 风 */
  gap: 8px;
  min-height: 44px;
}

/* 导入错题/卷子图片：左侧轻量入口，国内直连视觉识图 */
.composer-import-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(196, 188, 178, 0.7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted-color, #8a8278);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.composer-import-btn svg {
  width: 20px;
  height: 20px;
}

.composer-import-btn:hover {
  color: var(--accent-color, #c2703d);
  border-color: var(--accent-color, #c2703d);
  background: rgba(255, 255, 255, 0.95);
}

.composer-import-btn.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

/* 点📷弹出：选图片 / 选文件夹 */
.composer-import-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  padding: 5px;
  border: 1px solid rgba(196, 188, 178, 0.7);
  border-radius: 12px;
  background: #fffaf4;
  box-shadow: 0 10px 28px rgba(40, 36, 32, 0.16);
}

.composer-import-menu[hidden] {
  display: none;
}

.composer-import-menu-item {
  text-align: left;
  padding: 9px 11px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-color, #2e251f);
  cursor: pointer;
  white-space: nowrap;
}

.composer-import-menu-item:hover {
  background: rgba(229, 121, 58, 0.12);
}

.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 2px 0;
}

.composer-attachment {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(196, 188, 178, 0.7);
  background: #efeae3;
  flex: 0 0 auto;
}

.composer-attachment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.composer-attachment.is-recognizing::after {
  content: "识别中";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: #fff;
  background: rgba(40, 36, 32, 0.55);
}

.composer-attachment.is-done::after {
  content: "✓";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #fff;
  background: rgba(76, 152, 96, 0.92);
  border-radius: 50%;
}

.composer-attachment.is-error::after {
  content: "!";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #fff;
  background: rgba(196, 80, 64, 0.92);
  border-radius: 50%;
}

.composer-attachment-remove {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(40, 36, 32, 0.6);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.composer-input-row textarea {
  min-height: 44px;
  height: auto;
  padding: 10px 12px;
  border-radius: 14px;
  resize: none;
  line-height: 1.4;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* 上下文主按钮：空=麦克风，有字=发送，圆形纸墨质感 */
.composer-primary-btn {
  align-self: end;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fffaf4;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(217, 87, 15, 0.28);
  transition: transform 130ms ease, box-shadow 130ms ease, background 160ms ease;
}

.composer-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(217, 87, 15, 0.34);
}

.composer-primary-btn:active {
  transform: translateY(0);
}

.composer-primary-btn svg {
  width: 21px;
  height: 21px;
}

.composer-primary-btn .composer-icon-send {
  display: none;
}

.composer-primary-btn.is-send .composer-icon-mic {
  display: none;
}

.composer-primary-btn.is-send .composer-icon-send {
  display: block;
}

.composer-primary-btn.is-listening {
  background: var(--accent-deep);
}

/* 录音态：盖在输入行上的波形 + 取消/确认 */
.composer-listening {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  border-radius: 14px;
  background: rgba(253, 248, 240, 0.97);
  border: 1.5px solid rgba(217, 87, 15, 0.32);
  z-index: 3;
}

.composer-listening[hidden] {
  display: none;
}

.composer-listening-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.05rem;
  cursor: pointer;
  border: 1.5px solid transparent;
}

.composer-listening-btn.cancel {
  background: #f1e9e0;
  color: #8a7665;
}

.composer-listening-btn.cancel:hover {
  background: #e9ddd0;
}

.composer-listening-btn.confirm {
  background: #4c7e69;
  color: #fffaf4;
  box-shadow: 0 5px 14px rgba(76, 126, 105, 0.3);
}

.composer-listening-btn.confirm:hover {
  background: #3f6c5a;
}

.composer-waveform {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
}

.composer-waveform span {
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-color);
  animation: composer-wave 900ms ease-in-out infinite;
}

.composer-waveform span:nth-child(2n) { animation-delay: 120ms; }
.composer-waveform span:nth-child(3n) { animation-delay: 240ms; }
.composer-waveform span:nth-child(4n) { animation-delay: 360ms; }
.composer-waveform span:nth-child(5n) { animation-delay: 480ms; }

@keyframes composer-wave {
  0%, 100% { height: 7px; opacity: 0.55; }
  50% { height: 22px; opacity: 1; }
}

.composer-listening-label {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  font-size: 0.66rem;
  color: #b08d65;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .composer-waveform span { animation: none; height: 14px; }
}

textarea::placeholder {
  color: #96908b;
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 34px;
}

.composer-tools {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-box {
  display: none !important;
}

.rich-card {
  background: #f4f1ed;
  border: 1px solid #ddd8d2;
  border-radius: 12px;
  padding: 12px;
}

.rich-card .meta {
  color: var(--muted-color);
  font-size: 0.92rem;
}

.rich-card ul,
.rich-card ol {
  margin: 8px 0 14px;
  padding-left: 20px;
}

.rich-card pre {
  white-space: pre-wrap;
  overflow-x: auto;
  background: #f7f4f1;
  border: 1px solid var(--line-color);
  border-radius: 8px;
  padding: 12px;
}

.semantic-chip {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(217, 87, 15, 0.07);
  color: #8a4a35;
  font-size: 0.92em;
}

/* Legacy spans still present in stored chat history: render as plain text. */
.semantic-action,
.semantic-mark {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ============ 纸与墨 · 结构化消息块 ============ */

.msg-upgrade {
  margin: 10px 0 4px;
  padding: 10px 14px;
  border-left: 3px solid #d9570f;
  border-radius: 4px 12px 12px 4px;
  background: #f4f0e9;
}

.msg-upgrade-label {
  display: block;
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
  font-size: 0.82rem;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #b04a10;
  margin-bottom: 4px;
}

.msg-upgrade p {
  margin: 0;
  color: #2f2b27;
}

.msg-finish-card {
  margin: 12px 0 4px;
  padding: 14px 16px;
  border: 1.5px solid #1c1a17;
  border-radius: 14px;
  background: #fdfcf9;
  box-shadow: 3px 3px 0 #e3ded4;
}

.msg-finish-head {
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 10px;
}

.msg-finish-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
}

.msg-finish-row + .msg-finish-row {
  border-top: 1px dashed #e3ded4;
}

.msg-finish-label {
  flex: 0 0 64px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #d9570f;
}

.msg-finish-row p {
  margin: 0;
  flex: 1;
  line-height: 1.65;
}

/* ============ 纸与墨 · 聊天空状态 ============ */

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 30px 24px 14px;
  text-align: center;
}

.chat-empty-state img {
  width: 44px;
  height: 44px;
  opacity: 0.85;
}

.chat-empty-state p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-color);
}

.chat-empty-state small {
  font-size: 0.8rem;
  color: var(--muted-color);
}

/* ============ 纸与墨 · 阶段里程碑（浮现在对话流中） ============ */

.lesson-milestone {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 2px;
  padding: 4px 13px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #8a8478;
  background: #f4f0e9;
  border-radius: 999px;
  animation: milestone-in 0.45s ease;
}

.lesson-milestone i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #1c1a17;
  color: #fdfcf9;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

@keyframes milestone-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ 纸与墨 · 今天页 ============ */

.today-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 4px 4px;
}

.today-greeting {
  margin: 0;
  font-family: "Georgia", "Times New Roman", "Songti SC", "STSong", serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink-color);
  letter-spacing: 0.01em;
}

.today-sub {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--muted-color);
}

.today-resume-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 18px;
  border: 1.5px solid var(--ink-color);
  border-radius: 14px;
  background: var(--paper-bright);
  box-shadow: var(--paper-shadow);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.today-resume-btn:hover {
  transform: translateY(-2px);
  box-shadow: 4px 5px 0 #e3ded4;
}

.today-resume-label {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink-color);
}

.today-resume-meta {
  font-size: 0.78rem;
  color: var(--accent-deep);
  max-width: 240px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.growth-fold {
  margin-top: 10px;
  border-top: 1px solid var(--line-color);
  padding-top: 6px;
}

.growth-fold > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 4px;
  cursor: pointer;
  list-style: none;
  color: var(--muted-color);
}

.growth-fold > summary::-webkit-details-marker {
  display: none;
}

.growth-fold > summary::before {
  content: "▸";
  font-size: 0.8rem;
  transition: transform 160ms ease;
}

.growth-fold[open] > summary::before {
  transform: rotate(90deg);
}

.growth-fold > summary span {
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-color);
}

.growth-fold > summary small {
  font-size: 0.78rem;
}

.growth-fold-count {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--accent-deep);
}

/* ============ 纸与墨 · 英语现场表面切换 ============ */

.surface-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-color);
  border-radius: 999px;
  background: var(--paper-bright);
}

.surface-chips[hidden] {
  display: none !important;
}

.surface-chip {
  min-width: 52px;
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-color);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.surface-chip:hover {
  color: var(--text-color);
}

.surface-chip.active {
  background: var(--ink-color);
  color: var(--paper-bright);
  font-weight: 500;
}

.surface-chip-icon {
  min-width: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.surface-chip-play {
  font-size: 0.7rem;
  line-height: 1;
  transform: translateX(0.5px);
}

/* ============ 数学占位卡 ============ */

.course-card-soon {
  opacity: 0.78;
}

.course-card-soon .course-open-btn {
  border-style: dashed;
  color: var(--muted-color);
}

@keyframes thinking-bounce {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

button.recording,
.composer-button.recording,
.icon-button.recording {
  background: rgba(217, 87, 15, 0.12);
  border-color: rgba(217, 87, 15, 0.24);
  color: var(--accent-color);
}

details summary {
  cursor: pointer;
  color: var(--accent-color);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: #ccc8c2;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b5b0aa;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1220px) {
  .view-mode-switch {
    top: 8px;
  }

  .study-home {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .study-home-main {
    grid-template-rows: auto;
  }

  .study-home-side {
    overflow: visible;
  }

  .study-metrics,
  .course-grid,
  .content-library-grid,
  .learning-plan-materials-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-library-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .course-card-featured {
    grid-column: 1 / -1;
  }

  .googoo-welcome {
    gap: 18px;
    padding: 20px 12px;
  }

  .googoo-welcome-reply {
    min-height: 92px;
    padding: 16px 18px;
  }

  .googoo-welcome-transcript {
    min-height: 62px;
  }

  .googoo-voice-dock {
    left: 12px;
    bottom: 20px;
    right: auto;
    max-width: calc(100vw - 24px);
  }

  .workspace-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .video-learning-layout,
  .pronunciation-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .pronunciation-assessment-grid {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 28px;
  }

  .pronunciation-visual-card {
    width: min(680px, 100%);
    justify-self: center;
  }

  .pronunciation-challenge-panel {
    min-height: auto;
  }

  .video-learning-main {
    min-height: 760px;
  }

  .video-cue-panel {
    min-height: 360px;
  }

  .rail,
  .resize-handle {
    display: none;
  }

  .reading-content {
    padding: 28px 30px 56px;
    font-size: 1.24rem;
  }

  .workspace-layout[data-view-mode="read"] .reading-content {
    font-size: 1.36rem;
  }

  .toc-shell {
    display: none;
  }
}

@media (max-width: 720px) {
  .study-home {
    padding: 54px 12px 14px;
  }

  .study-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 22px;
  }

  .study-hero-orb {
    width: 112px;
    height: 112px;
  }

  .study-hero-orb span {
    width: 46px;
    height: 46px;
  }

  .study-metrics,
  .course-grid,
  .content-library-grid,
  .learning-plan-materials-list,
  .course-card-featured,
  .course-mode-grid {
    grid-template-columns: 1fr;
  }

  .course-card-featured {
    grid-column: auto;
  }

  .course-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .learning-plan-material-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .content-library-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learning-plan-material-card .study-primary-btn,
  .learning-plan-material-card .study-secondary-btn {
    grid-column: 1 / -1;
  }

  .course-cover {
    min-height: 148px;
  }

  .study-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-heatmap-head-actions {
    justify-content: flex-start;
  }

  .study-heatmap-summary {
    width: 100%;
  }

  .study-heatmap-summary span {
    flex: 1 1 140px;
  }

  .video-drill-stats,
  .video-drill-actions,
  .pronunciation-score-grid,
  .pronunciation-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-active-text {
    font-size: 1.65rem;
  }

  .video-learning-layout,
  .pronunciation-layout {
    padding: 10px;
  }

  .pronunciation-main-panel {
    min-height: min(760px, calc(100vh - 128px));
  }

  .pronunciation-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pronunciation-actions {
    gap: 10px 16px;
  }

  .pronunciation-sentence {
    font-size: 2rem;
  }

  .pronunciation-word strong {
    font-size: 2.05rem;
  }

  .video-caption-overlay {
    bottom: 62px;
    width: 96%;
  }

  .video-lookup-card {
    left: 10px;
    top: 10px;
    width: calc(100% - 20px);
    max-height: 58%;
  }
}
