/* WEB前端在线学习：延续主站目录式设计，增加高密度代码工作台 */
.web-hero { padding: 64px 0; background: var(--ink); color: var(--paper); }
.web-hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 72px; align-items: end; }
.web-hero .kicker { color: var(--yellow); }
.web-hero h1 { margin: 12px 0 24px; font-size: clamp(40px, 5vw, 70px); }
.web-hero .lede { color: oklch(0.92 0.01 220); }
.web-hero .btn { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.web-hero .btn.secondary { background: transparent; border-color: oklch(0.75 0.01 220); color: var(--paper); }
.web-hero-panel { padding: 28px 0 0; border-top: 1px solid oklch(0.75 0.01 220); }
.web-hero-panel > span { color: var(--yellow); font: 700 12px/1.4 var(--mono); letter-spacing: .12em; }
.web-hero-panel ol { margin: 18px 0; padding-left: 22px; }
.web-hero-panel li { padding: 8px 0; border-bottom: 1px solid oklch(0.75 0.01 220 / .25); }
.web-hero-panel p { margin: 18px 0 0; color: oklch(0.92 0.01 220); font-size: 13px; }
.web-metrics { border-bottom: 1px solid var(--line); }
.web-metrics .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.web-metrics span { padding: 24px; border-right: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.web-metrics span:last-child { border-right: 0; }
.web-metrics strong { display: block; color: var(--ink); font: 700 30px/1.2 var(--mono); }
.web-note { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.web-note strong { font-size: 14px; }
.web-note p { color: var(--muted); font-size: 12px; }
.web-code-page { padding: 32px 0 72px; }
.code-page-links { display: flex; gap: 18px; font-size: 13px; }
.code-page-links a { color: var(--blue); }
.code-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 20px 0 26px; border-bottom: 2px solid var(--ink); }
.code-heading h1 { margin: 8px 0 10px; font-size: clamp(32px, 4vw, 52px); }
.code-heading p { margin: 0; color: var(--muted); }
.demo-picker { display: flex; align-items: center; gap: 14px; padding: 18px 0; }
.demo-picker label { font-weight: 700; font-size: 14px; }
.demo-picker select { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
#runtime-badge { color: var(--teal); font: 700 12px/1.4 var(--mono); white-space: nowrap; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.editor-pane, .preview-pane { min-width: 0; }
.editor-pane { background: var(--ink); color: var(--paper); }
.preview-pane { background: var(--paper); border-left: 1px solid var(--line); }
.pane-head { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.editor-pane .pane-head { border-color: oklch(0.99 0.01 220 / .14); }
.pane-head span { color: var(--muted); font: 11px/1.4 var(--mono); }
.editor-pane .pane-head span { color: oklch(0.76 0.01 220); }
.pane-head h2 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.02em; }
.pane-head .dirty { color: var(--yellow); }
#run-status.error { color: var(--coral); }
.file-tabs { margin: 0; padding: 12px 14px 0; flex-wrap: nowrap; overflow-x: auto; }
.file-tab { flex: 0 0 auto; border-color: oklch(0.99 0.01 220 / .18); background: transparent; color: oklch(0.78 0.01 220); }
.file-tab.active { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.editor-meta { display: flex; justify-content: space-between; gap: 16px; padding: 12px 18px; color: oklch(0.72 0.01 220); font: 11px/1.4 var(--mono); }
#code-editor { display: block; width: 100%; height: 540px; resize: vertical; margin: 0; padding: 18px; border: 0; border-top: 1px solid oklch(0.99 0.01 220 / .12); border-radius: 0; outline-offset: -4px; background: var(--ink); color: oklch(0.93 0.01 220); caret-color: var(--yellow); font: 13px/1.7 var(--mono); tab-size: 2; white-space: pre; overflow: auto; }
.editor-help { padding: 12px 18px; color: oklch(0.72 0.01 220); font-size: 11px; }
.run-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.run-toolbar .btn { min-height: 44px; }
#preview { display: block; width: 100%; height: 480px; border: 0; background: white; }
.console-head { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; }
.console-head span { color: var(--muted); font-family: var(--mono); }
.console-output { height: 136px; overflow: auto; padding: 10px 16px; background: var(--soft); font: 12px/1.6 var(--mono); }
.console-output p { margin: 0 0 7px; overflow-wrap: anywhere; }
.console-empty { color: var(--muted); }
.console-line.warn { color: #8a5700; }
.console-line.error { color: #a4252a; }
.run-guide { display: grid; grid-template-columns: 1fr 1.5fr; gap: 48px; padding: 48px 0 20px; }
.run-guide h2 { margin-top: 8px; font-size: 28px; }
.run-guide ol { margin: 0; padding-left: 22px; }
.run-guide li { padding: 10px 0; }
.run-guide li strong, .run-guide li span { display: block; }
.run-guide li span, #runtime-note { color: var(--muted); font-size: 13px; }
#runtime-note { grid-column: 1 / -1; margin: 0; padding-top: 18px; border-top: 1px solid var(--line); }
.answer-sheet { max-width: 1000px; margin: auto; }
.answer-section { padding: 32px 0; border-bottom: 1px solid var(--line); }
.answer-section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 20px; }
.answer-section-head span { color: var(--task-color); font: 700 12px/1.4 var(--mono); }
.answer-section-head h2 { margin: 0; font-size: 26px; }
.answer-item { border-top: 1px solid var(--line); }
.answer-item:last-child { border-bottom: 1px solid var(--line); }
.answer-item summary { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; align-items: center; min-height: 58px; cursor: pointer; }
.answer-item summary span { color: var(--muted); font: 13px/1.4 var(--mono); }
.answer-item summary i { color: var(--blue); font-size: 12px; font-style: normal; }
.answer-item p { margin: 0; padding: 0 0 22px 106px; color: var(--muted); }
.practice-answer h3 { margin: 26px 0 10px; font-size: 18px; }
.practice-answer > p, .practice-answer li { line-height: 1.75; }
.practice-demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.practice-demos a { padding: 18px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.practice-demos a:hover { border-color: var(--task-color); }
.practice-demos strong, .practice-demos span, .practice-demos b { display: block; }
.practice-demos span { margin: 6px 0 14px; color: var(--muted); font-size: 12px; }
.practice-demos b { color: var(--task-color); font-size: 13px; }
.answer-note { padding: 16px; background: var(--soft); font-size: 13px; }
@media (max-width: 1024px) {
  .web-hero-grid { gap: 40px; }
  .workbench { grid-template-columns: 1fr; }
  .preview-pane { border-left: 0; border-top: 1px solid var(--line); }
  #code-editor { height: 440px; }
}
@media (max-width: 768px) {
  .web-hero { padding: 44px 0; }
  .web-hero-grid, .run-guide { grid-template-columns: 1fr; }
  .web-hero-grid { gap: 36px; }
  .web-metrics .container { grid-template-columns: 1fr 1fr; }
  .web-metrics span:nth-child(2) { border-right: 0; }
  .web-metrics span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .code-heading { align-items: flex-start; flex-direction: column; }
  .demo-picker { align-items: stretch; flex-direction: column; }
  #runtime-badge { white-space: normal; }
  .run-guide { gap: 16px; }
  .practice-demos { grid-template-columns: 1fr; }
  .answer-item summary { grid-template-columns: 64px 1fr; gap: 10px; }
  .answer-item summary i { display: none; }
  .answer-item p { padding-left: 74px; }
}
@media (max-width: 480px) {
  .web-metrics span { padding: 18px 12px; }
  .web-code-page { padding-top: 24px; }
  .code-page-links { width: 100%; justify-content: space-between; }
  .pane-head { padding: 14px; }
  .run-toolbar .btn { flex: 1 1 calc(50% - 8px); padding-inline: 8px; }
  #preview { height: 430px; }
  #code-editor { height: 400px; font-size: 12px; }
  .answer-section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
}
@media print {
  .demo-picker, .workbench, .run-guide, .code-page-links { display: none !important; }
  .answer-item { break-inside: avoid; }
  .answer-sheet { max-width: none; }
  .answer-section { break-inside: auto; }
}

/* 连续学习路径与完整题目：任务书和答案页共用清晰层级 */
.bridge-panel { margin: 0; padding: 20px 22px; border-left: 5px solid var(--task-color); background: var(--soft); color: var(--ink); line-height: 1.85; }
.term-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.term-list li { padding: 14px 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); line-height: 1.7; }
.next-chapter-note { margin: 0; padding: 20px 22px; border-radius: 7px; background: var(--ink); color: var(--paper); line-height: 1.85; }
.answer-body { padding: 0 0 26px 106px; }
.answer-body .question-stem { margin: 0 0 14px; padding: 0; color: var(--ink); font-weight: 700; line-height: 1.75; }
.answer-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.answer-options li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); line-height: 1.55; }
.answer-options li span { min-width: 0; overflow-wrap: anywhere; }
.answer-options li strong { flex: 0 0 auto; color: var(--teal); font-size: 11px; }
.answer-options .correct-option { border-color: var(--teal); background: oklch(0.96 0.025 175); color: var(--ink); }
.answer-body .answer-explanation { margin: 0; padding: 16px 18px; background: var(--soft); color: var(--muted); line-height: 1.8; }
.answer-explanation strong { color: var(--task-color); }
@media (max-width: 768px) {
  .answer-body { padding-left: 74px; }
  .answer-options { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .bridge-panel, .next-chapter-note { padding: 16px; }
  .answer-body { padding-left: 0; }
}
@media print {
  .answer-body { padding-left: 0; }
  .answer-options { grid-template-columns: 1fr 1fr; }
}
