/* ============================================================
   Capynana 教学营 · 课程正文组件（第 2–6 课）
   依赖 style.css 的变量，勿单独使用
   ============================================================ */

.article { min-width: 0; }
section.chapter { padding-top: 0; }

/* ---------- 标题里的编号 ---------- */
.article h2 .num {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 32px; padding: 0 8px;
  border-radius: 9px;
  background: var(--accent); color: #4a3300;
  font-size: 15px; font-family: var(--font-mono); font-weight: 800;
}
.article h3 .num {
  color: var(--leaf); font-weight: 800; margin-right: 4px;
  font-family: var(--font-mono); font-size: .92em;
}

/* ---------- 导语 ---------- */
.article .lead {
  font-size: 17.5px; line-height: 1.9; color: var(--text-2);
  margin: 16px 0 20px;
}

/* ---------- 高亮 ---------- */
.article mark.hl {
  background: linear-gradient(transparent 58%, var(--accent-soft) 58%);
  color: inherit; font-weight: 700; padding: 0 2px;
}
[data-theme="dark"] .article mark.hl {
  background: linear-gradient(transparent 58%, rgba(255, 209, 92, .22) 58%);
  color: var(--text);
}

/* ---------- 表格 ---------- */
.table-wrap table {
  width: 100%; border-collapse: collapse;
  font-size: 14.5px; background: var(--surface);
}
.table-wrap th {
  background: var(--surface-2); text-align: left; font-weight: 700;
  padding: 11px 15px; border-bottom: 1px solid var(--border);
  white-space: nowrap; color: var(--text);
}
.table-wrap td {
  padding: 11px 15px; border-bottom: 1px solid var(--border);
  vertical-align: top; color: var(--text-2); line-height: 1.7;
}
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap td strong { color: var(--text); }
.table-wrap td .q { color: var(--text); font-weight: 600; }
.table-wrap td .letter {
  font-family: var(--font-mono); font-weight: 800;
  color: var(--accent-ink); font-size: 16px;
}

/* ---------- 提示框 ---------- */
.note {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 15px 18px; margin: 22px 0;
  font-size: 15px; line-height: 1.85;
}
.note .note-icon { font-size: 17px; line-height: 1.7; flex: none; }
.note p { margin: 0; color: var(--text); }
.note .note-title { font-weight: 800; color: var(--accent-ink); }
.note.note-blue { background: var(--leaf-soft); }
.note.note-blue .note-title { color: var(--leaf-ink); }
/* 香蕉豚老师的大白话：沿用 .note 的排版，只把头像和标题换成第 1 课的识别色 */
.note.note-banana {
  background: var(--surface-2);
  border: 1px solid var(--border);
  gap: 14px;
  align-items: flex-start;
}
.note.note-banana .note-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 2px solid var(--accent);
  background: #fdf8ee;
}
.note.note-banana .note-title { display: block; margin-bottom: 2px; }
[data-theme="dark"] .note .note-title { color: var(--accent); }
[data-theme="dark"] .note.note-blue .note-title { color: var(--leaf-ink); }

/* ---------- 左右对比 ---------- */
.vs { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 22px 0; }
@media (min-width: 720px) { .vs { grid-template-columns: 1fr 1fr; } }
.vs-card {
  border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid var(--border); background: var(--surface);
}
.vs-card.bad { background: var(--danger-soft); border-color: transparent; }
.vs-card.good { background: var(--leaf-soft); border-color: transparent; }
.vs-card .vs-head {
  font-weight: 800; margin-bottom: 8px; font-size: 14.5px;
  display: flex; align-items: center; gap: 7px;
}
.vs-card.bad .vs-head { color: var(--danger); }
.vs-card.good .vs-head { color: var(--leaf-ink); }
.vs-card p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.8; color: var(--text-2); }
.vs-card p:last-child { margin-bottom: 0; }
.vs-card p.q { color: var(--text); font-weight: 700; }
[data-theme="dark"] .vs-card p { color: var(--text-2); }
[data-theme="dark"] .vs-card p.q { color: var(--text); }

