:root {
  --color-paper: #fdfcf8;
  --color-atmosphere: #eaf4ff;
  --color-surface: #fffdfb;
  --color-surface-hover: #f3f8fd;
  --color-structure: #2d7fb8;
  --color-structure-deep: #244f6b;
  --color-action: #ff7f6a;
  --color-action-deep: #c8544a;
  --color-highlight: #e8cf72;
  --color-text: #243843;
  --color-muted: #4c6270;
  --color-line: #d9e7f2;
  --color-error-bg: #fff1ef;
  --color-error: #a6433e;
  --shadow-soft: 0 8px 24px rgba(45, 127, 184, .08);
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--color-text);
  background: var(--color-paper);
  scrollbar-gutter: stable;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--color-paper); }
body.modal-open { overscroll-behavior: none; }
button, a { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(255, 127, 106, .65); outline-offset: 3px; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
body.study-mode .app-shell { display: block; }
body.study-mode .sidebar { display: none; }
body.study-mode .main-content { width: 100%; max-width: none; padding: 32px clamp(22px, 5vw, 80px) 64px; }
.sidebar { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: var(--space-7); height: 100vh; min-height: 0; overflow-y: auto; padding: 28px 18px; background: var(--color-atmosphere); border-right: 1px solid var(--color-line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--color-structure-deep); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: white; background: var(--color-structure); border-radius: 10px 10px 10px 3px; font-family: Georgia, serif; font-size: 22px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: var(--color-muted); font-size: 11px; }
.nav-list { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; color: var(--color-structure-deep); border-radius: var(--radius-md); text-decoration: none; transition: background-color .18s ease, transform .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.65); transform: translateX(2px); }
.nav-item.is-active { color: var(--color-structure-deep); background: var(--color-surface); box-shadow: var(--shadow-soft); font-weight: 700; }
.nav-item.is-active::before { width: 3px; height: 20px; margin-left: -13px; background: var(--color-action); border-radius: 0 3px 3px 0; content: ""; }
.nav-item.is-disabled { color: #78909d; cursor: not-allowed; opacity: .7; }
.nav-item small { margin-left: auto; font-size: 10px; color: var(--color-muted); }
.sidebar-footer { display: grid; gap: 8px; margin-top: auto; }
.sidebar-note { padding: 16px; background: rgba(255,255,255,.56); border: 1px solid rgba(217,231,242,.9); border-radius: var(--radius-md); }
.note-pin { color: var(--color-highlight); }
.sidebar-note p { margin: 8px 0 0; color: var(--color-muted); font-family: Georgia, "Microsoft YaHei", serif; font-size: 12px; line-height: 1.7; }
.sidebar-settings { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; color: var(--color-muted); background: transparent; border: 0; border-radius: 8px; font-size: 12px; text-align: left; }
.sidebar-settings:hover, .sidebar-settings.is-active { color: var(--color-structure-deep); background: rgba(255,255,255,.56); }

.main-content { width: min(1120px, 100%); margin: 0 auto; padding: 56px clamp(24px, 5vw, 72px) 72px; }
.page-header, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5); }
.eyebrow { margin: 0 0 9px; color: var(--color-structure); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 620px; margin-bottom: 12px; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: clamp(32px, 4vw, 52px); font-weight: 500; line-height: 1.15; }
h1 em { color: var(--color-action-deep); font-style: normal; }
.lede { max-width: 580px; margin-bottom: 0; color: var(--color-muted); font-size: 15px; line-height: 1.8; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: var(--radius-md); font-weight: 700; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button#export-wiki:disabled { cursor: default; }
.button-primary { color: #fff; background: var(--color-action); box-shadow: 0 7px 14px rgba(255,127,106,.2); }
.button-primary:hover { background: var(--color-action-deep); }
.button-secondary { color: var(--color-structure-deep); background: var(--color-surface); border-color: var(--color-line); }
.button-secondary:hover { background: var(--color-surface-hover); }
#study-view a.button.button-secondary, #study-view a.button.button-secondary:hover, #study-view a.button.button-secondary:focus-visible { text-decoration: none; }
.button-small { min-height: 32px; padding: 0 11px; font-size: 12px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 48px 0 58px; }
.metric-card { display: flex; align-items: center; gap: 14px; padding: 19px; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }
.metric-icon.blue { color: var(--color-structure); background: var(--color-atmosphere); }
.metric-icon.gold { color: #8a6f1d; background: #fff9df; }
.metric-icon.coral { color: var(--color-action-deep); background: #fff0ed; }
.metric-label { display: block; margin-bottom: 5px; color: var(--color-muted); font-size: 12px; }
.metric-card strong { color: var(--color-structure-deep); font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.section-heading { align-items: center; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 0; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: 28px; font-weight: 500; }
.section-caption { color: var(--color-muted); font-size: 12px; }
.course-list { display: grid; gap: 16px; }
.course-directory { position: relative; overflow: hidden; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); interpolate-size: allow-keywords; }
.course-directory::details-content, .chapter-group > details::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size .2s ease, content-visibility .2s allow-discrete, opacity .16s ease; }
.course-directory[open]::details-content, .chapter-group > details[open]::details-content { block-size: auto; opacity: 1; }
.course-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 44px 20px 22px; cursor: pointer; list-style: none; }
.course-summary::-webkit-details-marker { display: none; }
.course-summary:hover { background: var(--color-surface-hover); }
.course-summary-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.course-summary-actions { display: flex; align-items: center; }
.course-remove { position: absolute; top: 10px; right: 12px; z-index: 1; width: 18px; height: 18px; padding: 0; color: #91a2ad; background: none; border: 0; cursor: pointer; font-size: 15px; font-weight: 400; line-height: 18px; opacity: .68; }
.course-remove:hover { color: #536d7d; opacity: 1; }
.course-remove:focus-visible { color: #536d7d; outline: 1px dashed var(--color-structure); outline-offset: 2px; opacity: 1; }
.folder-icon { display: grid; place-items: center; width: 34px; height: 30px; color: #927a25; background: #fff8d9; border-radius: 8px; }
.course-title { overflow: hidden; color: var(--color-structure-deep); font-size: 16px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.course-meta { display: block; margin-top: 7px; color: var(--color-muted); font-size: 12px; }
.course-progress { display: flex; align-items: center; gap: 11px; min-width: 150px; }
.progress-track { width: 100px; height: 6px; overflow: hidden; background: var(--color-atmosphere); border-radius: 99px; }
.progress-value { display: block; height: 100%; background: var(--color-highlight); border-radius: inherit; transition: width .24s ease; }
.course-progress span { color: var(--color-muted); font-size: 11px; }
.course-directory-body { opacity: 0; transform: translateY(-4px); transition: opacity .16s ease, transform .2s ease; }
.course-directory[open] > .course-directory-body { opacity: 1; transform: translateY(0); }
.lesson-list { display: grid; border-top: 1px solid var(--color-line); }
.lesson-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 16px 56px 16px 70px; border-bottom: 1px solid #edf3f7; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-info { min-width: 0; }
.lesson-title { overflow: hidden; margin: 0 0 5px; color: var(--color-text); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.lesson-title-link { max-width: 100%; padding: 0; overflow: hidden; color: inherit; background: transparent; border: 0; cursor: pointer; font: inherit; font-weight: inherit; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.lesson-title-link:hover, .lesson-title-link:focus-visible { color: var(--color-action-deep); text-decoration: underline; text-decoration-color: rgba(55,114,145,.35); text-underline-offset: 3px; outline: none; }
.lesson-meta { display: flex; align-items: center; gap: 9px; color: var(--color-muted); font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; background: var(--color-highlight); border-radius: 99px; }
.status-dot.ready { background: var(--color-structure); }
.status-dot.completed { background: #3f756a; }
.status-dot.error { background: var(--color-error); }
.lesson-actions { display: flex; align-items: center; gap: 9px; }
.lesson-regenerate { position: absolute; top: 8px; right: 14px; width: 28px; height: 28px; padding: 0; color: var(--color-muted); background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer; font-size: 17px; line-height: 1; }
.lesson-regenerate:hover:not(:disabled), .lesson-regenerate:focus-visible { color: var(--color-action-deep); background: #f3f8f8; border-color: var(--color-line); }
.lesson-regenerate:disabled { color: #c2cdd1; cursor: not-allowed; }
.lesson-regenerate-dialog { width: min(460px, calc(100% - 28px)); padding: 0; color: var(--color-text); background: #fffefb; border: 1px solid var(--color-line); border-radius: 16px; box-shadow: 0 24px 70px rgba(23,55,72,.22); }
.lesson-regenerate-card { display: grid; gap: 12px; padding: 24px; }
.lesson-regenerate-card h2, .lesson-regenerate-card p { margin: 0; }
.lesson-regenerate-name { color: var(--color-structure-deep); font-weight: 700; }
.lesson-regenerate-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }

/* Chapter rhythm: a light structural layer over the existing lesson list. */
.chapter-group { position: relative; border-top: 1px solid #dcebf2; }
.chapter-group:first-child { border-top: 0; }
.chapter-group.is-current::before { position: absolute; top: 15px; left: 0; width: 3px; height: 24px; content: ""; background: var(--color-action); border-radius: 0 3px 3px 0; }
.chapter-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 22px; cursor: pointer; list-style: none; }
.chapter-summary::-webkit-details-marker { display: none; }
.chapter-summary:hover { background: #f8fbfd; }
.chapter-summary-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chapter-index { color: var(--color-structure); font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.chapter-title { display: block; color: var(--color-structure-deep); font-size: 14px; font-weight: 750; }
.chapter-meta { display: block; margin-top: 4px; color: var(--color-muted); font-size: 11px; }
.chapter-progress { color: var(--color-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chapter-summary-actions { display: flex; align-items: center; gap: 11px; }
.chapter-material-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--color-structure-deep); background: #fff; border: 1px solid var(--color-line); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 8px rgba(36,79,107,.08); }
.chapter-material-button:hover:not(:disabled), .chapter-material-button:focus-visible { color: var(--color-action-deep); background: #fff9df; border-color: #dfca72; outline: none; }
.chapter-material-button:disabled { cursor: wait; opacity: .52; }
.chapter-play-shape { display: block; width: 0; height: 0; margin-left: 2px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; }
.chapter-material-button.is-ready .chapter-play-shape { border-top-width: 6px; border-bottom-width: 6px; }
.chapter-lessons { overflow: hidden; border-top: 1px solid transparent; opacity: 0; transform: translateY(-3px); transition: border-color .2s ease, opacity .16s ease, transform .2s ease; }
.chapter-group > details[open] > .chapter-lessons { border-top-color: #edf4f7; opacity: 1; transform: translateY(0); }
.chapter-lessons .lesson-row { padding-left: 54px; }
.chapter-exercise-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 13px 22px 13px 54px; color: var(--color-structure); background: #fbfcf8; border: 0; border-top: 1px solid #edf3e9; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.chapter-exercise-row:hover:not(:disabled) { background: #f4f9ed; }
.chapter-exercise-row:disabled { color: #a6b3b8; cursor: not-allowed; }
.chapter-exercise-status { color: var(--color-muted); font-size: 11px; text-align: right; }
.chapter-exercise-row span:first-child { color: var(--color-highlight); font-size: 13px; }
.study-chapter-context { margin: 0 0 5px; color: var(--color-action-deep); font-size: 12px; }
.exercise-heading { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.exercise-heading h2 { margin: 0 0 7px; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: 22px; font-weight: 500; }
.exercise-heading p { margin: 0; color: var(--color-muted); font-size: 12px; }
.exercise-form { display: grid; gap: 18px; }
.exercise-question { display: grid; gap: 8px; color: var(--color-text); font-size: 14px; line-height: 1.6; }
.exercise-question strong { color: var(--color-structure); }
.exercise-question textarea { width: 100%; min-height: 86px; padding: 11px 12px; color: var(--color-text); background: #fbfdfe; border: 1px solid var(--color-line); border-radius: 8px; resize: vertical; font: inherit; font-size: 13px; line-height: 1.6; }
.exercise-question textarea:focus { outline: 2px solid rgba(76, 143, 176, .22); border-color: var(--color-structure); }
.exercise-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
#exercise-save-state { margin-right: auto; color: var(--color-muted); font-size: 11px; }
.exercise-feedback { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--color-line); }
.exercise-feedback h3 { margin: 0 0 12px; color: var(--color-structure-deep); font-size: 16px; }
.exercise-feedback-item { padding: 12px 0; border-top: 1px solid #edf3f7; color: var(--color-text); font-size: 13px; line-height: 1.6; }
.exercise-feedback-item p { margin: 5px 0 0; color: var(--color-muted); }
.exercise-generation-state { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0 4px; padding: 18px 16px; color: var(--color-text); background: #f8fbfd; border-left: 3px solid var(--color-structure); border-radius: 0 9px 9px 0; }
.exercise-generation-state.is-error { background: #fffaf7; border-left-color: var(--color-action); }
.exercise-generation-state strong { display: block; color: var(--color-structure-deep); font-size: 15px; font-weight: 700; }
.exercise-generation-state p { margin: 6px 0 12px; color: var(--color-muted); font-size: 12px; line-height: 1.6; }
.exercise-generation-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: var(--color-structure); border: 1px solid currentColor; border-radius: 50%; font-weight: 700; line-height: 1; }
.exercise-generation-state.is-error .exercise-generation-icon { color: var(--color-action-deep); }
.practice-competencies { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -7px 0 22px; padding: 11px 13px; background: var(--color-atmosphere); border: 1px solid #dcebf2; border-radius: 9px; }
.practice-label { color: var(--color-structure); font-size: 11px; font-weight: 700; }
.practice-competency { padding: 3px 8px; color: var(--color-structure-deep); background: #fffdf6; border: 1px solid #eadb9a; border-radius: 99px; font-size: 11px; }
.practice-task { padding: 18px 0 20px; border-top: 1px solid #e6eff4; }
.practice-task:first-child { border-top: 0; }
.practice-task-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.practice-mode { display: inline-flex; align-items: center; padding: 3px 8px; color: var(--color-action-deep); background: #fff6f1; border: 1px solid #f3d5cb; border-radius: 99px; font-size: 11px; font-weight: 700; }
.practice-source { display: inline-flex; align-items: center; margin-left: 6px; padding: 3px 8px; color: #7a6825; background: #fffdf6; border: 1px solid #eadb9a; border-radius: 99px; font-size: 10px; }
.practice-task-index { color: var(--color-muted); font-size: 11px; }
.practice-task h3 { margin: 0 0 10px; color: var(--color-structure-deep); font-size: 16px; font-weight: 700; }
.practice-scenario { margin: 10px 0 12px; padding: 12px 14px; background: #f8fbfd; border-left: 3px solid var(--color-structure); border-radius: 0 8px 8px 0; }
.practice-scenario p { margin: 5px 0 0; color: var(--color-text); font-size: 13px; line-height: 1.7; white-space: pre-line; }
.practice-scenario-overview { margin-top: -8px; }
.practice-prompt { margin: 0 0 12px; color: var(--color-text); font-size: 14px; line-height: 1.7; }
.practice-guidance { margin: 0 0 13px; padding: 9px 12px 9px 28px; color: var(--color-muted); background: #fffdf8; border: 1px solid #f1e8c5; border-radius: 8px; font-size: 12px; line-height: 1.7; }
.practice-answer { display: grid; gap: 7px; color: var(--color-structure); font-size: 12px; font-weight: 700; }
.practice-answer textarea { width: 100%; min-height: 110px; padding: 11px 12px; color: var(--color-text); background: #fbfdfe; border: 1px solid var(--color-line); border-radius: 8px; resize: vertical; font: inherit; font-size: 13px; font-weight: 400; line-height: 1.7; }
.practice-answer textarea:focus { outline: 2px solid rgba(76, 143, 176, .22); border-color: var(--color-structure); }
.exercise-feedback { background: #fbfdfe; border-radius: 10px; padding-inline: 14px; }
.exercise-feedback-item b { color: var(--color-structure); font-weight: 700; }
.practice-next-step { margin: 14px 0 0; padding: 10px 12px; color: var(--color-text); background: var(--color-atmosphere); border-radius: 8px; font-size: 12px; line-height: 1.7; }
.text-button { padding: 0; color: var(--color-structure); background: transparent; border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.text-button:hover { color: var(--color-action-deep); }
.error-message { max-width: 250px; padding: 7px 9px; color: var(--color-error); background: var(--color-error-bg); border-radius: var(--radius-sm); font-size: 11px; }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 30px; color: var(--color-muted); background: var(--color-surface); border: 1px dashed var(--color-line); border-radius: var(--radius-lg); text-align: center; }
.empty-state p { margin: 10px 0 0; font-size: 13px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--color-line); border-top-color: var(--color-structure); border-radius: 99px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.preview-dialog { width: min(700px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: 0 18px 60px rgba(36,79,107,.22); overflow: hidden; }
.preview-dialog[open] { display: flex; flex-direction: column; }
.preview-dialog::backdrop { background: rgba(36,79,107,.24); backdrop-filter: blur(2px); }
.practice-dialog { width: min(920px, calc(100% - 32px)); height: min(820px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: 0 18px 60px rgba(36,79,107,.22); overflow: hidden; }
.practice-dialog::backdrop { background: rgba(36,79,107,.24); backdrop-filter: blur(2px); }
.practice-modal { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.practice-modal-header p:last-child { margin: 7px 0 0; color: var(--color-muted); font-size: 12px; }
.practice-modal-body { min-height: 0; padding: 26px 28px 32px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 28px 18px; border-bottom: 1px solid var(--color-line); }
.dialog-header h2 { margin: 0; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: 25px; font-weight: 500; }
.preview-subtitle { max-width: min(440px, 70vw); margin: 7px 0 0; color: var(--color-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; color: var(--color-muted); background: transparent; border: 1px solid var(--color-line); border-radius: 50%; font-size: 22px; line-height: 1; }
.icon-button:hover { color: var(--color-action-deep); background: var(--color-error-bg); }
.preview-body { display: grid; flex: 1 1 auto; gap: 18px; min-height: 0; padding: 26px 28px 30px; overflow-y: auto; overscroll-behavior: contain; }
.note-diagnostics { display: inline-flex; align-items: center; margin: 2px 0 12px; padding: 4px 8px; color: var(--color-muted); background: transparent; border: 1px solid var(--color-line); border-radius: 6px; cursor: pointer; font: inherit; font-size: 11px; }
.note-diagnostics:hover, .note-diagnostics:focus-visible { color: var(--color-structure-deep); background: var(--color-surface-hover); outline: none; }
.diagnostics-loading, .diagnostics-error { display: grid; justify-items: center; gap: 10px; padding: 44px 18px; color: var(--color-muted); text-align: center; }
.diagnostics-loading p, .diagnostics-error p { margin: 0; font-size: 13px; }
.diagnostics-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; padding: 0 0 16px; color: var(--color-muted); border-bottom: 1px solid var(--color-line); font-size: 12px; }
.diagnostics-meta span { white-space: nowrap; }
.diagnostics-meta .diagnostics-status { color: var(--color-structure-deep); font-weight: 700; }
.diagnostics-content { padding: 18px 0 4px; }
.diagnostics-section { padding: 0 0 16px; border-bottom: 1px solid #edf3f7; }
.diagnostics-section + .diagnostics-section { padding-top: 16px; }
.diagnostics-section h3 { margin: 0 0 8px; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: 17px; font-weight: 500; }
.diagnostics-technical { padding: 12px 0; border-bottom: 1px solid #edf3f7; }
.diagnostics-technical summary { color: var(--color-structure-deep); cursor: pointer; font-size: 13px; }
.diagnostics-technical p { margin: 8px 0 0; color: var(--color-muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.diagnostics-section p { margin: 6px 0; color: var(--color-muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.diagnostics-section code { padding: 1px 4px; color: var(--color-structure-deep); background: var(--color-atmosphere); border-radius: 3px; font-size: 11px; }
.diagnostics-raw { margin-top: 12px; color: var(--color-muted); font-size: 12px; }
.diagnostics-raw summary { cursor: pointer; }
.diagnostics-raw pre { max-height: 220px; margin: 10px 0 12px; padding: 12px; overflow: auto; color: var(--color-muted); background: var(--color-atmosphere); border: 1px solid var(--color-line); border-radius: 6px; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.diagnostics-raw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 520px) { .preview-dialog { width: calc(100% - 20px); max-height: calc(100% - 20px); } .dialog-header { padding: 20px 18px 15px; } .preview-body { padding: 20px 18px 24px; } .preview-subtitle { max-width: 64vw; } }
.preview-section { padding-left: 14px; border-left: 3px solid var(--color-highlight); }
.preview-section h3 { margin: 0 0 8px; color: var(--color-structure); font-size: 13px; }
.preview-section p, .preview-section li { color: var(--color-muted); font-size: 13px; line-height: 1.75; }
.preview-section p { margin: 0; }
.preview-section ul { margin: 0; padding-left: 18px; }
.remove-course-dialog { width: min(360px, calc(100% - 32px)); padding: 0; color: var(--color-text); background: transparent; border: 0; }
.remove-course-dialog::backdrop { background: rgba(36,79,107,.14); backdrop-filter: blur(1px); }
.remove-course-card { padding: 24px; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 14px; box-shadow: 0 18px 50px rgba(36,79,107,.16); }
.remove-course-kicker { margin: 0 0 8px; color: var(--color-muted); font-size: 11px; letter-spacing: .12em; }
.remove-course-card h2 { margin: 0; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: 21px; font-weight: 500; }
.remove-course-name { overflow: hidden; margin: 16px 0 5px; color: var(--color-text); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.remove-course-note { margin: 0; color: var(--color-muted); font-size: 12px; }
.remove-course-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.remove-course-actions button { min-width: 62px; padding: 8px 13px; border: 0; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; }
.remove-course-cancel { color: var(--color-muted); background: transparent; }
.remove-course-cancel:hover { color: var(--color-structure-deep); background: var(--color-surface-hover); }
.remove-course-confirm { color: #87483f; background: #fff1ed; }
.remove-course-confirm:hover { color: #75372f; background: #ffe8e2; }
.remove-course-confirm:disabled { cursor: wait; opacity: .55; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 4; }
.toast { max-width: 340px; padding: 12px 15px; color: #fff; background: var(--color-structure-deep); border-radius: var(--radius-md); box-shadow: var(--shadow-soft); font-size: 13px; }

.study-view { width: 100%; }
.main-content.is-study-mode { width: min(1280px, 100%); }
.study-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5); margin-bottom: 28px; }
.study-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.study-header h1 { max-width: 780px; margin-bottom: 8px; font-size: clamp(23px, 2.5vw, 32px); line-height: 1.25; }
.study-grid { --study-row-height: clamp(560px, calc(100vh - 170px), 680px); display: grid; grid-template-columns: minmax(320px, 1fr) minmax(460px, 1.45fr); grid-template-areas: "notes video" "mindmap mindmap"; gap: 18px; align-items: stretch; }
.study-panel { min-width: 0; overflow: hidden; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.study-left { grid-area: notes; display: flex; flex-direction: column; height: var(--study-row-height); overflow: hidden; }
.study-center { position: relative; grid-area: video; display: flex; flex-direction: column; justify-content: flex-start; min-height: var(--study-row-height); padding: 18px; overflow: visible; }
.study-tabs { position: relative; z-index: 1; flex: 0 0 auto; display: flex; gap: 5px; padding: 8px; border-bottom: 1px solid var(--color-line); background: var(--color-atmosphere); }
.study-tab { flex: 1; min-height: 34px; color: var(--color-muted); background: transparent; border: 0; border-radius: var(--radius-sm); font-size: 16.9px; font-weight: 700; }
.study-tab.is-active { color: var(--color-structure-deep); background: var(--color-surface); box-shadow: var(--shadow-soft); }
.study-capture-note { flex: 0 0 32px; align-self: center; width: 32px; height: 32px; padding: 0; color: var(--color-structure-deep); background: transparent; border: 0; border-radius: 50%; font-size: 20.8px; opacity: .38; transition: opacity .16s ease, background-color .16s ease; }
.study-capture-note:hover, .study-capture-note:focus-visible { background: rgba(255,255,255,.72); opacity: .9; }
.study-tab-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px; }
.study-note-item { position: relative; padding: 10px 8px; border-bottom: 1px solid #edf3f7; border-radius: 8px; transition: color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.study-note-actions { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; align-items: center; gap: 3px; margin: 0; visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(-2px); transition: visibility 0s linear .12s, opacity .12s ease, transform .12s ease; }
.study-note-item:hover > .study-note-actions, .study-note-item:focus-within > .study-note-actions, .study-note-subitem:hover > .study-note-actions, .study-note-subitem:focus-within > .study-note-actions { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }
.study-note-action { display: inline-grid; place-items: center; width: 25px; height: 25px; padding: 0; color: #263f4d; background: rgba(255,255,255,.88); border: 1px solid transparent; border-radius: 6px; font-size: 13px; line-height: 1; opacity: 1; transition: opacity .15s ease, color .15s ease, border-color .15s ease, background-color .15s ease; }
.study-note-action:hover, .study-note-action:focus-visible { color: var(--color-structure-deep); background: #fff; border-color: var(--color-line); opacity: 1; outline: none; }
.study-note-action.is-delete:hover, .study-note-action.is-delete:focus-visible { color: var(--color-error); border-color: rgba(173,67,57,.25); }
.study-note-item:last-child { border-bottom: 0; }
.study-note-item.is-user-note { margin: 5px 0; padding: 10px; background: #fffdf2; border: 1px solid #eee3b5; border-radius: var(--radius-md); }
.study-note-item.is-draft { border-style: dashed; }
.study-note { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 86px 7px 3px; color: var(--color-structure-deep); background: transparent; border: 0; text-align: left; font-size: 15.6px; font-weight: 700; }
.study-note-time, .transcript-segment span:first-child { flex: 0 0 auto; color: var(--color-action-deep); font-variant-numeric: tabular-nums; }
.study-note.is-active, .mindmap-node.is-active { color: var(--color-action-deep); }
.study-note-item.is-active { background: rgba(244,218,115,.06); box-shadow: inset 2px 0 0 rgba(215,184,74,.28); }
.study-note-item.is-active .study-note { color: #795d16; }
.study-note-item.is-active .study-note-time { padding: 2px 6px; color: #684f11; background: rgba(237,207,117,.45); border-radius: 5px; }
.study-note-item.is-active .study-note-reading { color: var(--color-structure-deep); }
.study-note-subitem.is-active { margin-inline: -7px; padding-inline: 7px; background: rgba(244,218,115,.16); border-radius: 7px; box-shadow: inset 2px 0 0 rgba(215,184,74,.7); }
.study-note-subitem.is-active .study-note-subpoint { color: #795d16; }
.study-event-flow { display: flex; flex-wrap: wrap; gap: 6px; margin: 3px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--color-line); }
.study-event-marker { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 7px; color: var(--color-muted); background: transparent; border: 0; border-radius: 6px; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.study-event-marker small { color: #8da0aa; font-size: 10px; font-variant-numeric: tabular-nums; }
.study-event-marker:hover, .study-event-marker:focus-visible { color: var(--color-structure-deep); background: #f3f8f8; outline: none; }
.study-event-marker.is-active { color: #795d16; background: rgba(244,218,115,.2); box-shadow: inset 2px 0 0 rgba(215,184,74,.7); }
.study-note-body { display: block; width: 100%; min-height: 65px; padding: 10px 12px 14px; color: var(--color-text); background: #fffefb; border: 1px solid var(--color-line); border-radius: var(--radius-sm); font-size: 16.9px; line-height: 1.8; }
.study-note-capture { margin: 2px 0 9px; overflow: hidden; background: #102b3b; border: 1px solid var(--color-line); border-radius: 8px; }
.study-note-capture img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.study-note-capture figcaption { padding: 6px 9px; color: var(--color-muted); background: #fffefb; font-size: 12px; }
.user-note-editor { min-height: 78px; resize: vertical; font-family: inherit; }
.user-note-editor:focus { border-color: #d8c76e; outline: 2px solid rgba(232,207,114,.22); }
.user-note-hint { display: block; padding: 6px 2px 0; color: var(--color-muted); font-size: 13px; }
.study-note-reading { background: transparent; border: 0; padding: 2px 8px 18px; }
.study-note-part + .study-note-part { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--color-line); }
.study-note-part-label { display: block; margin-bottom: 6px; color: var(--color-structure); font-size: 13px; font-weight: 800; letter-spacing: .09em; }
.study-note-part.is-understanding { color: #4d6574; }
.study-note-part p:last-child { margin-bottom: 0; }
.study-note-section { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--color-line); }
.study-note-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--color-structure-deep); font-size: 15.6px; font-weight: 800; }
.study-note-section-heading small { color: var(--color-muted); font-size: 13px; font-weight: 500; }
.study-note-subitem { position: relative; padding: 9px 0; border-top: 1px solid #edf3f7; }
.study-note-subitem > .study-note-actions { top: 6px; right: 0; }
.study-note-subitem:first-of-type { border-top: 0; }
.study-note-subpoint { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 0 86px 0 0; color: var(--color-structure-deep); background: transparent; border: 0; text-align: left; font-size: 15.6px; font-weight: 750; }
.study-note-subpoint small { flex: 0 0 auto; color: var(--color-action-deep); font-size: 13px; font-weight: 500; }
.study-note-subitem > p, .study-note-subitem-understanding p { margin: 6px 0 0; color: var(--color-text); font-size: 15.6px; line-height: 1.7; }
.study-note-subitem-understanding p { color: var(--color-muted); }
.study-note-reading p { margin: 0 0 9px; }
.study-note-reading h3, .study-note-reading h4, .study-note-reading h5 { margin: 12px 0 7px; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; }
.study-note-reading h3 { font-size: 22px; }
.study-note-reading h4 { font-size: 19.5px; }
.study-note-reading h5 { font-size: 16.9px; }
.study-note-bullet { padding-left: 15px; }
.study-note-bullet::before { content: "·"; float: left; margin-left: -12px; color: var(--color-action-deep); font-weight: 800; }
.study-note-reading code { padding: 1px 4px; color: var(--color-structure-deep); background: var(--color-atmosphere); border-radius: 4px; font-size: .92em; }
.note-editor-dialog { width: min(700px, calc(100% - 28px)); max-height: calc(100% - 36px); padding: 0; overflow: hidden; color: var(--color-text); background: #fffefb; border: 1px solid var(--color-line); border-radius: 18px; box-shadow: 0 24px 70px rgba(23,55,72,.22); }
.note-editor-dialog::backdrop { background: rgba(30,49,58,.34); backdrop-filter: blur(2px); }
.note-editor-card { display: grid; gap: 17px; max-height: calc(100vh - 40px); padding: 22px 24px 24px; overflow: auto; }
.note-editor-header { padding: 0 0 14px; border-bottom: 1px solid var(--color-line); }
.note-editor-original { padding: 13px 15px; color: var(--color-muted); background: #f7fafb; border: 1px solid var(--color-line); border-radius: 10px; font-size: 14px; line-height: 1.65; }
.note-editor-original strong { display: block; margin-bottom: 4px; color: var(--color-structure-deep); }
.note-editor-fields { display: grid; gap: 14px; }
.note-editor-card label { display: grid; gap: 7px; color: var(--color-structure-deep); font-size: 14px; font-weight: 700; }
.note-editor-card input, .note-editor-card textarea { width: 100%; color: var(--color-text); background: #fff; border: 1px solid var(--color-line); border-radius: 9px; font: inherit; font-weight: 400; line-height: 1.65; }
.note-editor-card input { height: 42px; padding: 0 12px; }
.note-editor-card textarea { padding: 10px 12px; resize: vertical; }
.note-editor-card input:focus, .note-editor-card textarea:focus { border-color: #d4bd57; outline: 3px solid rgba(226,199,87,.16); }
.note-editor-feedback { min-height: 20px; margin: -4px 0 0; color: var(--color-muted); font-size: 13px; }
.note-editor-feedback[data-state="error"] { color: var(--color-error); }
.note-editor-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.note-save-state { display: block; min-height: 15px; margin-top: 4px; color: var(--color-muted); font-size: 13px; text-align: right; }
.transcript-segment { display: grid; grid-template-columns: auto 1fr; gap: 9px; width: 100%; padding: 10px 7px; color: var(--color-text); background: transparent; border: 0; border-bottom: 1px solid #edf3f7; border-radius: 7px; text-align: left; font-size: 15.6px; line-height: 1.55; transition: color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.transcript-segment.is-active { color: var(--color-structure-deep); background: rgba(244,218,115,.23); box-shadow: inset 3px 0 0 rgba(215,184,74,.75), 0 0 0 1px rgba(221,199,112,.45); font-weight: 650; }
.transcript-segment.is-active span:first-child { padding: 2px 5px; color: #684f11; background: rgba(237,207,117,.45); border-radius: 5px; }
.study-status { min-height: 20px; margin-bottom: 8px; color: var(--color-muted); font-size: 11px; text-align: right; }
.study-status[data-state="saving"], .study-status[data-state="pending"] { color: #8a6f1d; }
.study-status[data-state="error"] { color: var(--color-error); }
.study-status[data-state="saved"] { color: var(--color-structure); }
.agent-run-state { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -2px 0 8px; color: var(--color-structure-deep); font-size: 12px; }
.agent-run-state small { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.agent-run-state a { color: var(--color-structure); }
.agent-proposal-diff { max-height: 220px; margin: 0; padding: 10px 12px; overflow: auto; color: var(--color-text); background: #f7fafb; border: 1px solid var(--color-line); border-radius: 7px; white-space: pre-wrap; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.agent-reply-label { display: grid; gap: 7px; color: var(--color-structure-deep); font-size: 13px; font-weight: 700; }
.agent-reply-label textarea { width: 100%; padding: 10px 12px; color: var(--color-text); background: #fff; border: 1px solid var(--color-line); border-radius: 8px; font: inherit; line-height: 1.6; resize: vertical; }
.archive-progress { height: 3px; margin: -3px 0 7px; overflow: hidden; border-radius: 999px; background: rgba(138, 111, 29, 0.12); }
.archive-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: #b99331; transition: width 220ms ease; }
.archive-review-dialog { width: min(760px, calc(100vw - 32px)); max-height: 85vh; padding: 0; color: var(--color-text); background: #fffdf8; border: 1px solid var(--color-line); border-radius: 16px; box-shadow: 0 18px 60px rgba(36,79,107,.22); }
.archive-review-dialog::backdrop { background: rgba(18,42,56,.42); }
.archive-review-card { display: grid; gap: 18px; padding: 22px; }
.archive-review-card header { display: flex; justify-content: space-between; align-items: start; }
.archive-review-card h2, .archive-review-item h3 { margin: 0; color: var(--color-structure-deep); }
.archive-review-list { display: grid; gap: 12px; overflow: auto; }
.archive-review-item { display: grid; gap: 12px; padding: 15px; background: #fff; border: 1px solid var(--color-line); border-radius: 11px; }
.archive-review-item p, .archive-review-item small { margin: 5px 0 0; color: var(--color-muted); font-size: 13px; }
.archive-review-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.archive-review-actions select { min-width: 190px; height: 34px; padding: 0 8px; color: var(--color-text); background: #fff; border: 1px solid var(--color-line); border-radius: 7px; }
.study-player-surface { position: relative; z-index: 1; display: flex; flex: 0 0 auto; flex-direction: column; width: 100%; min-height: auto; overflow: hidden; background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius-md); box-shadow: 0 5px 18px rgba(36,79,107,.1); }
.study-video { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: var(--study-video-aspect-ratio, 16 / 9); object-fit: contain; background: #173244; cursor: pointer; }
.screenshot-region-overlay { position: absolute; z-index: 5; overflow: hidden; background: rgba(10,31,43,.28); cursor: crosshair; touch-action: none; user-select: none; }
.screenshot-region-selection { position: absolute; z-index: 1; border: 2px solid #fff8d9; box-shadow: 0 0 0 9999px rgba(10,31,43,.48), 0 0 0 1px rgba(36,79,107,.6); pointer-events: none; }
.screenshot-region-actions { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 11px; color: var(--color-structure-deep); background: rgba(255,255,255,.94); border: 1px solid var(--color-line); border-radius: 9px; box-shadow: var(--shadow-soft); cursor: default; }
.screenshot-region-actions span { margin-right: 3px; font-size: 12px; font-weight: 700; }
.screenshot-region-actions button { min-height: 30px; padding: 0 10px; color: var(--color-structure-deep); background: #fff; border: 1px solid var(--color-line); border-radius: 7px; font: inherit; font-size: 12px; font-weight: 700; }
.screenshot-region-actions button[data-capture-save] { color: #fff; background: var(--color-action); border-color: var(--color-action); }
.screenshot-region-actions button:disabled { cursor: not-allowed; opacity: .5; }
.study-player-controls { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 7px 10px; color: var(--color-muted); background: #fff; border-top: 1px solid #cbdbe5; box-shadow: 0 -2px 8px rgba(36,79,107,.06); }
.study-player-controls button { flex: 0 0 auto; color: var(--color-structure-deep); background: transparent; border: 0; border-radius: 6px; }
.study-player-controls button:hover, .study-player-controls button:focus-visible { color: var(--color-action-deep); background: #fff; }
.study-player-icon { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; font-size: 14px; }
.study-player-play-shape { position: relative; display: block; width: 14px; height: 14px; }
.study-player-play-shape::before { content: ""; position: absolute; top: 1px; left: 3px; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; }
.study-player-icon.is-playing .study-player-play-shape::before, .study-player-icon.is-playing .study-player-play-shape::after { content: ""; position: absolute; top: 1px; width: 4px; height: 12px; background: currentColor; border: 0; border-radius: 1px; }
.study-player-icon.is-playing .study-player-play-shape::before { left: 2px; }
.study-player-icon.is-playing .study-player-play-shape::after { right: 2px; }
.study-player-text-button { min-width: 38px; height: 30px; padding: 0 6px; font-size: 11px; }
.study-player-progress, .study-player-volume { height: 20px; margin: 0; accent-color: var(--color-structure); cursor: pointer; }
.study-player-progress { flex: 1 1 auto; min-width: 90px; }
.study-player-volume { flex: 0 1 74px; min-width: 48px; max-width: 74px; }
.study-player-time { flex: 0 0 auto; min-width: 88px; color: var(--color-muted); font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.study-player-rate { flex: 0 0 auto; min-width: 31px; padding: 4px 6px; color: var(--color-structure-deep); background: var(--color-atmosphere); border-radius: 6px; font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.study-player-surface:fullscreen { width: 100vw; height: 100vh; padding: 16px; background: #102b3b; border: 0; border-radius: 0; }
.study-player-surface:fullscreen .study-video { flex: 1 1 auto; min-height: 0; max-height: none; object-fit: contain; background: #000; }
.study-player-surface:fullscreen .study-player-controls { flex: 0 0 auto; border-radius: 0 0 8px 8px; }
.study-status { flex-shrink: 0; }
.study-video-complete { position: absolute; top: 50%; left: 50%; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 12px 14px; color: var(--color-structure-deep); background: rgba(255,255,255,.94); border: 1px solid var(--color-line); border-radius: var(--radius-md); box-shadow: 0 12px 30px rgba(36,79,107,.2); transform: translate(-50%,-50%); }
.study-video-complete[hidden] { display: none; }
.study-right { grid-area: mindmap; max-height: none; padding: 20px; }
.study-mindmap-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.study-mindmap-heading .eyebrow { margin: 0 0 4px; font-size: 10px; }
.study-mindmap-heading h2 { margin: 0; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: 20px; font-weight: 500; }
.study-mindmap-heading > span { color: var(--color-muted); font-size: 10px; }
.mindmap-wrap { overflow: hidden; }
.mindmap-board { position: relative; height: clamp(460px, 62vh, 720px); overflow: hidden; background-color: #fbfdfd; background-image: radial-gradient(circle, rgba(103,135,148,.2) 1px, transparent 1px); background-size: 22px 22px; border: 1px solid var(--color-line); border-radius: 12px; cursor: grab; touch-action: none; user-select: none; }
.mindmap-board.is-dragging { cursor: grabbing; }
.mindmap-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.mindmap-connections { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.mindmap-connections path { fill: none; stroke: #a7bdc7; stroke-linecap: round; stroke-width: 1.6; }
.mindmap-board-node { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 188px; min-height: 48px; padding: 9px 11px; color: var(--color-structure-deep); background: rgba(255,255,255,.97); border: 1px solid #cfdee5; border-radius: 9px; cursor: pointer; box-shadow: 0 3px 12px rgba(36,79,107,.09); font: inherit; font-size: 12px; line-height: 1.35; text-align: left; }
.mindmap-board-node.depth-0 { color: #fff; background: var(--color-structure-deep); border-color: var(--color-structure-deep); font-weight: 800; }
.mindmap-board-node.depth-1 { background: #f0f7fa; border-color: #b9d0db; font-weight: 750; }
.mindmap-board-node.depth-2 { border-left: 4px solid #d8bd58; }
.mindmap-board-node:hover, .mindmap-board-node:focus-visible, .mindmap-board-node.is-active { background: #fff8d8; border-color: #dbc15d; outline: none; transform: translateY(-1px); box-shadow: 0 5px 15px rgba(36,79,107,.14); }
.mindmap-board-node.depth-0:hover, .mindmap-board-node.depth-0:focus-visible { color: #fff; background: var(--color-structure-deep); }
.mindmap-board-node small { flex: 0 0 auto; color: var(--color-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.mindmap-toolbar { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: flex; gap: 4px; padding: 5px; background: rgba(255,255,255,.92); border: 1px solid var(--color-line); border-radius: 9px; box-shadow: 0 4px 14px rgba(36,79,107,.12); }
.mindmap-toolbar button { min-width: 30px; height: 28px; padding: 0 8px; color: var(--color-structure-deep); background: transparent; border: 0; border-radius: 6px; cursor: pointer; font: inherit; font-size: 11px; }
.mindmap-toolbar button:hover, .mindmap-toolbar button:focus-visible { background: var(--color-atmosphere); outline: none; }
.mindmap-tree, .mindmap-tree ul { margin: 0; padding-left: 18px; list-style: none; }
.mindmap-tree { padding-left: 0; }
.mindmap-tree li { position: relative; margin: 4px 0; }
.mindmap-tree li::before { position: absolute; top: 17px; left: -11px; width: 8px; height: 1px; background: var(--color-line); content: ""; }
.mindmap-tree > li::before { display: none; }
.mindmap-tree .mindmap-node, .mindmap-label { display: flex; align-items: center; justify-content: space-between; gap: 7px; width: 100%; padding: 8px 9px; color: var(--color-structure-deep); background: #fbfdff; border: 1px solid transparent; border-radius: var(--radius-sm); text-align: left; font-size: 12px; }
.mindmap-tree .mindmap-node:hover, .mindmap-tree .mindmap-node.is-active { background: #fff9df; border-color: #eadb9a; }
.mindmap-tree .mindmap-node small { flex: 0 0 auto; color: var(--color-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.study-empty { margin: 0; padding: 20px 8px; color: var(--color-muted); font-size: 12px; text-align: center; }
.study-tab-panel .study-empty { font-size: 15.6px; }

.settings-dialog { width: min(1040px, calc(100% - 32px)); height: min(760px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: 0 24px 80px rgba(36,79,107,.24); }
.settings-dialog::backdrop { background: rgba(24,52,70,.3); backdrop-filter: blur(3px); }
.settings-dialog .eyebrow { font-size: 14.3px; }
.settings-dialog .icon-button { font-size: 28.6px; }
.settings-dialog .button, .settings-dialog .button-small { font-size: 15.6px; }
.settings-modal { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.settings-modal-header { flex: 0 0 auto; padding: 22px 24px 18px; }
.settings-modal-header h2 { margin: 0; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: 32.5px; font-weight: 500; }
.settings-modal-header > div > p:last-child { margin: 7px 0 0; color: var(--color-muted); font-size: 15.6px; }
.settings-modal-form { display: grid; grid-template-rows: minmax(0, 1fr) auto; flex: 1; min-height: 0; }
.settings-modal-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 0; }
.settings-category-nav { display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; background: #f7fafc; border-right: 1px solid var(--color-line); }
.settings-category-button { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 8px; width: 100%; padding: 11px 12px; color: var(--color-muted); background: transparent; border: 1px solid transparent; border-radius: 10px; text-align: left; }
.settings-category-button > span { color: #a18a36; font-family: Georgia, serif; font-size: 14.3px; }
.settings-category-button strong { color: inherit; font-size: 16.9px; }
.settings-category-button small { overflow: hidden; color: var(--color-muted); font-size: 13px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.settings-category-button:hover { color: var(--color-structure-deep); background: rgba(255,255,255,.76); }
.settings-category-button.is-active { color: var(--color-structure-deep); background: var(--color-surface); border-color: var(--color-line); box-shadow: var(--shadow-soft); }
.settings-category-button small.is-ready { color: #3f756a; }
.settings-content { min-width: 0; overflow: auto; padding: 26px 28px 34px; }
.settings-panel.settings-card { min-height: 0; align-self: start; padding: 0; background: transparent; }
.settings-panel.settings-card.is-compact { width: min(650px, 100%); gap: 14px; padding: 20px; background: #fbfdff; border: 1px solid var(--color-line); border-radius: 12px; }
.settings-panel.is-compact .settings-card-heading { margin-bottom: 0; }
.settings-panel.is-compact .settings-secret-note { margin: -3px 0 0; }
.settings-card { display: grid; gap: 17px; padding: 22px; background: var(--color-surface); }
.settings-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.settings-step { margin: 0 0 4px; color: #927a25; font-family: Georgia, serif; font-size: 14.3px; }
.settings-card h2 { margin: 0; color: var(--color-structure-deep); font-family: Georgia, "Microsoft YaHei", serif; font-size: 24.7px; font-weight: 600; }
.settings-status { flex: 0 0 auto; padding: 4px 7px; color: var(--color-muted); background: var(--color-atmosphere); border-radius: 6px; font-size: 13px; }
.settings-status.is-ready { color: #3f756a; background: #edf8f3; }
.settings-status.is-error { color: var(--color-error); background: #fff4f1; }
.settings-card label { display: grid; gap: 7px; color: var(--color-structure-deep); font-size: 15.6px; font-weight: 650; }
.settings-card label small { color: var(--color-muted); font-size: 13px; font-weight: 400; }
.settings-card input, .settings-card select { width: 100%; min-width: 0; padding: 10px 11px; color: var(--color-text); background: #fff; border: 1px solid var(--color-line); border-radius: 8px; font: inherit; font-size: 15.6px; }
.settings-card input:focus, .settings-card select:focus { border-color: var(--color-structure); outline: 2px solid rgba(45,127,184,.12); }
.settings-path-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.settings-path-row .button { min-height: 38px; padding: 0 12px; font-size: 14.3px; white-space: nowrap; }
.settings-secret-note { margin: -10px 0 0; color: var(--color-muted); font-size: 13px; line-height: 1.5; }
.settings-card .settings-clear-key { display: flex; align-items: center; gap: 8px; color: var(--color-muted); font-size: 14.3px; font-weight: 400; }
.settings-switch { display: flex !important; grid-template-columns: auto 1fr; grid-auto-flow: column; align-items: flex-start; gap: 11px !important; padding: 12px; background: #fff; border: 1px solid var(--color-line); border-radius: 9px; }
.settings-switch input { flex: 0 0 auto; width: 16px; margin-top: 2px; accent-color: var(--color-structure); }
.settings-switch span { display: grid; gap: 5px; }
.settings-switch small { color: var(--color-muted); font-size: 14.3px; font-weight: 400; line-height: 1.5; }
.chapter-model-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; color: var(--color-muted); background: var(--color-atmosphere); border-radius: 8px; font-size: 14.3px; }
.chapter-model-summary strong { overflow: hidden; max-width: 62%; color: var(--color-structure-deep); font-size: 14.3px; text-overflow: ellipsis; white-space: nowrap; }
.settings-go-llm { justify-self: start; }
.settings-clear-key input { width: auto; }
.learning-system-choice { display: flex; gap: 18px; margin: 0; padding: 12px; border: 1px solid var(--color-line); border-radius: 9px; background: #fff; }
.learning-system-choice legend { padding: 0 4px; color: var(--color-structure-deep); font-size: 15.6px; font-weight: 650; }
.learning-system-choice label { display: flex; align-items: center; gap: 7px; color: var(--color-text); font-size: 15.6px; font-weight: 500; }
.learning-system-choice input { width: auto; accent-color: var(--color-structure); }
.knowledge-agent-model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.knowledge-agent-editor { display: grid; gap: 7px; }
.knowledge-agent-editor > label { display: block; }
.knowledge-agent-editor textarea { width: 100%; min-height: 160px; resize: vertical; padding: 11px; color: var(--color-text); background: #fff; border: 1px solid var(--color-line); border-radius: 8px; font: 14.3px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.knowledge-agent-editor textarea:focus { border-color: var(--color-structure); outline: 2px solid rgba(45,127,184,.12); }
.knowledge-agent-editor textarea:disabled { background: #f4f7f9; }
.knowledge-agent-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.knowledge-agent-editor-status { min-height: 20px; color: var(--color-muted); font-size: 13px; }
.knowledge-agent-editor-status.is-error { color: var(--color-error); }
.shortcut-settings-intro { margin: -2px 0 2px; color: var(--color-muted); font-size: 14.3px; line-height: 1.6; }
.shortcut-settings-list { display: grid; border-top: 1px solid var(--color-line); }
.shortcut-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; padding: 10px 0; border-bottom: 1px solid var(--color-line); }
.shortcut-setting-row > span { display: grid; gap: 4px; min-width: 0; }
.shortcut-setting-row strong { color: var(--color-structure-deep); font-size: 15.6px; }
.shortcut-setting-row small { color: var(--color-muted); font-size: 13px; font-weight: 400; }
.shortcut-key-list { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.shortcut-key-button { min-width: 54px; min-height: 32px; padding: 5px 10px; color: var(--color-structure-deep); background: #fff; border: 1px solid #cfdce4; border-bottom-width: 2px; border-radius: 7px; box-shadow: 0 1px 0 rgba(36,79,107,.08); font: inherit; font-size: 14.3px; cursor: pointer; }
.shortcut-key-button:hover, .shortcut-key-button:focus-visible { border-color: var(--color-structure); outline: 2px solid rgba(45,127,184,.12); }
.shortcut-key-button.is-recording { min-width: 78px; color: var(--color-action-deep); background: #fff9df; border-color: #d9c670; }
.shortcut-settings-error { min-height: 17px; margin: 0; color: var(--color-error); font-size: 14.3px; }
.llm-add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.llm-preset-menu { display: grid; gap: 6px; padding: 10px; background: #fbfdff; border: 1px solid var(--color-line); border-radius: 10px; }
.llm-preset { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; color: var(--color-structure-deep); background: #fff; border: 1px solid var(--color-line); border-radius: 8px; font-size: 15.6px; text-align: left; }
.llm-preset:hover { background: var(--color-surface-hover); }
.llm-preset small { color: var(--color-muted); font-size: 13px; }
.llm-provider-list { display: grid; gap: 12px; }
.llm-provider { padding: 14px 16px; background: #fbfdff; border: 1px solid var(--color-line); border-radius: 12px; }
.llm-provider-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.llm-provider-toggle { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 0; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; }
.llm-provider-toggle:focus-visible { outline: 2px solid rgba(45,127,184,.2); outline-offset: 4px; border-radius: 4px; }
.llm-provider-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.llm-provider-identity strong { color: var(--color-structure-deep); font-size: 18.2px; }
.llm-provider-chevron { flex: 0 0 auto; width: 14px; height: 14px; color: var(--color-muted); background: currentColor; clip-path: polygon(25.3% 7.1%, 25.3% 92.9%, 99.5% 50%); transform: rotate(0deg); transform-origin: 50% 50%; transition: transform .16s ease; }
.llm-provider-toggle[aria-expanded="true"] .llm-provider-chevron { transform: rotate(90deg); }
.llm-provider-body { display: grid; grid-template-rows: 1fr; margin-top: 14px; padding-top: 15px; border-top: 1px solid var(--color-line); opacity: 1; transform: translateY(0); transition: grid-template-rows .2s ease, margin-top .2s ease, padding-top .2s ease, border-color .2s ease, opacity .16s ease, transform .2s ease; }
.llm-provider-body[data-expanded="false"] { grid-template-rows: 0fr; margin-top: 0; padding-top: 0; border-top-color: transparent; opacity: 0; transform: translateY(-4px); }
.llm-provider-body-inner { display: grid; gap: 15px; min-height: 0; overflow: hidden; }
.llm-tag { padding: 1px 7px; color: var(--color-muted); background: var(--color-atmosphere); border: 1px solid var(--color-line); border-radius: 4px; font-size: 14.3px; }
.credential-dot { width: 8px; height: 8px; border-radius: 50%; }
.credential-dot.is-set { background: #3f756a; }
.credential-dot.is-local { background: var(--color-highlight); }
.credential-dot.is-missing { background: var(--color-error); }
.llm-provider-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.llm-active-badge { padding: 3px 9px; color: #3f756a; background: #edf8f3; border: 1px solid #cfe8de; border-radius: 99px; font-size: 14.3px; }
.llm-models { display: grid; gap: 11px; padding-top: 15px; border-top: 1px solid var(--color-line); }
.llm-models-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.llm-models-head > span { color: var(--color-structure-deep); font-size: 15.6px; font-weight: 650; }
.llm-models-note { margin: -4px 0 0; color: var(--color-muted); font-size: 14.3px; line-height: 1.5; }
.llm-models-note.is-ok { color: #3f756a; }
.llm-models-note.is-error { color: var(--color-error); }
.model-purpose-control { display: block; }
.llm-profile-basics, .model-purpose-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-save-row { display: flex; align-items: center; justify-content: flex-start; gap: 18px; min-height: 50px; margin: 0; padding: 10px 24px; background: var(--color-surface); border-top: 1px solid var(--color-line); }
.settings-feedback { margin: 0; color: var(--color-muted); font-size: 15.6px; }
.settings-feedback.is-error { color: var(--color-error); }
.chapter-planning-callout { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 22px 4px; padding: 14px 16px; background: var(--color-surface-hover); border: 1px solid var(--color-line); border-radius: 10px; }
.chapter-planning-callout strong { color: var(--color-structure-deep); font-size: 13px; }
.chapter-planning-callout p { margin: 5px 0 0; color: var(--color-muted); font-size: 11px; line-height: 1.5; }
.chapter-plan-button { flex: 0 0 auto; background: var(--color-action); border-color: var(--color-action); }
.chapter-plan-button:hover { background: #d86f5d; border-color: #d86f5d; }

@media (max-width: 1000px) { .study-grid { grid-template-columns: minmax(280px, .9fr) minmax(380px, 1.2fr); } }
@media (max-width: 800px) { .app-shell, .study-grid { grid-template-columns: minmax(0, 1fr); } .study-grid { grid-template-areas: "video" "notes" "mindmap"; --study-row-height: auto; } .sidebar { position: static; height: auto; overflow: visible; gap: 20px; padding: 16px 20px; } .nav-list { display: flex; overflow-x: auto; scrollbar-width: none; } .nav-list::-webkit-scrollbar { display: none; } .nav-item { flex: 0 0 auto; } .sidebar-note { display: none; } .sidebar-settings { width: auto; margin-left: auto; } .main-content { padding-top: 34px; } body.study-mode .main-content { padding: 22px 16px 44px; } .study-panel, .study-video, .study-note-body { width: 100%; max-width: 100%; } .study-left, .study-center { height: auto; max-height: none; } .llm-profile-basics, .model-purpose-grid, .knowledge-agent-model-grid { grid-template-columns: 1fr; } .settings-dialog, .practice-dialog, .note-editor-dialog { width: calc(100% - 20px); height: calc(100% - 20px); max-height: calc(100% - 20px); } .note-editor-card { max-height: none; padding: 18px; } .note-editor-actions { flex-wrap: wrap; } .settings-modal-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); } .settings-category-nav { flex-direction: row; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--color-line); } .settings-category-button { flex: 0 0 auto; width: auto; min-width: 132px; } .settings-content { padding: 22px 20px 30px; } }
@media (max-width: 560px) { .page-header, .section-heading { display: grid; align-items: start; } .metrics { grid-template-columns: 1fr; margin: 32px 0 42px; } .course-progress { min-width: 0; } .lesson-row { grid-template-columns: 1fr; padding-left: 22px; } .lesson-actions { justify-content: flex-start; } .error-message { max-width: none; } .chapter-planning-callout { align-items: flex-start; flex-direction: column; margin-inline: 14px; } .chapter-plan-button { width: 100%; } }
@media (max-width: 560px) { .chapter-summary { align-items: flex-start; padding-inline: 16px; } .chapter-summary-main { align-items: flex-start; } .chapter-lessons .lesson-row, .chapter-exercise-row { padding-left: 28px; } .practice-modal-body { padding: 20px 18px 26px; } .exercise-heading { display: grid; } .exercise-actions { flex-wrap: wrap; justify-content: flex-start; } #exercise-save-state { width: 100%; } .practice-task-top { align-items: flex-start; flex-direction: column; gap: 6px; } }
@media (max-width: 560px) { .study-player-controls { flex-wrap: wrap; } .study-player-progress { order: 3; flex-basis: 100%; } .study-player-time { margin-left: auto; } .study-player-volume { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
/* Cloud sign-in stays intentionally small; the learning UI remains unchanged. */
.login-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.login-dialog::backdrop {
  background: rgba(35, 41, 38, 0.32);
  backdrop-filter: blur(6px);
}

.login-card {
  width: min(390px, calc(100vw - 32px));
  display: grid;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--line, #e6e0d4);
  border-radius: 22px;
  background: var(--paper, #fffdf8);
  box-shadow: 0 24px 70px rgba(54, 48, 37, 0.16);
}

.login-card label {
  display: grid;
  gap: 8px;
}

.login-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--line, #d9d2c5);
  border-radius: 12px;
  background: #fff;
}

.login-feedback {
  min-height: 1.4em;
  margin: 0;
  color: var(--danger, #9b3b32);
}

.archive-review-actions input { min-width: 0; padding: 9px 12px; border: 1px solid var(--border, #dce2e6); border-radius: 8px; font: inherit; background: white; }

/* Global learning system theme. Reader-specific surfaces live in library.css. */
html[data-theme="dark"] {
  color-scheme: dark;
  --color-paper: #151b20;
  --color-atmosphere: #1b2932;
  --color-surface: #202b33;
  --color-surface-hover: #293943;
  --color-structure: #72b9e3;
  --color-structure-deep: #d6e9f3;
  --color-action: #f18a78;
  --color-action-deep: #ffad98;
  --color-highlight: #e6c96d;
  --color-text: #e7eef1;
  --color-muted: #a7bac4;
  --color-line: #354953;
  --color-error-bg: #432c2d;
  --color-error: #ffaaa4;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .24);
}

html[data-theme="dark"] body { background: var(--color-paper); color: var(--color-text); }
html[data-theme="dark"] .sidebar { background: var(--color-atmosphere); border-color: var(--color-line); }
html[data-theme="dark"] .brand,
html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .nav-item.is-active,
html[data-theme="dark"] h1,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .course-title,
html[data-theme="dark"] .chapter-title,
html[data-theme="dark"] .metric-card strong,
html[data-theme="dark"] .dialog-header h2,
html[data-theme="dark"] .settings-card h2,
html[data-theme="dark"] .settings-card label,
html[data-theme="dark"] .learning-system-choice legend { color: var(--color-structure-deep); }
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .sidebar-settings:hover,
html[data-theme="dark"] .sidebar-settings.is-active { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .sidebar-note { background: rgba(0,0,0,.14); border-color: var(--color-line); }
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .course-directory,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .preview-dialog,
html[data-theme="dark"] .settings-dialog,
html[data-theme="dark"] .practice-dialog,
html[data-theme="dark"] .note-editor-dialog,
html[data-theme="dark"] .lesson-regenerate-dialog,
html[data-theme="dark"] .login-card { color: var(--color-text); background: var(--color-surface); border-color: var(--color-line); }
html[data-theme="dark"] .button-secondary:hover { background: var(--color-surface-hover); }
html[data-theme="dark"] .lesson-row,
html[data-theme="dark"] .chapter-group,
html[data-theme="dark"] .exercise-feedback-item { border-color: var(--color-line); }
html[data-theme="dark"] .chapter-summary:hover,
html[data-theme="dark"] .course-summary:hover { background: var(--color-surface-hover); }
html[data-theme="dark"] .chapter-material-button,
html[data-theme="dark"] .settings-category-button.is-active,
html[data-theme="dark"] .settings-category-nav,
html[data-theme="dark"] .settings-panel.is-compact,
html[data-theme="dark"] .settings-switch,
html[data-theme="dark"] .learning-system-choice,
html[data-theme="dark"] .knowledge-agent-editor textarea,
html[data-theme="dark"] .settings-card input,
html[data-theme="dark"] .settings-card select,
html[data-theme="dark"] .login-card input,
html[data-theme="dark"] .archive-review-actions input { color: var(--color-text); background: #182229; border-color: var(--color-line); }
html[data-theme="dark"] .settings-category-button:hover { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .settings-save-row { background: var(--color-surface); border-color: var(--color-line); }
html[data-theme="dark"] .settings-status,
html[data-theme="dark"] .chapter-model-summary,
html[data-theme="dark"] .llm-tag { background: var(--color-atmosphere); border-color: var(--color-line); }
html[data-theme="dark"] .settings-panel.is-compact,
html[data-theme="dark"] .knowledge-agent-editor textarea:disabled { background: #1b272e; }
html[data-theme="dark"] .metric-icon.blue { background: #203b4a; }
html[data-theme="dark"] .metric-icon.gold { background: #3d3824; }
html[data-theme="dark"] .metric-icon.coral { background: #452d2d; }
html[data-theme="dark"] .folder-icon { background: #3d3824; }
html[data-theme="dark"] .chapter-exercise-row,
html[data-theme="dark"] .exercise-generation-state { background: #1b2932; }
html[data-theme="dark"] .chapter-exercise-row:hover:not(:disabled) { background: #263b45; }
html[data-theme="dark"] .login-dialog::backdrop,
html[data-theme="dark"] dialog::backdrop { background: rgba(0,0,0,.62); }
html[data-theme="dark"] .toast { background: #27353d; border-color: var(--color-line); color: var(--color-text); }
