/* ============ 大模型学习中心 · 移动优先响应式样式 ============ */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #e5e9f2;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --green: #059669;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.75 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); }
.top-nav a { margin-left: 16px; color: var(--muted); font-size: 14px; }
.top-nav a:hover { color: var(--accent); text-decoration: none; }

main.wrap { padding-top: 16px; padding-bottom: 88px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0 28px; }

/* ---------- 首页 ---------- */
.hero {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: var(--radius); color: #fff; padding: 28px 20px; margin: 8px 0 16px;
}
.hero h1 { margin: 0 0 6px; font-size: 26px; }
.hero .sub { margin: 0 0 16px; opacity: .92; font-size: 14.5px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: rgba(255,255,255,.14); border-radius: 10px; text-align: center; padding: 10px 4px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; opacity: .85; }

.offline-card, .search-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 16px;
}
.offline-card h2 { margin: 0 0 6px; font-size: 18px; }
.offline-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.btn {
  display: inline-block; border-radius: 10px; padding: 10px 16px; font-size: 15px; font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { text-decoration: none; filter: brightness(1.08); }
.oc-per { margin-top: 12px; }
.oc-per summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: 4px 12px; font-size: 13px;
}
.chip:hover { text-decoration: none; filter: brightness(.97); }

#search-input {
  width: 100%; padding: 12px 14px; font-size: 15px; border: 1.5px solid var(--line);
  border-radius: 10px; outline: none; background: #fafbfe;
}
#search-input:focus { border-color: var(--accent); }
.search-results { margin-top: 10px; max-height: 420px; overflow: auto; }
.sr-item { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.sr-item:hover { background: var(--accent-soft); text-decoration: none; }
.sr-item b { color: var(--accent); }
.sr-path { font-size: 12px; color: var(--muted); }
.sr-x { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.stage-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.stage-card {
  display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; color: var(--ink); border: 1.5px solid transparent; position: relative;
}
.stage-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.sc-num {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; margin-bottom: 8px;
}
.sc-title { margin: 0 0 6px; font-size: 17px; }
.sc-desc { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.sc-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sc-progress { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sc-progress i { width: 80px; height: 6px; background: var(--line); border-radius: 4px; display: inline-block; position: relative; overflow: hidden; }
.sc-progress i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: var(--green); border-radius: 4px; }
.stage-card.placeholder { opacity: .6; }

/* ---------- 面包屑 ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin: 6px 0 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs b { color: var(--ink); }

/* ---------- 阶段页 ---------- */
.stage-head { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.stage-head h1 { margin: 0 0 8px; font-size: 21px; }
.stage-desc { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.pb-track { flex: 1; height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.pb-track i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--green), #34d399); transition: width .3s; }
.stage-progressbar { display: flex; align-items: center; gap: 10px; }
.pb-label { font-size: 13px; color: var(--muted); white-space: nowrap; }

.day-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.day-item {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 14px; color: var(--ink);
}
.day-item:hover { text-decoration: none; border-color: var(--accent); }
.day-item.done .di-title::after { content: " ✅"; font-size: 13px; }
.di-n {
  flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.di-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.di-title { font-size: 15px; line-height: 1.4; }
.di-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.di-badges em {
  font-style: normal; font-size: 12px; color: var(--muted);
  background: var(--bg); border-radius: 5px; padding: 1px 7px;
}
.di-go { color: var(--muted); font-size: 20px; }
.block-section { margin-bottom: 20px; }
.sec-title { font-size: 17px; margin: 18px 0 10px; }

/* ---------- 天页 ---------- */
.day-layout { display: block; }
.day-head {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 14px;
}
.day-eyebrow { margin: 0; font-size: 12.5px; color: var(--muted); }
.day-head h1 { margin: 4px 0 10px; font-size: 21px; line-height: 1.4; }
.goal {
  background: var(--amber-soft); border-left: 3px solid #f59e0b; color: var(--amber);
  border-radius: 0 10px 10px 0; padding: 10px 12px; font-size: 14px; margin-bottom: 12px;
}
.btn-done {
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 10px; padding: 8px 14px; font-size: 14px; cursor: pointer;
}
.btn-done.done { background: var(--green); border-color: var(--green); color: #fff; }

.day-toc { display: none; }
.block {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px; overflow: hidden;
}
.block-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.block-head h2 { margin: 0; font-size: 16.5px; flex: 1; min-width: 0; }
.block-tag {
  flex: none; font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
.hw-block { border-left: 4px solid #f59e0b; }
.hw-block .block-tag { color: var(--amber); background: var(--amber-soft); }
.badge { font-size: 12px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 6px; }

/* ---------- Markdown 正文 ---------- */
.md { font-size: 15px; overflow-wrap: break-word; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.4; margin: 22px 0 10px; }
.md h1 { font-size: 20px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md h2 { font-size: 18px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 16.5px; }
.md h4, .md h5, .md h6 { font-size: 15px; color: var(--muted); }
.md p { margin: 10px 0; }
.md ul, .md ol { padding-left: 22px; margin: 10px 0; }
.md li { margin: 4px 0; }
.md img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0; }
.md blockquote {
  margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0; color: #334155;
}
.md blockquote p { margin: 4px 0; }
.md table { border-collapse: collapse; margin: 12px 0; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; font-size: 13.5px; white-space: nowrap; }
.md th { background: var(--bg); }
.md code {
  background: #eef2f8; border-radius: 5px; padding: 1.5px 6px;
  font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 13px; color: #c2410c;
}
.md hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.md pre { margin: 0; }
.md .highlight, .codefrag .highlight { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.highlight pre { margin: 0; padding: 12px 14px; font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.6; }

/* ---------- 代码树 ---------- */
.code-tree { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.code-tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dashed var(--line); }
.code-tree li { margin: 2px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code-tree li.dir > details { flex: 1; min-width: 0; }
.code-tree summary { cursor: pointer; font-weight: 600; padding: 3px 4px; border-radius: 6px; }
.code-tree summary:hover { background: var(--bg); }
.code-tree .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binfile { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { font-size: 12px; color: var(--muted); flex: none; }
.rawlink { font-size: 12px; flex: none; }

.filelist { list-style: none; margin: 0; padding: 0; }
.filelist li {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px dashed var(--line); flex-wrap: wrap;
}
.filelist li:last-child { border-bottom: none; }
.filelist .fname { flex: 1; min-width: 0; }

.outline-wrap, .extract-wrap { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fcfdff; }
.outline-wrap summary, .extract-wrap summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.extract-wrap .md { font-size: 14px; }
.doc-note { color: var(--muted); font-size: 13px; background: var(--bg); padding: 8px 10px; border-radius: 8px; }

/* ---------- xmind 大纲 ---------- */
.xmind-outline { margin-top: 8px; font-size: 14px; }
.xmind-sheet { font-weight: 700; margin: 6px 0; }
.ol-item { padding: 3px 0; }
.ol-0 { font-weight: 700; font-size: 15px; }
.ol-1 { padding-left: 16px; }
.ol-2 { padding-left: 32px; }
.ol-3 { padding-left: 48px; }
.ol-4 { padding-left: 62px; }
.ol-5 { padding-left: 74px; }
ol.ol-item, .ol-details { list-style: none; }
.ol-details { margin: 0; }
.ol-details > summary { list-style: none; }
.ol-details > summary::-webkit-details-marker { display: none; }
.ol-details > summary::before { content: "▸ "; color: var(--accent); }
.ol-details[open] > summary::before { content: "▾ "; }
.ol-item .ol-item { font-weight: 400; }

/* ---------- 代码查看页 ---------- */
.codepage { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.code-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.copy-btn {
  border: 1.5px solid var(--accent); color: var(--accent); background: #fff;
  border-radius: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.copy-btn:active { transform: scale(.97); }
.copied-hint { color: var(--green); font-size: 13px; }

/* ---------- 上一节/下一节 ---------- */
.day-pager {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
}
.pager-link {
  flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; color: var(--ink); display: flex; flex-direction: column; gap: 1px; overflow: hidden;
}
.pager-link:hover { text-decoration: none; border-color: var(--accent); }
.pager-link span { font-size: 11px; color: var(--muted); }
.pager-link b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager-link.next { text-align: right; }
.pager-link.ghost { visibility: hidden; }

/* ---------- 离线版 ---------- */
.offline-nav { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 14px; }
.offline-nav summary { cursor: pointer; font-weight: 700; }
.offline-day { margin-bottom: 26px; }
.offline-stage { margin-top: 28px; }
.stage-title { font-size: 22px; margin-bottom: 4px; }
.stage-desc { color: var(--muted); font-size: 14px; }

/* ============ 平板 ≥768px ============ */
@media (min-width: 768px) {
  .wrap { padding: 0 24px; }
  .hero { padding: 36px 32px; }
  .hero h1 { font-size: 32px; }
  .stage-grid { grid-template-columns: repeat(2, 1fr); }
  .stage-head h1, .day-head h1 { font-size: 24px; }
  .highlight pre { font-size: 13px; }
}

/* ============ 桌面 ≥1080px ============ */
@media (min-width: 1080px) {
  .stage-grid { grid-template-columns: repeat(3, 1fr); }
  .day-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
  .day-toc { display: block; position: sticky; top: 68px; }
  .toc-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; font-size: 13.5px; }
  .toc-card b { display: block; margin: 4px 0 6px; }
  .toc-card b.toc-sub { margin-top: 14px; }
  .toc-card ol { margin: 0 0 6px; padding-left: 20px; }
  .toc-card li { margin: 3px 0; }
  .toc-card li.cur > a { font-weight: 700; }
  .toc-days li.cur { color: var(--accent); }
  .day-pager { position: static; background: none; border: none; padding: 6px 0 0; backdrop-filter: none; }
  main.wrap { padding-bottom: 40px; }
  .md { font-size: 15.5px; }
  .hero-stats { max-width: 520px; }
}