/* ---------- 代码 / 提示词块 ---------- */
.codeblock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 22px 0; overflow: hidden;
  box-shadow: var(--shadow);
}
.codeblock .code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.codeblock .code-lang {
  font-size: 12px; font-family: var(--font-mono); font-weight: 700;
  color: var(--text-3); letter-spacing: .5px;
}
.copy-btn {
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--leaf-ink); background: var(--leaf-soft);
  border: 1px solid transparent; border-radius: 999px;
  padding: 3px 12px; cursor: pointer; transition: all .15s;
}
.copy-btn:hover { border-color: var(--leaf); }
.copy-btn.copied { background: var(--leaf); color: #fff; }
.codeblock pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.85;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
}
[data-theme="dark"] .codeblock pre { color: var(--text); }

/* ---------- 清单 ---------- */
.checklist {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 20px; margin: 20px 0;
  background: var(--surface); box-shadow: var(--shadow);
}
.checklist label {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 15px; line-height: 1.7; color: var(--text-2);
}
.checklist label:last-child { border-bottom: none; }
.checklist input {
  width: 18px; height: 18px; margin-top: 3px;
  accent-color: var(--leaf); flex: none; cursor: pointer;
}
.checklist input:checked + .check-text { color: var(--text-3); text-decoration: line-through; }

