/* ===== 积木专用样式 blocks.css ===== */

/* 积木通用 */
.block { margin: 22px 0; }
.block-with-explain { position: relative; }
.explain-btn {
  position: absolute; top: 2px; right: -6px;
  border: none; background: transparent; cursor: pointer;
  color: #C4C9D4; font-size: 14px; padding: 4px 6px;
  border-radius: 6px; opacity: 0; transition: opacity .15s ease, color .15s ease;
}
.block-with-explain:hover .explain-btn { opacity: 1; }
.explain-btn:hover { color: var(--subject); background: rgba(0,0,0,.05); }

/* intro 章节导览 */
.b-intro {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--subject);
  border-radius: var(--radius-card); padding: 22px 26px;
}
.b-intro .summary { font-size: 15px; margin: 0 0 14px; }
.b-intro h5 { margin: 10px 0 6px; font-size: 13px; color: var(--subject); letter-spacing: 1px; }
.b-intro ul { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-soft); }

/* section 分节横幅：明显的「一节一停顿」分割感 */
.b-section {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-serif); font-size: 24px;
  margin: 72px 0 24px; padding: 16px 20px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--subject) 16%, transparent),
    color-mix(in srgb, var(--subject) 4%, transparent) 70%,
    transparent);
  border-left: 4px solid var(--subject);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}
