:root {
  --ink: #12231f;
  --ink-2: #1c342e;
  --muted: #71807a;
  --line: #dce2d9;
  --paper: #f7f5ee;
  --paper-2: #efeee6;
  --white: #fffefa;
  --mint: #baf1d3;
  --mint-deep: #1d715c;
  --coral: #e7654d;
  --amber: #e4aa5d;
  --shadow: 0 20px 40px rgba(21, 44, 35, 0.08);
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #e8ece5;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1100px; background: #e8ece5; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; background: var(--paper); }

.rail { width: 252px; flex: 0 0 252px; padding: 32px 22px 24px; color: #eaf5ed; background: var(--ink); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.rail::before, .rail::after { content: ""; position: absolute; border: 1px solid rgba(186,241,211,.16); border-radius: 50%; pointer-events: none; }
.rail::before { width: 380px; height: 380px; left: -250px; top: 160px; }
.rail::after { width: 240px; height: 240px; right: -180px; bottom: 60px; }
.brand-mark { width: 54px; height: 54px; border: 1px solid rgba(186,241,211,.6); border-radius: 50%; display: grid; place-items: center; position: relative; margin-bottom: 48px; }
.brand-core { width: 34px; height: 34px; border-radius: 50%; background: var(--mint); color: var(--ink); display: grid; place-items: center; font-size: 19px; font-weight: 900; }
.brand-orbit { position: absolute; width: 68px; height: 22px; border: 1px solid rgba(186,241,211,.45); border-radius: 50%; transform: rotate(-30deg); }
.rail-label, .eyebrow, .section-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 800; }
.rail-label { color: #829a91; margin-bottom: 14px; }
.rail-course-code { color: var(--mint); font: 30px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.08em; margin-top: 2px; }
.rail-course-title { color: #eaf5ed; font-size: 15px; font-weight: 800; margin: 4px 0 17px; }
.rail-current-lesson { border-left: 2px solid var(--mint); background: rgba(186,241,211,.1); border-radius: 0 9px 9px 0; padding: 13px 12px; display: grid; gap: 6px; }
.rail-current-code { color: var(--mint); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.rail-current-lesson strong { color: #f0f7ef; font-size: 13px; line-height: 1.5; }
.rail-current-lesson small { color: #8aa79a; font-size: 10px; }
.rail-state-label { margin-top: 31px; }
.rail-facts { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid rgba(186,241,211,.16); padding: 13px 0; gap: 8px; }
.rail-facts div { display: grid; gap: 4px; border-left: 1px solid rgba(186,241,211,.16); padding-left: 8px; }
.rail-facts div:first-child { border-left: 0; padding-left: 0; }
.rail-facts b { color: var(--mint); font: 17px ui-monospace, SFMono-Regular, Menlo, monospace; }
.rail-facts span { color: #8aa097; font-size: 9px; line-height: 1.35; }
.topic-list { display: grid; gap: 8px; position: relative; z-index: 1; }
.topic-item { border: 1px solid transparent; color: #aac0b6; background: transparent; text-align: left; padding: 14px 12px; display: grid; grid-template-columns: 26px 1fr 8px; gap: 10px; align-items: center; border-radius: 12px; transition: .2s ease; }
.topic-item:hover { border-color: rgba(186,241,211,.2); color: #eaf5ed; }
.topic-item.active { color: var(--ink); background: var(--mint); box-shadow: 0 12px 26px rgba(0,0,0,.16); }
.topic-index { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; opacity: .7; }
.topic-item strong, .topic-item small { display: block; }
.topic-item strong { font-size: 13px; margin-bottom: 4px; }
.topic-item small { font-size: 10px; opacity: .7; }
.topic-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(231,101,77,.15); }
.topic-dot.hollow { background: transparent; border: 1px solid currentColor; box-shadow: none; }
.rail-bottom { margin-top: auto; position: relative; z-index: 1; display: grid; gap: 16px; color: #9bb0a7; font-size: 11px; }
.privacy-chip { border: 1px solid rgba(186,241,211,.18); padding: 8px 10px; border-radius: 8px; width: max-content; color: #c7ded3; }
.lock { color: var(--mint); margin-right: 6px; }
.rail-user { display: flex; align-items: center; gap: 9px; }
.avatar { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #315348; color: var(--mint); font-weight: 800; }

.main-content { flex: 1; padding: 36px 46px 24px; max-width: 1600px; margin: 0 auto; width: calc(100% - 252px); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { color: var(--mint-deep); margin-bottom: 11px; }
.breadcrumb { color: #829189; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; margin-bottom: 12px; }
.breadcrumb span, .breadcrumb strong { color: var(--mint-deep); font-weight: 800; }.breadcrumb i { color: #b0bbb3; font-style: normal; padding: 0 5px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 3vw, 46px); letter-spacing: -.045em; line-height: 1.05; margin-bottom: 12px; }
.lede { color: var(--muted); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.mode-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; padding: 8px 12px; font-size: 11px; color: #486359; background: rgba(255,255,255,.55); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint-deep); box-shadow: 0 0 0 4px rgba(29,113,92,.12); }
.ghost-btn, .icon-btn, .secondary-btn { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; padding: 9px 13px; font-size: 12px; transition: .2s ease; }
.ghost-btn:hover, .secondary-btn:hover { border-color: var(--ink); background: var(--white); }
.lesson-preview-link { display: inline-flex; align-items: center; text-decoration: none; }
.assistant-card.ai-collapsed > :not(.assistant-header):not(.ai-status) { display: none; }
.icon-btn { width: 36px; height: 36px; padding: 0; font-size: 20px; color: var(--muted); }
.progress-strip { margin-top: 34px; padding: 18px 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.52); }
.progress-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.progress-head strong { display: block; margin-top: 5px; font-size: 14px; }
.section-kicker { color: var(--mint-deep); }
.progress-score { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.progress-track { display: flex; align-items: center; gap: 9px; }
.progress-node { width: 102px; flex: 0 0 102px; border: 0; background: transparent; text-align: left; padding: 0; color: #99a49d; }
.progress-node span { display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; border: 1px solid #bec9c1; font: 11px ui-monospace, monospace; margin-bottom: 8px; }
.progress-node b, .progress-node small { display: block; }
.progress-node b { font-size: 12px; color: #76857d; }
.progress-node small { font-size: 10px; color: #9aa49e; margin-top: 3px; }
.progress-node.current span { background: var(--ink); border-color: var(--ink); color: var(--mint); }
.progress-node.current b { color: var(--ink); }
.progress-node.done span { background: var(--mint); border-color: var(--mint-deep); color: var(--mint-deep); }
.progress-node.done b { color: var(--mint-deep); }
.track-line { height: 1px; background: #cbd4cb; flex: 1; margin-top: -30px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 326px; gap: 28px; margin-top: 31px; align-items: start; }
.module-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.module-heading h2 { font-size: 23px; letter-spacing: -.03em; margin: 7px 0 0; }
.source-tag { border: 1px solid var(--line); color: var(--muted); border-radius: 7px; padding: 6px 9px; font-size: 10px; white-space: nowrap; }
.paper-card, .task-card, .note-card, .assistant-card, .insight-card { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.paper-card { background: var(--white); padding: 24px; }
.card-topline { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 17px; }
.card-number { font: 10px ui-monospace, monospace; letter-spacing: .1em; color: var(--mint-deep); }
.paper-card h3, .task-card h3 { margin-bottom: 11px; font-size: 21px; letter-spacing: -.03em; }
.card-copy { color: #5d6c64; line-height: 1.8; font-size: 13px; max-width: 680px; margin-bottom: 18px; }
.code-snippet { border-left: 3px solid var(--coral); background: var(--ink); color: #edf9ee; border-radius: 5px; padding: 12px 14px; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; overflow: auto; }
.syntax-var { color: var(--mint); }.syntax-string { color: #f8c883; }.syntax-comment { color: #95a89f; }
.concept-tags { display: flex; gap: 7px; margin: 15px 0 21px; flex-wrap: wrap; }
.concept-tags span { padding: 5px 8px; border-radius: 4px; background: #eef4ec; color: #477363; font-size: 11px; }
.self-check { border-top: 1px solid var(--line); padding-top: 18px; }
.self-check-prompt { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; font-size: 13px; }
.check-badge { background: #fff1db; color: #9f6726; padding: 4px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { background: #fbfbf7; color: #33483f; border: 1px solid var(--line); border-radius: 7px; text-align: left; padding: 10px 12px; font-size: 12px; transition: .18s ease; }
.choice:hover { border-color: var(--mint-deep); background: #f1fbf3; }.choice.correct { background: #e1f7e8; border-color: var(--mint-deep); color: var(--mint-deep); }.choice.wrong { background: #fff0ed; border-color: var(--coral); color: #a94635; }
.feedback-box { min-height: 35px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; margin-top: 12px; }.feedback-icon { color: var(--coral); font-weight: 800; }

.task-card { margin-top: 16px; background: var(--ink-2); color: #edf6ef; padding: 23px 24px; }.task-card .card-topline { color: #9db4a8; }.task-card .card-number { color: var(--mint); }.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 23px; }.task-card h3 { color: #f4f6ee; }.task-card p { color: #b6c7be; font-size: 12px; line-height: 1.7; }.task-card code { color: var(--mint); font-family: ui-monospace, monospace; }.code-editor { margin-top: 15px; display: grid; grid-template-columns: 28px 1fr; background: #0e1d1a; border-radius: 8px; padding: 12px 0; color: #dcebe0; font: 12px/1.9 ui-monospace, SFMono-Regular, Menlo, monospace; }.code-editor span:not(.ln) { padding-left: 8px; }.code-editor .ln { text-align: right; color: #60756c; padding-right: 9px; user-select: none; }.code-editor em { color: #9ee3c7; font-style: normal; }.code-editor i { color: #facd91; font-style: normal; }.code-editor b { color: #f08e79; font-weight: 500; }.run-panel { border-left: 1px solid rgba(186,241,211,.18); padding-left: 18px; }.run-label { color: #adc3b8; font-size: 10px; margin: 2px 0 11px; }.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); margin-right: 5px; }.primary-btn { border: 0; background: var(--mint); color: var(--ink); border-radius: 7px; padding: 10px 12px; font-size: 12px; font-weight: 800; width: 100%; transition: .2s ease; }.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(186,241,211,.14); }.secondary-btn { color: #d9e8dc; border-color: rgba(186,241,211,.27); width: 100%; margin-top: 8px; font-size: 11px; }.output-box, .trace-box { margin-top: 14px; padding: 10px; border-radius: 7px; background: #0d1b19; border: 1px solid rgba(186,241,211,.13); font-size: 11px; }.output-label { display: block; color: #789187; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 7px; }.output-box code, .trace-box code { color: #f8cf96; font-size: 11px; overflow-wrap: anywhere; }.trace-box { color: #a6c5b8; line-height: 1.6; }.trace-box div + div { border-top: 1px solid rgba(186,241,211,.1); margin-top: 7px; padding-top: 7px; }.trace-box span { color: #789187; display: block; font-size: 9px; }

.note-card { margin-top: 16px; background: #fff8eb; padding: 21px 24px 23px; }.note-card .card-topline { color: #977b55; }.saved-state { color: #b88740; font-size: 10px; }.note-layout { display: grid; grid-template-columns: 220px 1fr; gap: 14px 20px; align-items: start; }.note-prompt { display: grid; grid-template-columns: 22px 1fr; gap: 8px; }.note-prompt strong { font-size: 12px; line-height: 1.5; }.note-prompt small { grid-column: 2; color: #987f5b; line-height: 1.5; font-size: 10px; }.note-pin { color: var(--coral); font-size: 17px; }.note-card textarea { resize: vertical; min-height: 75px; border: 1px solid #ead9ba; background: rgba(255,255,255,.65); border-radius: 7px; padding: 11px; color: var(--ink); outline: none; font-size: 12px; line-height: 1.6; }.note-card textarea:focus { border-color: var(--coral); }.note-actions { grid-column: 2; display: flex; justify-content: flex-end; gap: 8px; }.note-actions .ghost-btn { border-color: #e0c99f; color: #835f31; }.compact { width: auto; padding: 9px 13px; background: var(--coral); color: white; }

.assistant-column { display: grid; gap: 16px; }.catalog-card { background: #f3f6ef; border: 1px solid var(--line); border-radius: 14px; padding: 17px; }.catalog-card .card-topline { margin-bottom: 12px; }.catalog-count { font-size: 9px; color: var(--mint-deep); }.catalog-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }.catalog-title-row strong { font-size: 14px; }.catalog-lock { font-size: 9px; color: #9d6d32; background: #fff1dd; padding: 4px 6px; border-radius: 4px; }.catalog-card details { border-top: 1px solid #dce3d8; }.catalog-card summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 11px 1px 9px; font-size: 11px; font-weight: 800; }.catalog-card summary::-webkit-details-marker { display: none; }.catalog-card summary::before { content: "＋"; color: var(--mint-deep); font-size: 13px; margin-right: 4px; }.catalog-card details[open] summary::before { content: "－"; }.catalog-card summary b { color: #87968d; font-size: 9px; font-weight: 500; }.catalog-children { display: grid; gap: 5px; padding: 0 0 10px 12px; }.catalog-row { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 7px 7px; text-align: left; display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 4px; color: #47675a; }.catalog-row:hover:not(:disabled), .catalog-row.current { border-color: #b8dac5; background: #e1f4e5; }.catalog-row.locked { color: #9aa49e; cursor: not-allowed; }.catalog-row span { font: 9px ui-monospace, monospace; color: #8a9d91; }.catalog-row strong { font-size: 10px; font-weight: 600; }.catalog-row i { font-size: 9px; font-style: normal; color: var(--mint-deep); }.catalog-row.locked i { color: #a8afa9; }.catalog-note { display: flex; align-items: center; gap: 5px; border-top: 1px solid #dce3d8; margin-top: 2px; padding-top: 10px; color: #7f8d85; font-size: 9px; line-height: 1.5; }.catalog-note span { color: var(--mint-deep); }.assistant-card { background: var(--white); padding: 20px; position: sticky; top: 20px; }.assistant-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }.assistant-header h2 { font-size: 20px; letter-spacing: -.03em; margin: 7px 0 0; }.ai-status { color: #9b6728; background: #fff1dd; border-radius: 5px; padding: 5px 6px; font-size: 9px; white-space: nowrap; }.ai-status i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); margin-right: 4px; }.assistant-intro { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 15px 0; }.suggestion-list { display: grid; gap: 6px; }.suggestion-list button { border: 1px solid var(--line); background: #f7faf5; border-radius: 6px; padding: 8px 9px; text-align: left; font-size: 11px; color: #47675a; }.suggestion-list button:hover { border-color: var(--mint-deep); color: var(--mint-deep); }.chat-log { display: grid; gap: 10px; margin: 15px 0 12px; max-height: 228px; overflow: auto; }.chat-message { border-radius: 8px; padding: 10px; font-size: 11px; line-height: 1.65; }.chat-message p { margin: 0; }.chat-message.ai { background: #edf5ec; color: #456055; }.chat-message.user { background: var(--ink); color: #e9f7ed; justify-self: end; max-width: 88%; }.message-label { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; opacity: .65; display: block; margin-bottom: 4px; }.chat-form { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }.chat-form input { flex: 1; min-width: 0; border: 0; outline: none; padding: 10px; color: var(--ink); font-size: 11px; background: transparent; }.chat-form button { width: 37px; border: 0; background: var(--coral); color: white; font-size: 17px; }.guardrail-note { display: flex; gap: 5px; align-items: center; color: #89968f; font-size: 9px; margin-top: 11px; }.guardrail-note span { color: var(--mint-deep); }.insight-card { background: var(--paper-2); padding: 18px; }.insight-card .card-topline { color: var(--muted); margin-bottom: 15px; }.signal-live { color: var(--mint-deep); font-size: 10px; }.signal-row { display: grid; grid-template-columns: 34px 1fr 31px; gap: 8px; align-items: center; font-size: 10px; color: #60736b; margin: 11px 0; }.signal-row b { text-align: right; font: 10px ui-monospace, monospace; color: var(--ink); }.mini-bar { height: 6px; border-radius: 99px; background: #d8ded5; overflow: hidden; }.mini-bar i { display: block; height: 100%; border-radius: inherit; background: var(--mint-deep); transition: width .35s ease; }.teacher-tip { border-top: 1px solid #d6ddd4; padding-top: 13px; margin-top: 15px; }.teacher-tip span { color: #8a6c38; font-size: 10px; }.teacher-tip p { color: #64766d; font-size: 11px; line-height: 1.6; margin: 6px 0 0; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); margin-top: 31px; padding-top: 15px; color: #8c9991; font-size: 10px; }
.hidden { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(18,35,31,.58); z-index: 10; padding: 20px; }.teacher-modal { width: min(530px, 100%); background: var(--paper); border-radius: 15px; padding: 27px; box-shadow: 0 35px 70px rgba(0,0,0,.28); position: relative; }.modal-close { position: absolute; top: 12px; right: 16px; border: 0; background: transparent; color: var(--muted); font-size: 24px; }.teacher-modal h2 { font-size: 27px; letter-spacing: -.04em; margin: 7px 0 23px; }.class-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); padding: 17px 0; margin-bottom: 18px; }.class-stats div { display: grid; gap: 5px; padding-left: 16px; border-left: 1px solid var(--line); }.class-stats div:first-child { border-left: 0; padding-left: 0; }.class-stats b { font: 26px ui-monospace, monospace; }.class-stats span { color: var(--muted); font-size: 10px; }.teacher-list { display: grid; gap: 12px; }.teacher-list > div { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; }.teacher-list strong { font-size: 12px; }.teacher-list small { grid-column: 2; color: var(--muted); font-size: 10px; margin-top: 2px; }.list-dot { width: 7px; height: 7px; border-radius: 50%; }.list-dot.mint { background: var(--mint-deep); }.list-dot.coral { background: var(--coral); }.list-dot.amber { background: var(--amber); }.modal-footnote { color: var(--muted); font-size: 10px; line-height: 1.6; border-top: 1px solid var(--line); margin: 19px 0 0; padding-top: 13px; }

@media (max-width: 1200px) { body { min-width: 980px; }.main-content { padding-inline: 30px; }.workspace-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }.task-layout { grid-template-columns: minmax(0, 1fr) 170px; }.progress-node { width: 86px; flex-basis: 86px; } }

/* 单步执行：每次点击只推进一个执行状态 */
.step-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(186,241,211,.1); padding-bottom: 7px; margin-bottom: 7px; }
.step-header span { color: #789187; font-size: 9px; }
.step-header b { color: var(--mint); font: 9px ui-monospace, monospace; font-weight: 500; }
.trace-row { padding: 6px 0; border-top: 1px solid rgba(186,241,211,.1); }
.trace-row:first-child { border-top: 0; }
.trace-row span { color: #789187; display: block; font-size: 9px; }
.trace-row code { display: block; margin-top: 2px; }
.step-note { color: #789187; font-size: 9px; margin-top: 8px; text-align: center; }
.lab-toolbar { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 7px 10px; border: 1px solid rgba(223,243,110,.15); border-bottom: 0; background: #102842; color: #9fb4c4; font-size: 10px; }
.lab-file { font: 10px ui-monospace, monospace; color: #dce9f2; }.lab-tabs { display: flex; gap: 11px; margin-left: auto; }.lab-tab { padding: 4px 0; color: #8299ab; }.lab-tab.active { color: var(--mint); border-bottom: 1px solid var(--mint); }.lab-runtime { color: #7f98aa; font-size: 9px; }
.catalog-scroll { max-height: 330px; overflow-y: auto; padding-right: 4px; }
.catalog-scroll::-webkit-scrollbar { width: 4px; }.catalog-scroll::-webkit-scrollbar-thumb { background: #c5d1c6; border-radius: 99px; }

/* 当前课题优先：完整目录改为顶部抽屉，不再挤占课堂主工作区 */
body { min-width: 0; }
.rail { width: 204px; flex-basis: 204px; }
.main-content { width: calc(100% - 204px); max-width: 1840px; padding: 30px 34px 22px; }
.workspace-grid { grid-template-columns: minmax(0, 1fr) 276px; gap: 22px; }
.catalog-card { display: none; }
.lesson-context { display: flex; align-items: center; gap: 11px; margin-top: 19px; padding: 11px 13px; border: 1px solid #d4e3d7; border-left: 3px solid var(--mint-deep); border-radius: 8px; background: #f1f8f0; width: min(680px, 100%); }
.lesson-context-code { color: var(--mint-deep); font: 13px ui-monospace, monospace; font-weight: 800; }
.lesson-context div { display: grid; gap: 3px; }.lesson-context strong { font-size: 12px; }.lesson-context small { color: #7d8f84; font-size: 10px; }.lesson-context-rule { margin-left: auto; color: #7a8f80; font-size: 9px; white-space: nowrap; }
.course-index-drawer { width: min(520px, 100%); max-height: min(760px, 90vh); overflow: auto; background: var(--paper); border-radius: 15px; padding: 28px; box-shadow: 0 35px 70px rgba(0,0,0,.28); position: relative; }.course-index-drawer h2 { font-size: 28px; letter-spacing: -.04em; margin: 8px 0 8px; }.drawer-intro { color: var(--muted); font-size: 11px; line-height: 1.65; margin-bottom: 18px; }.drawer-intro strong { color: var(--mint-deep); }.drawer-tree { border-top: 1px solid var(--line); padding-top: 14px; }.drawer-tree .catalog-scroll { max-height: 475px; }.drawer-tree .catalog-row { padding: 8px 7px; }
@media (max-width: 1200px) { .rail { width: 190px; flex-basis: 190px; }.main-content { width: calc(100% - 190px); padding-inline: 24px; }.workspace-grid { grid-template-columns: minmax(0, 1fr) 252px; gap: 16px; } }

/* Studio redesign: 教材页 × 编程实验台。当前课题是主角，课程目录退到抽屉。 */
:root {
  --ink: #10243e;
  --ink-2: #173553;
  --muted: #6d7e90;
  --line: #d3dee9;
  --paper: #f1f5f9;
  --paper-2: #e7eef5;
  --white: #ffffff;
  --mint: #dff36e;
  --mint-deep: #1c6b8f;
  --coral: #ee6d54;
  --amber: #d3a052;
  --shadow: 0 12px 28px rgba(31, 61, 90, 0.08);
}
body { background: var(--paper); color: var(--ink); }
.app-shell { display: block; min-height: 100vh; background: var(--paper); }
.rail { display: none; }
.main-content { width: 100%; max-width: none; padding: 28px clamp(24px, 5vw, 78px) 22px; }
.topbar { align-items: flex-end; border-bottom: 1px solid var(--line); padding-bottom: 23px; }
.eyebrow { color: var(--mint-deep); letter-spacing: .18em; }
.breadcrumb { color: #8190a0; margin-bottom: 11px; }
.breadcrumb span, .breadcrumb strong { color: var(--mint-deep); }
h1 { font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif; font-size: clamp(34px, 4.2vw, 58px); letter-spacing: -.065em; line-height: 1; margin-bottom: 13px; }
.lede { color: #6e7e8d; font-size: 13px; }
.top-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mode-pill { border-color: #c9d7e3; background: transparent; color: #3d637e; }
.ghost-btn, .icon-btn, .secondary-btn { border-color: #c8d5e2; color: var(--ink); background: rgba(255,255,255,.35); border-radius: 4px; }
.ghost-btn:hover, .secondary-btn:hover { border-color: var(--mint-deep); background: var(--white); }
.lesson-context { width: min(720px, 100%); margin-top: 18px; border: 0; border-left: 3px solid var(--mint-deep); border-radius: 0; background: transparent; padding: 7px 0 7px 13px; }
.lesson-context-code { background: var(--ink); color: var(--mint); border-radius: 3px; padding: 7px 8px; font-size: 12px; }
.lesson-context strong { font-size: 13px; }.lesson-context small { color: #7e8e9e; }.lesson-context-rule { color: var(--mint-deep); font-weight: 700; }
.progress-strip { margin-top: 25px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 0 17px; }
.progress-head { margin-bottom: 14px; }.progress-head strong { color: var(--ink); font-size: 13px; }.progress-score { color: var(--mint-deep); }
.progress-track { gap: 7px; }.progress-node { width: 95px; flex-basis: 95px; }.progress-node span { width: 24px; height: 24px; border-radius: 3px; border-color: #b9c9d7; }.progress-node.current span { background: var(--mint); border-color: var(--mint); color: var(--ink); }.progress-node.current b { color: var(--ink); }.progress-node.done span { background: #d8ebf2; border-color: var(--mint-deep); color: var(--mint-deep); }.track-line { margin-top: -27px; background: #c9d6e0; }
.workspace-grid { grid-template-columns: minmax(0, 1fr) 276px; gap: clamp(22px, 3vw, 44px); margin-top: 27px; }
.module-heading { border-left: 3px solid var(--mint); padding-left: 13px; margin-bottom: 14px; }.module-heading h2 { font-family: "Songti SC", "STSong", serif; font-size: 27px; }.source-tag { border-radius: 3px; background: #e5edf3; border-color: #d2dfe9; }
.paper-card, .task-card, .note-card, .assistant-card, .insight-card { border-radius: 5px; box-shadow: none; }
.paper-card { border-top: 4px solid var(--ink); padding: 28px; }.card-topline { color: #738497; }.paper-card h3, .task-card h3 { font-family: "Songti SC", "STSong", serif; font-size: 24px; }.card-copy { color: #53697d; }
.code-snippet { border-radius: 3px; border-left-width: 4px; background: var(--ink); }
.concept-tags span { border-radius: 3px; background: #e4eff4; color: #2d6783; }
.self-check { border-top-color: #d7e1ea; }.choice { border-radius: 4px; background: #f8fafc; }.choice:hover { background: #f2fae1; }.choice.correct { background: #edf7cf; border-color: var(--mint-deep); }.choice.wrong { background: #fff0eb; }
.task-card { background: var(--ink); padding: 25px 28px; }.task-card .card-topline { color: #9eb5c7; }.task-card p { color: #bbcad7; }.code-editor { border-radius: 3px; background: #0b1b2d; }.run-panel { border-left-color: rgba(223,243,110,.25); }.primary-btn { border-radius: 4px; background: var(--mint); }.secondary-btn { color: #dbe8f0; border-color: rgba(223,243,110,.35); background: transparent; border-radius: 4px; }.secondary-btn:hover { color: var(--ink); }.output-box, .trace-box { border-radius: 3px; background: #0a1929; }
.note-card { background: #fffef7; border-color: #e4e0c7; border-left: 4px solid var(--amber); }.note-card textarea { border-radius: 3px; border-color: #ddd8b9; }.note-actions .ghost-btn { border-radius: 4px; }.compact { border-radius: 4px; }
.assistant-column { gap: 20px; }.assistant-card { background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 4px 0 4px 20px; position: sticky; top: 20px; }.assistant-header h2 { font-family: "Songti SC", "STSong", serif; font-size: 24px; }.assistant-intro { color: #718397; }.suggestion-list button { border-radius: 3px; background: rgba(255,255,255,.45); border-color: #ccd9e4; }.chat-message { border-radius: 3px; }.chat-message.ai { background: #e5eff4; }.chat-message.user { background: var(--ink); }.chat-form { border-radius: 3px; background: rgba(255,255,255,.75); }.chat-form button { background: var(--coral); }.insight-card { background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 4px 0 4px 20px; }.mini-bar { background: #d7e1e8; }.mini-bar i { background: var(--mint-deep); }.teacher-tip { border-top-color: var(--line); }.page-footer { border-top-color: var(--line); }
.course-index-drawer { border-radius: 5px; }.drawer-tree { border-top-color: var(--line); }
@media (max-width: 980px) { .workspace-grid { grid-template-columns: 1fr; }.assistant-column { display: grid; grid-template-columns: 1fr 1fr; }.assistant-card, .insight-card { position: static; }.topbar { align-items: flex-start; flex-direction: column; }.top-actions { justify-content: flex-start; } }
.assistant-column { align-content: start; }
.assistant-card { position: static; }
.chat-log { max-height: 184px; }
.insight-card { margin-top: 2px; padding-top: 13px; }

/* 机房可读性：以 1366×768 的学生机和投屏阅读为基准放大正文 */
body { font-size: 16px; }
.breadcrumb { font-size: 12px; }.lede { font-size: 15px; }.lesson-context strong { font-size: 15px; }.lesson-context small { font-size: 12px; }.lesson-context-rule { font-size: 11px; }
.progress-head strong { font-size: 15px; }.progress-score { font-size: 12px; }.progress-node b { font-size: 14px; }.progress-node small { font-size: 12px; }
.module-heading h2 { font-size: 30px; }.source-tag { font-size: 11px; }
.paper-card h3, .task-card h3 { font-size: 27px; }.card-copy { font-size: 15px; }.concept-tags span { font-size: 13px; }.self-check-prompt { font-size: 15px; }.choice { font-size: 14px; padding: 12px 13px; }.feedback-box { font-size: 13px; }
.task-card p { font-size: 14px; }.code-editor { font-size: 14px; line-height: 2; }.lab-toolbar { font-size: 12px; }.lab-file, .lab-runtime { font-size: 11px; }.run-label { font-size: 12px; }.primary-btn, .secondary-btn { font-size: 14px; padding: 11px 13px; }.step-note { font-size: 11px; }.output-box, .trace-box { font-size: 13px; }.output-label, .step-header span, .step-header b, .trace-row span { font-size: 11px; }.output-box code, .trace-box code { font-size: 13px; }
.note-prompt strong { font-size: 14px; }.note-prompt small { font-size: 12px; }.note-card textarea { font-size: 14px; }.saved-state { font-size: 11px; }
.assistant-header h2 { font-size: 27px; }.assistant-intro { font-size: 13px; }.suggestion-list button { font-size: 13px; padding: 10px 11px; }.chat-message { font-size: 13px; }.message-label { font-size: 10px; }.chat-form input { font-size: 13px; padding: 12px; }.guardrail-note { font-size: 11px; }.signal-row { font-size: 12px; }.signal-row b { font-size: 12px; }.teacher-tip span { font-size: 11px; }.teacher-tip p { font-size: 13px; }

/* 可编辑的课堂 Python 实验台 */
.python-editor { display: block; width: 100%; min-height: 260px; margin-top: 12px; padding: 16px; border: 1px solid #48617a; border-radius: 4px; background: #0b1b2d; color: #edf6ef; font: 16px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; tab-size: 4; }
.python-editor:focus, .lab-test-input:focus { outline: 2px solid var(--mint); outline-offset: 2px; }
.lab-example-btn { margin-left: auto; padding: 6px 10px; border: 1px solid #6d8499; border-radius: 4px; background: transparent; color: #edf6ef; font-size: 13px; }
.lab-example-btn:hover { background: #244361; }
.lab-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.lab-field-label { display: block; color: #e2edf5; font-size: 14px; margin-bottom: 8px; }
.lab-field-label span { display: block; color: #a6bbce; font-size: 12px; margin-top: 4px; }
.lab-test-input { display: block; width: 100%; min-height: 104px; padding: 10px 12px; border: 1px solid #48617a; border-radius: 4px; background: #0b1b2d; color: #edf6ef; font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.lab-test-input::placeholder { color: #94a9be; }
.lab-test-result { min-height: 24px; }
.lab-test-result[data-result="pass"] { color: #dff36e; }
.lab-test-result[data-result="fail"], .lab-test-result[data-result="error"] { color: #ffb99f; }
.output-box code { display: block; white-space: pre-wrap; }
.trace-box { max-height: 390px; overflow-y: auto; }
.trace-row code { display: block; white-space: pre-wrap; }
.run-panel button:disabled, .lab-example-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
@media (max-width: 680px) { .lab-input-grid { grid-template-columns: 1fr; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.lab-libraries { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 18px; color: #a6bbce; font-size: 13px; }
.lab-libraries code { padding: 4px 8px; background: #244361; border-radius: 4px; color: #e2edf5; }
.task-card .runtime-status { font-size: 13px; margin: 8px 0 14px; }
.lab-example-select { min-width: 0; max-width: 220px; margin-left: auto; padding: 6px; color: #edf6ef; background: #17334f; border: 1px solid #6d8499; border-radius: 4px; font-size: 13px; }
.lab-example-btn { margin-left: 0; white-space: nowrap; }
.python-artifacts { border-top: 1px solid #48617a; margin-top: 20px; padding-top: 16px; }
.python-artifacts h4 { margin: 0 0 12px; font-size: 16px; }
.python-table-wrap { overflow-x: auto; margin-bottom: 18px; }
.python-table-wrap table { border-collapse: collapse; font-size: 14px; min-width: 60%; }
.python-table-wrap caption { text-align: left; color: #bbcad7; margin-bottom: 8px; }
.python-table-wrap th, .python-table-wrap td { border: 1px solid #48617a; padding: 8px 12px; text-align: left; white-space: nowrap; }
.python-table-wrap th { background: #244361; }
.python-figure { margin: 16px 0 0; }
.python-figure img { display: block; max-width: 100%; height: auto; background: white; border-radius: 4px; }
.python-figure figcaption { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; color: #bbcad7; }
.python-figure a { color: var(--mint); }
@media (max-width: 680px) { .lab-toolbar { flex-wrap: wrap; }.lab-example-select { max-width: 100%; } }
.task-card .CodeMirror { height: 310px; margin-top: 12px; border: 1px solid #48617a; border-radius: 4px; background: #0b1b2d; color: #edf6ef; font: 16px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; }
.task-card .CodeMirror-gutters { border-right: 1px solid #244361; background: #122b43; }
.task-card .CodeMirror-linenumber { color: #93a9bd; }
.task-card .CodeMirror-cursor { border-left-color: #dff36e; }
.task-card .CodeMirror-selected { background: #345775; }
.task-card .CodeMirror-focused .CodeMirror-selected { background: #345775; }
.task-card .cm-keyword { color: #ffac8f; }.task-card .cm-string { color: #f8cf96; }.task-card .cm-number { color: #a4d7f5; }.task-card .cm-builtin { color: #98d9bd; }.task-card .cm-comment { color: #90a5b7; }.task-card .cm-def { color: #dff36e; }.task-card .cm-variable { color: #edf6ef; }.task-card .cm-meta { color: #b8d5f2; }
.task-card .CodeMirror-matchingbracket { color: #dff36e !important; text-decoration: underline; }
.task-card .python-executed-line { background: #294735; }
.task-card .python-error-line { background: rgba(238, 109, 84, .28); box-shadow: inset 3px 0 #ff8f76; }
.task-card .CodeMirror:focus-within { outline: 2px solid var(--mint); outline-offset: 2px; }

/* 教学型 IDLE：文件、数据和交互控制台 */
.lab-toolbar { flex-wrap: wrap; }
.lab-file { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.lab-file i { color: #9fb4c4; font: 11px/1.2 "PingFang SC", sans-serif; font-style: normal; }
.lab-file-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-tool-btn { border: 1px solid #607d96; border-radius: 3px; background: #17334f; color: #e4edf4; padding: 6px 9px; font-size: 12px; line-height: 1.1; }
.lab-tool-btn:hover { border-color: var(--mint); color: var(--mint); }
.lab-tool-btn:disabled { opacity: .5; cursor: not-allowed; }
.lab-data-files { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; border: 1px solid #48617a; border-top: 0; padding: 8px 10px; color: #a9bdcc; font-size: 12px; background: #0e2338; }
.lab-data-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 5px 4px 8px; border-radius: 99px; background: #244361; }
.lab-data-chip code { color: #e7f0f5; }
.lab-data-chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: #afc2d1; font-size: 16px; }
.lab-data-chip button:hover { background: #ee6d54; color: white; }
.python-shell { margin-top: 21px; border: 1px solid #48617a; border-radius: 4px; overflow: hidden; background: #0a1929; }
.shell-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 13px; border-bottom: 1px solid #365169; background: #122b43; }
.shell-heading > div { display: grid; gap: 3px; }
.shell-heading strong { color: #edf6ef; font-size: 14px; }
.shell-heading span { color: #9fb4c4; font-size: 11px; }
.shell-log { min-height: 128px; max-height: 250px; overflow: auto; margin: 0; padding: 13px 15px; color: #dce9f2; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.shell-log > span { display: block; min-height: 1.4em; }
.shell-command { color: #dff36e; margin-top: 7px; }
.shell-output { color: #edf6ef; }
.shell-error { color: #ffac95; }
.shell-system { color: #91a8ba; }
.shell-compose { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; gap: 9px; padding: 10px 12px; border-top: 1px solid #365169; background: #10243a; }
.shell-compose label { color: var(--mint); padding-top: 9px; font: 14px ui-monospace, monospace; font-weight: 800; }
.shell-compose textarea { min-height: 52px; resize: vertical; border: 1px solid #57728a; border-radius: 3px; padding: 8px 10px; outline: 0; background: #0b1b2d; color: #edf6ef; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.shell-compose textarea:focus { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint); }
.shell-compose .primary-btn { align-self: stretch; }
.shell-variables { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 9px 12px; border-top: 1px solid #29445b; color: #8fa6b8; font-size: 11px; }
.shell-variables code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 7px; border-radius: 3px; background: #17334f; color: #dce9f2; }
@media (max-width: 900px) { .lab-example-select { margin-left: 0; }.shell-compose { grid-template-columns: auto minmax(0, 1fr); }.shell-compose .primary-btn { grid-column: 2; }.lab-file { width: 100%; justify-content: space-between; } }

/* 链表课：真实执行状态驱动的逻辑链 + 物理存储 */
.linked-list-viz { margin-top: 21px; border: 1px solid #527089; border-radius: 4px; overflow: hidden; background: #10243a; }
.linked-viz-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-bottom: 1px solid #3c5870; background: #17334f; }
.linked-viz-heading > div:first-child { display: grid; gap: 3px; }
.linked-viz-heading strong { color: #f0f6f8; font-size: 15px; }
.linked-viz-heading span { color: #a8bccb; font-size: 11px; }
.linked-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.linked-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.linked-legend i { width: 11px; height: 11px; border-radius: 2px; background: #244361; }
.linked-legend i.changed { background: #dff36e; }
.linked-legend i.unreachable { background: #607386; opacity: .55; }
.linked-teaching-note { padding: 10px 14px; border-bottom: 1px solid #304b62; color: #dce8ef; background: #0e2135; font-size: 13px; line-height: 1.6; }
.linked-chain { display: flex; align-items: center; min-height: 120px; overflow-x: auto; padding: 18px 14px; }
.linked-head, .linked-terminal { flex: 0 0 auto; display: grid; place-items: center; min-width: 72px; min-height: 57px; padding: 8px 10px; border: 1px solid #658097; border-radius: 4px; color: #dce8ef; background: #0b1b2d; }
.linked-head span { color: #9eb3c3; font-size: 10px; }.linked-head b { color: var(--mint); font: 19px ui-monospace, monospace; }
.linked-head.changed { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(223,243,110,.16); }
.linked-node { flex: 0 0 auto; width: 118px; overflow: hidden; border: 1px solid #68839a; border-radius: 4px; background: #0b1b2d; }
.linked-node > span { display: block; padding: 5px 8px; color: #9db2c2; background: #17334f; font: 10px ui-monospace, monospace; }
.linked-node > div { display: grid; grid-template-columns: minmax(0, 1fr) 38px; min-height: 52px; }
.linked-node b, .linked-node code { display: grid; place-items: center; min-width: 0; padding: 7px; color: #f1f6f8; overflow: hidden; text-overflow: ellipsis; }
.linked-node b { font-size: 14px; }.linked-node code { border-left: 1px solid #526d84; color: #a4d7f5; font-size: 13px; }
.linked-node.changed { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(223,243,110,.2); }
.linked-node.changed > span { color: var(--ink); background: var(--mint); }
.linked-arrow { flex: 0 0 auto; padding: 0 7px; color: var(--mint); font: 22px ui-monospace, monospace; }
.linked-terminal { min-width: 82px; color: #9fb4c4; font: 12px ui-monospace, monospace; }.linked-terminal.invalid { border-color: #ff8f76; color: #ffad99; }
.linked-memory-wrap { max-height: 270px; overflow: auto; border-top: 1px solid #3c5870; }
.linked-memory { width: 100%; border-collapse: collapse; color: #dce8ef; font-size: 12px; }
.linked-memory caption { padding: 9px 13px; text-align: left; color: #9fb4c4; background: #0e2135; }
.linked-memory th, .linked-memory td { border-top: 1px solid #29455c; padding: 8px 13px; text-align: left; }
.linked-memory th { position: sticky; top: 0; color: #a9bdcc; background: #17334f; }
.linked-memory tr.changed td { color: #f2f7cf; background: rgba(223,243,110,.08); }
.linked-memory tr.unreachable td { color: #7f92a2; background: rgba(96,115,134,.08); }
@media (max-width: 700px) { .linked-viz-heading { align-items: flex-start; flex-direction: column; }.linked-node { width: 104px; }.linked-arrow { padding-inline: 5px; } }
