:root {
  --ink: #15223a;
  --ink-2: #29364b;
  --muted: #728095;
  --blue: #315fe8;
  --blue-2: #244cca;
  --blue-soft: #edf2ff;
  --gold: #f0c564;
  --paper: #ffffff;
  --canvas: #f3f5f8;
  --canvas-2: #eef1f5;
  --line: #e1e6ed;
  --line-dark: #cfd6e0;
  --green: #1f9d6a;
  --green-soft: #eaf8f1;
  --shadow: 0 22px 60px rgba(21, 34, 58, 0.09);
  --sidebar: 224px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); font-size: 16px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-defs { position: fixed; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #101b30; color: #dce3ee; padding: 28px 18px 20px; display: flex; flex-direction: column; z-index: 20; }
.brand { appearance: none; border: 0; background: none; color: #fff; display: inline-flex; align-items: center; gap: 11px; padding: 0 10px; font-size: 19px; font-weight: 760; letter-spacing: -.03em; cursor: pointer; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--gold); color: var(--ink); font-family: Georgia, serif; font-weight: 900; font-size: 18px; }
.main-nav { display: grid; gap: 7px; margin-top: 48px; }
.nav-item { position: relative; width: 100%; border: 0; background: transparent; color: #9eabc0; padding: 12px 12px; border-radius: 11px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 650; text-align: left; cursor: pointer; transition: .2s ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item b { margin-left: auto; padding: 1px 7px; border-radius: 20px; background: #26334a; color: #cdd6e4; font-size: 11px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: #263650; box-shadow: inset 3px 0 0 var(--gold); }
.nav-item.active svg { color: var(--gold); }
.sidebar-spacer { flex: 1; }
.admin-link { margin-bottom: 15px; }
.quota-card { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.045); border-radius: 13px; padding: 13px; margin-bottom: 14px; }
.quota-card > div:first-child { display: flex; justify-content: space-between; font-size: 12px; color: #9eabc0; }
.quota-card strong { color: #fff; }
.quota-track { height: 4px; background: #324057; border-radius: 4px; margin: 11px 0 9px; overflow: hidden; }
.quota-track i { display: block; width: 68%; height: 100%; background: var(--gold); border-radius: inherit; }
.quota-card small { color: #818fa5; font-size: 11px; }
.profile-chip { position: relative; border: 0; background: transparent; color: #fff; display: grid; grid-template-columns: 34px 1fr 20px; align-items: center; gap: 9px; padding: 10px 7px; text-align: left; cursor: pointer; }
.avatar, .large-avatar { display: grid; place-items: center; border-radius: 50%; background: #dce5ff; color: var(--blue); font-weight: 800; }
.avatar { width: 34px; height: 34px; font-size: 13px; }
.profile-chip span:nth-child(2) { display: grid; }
.profile-chip strong { font-size: 13px; }
.profile-chip small { color: #7f8da3; font-size: 11px; }
.profile-chip svg { width: 17px; color: #78879e; }
.profile-popover { position: fixed; z-index: 40; left: 18px; bottom: 74px; width: 188px; padding: 7px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.profile-popover button { width: 100%; border: 0; background: none; padding: 10px; border-radius: 8px; display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }
.profile-popover button:hover { background: var(--canvas); }
.profile-popover svg { width: 17px; }

.app-main { margin-left: var(--sidebar); min-height: 100vh; }
.page { display: none; min-height: 100vh; padding: 34px 40px 48px; }
.page.active { display: block; animation: pageIn .34s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; max-width: 1440px; margin: 0 auto 25px; }
.page-header h1 { margin: 4px 0 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(29px, 2.8vw, 42px); letter-spacing: -.04em; line-height: 1.1; font-weight: 600; }
.page-header p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .14em; }
.eyebrow.light { color: var(--gold); }
.workspace-header { margin-bottom: 22px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.save-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.save-status i, .status-pill i, .version-state i, .admin-badge i { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px rgba(31,157,106,.11); }
.ghost-btn, .secondary-btn, .primary-btn, .gold-btn, .dark-ghost { border-radius: 10px; min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 750; cursor: pointer; transition: .2s; }
.ghost-btn { border: 1px solid var(--line-dark); background: rgba(255,255,255,.6); }
.secondary-btn { border: 1px solid var(--line-dark); background: #fff; }
.primary-btn { border: 1px solid var(--blue); background: var(--blue); color: #fff; box-shadow: 0 7px 16px rgba(49,95,232,.16); }
.primary-btn:hover, .generate-btn:hover { background: var(--blue-2); transform: translateY(-1px); }
.ghost-btn:hover, .secondary-btn:hover { border-color: #aeb7c5; background: #f9fafc; }
.primary-btn svg, .ghost-btn svg, .secondary-btn svg, .gold-btn svg, .dark-ghost svg { width: 17px; height: 17px; }
.wide { width: 100%; }

.workspace-grid { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 18px; align-items: start; }
.studio-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 30px rgba(21,34,58,.045); padding: 19px; }
.panel-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.model-identity { display: flex; align-items: center; gap: 10px; }
.model-identity > div { display: grid; }
.model-identity strong { font-size: 14px; }
.model-identity small { font-size: 11px; color: var(--muted); }
.model-orb { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.model-orb.sound { background: var(--blue-soft); color: var(--blue); }
.model-orb svg { width: 19px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #dce8e2; border-radius: 30px; padding: 6px 9px; color: #4e675d; font-size: 11px; }
.status-pill i { width: 6px; height: 6px; box-shadow: none; }
.prompt-box { border: 1px solid #cfd7e4; border-radius: 13px; padding: 15px; box-shadow: 0 0 0 3px rgba(49,95,232,.04); }
.prompt-box > label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.prompt-box textarea { width: 100%; min-height: 74px; resize: vertical; border: 0; outline: 0; color: var(--ink); font-size: 14px; line-height: 1.65; }
.prompt-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prompt-chips button { border: 1px solid #dbe2ed; background: #f7f8fb; color: #5f6c80; padding: 5px 9px; border-radius: 20px; font-size: 11px; cursor: pointer; }
.prompt-chips button.selected { border-color: #aebff4; background: var(--blue-soft); color: var(--blue); }
.generate-btn { border: 0; border-radius: 9px; background: var(--blue); color: #fff; padding: 9px 13px; display: inline-flex; align-items: center; gap: 7px; font-weight: 750; font-size: 12px; cursor: pointer; transition: .2s; white-space: nowrap; }
.generate-btn svg { width: 16px; }
.article-shell { margin-top: 15px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.article-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f7f8fa; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.article-toolbar > div { display: flex; align-items: center; gap: 12px; }
.doc-state { color: var(--green); font-weight: 750; }
.icon-button, .more-button { border: 0; background: transparent; display: inline-grid; place-items: center; padding: 5px; cursor: pointer; color: var(--muted); border-radius: 7px; }
.icon-button:hover, .more-button:hover { background: #e8ecf2; color: var(--ink); }
.icon-button svg, .more-button svg { width: 17px; height: 17px; }
.reading-article { padding: 25px 30px 20px; outline: 0; min-height: 270px; }
.reading-article:focus { box-shadow: inset 0 0 0 2px rgba(49,95,232,.08); }
.reading-article h2 { margin: 0 0 18px; font-family: Georgia, serif; font-size: 27px; font-weight: 600; letter-spacing: -.02em; }
.reading-article p { margin: 0 0 13px; color: #344055; font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.75; }
.article-insights { display: flex; gap: 8px; padding: 12px 14px; background: #fbfcfd; border-top: 1px solid var(--line); }
.article-insights button { border: 1px solid var(--line); background: #fff; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 11px; cursor: pointer; }
.article-insights span { color: var(--blue); font-weight: 800; margin-right: 4px; }
.revision-bar { display: grid; grid-template-columns: 22px 1fr 34px; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 7px 8px 7px 12px; margin-top: 13px; color: var(--blue); }
.revision-bar svg { width: 17px; }
.revision-bar input { border: 0; outline: 0; font-size: 13px; color: var(--ink); }
.revision-bar button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; }
.confirm-copy { width: 100%; margin-top: 13px; min-height: 44px; border: 0; border-radius: 10px; background: #17253d; color: #fff; font-size: 13px; font-weight: 780; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.confirm-copy:hover { background: #22334e; }
.confirm-copy svg { width: 17px; color: var(--gold); }

.audio-studio { position: sticky; top: 22px; }
.audio-version-note { display: flex; align-items: center; gap: 8px; border: 1px solid #d9e8df; color: #39775e; background: #f4fbf7; border-radius: 10px; padding: 9px 11px; font-size: 11px; }
.audio-version-note svg { width: 15px; }
.audio-version-note small { margin-left: auto; color: #7b9188; }
.voice-card { margin-top: 14px; padding: 16px; border-radius: 14px; background: #15223a; color: #fff; display: grid; grid-template-columns: 50px 1fr 38px; gap: 12px; align-items: center; }
.voice-avatar { position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.voice-avatar i { position: absolute; width: 10px; height: 10px; right: 0; bottom: 2px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); }
.voice-card .eyebrow { color: #8da1bd; font-size: 9px; }
.voice-card h3 { margin: 1px 0 0; font-family: Georgia, serif; font-size: 21px; }
.voice-card p { margin: 1px 0 0; color: #9eadc2; font-size: 11px; }
.circle-play { border: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 6px 18px rgba(14,26,46,.12); }
.circle-play svg { width: 17px; fill: currentColor; stroke-width: 1; margin-left: 2px; }
.voice-settings { display: grid; gap: 16px; padding: 18px 2px 15px; }
.setting-group { display: grid; gap: 8px; }
.setting-group > label { display: flex; justify-content: space-between; color: #506077; font-size: 12px; font-weight: 650; }
.setting-group label strong { color: var(--blue); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: #f0f2f6; border-radius: 9px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented button { border: 0; padding: 7px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.segmented button.active { background: #fff; color: var(--ink); font-weight: 750; box-shadow: 0 2px 8px rgba(21,34,58,.08); }
input[type="range"] { width: 100%; accent-color: var(--blue); }
.select-like { min-height: 38px; border: 1px solid var(--line-dark); border-radius: 9px; background: #fff; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; color: #3c4b61; font-size: 12px; cursor: pointer; }
.select-like svg { width: 14px; transform: rotate(90deg); color: var(--muted); }
.audio-preview { border-top: 1px solid var(--line); padding-top: 14px; }
.audio-preview-head { display: flex; justify-content: space-between; align-items: center; }
.audio-preview-head > div { display: grid; }
.audio-preview-head span { font-size: 12px; font-weight: 750; }
.audio-preview-head small { font-size: 10px; color: var(--muted); }
.text-link { border: 0; background: transparent; padding: 0; color: var(--blue); font-size: 12px; font-weight: 700; cursor: pointer; }
.waveform { height: 57px; display: flex; align-items: center; gap: 3px; padding: 6px 0; overflow: hidden; }
.waveform i { width: 4px; min-width: 3px; height: var(--h); border-radius: 3px; background: #afbed7; }
.waveform i:nth-child(-n+11) { background: var(--blue); }
.generate-progress { margin-top: 12px; padding: 12px 13px; border: 1px solid #e3e9f4; border-radius: 12px; background: #f8fafd; }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress-title { display: flex; align-items: center; gap: 8px; color: #1c2b45; font-size: 12px; font-weight: 600; }
.progress-elapsed { color: #74829a; font-size: 11px; font-variant-numeric: tabular-nums; }
.progress-spinner { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #d3ddf0; border-top-color: #3b6ef0; animation: progress-spin .8s linear infinite; }
.progress-track { position: relative; height: 5px; margin: 10px 0 9px; border-radius: 999px; background: #e6ecf6; overflow: hidden; }
.progress-track i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: #3b6ef0; transition: width .35s ease; }
.progress-track i.indeterminate { background: linear-gradient(90deg, #c3d1fa 0%, #3b6ef0 45%, #c3d1fa 100%); background-size: 200% 100%; animation: progress-flow 1.2s linear infinite; }
.progress-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.progress-steps li { display: flex; align-items: center; gap: 7px; color: #97a3b6; font-size: 11px; }
.progress-steps li i { flex: none; display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #cfd8e8; }
.progress-steps li.active { color: #1c2b45; font-weight: 600; }
.progress-steps li.active i { border-color: #3b6ef0; }
.progress-steps li.active i::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #3b6ef0; }
.progress-steps li.done { color: #45536a; }
.progress-steps li.done i { border-color: #2fa36b; background: #2fa36b; }
.progress-steps li.done i::after { content: "✓"; color: #fff; font-size: 9px; line-height: 1; }
.progress-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; min-height: 16px; }
.progress-detail { color: #8d99ad; font-size: 10px; }
.progress-cancel { border: 0; padding: 0; background: transparent; color: #7b879b; font-size: 11px; text-decoration: underline; cursor: pointer; }
.progress-cancel:hover { color: #e0575b; }
.generate-progress.done .progress-spinner { border-color: #2fa36b; border-top-color: #2fa36b; animation: none; }
.generate-progress.error { border-color: #f3d4d4; background: #fdf6f6; }
.generate-progress.error .progress-title { color: #b8393d; }
.generate-progress.error .progress-spinner { border-color: #e9b6b7; border-top-color: #d04145; animation: none; }
.regenerate-audio { display: block; margin: 10px auto 0; }
@keyframes progress-spin { to { transform: rotate(360deg); } }
@keyframes progress-flow { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.audio-generate { margin-top: 10px; }
.audio-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; margin-top: 10px; }
.ai-disclosure { margin: 10px 0 0; color: #929daa; font-size: 10px; text-align: center; }

.library-tools { max-width: 1440px; margin: 0 auto 18px; display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; gap: 14px; align-items: center; }
.search-box { min-height: 43px; display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; }
.search-box svg { width: 17px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: 13px; }
.filter-tabs { display: flex; align-items: center; gap: 4px; }
.filter-tabs button { border: 0; background: transparent; color: var(--muted); padding: 9px 11px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.filter-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(21,34,58,.06); }
.filter-tabs b { font-size: 10px; }
.select-like.compact { min-width: 110px; }
.featured-material { max-width: 1440px; margin: 0 auto 18px; min-height: 230px; border-radius: 19px; overflow: hidden; background: #15223a; color: #fff; display: grid; grid-template-columns: 1.25fr .75fr; position: relative; }
.featured-material::after { content: "M"; position: absolute; right: 29%; bottom: -112px; color: rgba(255,255,255,.028); font-family: Georgia, serif; font-size: 350px; line-height: 1; pointer-events: none; }
.featured-copy { padding: 32px 38px; }
.featured-copy .eyebrow { display: block; margin-top: 18px; }
.featured-copy h2 { margin: 6px 0 4px; font-family: Georgia, serif; font-size: 34px; font-weight: 600; }
.featured-copy p { color: #9eabc0; font-size: 13px; }
.status-chip { display: inline-flex; align-items: center; border-radius: 20px; padding: 4px 8px; font-size: 10px; font-weight: 750; }
.status-chip.ready { background: var(--green-soft); color: #287458; }
.status-chip.draft { background: #f0f2f5; color: #6e7988; }
.featured-actions { display: flex; gap: 9px; margin-top: 24px; }
.gold-btn { border: 1px solid var(--gold); background: var(--gold); color: var(--ink); }
.dark-ghost { border: 1px solid #3d4b61; background: transparent; color: #dfe5ef; }
.featured-sound { border-left: 1px solid rgba(255,255,255,.1); padding: 35px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: rgba(255,255,255,.02); }
.featured-sound > span { font-family: Georgia, serif; font-size: 20px; }
.featured-sound small { color: #8290a6; font-size: 10px; }
.mini-wave { height: 34px; display: flex; align-items: center; gap: 4px; }
.mini-wave i { width: 3px; height: 36%; background: var(--gold); border-radius: 2px; }
.mini-wave i:nth-child(2n) { height: 75%; }.mini-wave i:nth-child(3n) { height: 100%; }.mini-wave i:nth-child(5n) { height: 54%; }
.mini-wave.large { height: 75px; gap: 7px; margin: 7px 0 11px; }
.mini-wave.large i { width: 5px; }
.material-grid { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.material-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 17px; min-height: 245px; display: flex; flex-direction: column; transition: .2s; }
.material-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(21,34,58,.08); }
.material-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.material-card-top > button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.material-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.material-icon svg { width: 18px; }
.material-icon.blue { background: #eaf0ff; color: var(--blue); }.material-icon.amber { background: #fff4dc; color: #b47d12; }.material-icon.gray { background: #eef0f3; color: #657184; }.material-icon.mint { background: #e8f6f0; color: #218260; }
.material-card > .status-chip { align-self: flex-start; }
.material-card h3 { margin: 9px 0 3px; font-family: Georgia, serif; font-size: 19px; }
.material-card > p { margin: 0; color: var(--muted); font-size: 11px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; color: #8792a3; font-size: 10px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg { width: 12px; }
.card-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.tiny-wave { height: 30px; display: flex; align-items: center; gap: 3px; }
.tiny-wave i { width: 3px; height: 34%; background: #b7c4d8; border-radius: 2px; }
.tiny-wave i:nth-child(2n) { height: 70%; }.tiny-wave i:nth-child(3n) { height: 96%; }
.card-footer .circle-play { width: 31px; height: 31px; background: var(--ink); color: #fff; }
.draft-note { color: var(--muted); font-size: 10px; }
.arrow-button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ink); cursor: pointer; }
.arrow-button svg { width: 14px; }

.classroom-page { padding: 0 !important; background: #eef1f5; height: 100vh; overflow: hidden; }
.classroom-page.active { display: flex; flex-direction: column; }
.class-header { min-height: 78px; background: #fff; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 28px; }
.back-button { justify-self: start; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.class-header > div:nth-child(2) { display: grid; text-align: center; }
.class-header strong { font-family: Georgia, serif; font-size: 16px; }
.class-header span { color: var(--muted); font-size: 10px; }
.class-options { justify-self: end; display: flex; align-items: center; gap: 15px; }
.switch-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; cursor: pointer; }
.switch-row input { display: none; }
.switch-row i { position: relative; width: 34px; height: 19px; border-radius: 20px; background: #cad1da; transition: .2s; }
.switch-row i::after { content: ""; position: absolute; width: 15px; height: 15px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.16); transition: .2s; }
.switch-row input:checked + i { background: var(--blue); }
.switch-row input:checked + i::after { left: 17px; }
.class-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 90px minmax(0, 810px); justify-content: center; gap: 40px; padding: 36px 25px 140px; overflow-y: auto; }
.lesson-rail { display: flex; flex-direction: column; align-items: center; padding-top: 8px; color: var(--muted); }
.lesson-rail strong { font-family: Georgia, serif; color: var(--ink); font-size: 41px; font-weight: 400; line-height: 1; margin: 7px 0 15px; }
.lesson-rail i { width: 1px; height: 70px; background: #cbd2dc; }
.lesson-rail small { margin-top: 14px; text-align: center; font-size: 9px; line-height: 1.7; }
.class-reading { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 48px 56px 60px; box-shadow: var(--shadow); }
.class-title { margin-bottom: 33px; }
.class-title span { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.class-title h1 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 37px; font-weight: 600; letter-spacing: -.025em; }
.sentence { width: 100%; border: 0; background: transparent; padding: 13px 14px; border-radius: 10px; display: grid; grid-template-columns: 32px 1fr 30px; gap: 14px; align-items: start; text-align: left; cursor: pointer; transition: .18s; }
.sentence:hover { background: #f5f7fa; }
.sentence.active { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.sentence-number { padding-top: 5px; color: #a4adba; font-size: 10px; font-weight: 800; }
.sentence-copy { display: grid; }
.sentence-copy b { font-family: Georgia, serif; font-size: 20px; line-height: 1.55; font-weight: 500; color: #26334a; }
.sentence.active .sentence-copy b { color: var(--blue-2); }
.sentence-copy em { color: #909aa9; font-style: normal; font-size: 12px; margin-top: 3px; }
.sentence-play { opacity: 0; color: var(--blue); transition: .2s; padding-top: 3px; }
.sentence:hover .sentence-play, .sentence.active .sentence-play { opacity: 1; }
.sentence-play svg { width: 17px; }
.class-reading.hide-translation em { display: none; }
.class-player { position: absolute; left: calc(var(--sidebar) + 25px); right: 25px; bottom: 20px; min-height: 94px; background: rgba(21,34,58,.97); color: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(8,16,30,.27); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 23px; z-index: 5; }
.now-playing { display: flex; align-items: center; gap: 11px; min-width: 0; }
.voice-avatar.mini { width: 39px; height: 39px; font-size: 10px; flex: none; }
.now-playing > div { display: grid; min-width: 0; }
.now-playing small { color: #8291a7; font-size: 9px; }
.now-playing strong { font-family: Georgia, serif; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transport { display: flex; align-items: center; gap: 12px; }
.transport button { border: 0; background: transparent; color: #c5cedb; display: grid; place-items: center; cursor: pointer; }
.transport svg { width: 17px; }
.transport .main-play { width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--ink); }
.transport .main-play svg { width: 19px; fill: currentColor; stroke-width: 1; }
.transport .speed-button { width: 38px; height: 28px; border-radius: 7px; background: #263650; font-size: 10px; }
.class-progress { justify-self: end; width: min(280px, 100%); display: grid; grid-template-columns: 33px 1fr 33px; gap: 8px; align-items: center; color: #8291a7; font-size: 9px; }
.class-progress > div { height: 3px; background: #39475c; border-radius: 4px; overflow: hidden; }
.class-progress i { display: block; width: 18%; height: 100%; background: var(--gold); border-radius: inherit; transition: width .25s; }

.account-grid { max-width: 1440px; margin: 0 auto 18px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 17px; }
.account-profile-card, .usage-card, .plans-section { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 25px; }
.account-profile-card { display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; align-items: center; }
.large-avatar { width: 70px; height: 70px; font-size: 23px; }
.account-profile-card h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; }
.account-profile-card p { margin: 1px 0 8px; color: var(--muted); font-size: 12px; }
.plan-pill { background: var(--blue-soft); color: var(--blue); border-radius: 20px; padding: 5px 9px; font-size: 10px; font-weight: 700; }
.usage-head { display: flex; justify-content: space-between; align-items: flex-start; }
.usage-head h2 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 38px; }
.usage-head > span { color: var(--muted); font-size: 10px; }
.usage-track { height: 7px; background: #edf0f4; border-radius: 7px; overflow: hidden; margin: 13px 0 19px; }
.usage-track i { display: block; width: 68%; height: 100%; border-radius: inherit; background: var(--blue); }
.usage-stats { display: grid; grid-template-columns: repeat(3,1fr); }
.usage-stats div { display: grid; border-left: 1px solid var(--line); padding-left: 17px; }
.usage-stats div:first-child { border: 0; padding-left: 0; }
.usage-stats strong { font-family: Georgia, serif; font-size: 21px; }
.usage-stats strong small { font-family: inherit; font-size: 10px; }
.usage-stats span { color: var(--muted); font-size: 10px; }
.plans-section { max-width: 1440px; margin: 0 auto; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.section-heading h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 26px; }
.billing-toggle { background: #f0f2f5; border-radius: 9px; padding: 3px; }
.billing-toggle button { border: 0; background: transparent; border-radius: 7px; padding: 7px 10px; color: var(--muted); font-size: 11px; cursor: pointer; }
.billing-toggle button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 7px rgba(21,34,58,.08); }
.billing-toggle b { color: var(--green); font-size: 9px; }
.plan-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.plan-card { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 21px; }
.plan-card > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.plan-card h3 { margin: 7px 0 4px; font-family: Georgia, serif; font-size: 30px; }
.plan-card h3 small { color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 400; }
.plan-card p { color: var(--muted); font-size: 11px; }
.plan-card ul { min-height: 110px; list-style: none; padding: 0; margin: 17px 0; }
.plan-card li { padding: 5px 0; color: #4e5b6e; font-size: 11px; }
.plan-card li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 7px; }
.featured-plan { border: 1.5px solid var(--blue); box-shadow: 0 12px 28px rgba(49,95,232,.1); }
.recommend-label { position: absolute; top: -11px; right: 15px; background: var(--blue); color: #fff; border-radius: 20px; padding: 4px 9px; font-size: 9px; }

.admin-badge { display: flex; align-items: center; gap: 8px; color: var(--green); background: var(--green-soft); border-radius: 20px; padding: 8px 11px; font-size: 11px; }
.admin-badge i { box-shadow: none; }
.admin-metrics { max-width: 1440px; margin: 0 auto 17px; display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.admin-metrics article { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 17px; display: grid; }
.admin-metrics span { color: var(--muted); font-size: 10px; }
.admin-metrics strong { margin: 5px 0 2px; font-family: Georgia, serif; font-size: 24px; }
.admin-metrics small { color: var(--green); font-size: 9px; }
.admin-layout { max-width: 1440px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; display: grid; grid-template-columns: 185px 1fr; min-height: 510px; overflow: hidden; }
.admin-tabs { padding: 17px 10px; background: #f8f9fb; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.admin-tabs button { border: 0; background: transparent; color: var(--muted); padding: 10px 11px; border-radius: 8px; text-align: left; font-size: 12px; cursor: pointer; }
.admin-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(21,34,58,.06); font-weight: 750; }
.admin-content { display: none; padding: 28px; }
.admin-content.active { display: block; }
.admin-content-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.admin-content-head h2 { margin: 4px 0 2px; font-family: Georgia, serif; font-size: 25px; }
.admin-content-head p { margin: 0; color: var(--muted); font-size: 11px; }
.version-state { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 10px; }
.version-state i { box-shadow: none; }
.prompt-editor-label { display: grid; gap: 8px; margin-top: 20px; color: #4b596e; font-size: 11px; font-weight: 700; }
.prompt-editor-label textarea { width: 100%; min-height: 260px; resize: vertical; border: 1px solid var(--line-dark); border-radius: 11px; padding: 16px; outline: 0; color: var(--ink); background: #fbfcfd; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.7; }
.prompt-editor-label textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49,95,232,.08); }
.admin-save-row { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }
.admin-save-row > span { color: var(--muted); font-size: 10px; }
.admin-save-row > div { display: flex; gap: 8px; }
.provider-list { display: grid; gap: 10px; margin-top: 20px; }
.provider-list article { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.provider-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--gold); font-weight: 900; }
.provider-logo.sound { background: var(--blue-soft); color: var(--blue); }.provider-logo.neutral { background: #eef0f3; color: #5c687a; }
.provider-list strong { font-size: 13px; }.provider-list p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.api-config-card { margin-top: 20px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
.api-config-card label { display: grid; gap: 7px; color: #4b596e; font-size: 11px; font-weight: 750; }
.api-config-card input { width: 100%; min-height: 42px; border: 1px solid var(--line-dark); border-radius: 9px; padding: 0 11px; outline: 0; background: #fff; color: var(--ink); }
.api-config-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49,95,232,.08); }
.api-config-card p { margin: 10px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.api-config-card code { padding: 2px 5px; border-radius: 5px; background: #edf0f5; color: #3e4b61; }
.api-config-card > div { display: flex; justify-content: flex-end; gap: 8px; }
.settings-list { display: grid; gap: 10px; margin-top: 20px; }
.settings-list label { display: grid; grid-template-columns: 1fr 120px; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; }
.settings-list label > span { display: grid; }.settings-list strong { font-size: 12px; }.settings-list small { color: var(--muted); font-size: 10px; }
.settings-list input { border: 1px solid var(--line-dark); border-radius: 8px; padding: 8px 9px; text-align: right; outline: 0; }
.user-table { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.user-row { display: grid; grid-template-columns: 1.5fr .8fr .8fr .6fr; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 11px; }
.user-row:first-child { border-top: 0; }.user-row.head { background: #f7f8fa; color: var(--muted); font-size: 10px; }
.user-row > span:first-child { display: grid; }.user-row small { color: var(--muted); }

.login-screen { min-height: 100vh; background: #101b30; color: #fff; overflow: hidden; }
.login-header { min-height: 84px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-dark { padding: 0; }
.login-help { color: #8a99af; font-size: 12px; }
.login-main { min-height: calc(100vh - 84px); display: grid; grid-template-columns: 1.1fr .9fr; }
.login-story { position: relative; padding: 10vh 8vw; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.login-story::after { content: "M"; position: absolute; right: -110px; bottom: -190px; color: rgba(255,255,255,.025); font-family: Georgia, serif; font-size: min(45vw, 650px); line-height: 1; }
.login-story h1 { margin: 13px 0 18px; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 5vw, 74px); font-weight: 500; line-height: 1.17; letter-spacing: -.05em; }
.login-story > p { max-width: 480px; color: #9aa8bb; font-size: 16px; line-height: 1.8; }
.story-proof { margin-top: 50px; width: fit-content; display: flex; align-items: center; gap: 15px; padding: 15px 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.04); }
.story-proof > div:last-child { display: grid; }.story-proof strong { font-family: Georgia, serif; }.story-proof span { color: #8493a8; font-size: 10px; }
.auth-card { align-self: center; justify-self: center; width: min(430px, calc(100% - 60px)); background: #fff; color: var(--ink); border-radius: 20px; padding: 34px; box-shadow: 0 35px 90px rgba(0,0,0,.25); }
.auth-heading h2 { margin: 6px 0 4px; font-family: Georgia, "Songti SC", serif; font-size: 28px; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin: 25px 0 20px; }
.auth-tab { border: 0; background: transparent; color: var(--muted); padding: 10px; border-bottom: 2px solid transparent; cursor: pointer; }
.auth-tab.active { color: var(--blue); border-color: var(--blue); font-weight: 750; }
#auth-form { display: grid; gap: 15px; }
#auth-form > label { display: grid; gap: 6px; color: #4a5769; font-size: 11px; font-weight: 700; }
#auth-form input { min-height: 44px; border: 1px solid var(--line-dark); border-radius: 9px; padding: 0 12px; outline: 0; }
#auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49,95,232,.08); }
.auth-row { display: flex; justify-content: space-between; align-items: center; }
.check-row { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.check-row input { min-height: auto !important; accent-color: var(--blue); }
.auth-legal { color: #9aa3b0; font-size: 9px; text-align: center; margin: 15px 0 0; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; z-index: 100; background: var(--ink); color: #fff; border-radius: 10px; padding: 11px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; font-size: 12px; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; color: var(--gold); }

@media (max-width: 1180px) {
  :root { --sidebar: 82px; }
  .sidebar { width: var(--sidebar); padding-inline: 12px; align-items: center; }
  .brand > span:last-child, .nav-item span, .nav-item b, .quota-card, .profile-chip span:nth-child(2), .profile-chip > svg { display: none; }
  .brand { padding: 0; }.main-nav { width: 100%; }.nav-item { justify-content: center; padding: 13px; }.admin-link { justify-content: center; }.profile-chip { display: block; }.profile-popover { left: 10px; }
  .workspace-grid { grid-template-columns: 1fr; }.audio-studio { position: static; }
  .material-grid { grid-template-columns: repeat(2,1fr); }
  .class-player { left: calc(var(--sidebar) + 18px); }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { inset: auto 0 0 0; width: 100%; height: 68px; padding: 7px 10px; flex-direction: row; align-items: center; justify-content: center; border-top: 1px solid #293750; }
  .sidebar > .brand, .sidebar-spacer, .admin-link, .quota-card, .profile-chip, .profile-popover { display: none; }
  .main-nav { margin: 0; width: 100%; display: grid; grid-template-columns: repeat(4,1fr); gap: 2px; }
  .nav-item { flex-direction: column; gap: 2px; padding: 5px 2px; font-size: 9px; }
  .nav-item span { display: block; }.nav-item.active { box-shadow: inset 0 2px 0 var(--gold); }
  .app-main { margin-left: 0; padding-bottom: 68px; }
  .page { padding: 24px 15px 92px; }
  .page-header { align-items: flex-start; }.page-header h1 { font-size: 31px; }.page-header > .primary-btn { width: 42px; padding: 0; }.page-header > .primary-btn { font-size: 0; }
  .header-actions .save-status { display: none; }
  .prompt-footer { align-items: stretch; flex-direction: column; }.generate-btn { justify-content: center; }
  .reading-article { padding: 21px 18px; }.article-insights { overflow-x: auto; }.article-insights button { white-space: nowrap; }
  .audio-version-note small { display: none; }
  .library-tools { grid-template-columns: 1fr; }.filter-tabs { order: 2; overflow-x: auto; }.select-like.compact { display: none; }
  .featured-material { grid-template-columns: 1fr; }.featured-sound { display: none; }.featured-copy { padding: 27px 22px; }.material-grid { grid-template-columns: 1fr; }
  .classroom-page { height: calc(100vh - 68px); padding: 0 !important; }.class-header { min-height: 66px; grid-template-columns: 1fr auto; padding: 0 14px; }.class-header > div:nth-child(2) { display: none; }.class-stage { grid-template-columns: 1fr; padding: 20px 12px 130px; }.lesson-rail { display: none; }.class-reading { padding: 28px 14px; }.class-title h1 { font-size: 29px; }.sentence { grid-template-columns: 25px 1fr 25px; gap: 8px; padding-inline: 8px; }.sentence-copy b { font-size: 17px; }.class-player { left: 12px; right: 12px; bottom: 80px; min-height: 86px; grid-template-columns: 1fr; padding: 12px; }.now-playing, .class-progress { display: none; }.transport { justify-content: center; }
  .account-grid { grid-template-columns: 1fr; }.account-profile-card { grid-template-columns: 55px 1fr; }.account-profile-card .text-link { display: none; }.large-avatar { width: 55px; height: 55px; }.usage-stats strong { font-size: 18px; }.plans-section { padding: 18px 14px; }.plan-grid { grid-template-columns: 1fr; }.section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .admin-metrics { grid-template-columns: repeat(2,1fr); }.admin-layout { grid-template-columns: 1fr; }.admin-tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }.admin-tabs button { white-space: nowrap; }.admin-content { padding: 20px 14px; }.admin-save-row { align-items: flex-start; flex-direction: column; gap: 12px; }.settings-list label { grid-template-columns: 1fr; gap: 10px; }.user-row { grid-template-columns: 1.4fr .7fr .7fr; }.user-row > *:nth-child(4) { display: none; }
  .login-header { min-height: 70px; }.login-help { display: none; }.login-main { min-height: calc(100vh - 70px); grid-template-columns: 1fr; }.login-story { display: none; }.auth-card { width: calc(100% - 28px); padding: 25px; }
}

/* ===== 教学模板 ===== */
.template-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dbe2ed; background: #f7f8fb; color: #5f6c80; padding: 8px 12px; border-radius: 9px; font-size: 12px; cursor: pointer; }
.template-toggle svg { width: 14px; }
.template-toggle:hover { border-color: #aebff4; color: var(--blue); }
.template-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; padding: 14px; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.template-grid label { display: grid; gap: 5px; color: #5f6c80; font-size: 11px; font-weight: 650; }
.template-grid label.span-2 { grid-column: span 2; }
.template-grid input, .template-grid select { width: 100%; border: 1px solid #dbe2ed; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--ink); background: #fff; outline: 0; }
.template-grid input:focus, .template-grid select:focus { border-color: #aebff4; }
.template-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.template-foot span { color: var(--muted); font-size: 10px; }

/* ===== 重点词汇 ===== */
.keyword-toggle { border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 6px 11px; border-radius: 8px; font-size: 11px; cursor: pointer; }
.keyword-toggle.active { border-color: #aebff4; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.insight-pill { border: 1px solid var(--line); background: #fff; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 11px; }
.article-insights .insight-pill span { color: var(--blue); font-weight: 800; margin-right: 4px; }
.reading-article .word { border-radius: 3px; }
.reading-article.keyword-mode .word:hover { background: #eef3ff; cursor: pointer; }
.reading-article .word.keyword { color: #c93b26; font-weight: 700; background: #fdeeea; }
.vocabulary-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 14px; }
.vocabulary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vocabulary-head h3 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 18px; }
.vocabulary-table { margin-top: 10px; overflow-x: auto; }
.vocabulary-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vocabulary-table th { text-align: left; color: var(--muted); font-weight: 650; font-size: 11px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vocabulary-table td { padding: 7px 8px; border-bottom: 1px solid #f0f3f8; color: var(--ink); }
.vocabulary-table td[contenteditable]:focus { outline: 0; background: #f4f7ff; border-radius: 6px; }
.vocabulary-table td:first-child { font-weight: 700; }
.row-remove { border: 0; background: transparent; color: #b9c2d0; font-size: 14px; line-height: 1; cursor: pointer; }
.row-remove:hover { color: #c93b26; }
.vocabulary-empty { margin: 0; color: var(--muted); font-size: 11px; }
.vocabulary-note { margin: 9px 0 0; color: #9aa5b6; font-size: 10px; }

/* ===== 音色选择 ===== */
.voice-picker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 14px; }
.voice-picker-head small { color: var(--muted); font-size: 10px; }
.voice-picker { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.voice-option { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 11px; cursor: pointer; }
.voice-option strong { font-size: 13px; color: var(--ink); }
.voice-option small { font-size: 10px; color: var(--muted); }
.voice-option.active { border-color: #15223a; background: #15223a; }
.voice-option.active strong, .voice-option.active small { color: #fff; }
.audio-main-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 9px; margin-top: 12px; }

/* ===== 材料库 ===== */
.material-card.selected { border-color: #aebff4; box-shadow: 0 12px 26px rgba(59,110,240,.14); }
.featured-actions button:disabled { opacity: .55; cursor: not-allowed; }

/* ===== 课堂播放器 ===== */
.class-mode { display: inline-flex; gap: 4px; background: #1d2a41; border-radius: 9px; padding: 4px; margin-bottom: 12px; }
.class-mode button { border: 0; background: transparent; color: #9eadc2; padding: 6px 12px; border-radius: 7px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.class-mode button.active { background: var(--gold); color: var(--ink); font-weight: 700; }
.transport { position: relative; }
.transport .loop-button { width: auto; min-width: 64px; height: 28px; padding: 0 10px; border-radius: 7px; background: #263650; color: #9eadc2; font-size: 10px; }
.transport .loop-button.active { background: #3b6ef0; color: #fff; }
.speed-menu { position: absolute; bottom: 54px; right: 0; display: grid; gap: 2px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 16px 34px rgba(15,25,45,.18); z-index: 30; }
.speed-menu button { border: 0; background: transparent; color: var(--ink); font-size: 12px; padding: 6px 16px; border-radius: 7px; cursor: pointer; text-align: left; }
.speed-menu button.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.class-progress { grid-template-columns: 40px 1fr 40px; }
.class-progress > .seek-wrap { position: relative; height: 14px; background: transparent; overflow: visible; }
.seek-wrap::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); background: #39475c; border-radius: 4px; }
.seek-wrap i { position: absolute; left: 0; top: 50%; height: 3px; width: 0; transform: translateY(-50%); background: var(--gold); border-radius: 4px; }
.seek-wrap input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.class-hint { margin: 10px 0 0; color: #8a97ab; font-size: 10px; }
.account-note { margin-top: 16px; color: var(--muted); font-size: 11px; }
.text-progress { margin-top: 12px; padding: 12px 13px; border: 1px solid #e3e9f4; border-radius: 12px; background: #f8fafd; }
.text-progress.error { border-color: #f3d4d4; background: #fdf6f6; }
.text-progress.error .progress-title { color: #b8393d; }
.text-progress.error .progress-spinner { border-color: #e9b6b7; border-top-color: #d04145; animation: none; }
.text-progress.done .progress-spinner { border-color: #2fa36b; border-top-color: #2fa36b; animation: none; }

/* ===== 创作页迷你播放器 ===== */
.mini-player { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; margin-top: 10px; }
.mini-play { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mini-play svg { width: 15px; fill: currentColor; }
.mini-track { position: relative; height: 16px; display: flex; align-items: center; }
.mini-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; transform: translateY(-50%); background: #e6ecf6; border-radius: 4px; }
.mini-track i { position: absolute; left: 0; top: 50%; height: 4px; width: 0; transform: translateY(-50%); background: var(--blue); border-radius: 4px; }
.mini-track input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mini-time { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== 朗读头像 ===== */
.avatar-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.avatar-colors { display: flex; gap: 6px; }
.avatar-swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); box-shadow: 0 0 0 1px rgba(21,34,58,.12); cursor: pointer; }
.avatar-swatch.active { box-shadow: 0 0 0 2px var(--blue); }
.avatar-shapes { display: flex; gap: 4px; margin-left: auto; }
.avatar-shapes button { border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 10px; padding: 4px 9px; border-radius: 7px; cursor: pointer; }
.avatar-shapes button.active { border-color: #aebff4; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.avatar-gold { background: var(--gold); color: #142033; }
.avatar-blue { background: #3b6ef0; color: #fff; }
.avatar-green { background: #2fa36b; color: #fff; }
.avatar-coral { background: #e0715a; color: #fff; }
.avatar-violet { background: #7a5cf0; color: #fff; }
.avatar-slate { background: #2b3a52; color: #fff; }
.voice-avatar.shape-rounded { border-radius: 12px; }

/* ===== 课堂播放条 ===== */
#now-title { color: #9eadc2; font-size: 10px; letter-spacing: .02em; }
.now-status { margin-left: auto; align-self: center; color: #9eadc2; font-size: 10px; white-space: nowrap; }
.icon-button.active { background: var(--blue-soft); color: var(--blue); }

/* ===== 课堂单词栏 ===== */
.class-stage { grid-template-columns: 92px minmax(0, 1fr) 240px; gap: 24px; justify-content: stretch; }
.vocab-rail { display: flex; flex-direction: column; gap: 10px; align-self: start; padding: 16px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; overflow-y: auto; max-height: calc(100vh - 300px); }
.vocab-rail.collapsed { display: none; }
.vocab-rail-head { display: grid; gap: 2px; }
.vocab-rail-head strong { font-family: Georgia, serif; font-size: 17px; }
.vocab-rail-list { display: grid; gap: 6px; }
.vocab-rail-item { display: grid; gap: 1px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 10px; cursor: pointer; }
.vocab-rail-item:hover { border-color: #aebff4; }
.vocab-rail-item strong { font-size: 13px; color: var(--ink); }
.vocab-rail-item span { font-size: 10px; color: var(--blue); }
.vocab-rail-item em { font-style: normal; font-size: 10px; color: var(--muted); }
.vocab-rail-note, .vocab-rail-empty { margin: 0; color: #9aa5b6; font-size: 10px; }
@media (max-width: 1400px) { .class-stage { grid-template-columns: 80px minmax(0, 1fr) 210px; gap: 18px; } }
@media (max-width: 1180px) { .class-stage { grid-template-columns: 82px minmax(0, 1fr); } .vocab-rail { display: none; } .vocab-rail.collapsed { display: none; } }

/* ===== 侧栏收起 ===== */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-toggle { flex: none; width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: transparent; color: #9eabc0; display: grid; place-items: center; cursor: pointer; }
.sidebar-toggle svg { width: 14px; height: 14px; transform: rotate(180deg); }
.sidebar-toggle:hover { color: #fff; border-color: rgba(255,255,255,.3); }
body.sidebar-collapsed { --sidebar: 78px; }
body.sidebar-collapsed .sidebar { padding: 28px 10px 20px; align-items: center; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-item b,
body.sidebar-collapsed .quota-card,
body.sidebar-collapsed .profile-chip span:nth-child(2),
body.sidebar-collapsed .profile-chip > svg { display: none; }
body.sidebar-collapsed .sidebar-head { flex-direction: column; gap: 12px; }
body.sidebar-collapsed .brand { padding: 0; }
body.sidebar-collapsed .main-nav { width: 100%; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 12px; }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(0deg); }
body.sidebar-collapsed .profile-chip { display: flex; justify-content: center; }
body.sidebar-collapsed .profile-popover { left: 10px; }
.editing-hint { color: var(--muted); font-size: 11px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 独立管理后台 ===== */
.admin-standalone { background: var(--canvas); }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; background: #101b30; color: #fff; }
.admin-topbar-brand { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.admin-topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-topbar-actions .ghost-btn { color: #dce3ee; border-color: rgba(255,255,255,.2); text-decoration: none; }
.admin-topbar-actions .admin-badge { color: #cdd6e4; background: rgba(255,255,255,.08); }
.admin-main { max-width: 1240px; margin: 0 auto; padding: 20px 28px 60px; }
.admin-warning { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #f0e0b8; background: #fdf8ec; border-radius: 12px; color: #7a6420; font-size: 12px; line-height: 1.65; }
.admin-content .admin-warning { margin-top: 18px; }

/* ===== 登录与注册 ===== */
.auth-error { margin: 2px 0 0; padding: 9px 11px; border: 1px solid #f2cccc; background: #fdf3f3; border-radius: 9px; color: #bb3b3f; font-size: 12px; line-height: 1.5; }
.auth-tab { cursor: pointer; }
.auth-tab.active { cursor: default; }
#auth-submit:disabled { opacity: .7; cursor: progress; }
.auth-legal { color: #98a3b3; font-size: 11px; }

/* ===== 课堂字体大小 ===== */
.classroom-page { --class-scale: 1; }
.classroom-page .sentence-copy b { font-size: calc(20px * var(--class-scale)); }
.classroom-page .sentence-copy em { font-size: calc(12px * var(--class-scale)); }
.classroom-page .class-title h1 { font-size: calc(37px * var(--class-scale)); }
.classroom-page.class-scale-large { --class-scale: 1.2; }
.classroom-page.class-scale-xlarge { --class-scale: 1.4; }
.classroom-page.class-scale-huge { --class-scale: 1.6; }
.font-control { position: relative; }
.font-button .font-glyph { font-weight: 800; font-size: 15px; line-height: 1; }
.font-menu { position: absolute; top: 42px; right: 0; z-index: 45; min-width: 132px; padding: 6px; display: grid; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 16px 34px rgba(15,25,45,.18); }
.font-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; background: transparent; color: var(--ink); padding: 7px 12px; border-radius: 7px; font-size: 12px; text-align: left; cursor: pointer; }
.font-menu button small { color: var(--muted); font-size: 10px; }
.font-menu button.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.font-menu button.active small { color: var(--blue); }

/* ===== 管理页无权限提示 ===== */
.admin-lock { max-width: 520px; margin: 60px auto; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-align: center; }
.admin-lock h1 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 26px; }
.admin-lock p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.admin-lock .primary-btn { display: inline-flex; text-decoration: none; }
body.admin-locked .admin-topbar-actions { display: none; }

/* ===== 管理后台独立登录 ===== */
.admin-login { min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 40px 20px; }
.admin-login-card { width: min(420px, 100%); display: grid; gap: 12px; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); text-align: center; }
.admin-login-card .brand-mark { margin: 0 auto; }
.admin-login-card h1 { margin: 8px 0 0; font-family: Georgia, serif; font-size: 24px; }
.admin-login-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.admin-login-card label { display: grid; gap: 6px; text-align: left; color: #4b596e; font-size: 11px; font-weight: 700; }
.admin-login-card input { border: 1px solid var(--line-dark); border-radius: 10px; padding: 10px 12px; font-size: 13px; outline: 0; }
.admin-login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49,95,232,.08); }
.admin-login-card .text-link { justify-self: center; }
body.admin-guest .admin-main, body.admin-guest .admin-topbar-actions { display: none; }
body.admin-standalone:not(.admin-guest) .admin-login { display: none; }

/* ===== 材料库空状态 ===== */
.library-empty { grid-column: 1 / -1; padding: 48px 30px; background: #fff; border: 1px dashed var(--line-dark); border-radius: 16px; text-align: center; }
.library-empty h3 { margin: 10px 0 8px; font-family: Georgia, serif; font-size: 22px; }
.library-empty p { margin: 0 auto 20px; max-width: 540px; color: var(--muted); font-size: 12px; line-height: 1.85; }