.b-section .sec-chip {
  flex: none;
  min-width: 52px; padding: 6px 10px;
  background: var(--subject); color: #fff;
  border-radius: 8px; text-align: center;
  font-family: var(--font-sans); font-size: 15px; font-weight: 700;
  letter-spacing: .5px;
}
.b-section .sec-title { flex: 1; }
/* 节横幅上的「讨论本节」AI 入口 */
.sec-discuss {
  flex: none; font-size: 12.5px; cursor: pointer;
  color: var(--subject); background: rgba(255,255,255,.75);
  border: 1px solid color-mix(in srgb, var(--subject) 45%, transparent);
  border-radius: 999px; padding: 4px 12px; white-space: nowrap;
}
.sec-discuss:hover { background: var(--subject); color: #fff; }
@media (max-width: 640px) {
  .b-section {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 8px 10px;
    margin: 52px 0 20px;
    padding: 14px 12px;
    font-size: 20px;
    line-height: 1.55;
  }
  .b-section .sec-title { min-width: 0; }
  .b-section .sec-discuss {
    grid-column: 2;
    justify-self: start;
  }
}
/* 选中文字后浮出的「问 AI」按钮 */
.sel-pop {
  position: absolute; z-index: 1200; transform: translateX(-50%);
  font-size: 13px; cursor: pointer; white-space: nowrap;
  color: #fff; background: var(--subject, #EF4444);
  border: none; border-radius: 999px; padding: 7px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.sel-pop:hover { filter: brightness(1.08); }
/* 作业段的横幅（图标式 chip） */
.b-section-hw .sec-chip { font-size: 20px; min-width: 44px; }
.b-homework-wrap { margin-top: 8px; }
/* 苏格拉底追问子横幅：作业区内的特色板块（与目录 toc-soc 同风格渐变） */
.b-section-soc {
  display: flex; align-items: center; gap: 12px;
  margin: 48px 0 20px; padding: 14px 18px;
  font-family: var(--font-serif); font-size: 20px; color: #fff;
  background: linear-gradient(120deg, #F59E0B, var(--subject));
  border-radius: var(--radius-card);
  box-shadow: 0 6px 18px rgba(239, 68, 68, .28);
}
.b-section-soc .sec-chip {
  flex: none; min-width: 44px; padding: 6px 10px;
  background: rgba(255, 255, 255, .22); color: #fff;
  border-radius: 8px; text-align: center; font-size: 18px;
}
.b-section-soc .sec-title { flex: 1; }
.b-section-soc .soc-avatar {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: #FFF7ED; border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  font-size: 26px;   /* 🦉 徽章 */
}
/* PPT 侧栏展示：保留品牌识别，压缩横幅高度，让核心问题进入首屏。 */
.b-section-soc.soc-presentation-head {
  margin-bottom: 12px; padding: 10px 16px; gap: 10px;
  font-size: 18px; border-radius: 12px;
  box-shadow: 0 5px 14px rgba(124, 58, 237, .20);
}
.b-section-soc.soc-presentation-head .soc-avatar {
  width: 38px; height: 38px; font-size: 22px;
}

/* text 正文 */
.b-text { font-size: 15.5px; }
.b-text p { margin: 0 0 10px; }

/* formula 独立公式 */
.b-formula {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 18px 20px;
  text-align: center; overflow-x: auto;
}
.b-formula .f-label { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-soft); }

/* callout 重点批注 */
.b-callout {
  border-radius: var(--radius-card); padding: 14px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--co, #3B82F6); font-size: 14.5px;
}
.b-callout .co-title { font-weight: 700; margin-bottom: 4px; color: var(--co, #3B82F6); }
.b-callout.co-info, .b-callout.co-note { --co: #3B82F6; }
.b-callout.co-warn, .b-callout.co-warning { --co: #F59E0B; }
.b-callout.co-key, .b-callout.co-danger { --co: #EF4444; }
.b-callout.co-tip { --co: #10B981; }
.b-callout.co-example { --co: #7C3AED; }

/* table 对比表格 */
.b-table { overflow-x: auto; }
.b-table table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius-card); overflow: hidden; font-size: 14px;
  box-shadow: 0 1px 3px rgba(15,26,46,.06);
}
.b-table th {
  background: var(--hero-bg); color: #fff; font-weight: 600;
  padding: 10px 14px; text-align: left; white-space: nowrap;
}
.b-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.b-table caption { caption-side: bottom; padding: 8px; color: var(--ink-soft); font-size: 13px; }

/* figure 图示 */
.b-figure { text-align: center; }
.b-figure img, .b-figure svg { max-width: 100%; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.b-figure figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

/* divider */
.b-divider { border: none; border-top: 1px dashed var(--line); margin: 36px 0; }

/* ===== 交互组 ===== */
/* simulation 仿真 */
.b-sim {
  background: #111C30; border-radius: var(--radius-sim);
  padding: 18px; color: #E5E7EB;
}
.b-sim .sim-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.b-sim .sim-title { font-weight: 700; font-size: 16px; }
.b-sim .sim-hint { color: #8B95A7; font-size: 13px; }
.b-sim .sim-body { display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 16px; }
@media (max-width: 860px) { .b-sim .sim-body { grid-template-columns: minmax(0,1fr); } }
.b-sim canvas.sim-canvas { width: 100%; background: #0B1424; border-radius: 10px; display: block; touch-action: none; }
.sim-panel { font-size: 13px; }
.sim-panel label { display: block; color: #9CA3AF; margin: 10px 0 4px; }
.sim-panel input[type=range] { width: 100%; accent-color: var(--subject); }
.sim-panel select, .sim-panel .seg { width: 100%; background: #0B1424; color: #E5E7EB; border: 1px solid #263349; border-radius: 6px; padding: 6px 8px; }
.sim-readouts { margin-top: 14px; border-top: 1px solid #263349; padding-top: 10px; font-family: var(--font-mono); font-size: 12.5px; }
.sim-readouts .row { display: flex; justify-content: space-between; padding: 2px 0; }
.sim-readouts .val { color: #7DD3FC; }

/* socratic 苏格拉底讨论 */
.b-socratic {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 20px 22px;
}
.b-socratic h4 { margin: 0 0 4px; font-family: var(--font-serif); font-size: 18px; }
.b-socratic .soc-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 14px; }
.soc-log-note {
  margin: -4px 0 14px; padding: 7px 10px;
  border-radius: 7px; background: #F5F7FA; color: var(--ink-soft);
  font-size: 12px; line-height: 1.55;
}
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.soc-session { font-size: 13.5px; font-weight: 700; color: var(--subject); margin: 14px 0 8px; padding-left: 10px; border-left: 3px solid var(--subject); }
.topic-chip {
  border: 1px solid var(--line); background: #FAFAFC; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.topic-chip:hover { border-color: var(--subject); color: var(--subject); }
.topic-chip.active { background: var(--subject); border-color: var(--subject); color: #fff; }
/* 课堂展示：适合截取后放在 PPT 一侧，清楚呈现话题入口和递进问题。 */
.b-socratic.soc-presentation-side {
  padding: 14px 16px 16px; border-color: #DDD6FE;
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFAFF 100%);
  box-shadow: 0 4px 16px rgba(76, 29, 149, .07);
}
.soc-presentation-side .soc-sub {
  margin: 0 0 8px; padding: 8px 11px;
  border-radius: 8px; background: #F5F3FF; color: #4C1D95;
  font-size: 13.5px; line-height: 1.55;
}
.soc-presentation-side .soc-session {
  margin: 8px 0 9px; padding-left: 9px;
  font-size: 14px; line-height: 1.45;
}
.soc-presentation-side .topic-chips {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; margin-bottom: 10px;
}
.soc-presentation-side .topic-chip {
  width: 100%; min-height: 46px; padding: 7px 11px; border-radius: 9px;
  border-color: #C4B5FD; background: #fff; color: #4C1D95;
  font-size: 13.5px; font-weight: 700; line-height: 1.35; text-align: left;
}
.soc-presentation-side .topic-chip::before {
  content: '讨论'; display: inline-block; margin-right: 6px; padding: 1px 5px;
  border-radius: 4px; background: #EDE9FE; color: #6D28D9;
  font-size: 10px; vertical-align: 1px;
}
.soc-presentation-side .topic-chip:last-child::before { content: '课后'; }
.soc-presentation-side .topic-chip.active {
  border-color: #7C3AED; color: #fff;
  background: linear-gradient(120deg, #6D28D9, #8B5CF6);
  box-shadow: 0 4px 12px rgba(124, 58, 237, .20);
}
.soc-presentation-side .topic-chip.active::before {
  background: rgba(255,255,255,.20); color: #fff;
}
.soc-presentation-side .chat-box {
  height: 348px; border-color: #DDD6FE; background: #fff;
}
.soc-presentation-side .chat-msgs { padding: 12px 14px; }
.soc-presentation-side .chat-msg {
  max-width: 96%; margin-bottom: 10px; font-size: 14.5px; line-height: 1.62;
}
.soc-presentation-side .chat-msg .bubble { padding: 11px 14px; border-radius: 10px; }
.soc-presentation-side .chat-msg:first-child.user {
  max-width: 100%; margin: 0;
}
.soc-presentation-side .chat-msg:first-child.user .bubble {
  padding: 13px 15px; border: 1px solid #DDD6FE; border-left: 5px solid #7C3AED;
  border-radius: 8px; background: #FAF8FF; color: #1F2937;
  box-shadow: none;
}
.soc-presentation-side .chat-tools { padding-bottom: 8px; }
@media (max-width: 640px) {
  .b-socratic.soc-presentation-side { padding: 14px 12px; }
  .soc-presentation-side .topic-chips { grid-template-columns: 1fr; }
  .soc-presentation-side .soc-session { font-size: 14px; }
  .soc-presentation-side .topic-chip { font-size: 14px; }
  .soc-presentation-side .chat-msg { font-size: 14px; }
}
.soc-activity {
  margin: 10px 0 16px; padding: 18px;
  border: 1px solid color-mix(in srgb, var(--subject) 32%, var(--line));
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--subject) 7%, #fff), #fff 58%);
}
.soc-activity-kicker {
  display: inline-block; margin-bottom: 6px; padding: 3px 9px;
  border-radius: 999px; background: var(--subject); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
}
.soc-activity .soc-activity-title { margin: 2px 0 8px; font-size: 18px; line-height: 1.55; }
.soc-activity-context { margin: 0 0 14px; color: var(--ink-soft); font-size: 13.5px; }
.soc-data-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.soc-data-table { width: 100%; min-width: 600px; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
.soc-data-table th, .soc-data-table td { padding: 8px 9px; text-align: center; border: 1px solid var(--line); }
.soc-data-table thead th { background: #EAF1F7; color: var(--ink-soft); font-weight: 600; }
.soc-data-table tbody th { background: #F8FAFC; font-weight: 700; }
.soc-data-table td { font-family: var(--font-mono); font-weight: 600; }
.soc-swipe-hint { display: none; margin-top: 5px; color: #9CA3AF; font-size: 11.5px; }
.soc-formulas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.soc-formulas > div { padding: 11px 12px; border-radius: 9px; background: #F8FAFC; border: 1px solid var(--line); }
.soc-formulas span { display: block; margin-bottom: 4px; color: var(--ink-soft); font-size: 12px; }
.soc-formulas strong { font-family: var(--font-serif); font-size: 17px; font-weight: 600; }
.soc-final-prompt { margin-top: 12px; padding: 11px 13px; border-left: 3px solid #F59E0B; background: #FFFBEB; font-size: 13.5px; }
.soc-final-prompt strong { display: block; margin-bottom: 3px; color: #B45309; }
.soc-calc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.soc-calc-btn {
  border: 1px solid var(--subject); border-radius: 8px; padding: 8px 13px;
  background: var(--subject); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.soc-calc-btn:hover:not(:disabled) { filter: brightness(1.06); }
.soc-calc-btn:disabled { cursor: default; opacity: .55; }
.soc-calc-status { flex-basis: 100%; color: var(--ink-soft); font-size: 12px; }
@media (max-width: 640px) {
  .soc-activity { padding: 14px 12px; }
  .soc-swipe-hint { display: block; }
  .soc-formulas { grid-template-columns: 1fr; }
  .soc-calc-btn { width: 100%; }
}
.chat-box {
  border: 1px solid var(--line); border-radius: 10px; background: #FBFCFE;
  display: flex; flex-direction: column; height: 380px;
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; }
.chat-msg { margin-bottom: 12px; max-width: 88%; font-size: 14px; line-height: 1.7; }
.chat-msg .bubble { padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; }
.chat-msg.user { margin-left: auto; }
.chat-msg.user .bubble { background: var(--subject); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai .bubble { background: #EEF1F6; color: var(--ink); border-bottom-left-radius: 4px; }
.chat-msg .meta { font-size: 11px; color: #9CA3AF; margin: 3px 4px 0; }
.typing { color: #9CA3AF; font-size: 13px; padding: 4px 14px; font-style: italic; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; font-family: inherit;
}
.chat-input button {
  border: none; background: var(--subject); color: #fff;
  border-radius: 8px; padding: 0 16px; cursor: pointer; font-size: 14px;
}
.chat-tools { display: flex; gap: 10px; padding: 0 10px 10px; }
.chat-tools button {
  background: none; border: 1px dashed var(--line); color: var(--ink-soft);
  border-radius: 6px; font-size: 12px; padding: 4px 10px; cursor: pointer;
}
.chat-tools button:hover { color: var(--subject); border-color: var(--subject); }

/* ===== 媒体组统一外壳 ===== */
.b-media {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--subject);
  border-radius: var(--radius-card); overflow: hidden;
}
.b-media .media-head { padding: 12px 18px 0; font-weight: 600; font-size: 14.5px; }
.b-media .media-body { padding: 12px 18px; }
.b-media .media-cap { padding: 0 18px 14px; font-size: 13px; color: var(--ink-soft); }
.b-media .media-fallback {
  padding: 28px; text-align: center; color: #9CA3AF; font-size: 13px;
  background: #F3F4F6; border-radius: 8px;
}
.b-media video, .b-media audio { width: 100%; border-radius: 8px; }
.b-media iframe { width: 100%; border: none; border-radius: 8px; aspect-ratio: 16/9; background: #0B1424; }
.b-media .anim-host { min-height: 220px; }
.b-media canvas.anim-canvas { width: 100%; border-radius: 8px; background: #0B1424; display: block; }

/* gallery */
.gallery-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gallery-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .gallery-2col, .gallery-3col { grid-template-columns: 1fr; } }
.gallery-2col figure, .gallery-3col figure { margin: 0; }
.gallery-2col img, .gallery-3col img { width: 100%; border-radius: 8px; border: 1px solid var(--line); background:#fff; }
.gallery-2col figcaption, .gallery-3col figcaption { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin-top: 4px; }

/* 3d */
.d3-host { min-height: 320px; border-radius: 8px; overflow: hidden; background: #0B1424; }
.d3-host canvas { display: block; width: 100%; }

/* ===== 练习组 ===== */
/* example 例题 */
.b-example {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden;
}
.b-example summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 15px;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.b-example summary::before { content: "▸"; color: var(--subject); transition: transform .15s; }
.b-example[open] summary::before { transform: rotate(90deg); }
.b-example .ex-body { padding: 0 18px 16px; font-size: 14.5px; }
.b-example .ex-problem { background: #F8FAFC; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.b-example ol.steps { margin: 8px 0; padding-left: 22px; }
.b-example ol.steps li { margin-bottom: 8px; }
.b-example .ex-answer { border-left: 3px solid #10B981; background: #F0FDF6; padding: 10px 14px; border-radius: 0 8px 8px 0; }

/* homework 作业区 */
.b-homework {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 20px 22px;
}
.b-homework .hw-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.b-homework h4 { margin: 0; font-family: var(--font-serif); font-size: 18px; }
.hw-due { font-size: 12.5px; color: #B45309; background: #FEF3C7; padding: 2px 10px; border-radius: 999px; }
.hw-retry { font-size: 12.5px; color: var(--ink-soft); }
.hw-item { border: 1px solid var(--line); border-radius: 10px; margin: 14px 0; overflow: hidden; }
.hw-item summary { cursor: pointer; padding: 12px 16px; font-size: 14.5px; font-weight: 600; list-style: none; display:flex; gap:8px; align-items:center; }
.hw-item summary .qtype { font-size: 11px; font-weight: 600; color: #fff; background: var(--subject); border-radius: 4px; padding: 1px 7px; }
.hw-item summary::after { content: "展开作答 ▾"; margin-left: auto; font-size: 12px; color: #9CA3AF; font-weight: 400; }
.hw-item[open] summary::after { content: "收起 ▴"; }
.hw-item .hw-body { padding: 4px 16px 16px; font-size: 14.5px; }
.hw-opt { display: block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; cursor: pointer; }
.hw-opt:hover { border-color: var(--subject); }
.hw-opt input { margin-right: 8px; accent-color: var(--subject); }
.hw-fill-input, .hw-calc-input {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
  font-size: 14px; font-family: var(--font-mono); width: 160px;
}
.hw-deriv { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical; }
.hw-submit {
  border: none; background: var(--subject); color: #fff; border-radius: 8px;
  padding: 10px 26px; font-size: 14.5px; cursor: pointer; margin-top: 8px;
}
.hw-submit:disabled { opacity: .5; cursor: not-allowed; }
.hw-result { margin-top: 14px; border-radius: 10px; padding: 14px 16px; font-size: 14px; display: none; }
.hw-result.show { display: block; }
.hw-result.pass { background: #F0FDF6; border: 1px solid #BBF7D0; }
.hw-result.fail { background: #FEF2F2; border: 1px solid #FECACA; }
.hw-result .score-line { font-weight: 700; margin-bottom: 6px; }
.hw-result .rubric-row { display: flex; gap: 8px; font-size: 13px; padding: 3px 0; }
.hw-result .rubric-row .ok { color: #16A34A; }
.hw-result .rubric-row .no { color: #DC2626; }
.hw-result .ref { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--ink-soft); font-size: 13px; }
.hw-saved { font-size: 12px; color: #9CA3AF; margin-top: 6px; }
/* 作业说明条 */
.hw-note { font-size: 13px; color: var(--ink-soft); background: var(--card); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; margin-top: 8px; }
/* 分批作业 */
.hw-batch { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 18px 0 26px; background: color-mix(in srgb, var(--card) 60%, transparent); }
.hw-batch-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.hw-batch-head h5 { margin: 0; font-family: var(--font-serif); font-size: 16px; }
/* 过程输入区（计算题/推导题） */
.hw-process { margin-top: 10px; }
.hw-process-text { width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical; }
.hw-upload-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.hw-upload-btn { display: inline-block; cursor: pointer; font-size: 13px; color: var(--subject); border: 1px dashed var(--subject); border-radius: 8px; padding: 6px 12px; }
.hw-upload-btn:hover { background: color-mix(in srgb, var(--subject) 8%, transparent); }
.hw-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.hw-thumb { position: relative; display: inline-block; }
.hw-thumb img { height: 64px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.hw-thumb-rm { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: none; background: #DC2626; color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
/* 过程评判结果 */
.proc-review { margin-top: 8px; font-size: 13.5px; }
.proc-review.muted { color: var(--ink-soft); }
/* 参考答案折叠 */
.hw-ref { margin-top: 10px; }
.hw-ref summary { cursor: pointer; font-size: 13px; color: var(--subject); font-weight: 600; }
.hw-ref[open] summary { margin-bottom: 4px; }

/* ===== 段落级 AI 展开讲解 抽屉 ===== */
.explain-drawer-mask {
  position: fixed; inset: 0; background: rgba(15,26,46,.4);
  z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.explain-drawer-mask.open { opacity: 1; pointer-events: auto; }
.explain-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 92vw);
  background: #fff; z-index: 91; box-shadow: -8px 0 32px rgba(15,26,46,.18);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.explain-drawer.open { transform: none; }
.explain-drawer .ed-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.explain-drawer .ed-head h4 { margin: 0; font-size: 16px; font-family: var(--font-serif); flex: 1; }
.explain-drawer .ed-close { border: none; background: none; font-size: 20px; cursor: pointer; color: #9CA3AF; }
.explain-drawer .ed-context {
  margin: 12px 16px 0; padding: 10px 14px; background: #F8FAFC;
  border-left: 3px solid var(--subject); border-radius: 0 8px 8px 0;
  font-size: 13px; color: var(--ink-soft); max-height: 120px; overflow-y: auto;
}
.explain-drawer .ed-modes { display: flex; gap: 8px; padding: 12px 16px 0; }
.explain-drawer .ed-modes button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  font-size: 12.5px; padding: 5px 14px; cursor: pointer;
}
.explain-drawer .ed-modes button.active { background: var(--subject); border-color: var(--subject); color: #fff; }
.explain-drawer .chat-box { flex: 1; border: none; border-radius: 0; height: auto; min-height: 0; }

/* 课后练习子横幅：朴素卡片风，与苏格拉底渐变横幅区分 */
.b-section-ex {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--subject);
  box-shadow: 0 4px 12px rgba(15, 26, 46, .08);
}
