/* E04 · 人工智能简史 · 课程资料页通用样式（course-docs.css） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f7f5f0; color: #2d2d2d; line-height: 1.7; }
.doc { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; }

/* 顶部工具条 */
.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-top .back { font-size: 14px; font-weight: 700; color: #5b6ee8; text-decoration: none; padding: 8px 16px; border-radius: 40px; background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.dt-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-top .tag { font-size: 12px; font-weight: 700; color: #777; }
.pbtn { border: none; cursor: pointer; font-size: 13px; font-weight: 700; color: #3a5bd9; background: #fff; padding: 8px 14px; border-radius: 40px; box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.pbtn:hover { background: #eef2fc; }

/* 资料导航 */
.doc-nav { background: #fff; border-radius: 18px; padding: 12px; margin-bottom: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.05); }
.np-row { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.np-row::-webkit-scrollbar { height: 6px; }
.np-row::-webkit-scrollbar-thumb { background: #d8e0f4; border-radius: 6px; }
.np { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; white-space: nowrap; font-size: 11.5px; font-weight: 700; color: #4a5a86; background: #f4f7ff; border: 1px solid #e2e9fa; border-radius: 30px; padding: 5px 10px; text-decoration: none; }
a.np:hover { background: #e9efff; border-color: #c9d8f7; }
.np.on { color: #fff; background: linear-gradient(135deg, #5b6ee8, #8fa8ff); border-color: transparent; box-shadow: 0 6px 14px -8px #5b6ee8; }

/* 页头 */
.doc-hero { position: relative; background: linear-gradient(135deg, #5b6ee8, #8fa8ff); border-radius: 22px; color: #fff; padding: 26px 24px 22px; box-shadow: 0 16px 40px -18px #5b6ee8; margin-bottom: 16px; }
.doc-hero .kicker { font-size: 11.5px; font-weight: 800; letter-spacing: 2px; opacity: .9; }
.doc-hero h1 { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 27px; font-weight: 900; margin: 6px 0 8px; display: flex; align-items: center; gap: 10px; }
.doc-hero .hi { font-size: 26px; }
.doc-hero .lead { font-size: 14px; line-height: 1.85; opacity: .96; max-width: 900px; }
.doc-hero .meta { margin-top: 10px; font-size: 12px; opacity: .88; }

/* 区块 */
.sec { background: #fff; border-radius: 18px; padding: 20px 22px; margin-bottom: 14px; border: 1px solid rgba(0,0,0,.045); box-shadow: 0 5px 20px rgba(0,0,0,.045); }
.sec h2 { font-size: 18px; color: #0d2259; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sec h2 .si { font-size: 18px; }
.ssub { font-size: 12.5px; color: #8b93b0; margin-bottom: 8px; }
.sec h3 { font-size: 15px; color: #1c2a55; margin: 16px 0 6px; padding-left: 10px; border-left: 4px solid #8fa8ff; }
.sec h4 { font-size: 13.5px; color: #2a3a6b; margin: 12px 0 4px; }
.sec p { font-size: 13.5px; color: #3a4470; margin: 8px 0; }
.sec b { color: #0d2259; }
.sec code { background: #eef2fc; color: #2a3a6b; border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }

/* 列表 */
.ul, .ol, .ck { margin: 8px 0 8px 20px; }
.ul li, .ol li, .ck li { font-size: 13.5px; color: #3a4470; margin: 5px 0; line-height: 1.8; }
.ck { list-style: none; margin-left: 2px; }
.ck li { display: flex; gap: 8px; align-items: flex-start; }

/* 表格 */
.tw { overflow-x: auto; margin: 10px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid #e7ecf9; padding: 8px 10px; text-align: left; vertical-align: top; line-height: 1.7; color: #3a4470; }
th { background: #f0f4ff; color: #22305e; font-weight: 800; white-space: nowrap; }
tbody tr:nth-child(even) td { background: #fbfcff; }
table.kvt td:first-child { width: 130px; font-weight: 700; color: #22305e; background: #f8faff; white-space: nowrap; }
tbody td:first-child { white-space: nowrap; }
td.c, th.c { text-align: center; }

/* 提示框 */
.note { background: #f6f9ff; border: 1px dashed #cfddfc; border-radius: 12px; padding: 11px 14px; font-size: 12.5px; color: #3a4470; line-height: 1.9; margin: 10px 0; }
.note b { color: #0d2259; }
.note.warn { background: #fff9ef; border-color: #f3dcae; color: #6b5216; }
.note.ok { background: #f2fdf7; border-color: #bfe9d3; color: #1c6b47; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.cd { background: #f8faff; border: 1px solid #e6ecfb; border-radius: 14px; padding: 12px 14px; }
.cd h4 { margin: 0 0 4px; font-size: 13.5px; color: #22305e; }
.cd p { margin: 0; font-size: 12.5px; color: #4a5580; line-height: 1.8; }

/* 代码块 */
.code { background: #0f1a3c; color: #d7e3ff; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 12px; line-height: 1.75; font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace; margin: 10px 0; }

/* 逐字稿块 */
.sc { border: 1px solid #e7ecf9; border-radius: 14px; padding: 12px 16px; margin: 10px 0; background: #fcfdff; }
.sc h3 { border: none; padding: 0; margin: 0 0 6px; font-size: 14.5px; color: #22305e; }
.sc p { margin: 6px 0; font-size: 13px; color: #3a4470; line-height: 1.85; }
.sc .lb { display: inline-block; min-width: 92px; font-weight: 800; color: #5b6ee8; }

/* 素材包 */
.mgroup { margin: 14px 0 4px; }
.mgroup h3 { margin-bottom: 8px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mgrid figure { background: #f8faff; border: 1px solid #e6ecfb; border-radius: 12px; padding: 8px; text-align: center; }
.mgrid img { width: 100%; height: 96px; object-fit: contain; background: #fff; border-radius: 8px; display: block; }
.mgrid figcaption { font-size: 10.5px; color: #7a83a6; margin-top: 6px; word-break: break-all; }

/* 页脚 */
.doc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; font-size: 12px; color: #8b93b0; }
.doc-foot a { color: #5b6ee8; font-weight: 700; text-decoration: none; }

/* 打印 */
@media print {
  body { background: #fff; }
  .doc { max-width: none; padding: 0; }
  .doc-nav, .doc-top, .doc-foot { display: none; }
  .doc-hero { border-radius: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sec { break-inside: avoid; box-shadow: none; border: 1px solid #e7ecf9; }
  .sc, .cd, table { break-inside: avoid; }
  .mgrid img { height: 80px; }
}
@media (max-width: 640px) {
  .doc-hero h1 { font-size: 22px; }
  .sec { padding: 16px 14px; }
  .sec h2 { font-size: 16px; }
  table.kvt td:first-child { width: 96px; }
}

/* ===== 图片点击放大（配套 js/lightbox.js） =====
   观感对齐故事页灯箱（story-photos.css 的 .st-lb），保证全课件一致。 */
.mgrid img { cursor: zoom-in; transition: transform .16s ease; }
.mgrid figure { transition: border-color .16s ease, box-shadow .16s ease; }
.mgrid figure:hover { border-color: #c9d8f7; box-shadow: 0 8px 20px -12px #5b6ee8; }
.mgrid figure:hover img { transform: scale(1.03); }
body.lb-open { overflow: hidden; }

.lb { position: fixed; inset: 0; z-index: 9998; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px 60px 14px; background: rgba(26,17,30,.92); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease; }
.lb.on { opacity: 1; visibility: visible; }
.lb-stage { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; overflow: auto; overscroll-behavior: contain; }
.lb-img { margin: auto; max-width: min(1180px, 94vw); max-height: 76vh; object-fit: contain; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px -18px rgba(0,0,0,.85); cursor: zoom-out; user-select: none; -webkit-user-drag: none; }
.lb-stage.zoom .lb-img { max-width: none; max-height: none; cursor: zoom-in; }
.lb-bar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; max-width: min(880px, 90vw); font-size: 12.5px; color: #f2ecf5; text-align: center; }
.lb-name { font-weight: 800; color: #fff; word-break: break-all; }
.lb-idx { padding: 1px 10px; border-radius: 20px; background: rgba(255,255,255,.18); color: #fff; font-weight: 800; white-space: nowrap; }
.lb-hint { opacity: .6; }
.lb-x, .lb-prev, .lb-next { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(255,255,255,.18); font-size: 19px; line-height: 1; transition: background .15s ease; }
.lb-x { top: 16px; right: 20px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-x:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.34); }
.lb-x:focus-visible, .lb-prev:focus-visible, .lb-next:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb.single .lb-prev, .lb.single .lb-next { display: none; }

@media (max-width: 640px) {
  .lb { padding: 22px 8px 10px; }
  .lb-prev { left: 4px; }
  .lb-next { right: 4px; }
  .lb-img { max-height: 70vh; }
  .lb-x { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 17px; }
  .lb-hint { display: none; }
}
@media print {
  .lb { display: none !important; }
}