/* ---------- 结尾金句 ---------- */
.final {
  background: var(--leaf); color: #fff;
  border-radius: var(--radius); padding: 26px 28px;
  margin: 28px 0 0; text-align: center;
  box-shadow: var(--shadow);
}
.final p { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.8; color: #fff; }
.final p b { color: var(--accent); }

/* ---------- 漏斗图 ---------- */
.funnel { margin: 26px 0 8px; }
.funnel-band { text-align: center; padding: 14px 0 16px; }
.funnel-band .f-title { font-size: 15px; font-weight: 700; line-height: 1.4; color: #4a3300; }
.funnel-band .f-cue { font-size: 12.5px; margin-top: 3px; line-height: 1.4; color: #6b5b3e; }
.funnel-cap { text-align: center; font-size: 13px; color: var(--text-3); margin: 12px 0 0; }
@media (max-width: 640px) {
  .funnel-band { padding: 11px 0 12px; }
  .funnel-band .f-title { font-size: 13px; }
  .funnel-band .f-cue { display: none; }
}

/* ---------- 上下课导航补丁 ---------- */
.doc-nav .next.disabled {
  display: block; opacity: .45; pointer-events: none;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 14px 16px; text-align: right;
}
.doc-nav .next.disabled .dn-title { font-weight: 700; font-size: 15px; margin-top: 2px; display: block; }

/* ---------- 对话实录卡 ---------- */
.chat {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  margin: 22px 0; background: var(--surface); box-shadow: var(--shadow);
}
.chat-head {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.chat-head img { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-strong); }
.chat-name { font-size: 13px; font-weight: 700; color: var(--text); }
.chat-name small { font-weight: 400; color: var(--text-3); font-size: 11.5px; margin-left: 6px; }
.chat-meta { margin-left: auto; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.chat-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.bub {
  max-width: 88%; border-radius: 13px; padding: 11px 14px;
  font-size: 14px; line-height: 1.8; color: var(--text);
}
.bub .who {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; margin-bottom: 4px;
}
.bub .who .copy-btn { font-size: 11.5px; padding: 2px 10px; }
.bub pre {
  margin: 0; font-family: inherit; font-size: inherit;
  white-space: pre-wrap; word-break: break-word;
}
.bub.user {
  align-self: flex-end; background: var(--accent-soft);
  border: 1px solid var(--border); border-bottom-right-radius: 4px;
}
.bub.user .who { color: var(--accent-ink); justify-content: flex-end; }
.bub.ai {
  align-self: flex-start; background: var(--surface-2);
  border: 1px solid var(--border); border-bottom-left-radius: 4px;
  color: var(--text-2);
}
.bub.ai .who { color: var(--leaf-ink); }
.bub .att {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 5px 11px; border-radius: 8px;
  background: var(--leaf-soft); color: var(--leaf-ink);
  font-size: 12.5px; font-weight: 600;
}
@media (max-width: 640px) { .bub { max-width: 96%; } }

/* ---------- 配图 ---------- */
.article .figure { margin: 24px 0 8px; }
.article .figure img {
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); display: block; width: 100%; height: auto;
}
.article .fig-caption { font-size: 13px; color: var(--text-3); margin-top: 8px; text-align: center; }

/* ---------- 示意图 ---------- */
.dg { margin: 26px 0; padding: 18px 18px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.dg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.dg-tag { font-size: 12px; font-weight: 800; color: var(--text-3); min-width: 66px; letter-spacing: .5px; }
.dg-tag.hot { color: var(--accent-ink); }
.dg-chip { font-size: 13.5px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); line-height: 1.4; }
.dg-chip.hot { background: var(--accent-soft); border-color: #efd9a2; color: var(--accent-ink); font-weight: 700; }
.dg-chip.cool { background: var(--leaf-soft); border-color: #cfe6de; color: var(--leaf-ink); font-weight: 700; }
.dg-arrow { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.dg-note { font-size: 12.5px; color: var(--text-3); margin-left: auto; }
.dg-cap { font-size: 13px; color: var(--text-3); margin: 10px 0 2px; text-align: center; }
.dg-layers { display: flex; flex-direction: column; gap: 8px; }
.dg-layer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); }
.dg-layer:nth-child(2) { border-left-color: var(--leaf); }
.dg-layer:nth-child(3) { border-left-color: var(--brown); }
.dg-layer b { font-family: var(--font-mono); font-size: 13.5px; min-width: 52px; color: var(--text); }
.dg-layer span { font-size: 13.5px; color: var(--text-2); flex: 1; }
.dg-layer em { font-size: 12.5px; color: var(--text-3); font-style: normal; text-align: right; }
@media (max-width: 640px) {
  .dg-note { margin-left: 0; width: 100%; }
  .dg-layer em { display: none; }
}

/* ---------- 工具卡（AIGC 产品对比） ---------- */
.tool-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin: 20px 0; }
.tool-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.tool-logo { font-size: 21px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--border); flex: none; }
.tool-name { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1.3; }
.tool-sub { font-size: 12.5px; color: var(--text-3); }
.tool-tag { margin-left: auto; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf-ink); white-space: nowrap; }
.tool-body { padding: 14px 16px 16px; }
.tool-body > p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.85; color: var(--text-2); }
.tool-body > p:last-child { margin-bottom: 0; }
.tool-sec { font-size: 12.5px; font-weight: 800; color: var(--accent-ink); margin: 14px 0 6px; letter-spacing: .3px; }
.tool-sec:first-child { margin-top: 0; }
.tool-steps { margin: 0; padding-left: 20px; }
.tool-steps li { font-size: 14px; line-height: 1.8; color: var(--text-2); margin-bottom: 5px; }
.tool-steps li strong { color: var(--text); }
.tool-url { font-size: 12.5px; color: var(--text-3); margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.tool-url a { color: var(--leaf); font-weight: 700; text-decoration: none; }
.tool-url a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .tool-tag { margin-left: 0; width: 100%; }
}

/* ---------- 课件预览灯箱（第 3 课练习用） ---------- */
.demo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px 8px 0 0; padding: 9px 15px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 14px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.demo-btn:hover { border-color: var(--leaf); color: var(--leaf-ink); }
.demo-lightbox {
  position: fixed; inset: 0; z-index: 12000;
  display: none; flex-direction: column;
  background: rgba(18, 15, 8, .78);
}
.demo-lightbox.show { display: flex; }
.dl-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dl-title { font-weight: 800; font-size: 15px; color: var(--text); }
.dl-tab {
  margin-left: auto; font-size: 13px; color: var(--leaf-ink);
  text-decoration: none; font-weight: 700;
}
.dl-close {
  border: 0; background: none; color: var(--text-2);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px;
}
.dl-frame-wrap { flex: 1; background: #fff; }
#dlFrame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
