/* ============================================================
   个人教学资料站 · 公开站点样式
   与教师工作台（/teacher/app.css）相互独立，互不影响。
   ============================================================ */

:root {
  /* ---- 基本色 ---- */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6ebf2;
  --bg: #f7f9fc;
  --card: #ffffff;
  --card-soft: #f4f7ff;        /* 次级卡片/浅底 */
  --line-strong: #c9d6ee;      /* hover 时的边框 */
  --on-brand: #ffffff;         /* 品牌色块上的文字 */

  /* ---- 品牌色 ---- */
  --brand: #2d5bd7;
  --brand-dark: #1e3f9e;
  --brand-soft: #eaf0ff;
  --accent: #f59e0b;
  --accent-soft: #fff7e6;
  --ok: #12a150;
  --violet: #7c3aed;

  /* ---- 顶栏与首屏 ---- */
  --nav-bg: rgba(255, 255, 255, .88);
  --hero-a: #f4f7ff;
  --hero-b: #eef3ff;
  --hero-c: #f7f9fc;
  --hero-glow-1: rgba(124, 58, 237, .18);
  --hero-glow-2: rgba(45, 91, 215, .20);
  --hero-dot: rgba(45, 91, 215, .11);
  --hero-card: linear-gradient(180deg, #ffffff, #f7f9ff 70%, #f2f6ff);

  /* ---- 小色块 ---- */
  --tint-violet: #f3ecff;
  --tint-green: #e7f7ee;

  /* ---- 代码 ---- */
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  --icode-bg: #eef2f9;
  --icode-fg: #b02a5b;

  /* ---- 其它控件 ---- */
  --focus: #bfd3ff;
  --warn-line: #fde4b0;
  --warn-fg: #7c4a03;

  /* ---- 形状与阴影 ---- */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 4px 14px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, .13), 0 4px 12px rgba(15, 23, 42, .06);

  /* ---- 字体 ---- */
  --font-head: inherit;        /* 标题字体；纸感/墨绿主题会换成衬线体 */
  --track-label: 0;            /* 小标签字距 */

  --wrap: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶栏 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 8px; height: 62px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; color: var(--ink);
  margin-right: auto; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--violet));
  color: var(--on-brand); display: grid; place-items: center;
  font-size: 15px; font-weight: 800; letter-spacing: -.5px;
}
.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink-2); font-size: 14.5px; padding: 7px 12px;
  border-radius: 9px; white-space: nowrap; transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.nav-links a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-links a.cta {
  background: var(--brand); color: var(--on-brand); font-weight: 600; margin-left: 6px;
}
.nav-links a.cta:hover { background: var(--brand-dark); }

.nav-toggle {
  display: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 9px; width: 40px; height: 38px; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--ink-2);
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 420px at 12% -10%, var(--hero-glow-1), transparent 62%),
    radial-gradient(900px 400px at 88% 0%, var(--hero-glow-2), transparent 60%),
    linear-gradient(160deg, var(--hero-a) 0%, var(--hero-b) 40%, var(--hero-c) 100%);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--hero-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 72%);
}
.hero .wrap { position: relative; z-index: 1; padding-top: 62px; padding-bottom: 66px; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr);
  gap: 44px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--brand-dark); font-size: 13px; font-weight: 600;
  padding: 5px 13px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.hero h1 {
  margin: 18px 0 0; font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.22; letter-spacing: -.5px; font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand) 10%, var(--violet) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  margin: 18px 0 0; font-size: 17px; color: var(--ink-2);
  max-width: 46em; line-height: 1.85;
}
.hero-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 11px; font-size: 15px;
  font-weight: 600; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s, box-shadow .18s, background .18s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--line-strong); }

.hero-stats {
  margin-top: 34px; display: flex; gap: 30px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px dashed var(--line-strong);
}
.hero-stats div b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.hero-stats div span { font-size: 13px; color: var(--muted); }

/* Hero 右侧卡片 */
.hero-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 22px; position: relative;
}
.hero-card h3 { margin: 0 0 4px; font-size: 15px; }
.hero-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 15px; }
.hero-card ul { list-style: none; margin: 0; padding: 0; }
.hero-card li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.2px; color: var(--ink-2);
}
.hero-card li:first-child { border-top: 0; }
.hero-card li i {
  flex: none; width: 22px; height: 22px; border-radius: 7px;
  background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-size: 12px; font-style: normal; margin-top: 3px;
}

/* ---------------- 通用区块 ---------------- */
section.block { padding: 62px 0; }
section.block.tight { padding: 46px 0; }
.block-head { margin-bottom: 30px; }
.block-head h2 {
  margin: 0; font-size: clamp(21px, 2.6vw, 27px); letter-spacing: -.3px; font-weight: 800;
}
.block-head p { margin: 8px 0 0; color: var(--muted); font-size: 15px; max-width: 52em; }

/* ---------------- 卡片 ---------------- */
.grid { display: grid; gap: 20px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: transform .16s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }

.mod { display: block; padding: 24px; color: inherit; height: 100%; }
.mod:hover { text-decoration: none; }
.mod .ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 14px;
  background: var(--brand-soft);
}
.mod .ico.v { background: var(--tint-violet); }
.mod .ico.a { background: var(--accent-soft); }
.mod .ico.g { background: var(--tint-green); }
.mod h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.mod p { margin: 0; color: var(--muted); font-size: 14.2px; line-height: 1.7; }
.mod .more { margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--brand); }

/* ---------------- 资料列表 ---------------- */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 20px;
}
.toolbar input[type="search"], .toolbar select {
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14.5px; background: var(--card); color: var(--ink); font-family: inherit;
}
.toolbar input[type="search"] { min-width: 230px; flex: 1 1 230px; }
.toolbar .count { color: var(--muted); font-size: 13.5px; margin-left: auto; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 6px 13px; border-radius: 999px; font-size: 13.5px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }

/* ---------------- 分面筛选（年级 × 课型）----------------
   调研报告里 ESL KidStuff 用「年龄 × 等级」双维度，
   Figma 把筛选做成一級标签页并配数量徽标 —— 这里两样都照做。
   数量按「另一个维度保持当前选择」统计，点之前就知道会剩几项。 */
.facets {
  display: flex; flex-direction: column; gap: 9px;
  margin: 14px 0 4px; padding: 13px 16px;
  background: var(--card-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.facet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.facet .fl {
  flex: none; font-size: 12.5px; font-weight: 700; color: var(--muted);
  min-width: 30px;
}
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-2); text-decoration: none; transition: all .15s;
  /* 手机上可点区域至少 44px —— 上次样张链接只有 22px 被审计抓到过 */
  min-height: 44px;
}
.fchip:hover { border-color: var(--line-strong); color: var(--ink); }
.fchip b {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: var(--card-soft); border-radius: 999px; padding: 1px 7px;
  min-width: 20px; text-align: center;
}
.fchip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.fchip.on b { background: rgba(255,255,255,.24); color: var(--on-brand); }

/* 正在筛选时的一行说明 + 清除入口 */
.factive {
  margin: 10px 0 14px; font-size: 13.5px; color: var(--ink-2);
  padding: 9px 14px; background: var(--brand-soft);
  border-radius: var(--radius-sm);
}
.factive a { font-weight: 600; }

/* 卡片上的标签现在是链接了 —— 要有「能点」的样子 */
.item .tags a.tag { text-decoration: none; transition: all .15s; }
.item .tags a.tag:hover { background: var(--line-strong); color: var(--ink); }
.tag.on { background: var(--brand); color: var(--on-brand); font-weight: 600; }

/* 手机上：可点的标签必须满足 44px 触摸目标。
   注意只针对 a.tag —— 纯展示的 span.tag 是个标签，不是控件，
   给它撑到 44px 只会让卡片变得又高又空。桌面保持紧凑。 */
@media (max-width: 640px) {
  .item .tags a.tag {
    display: inline-flex; align-items: center;
    min-height: 44px; padding: 0 11px; border-radius: 999px;
  }
  .item .tags { gap: 6px; }
}

.item {
  display: flex; gap: 16px; padding: 17px 20px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .16s, box-shadow .18s;
}
.item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.item .ficon {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  color: var(--on-brand); letter-spacing: .3px;
}
.ficon.ppt { background: #d24726; }
.ficon.pdf { background: #c0392b; }
.ficon.doc { background: #2b579a; }
.ficon.audio { background: #7c3aed; }
.ficon.video { background: #0f766e; }
.ficon.img { background: #0891b2; }
.ficon.zip { background: #64748b; }
.ficon.other { background: #94a3b8; }
.item .meta { min-width: 0; flex: 1; }
.item .meta h4 { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; line-height: 1.5; }
.item .meta h4 a { color: inherit; }
.item .meta h4 a:hover { color: var(--brand); text-decoration: none; }
.item .meta p { margin: 0; color: var(--muted); font-size: 13.6px; line-height: 1.65; }
.item .tags { margin-top: 9px; display: flex; gap: 7px; flex-wrap: wrap; }
.tag {
  font-size: 12px; padding: 2.5px 9px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand-dark);
}
.tag.gray { background: var(--card-soft); color: var(--muted); }
.item .act { flex: none; display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.item .sz { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.empty {
  text-align: center; padding: 54px 20px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty .big { font-size: 34px; margin-bottom: 10px; }

/* ---------------- 引流位 ---------------- */
.hero-who { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

.funnel {
  background: var(--hero-card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.funnel .grid.c2 { align-items: stretch; }
.funnel .card.mod { display: flex; flex-direction: column; padding: 26px; }
.funnel .card.mod h3 { margin: 10px 0 8px; font-size: 18px; }
.funnel .card.mod .more { margin-top: auto; padding-top: 16px; }
.funnel .card.mod .more .btn { width: 100%; justify-content: center; }
.buyrow { display: flex; gap: 8px; flex-wrap: wrap; }
.funnel-note {
  margin: 20px 0 0; color: var(--muted); font-size: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 17px;
}
.qrbox {
  margin-top: 14px; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.qrbox .qr { width: 84px; height: 84px; border-radius: 8px; flex: none; object-fit: contain; background: var(--card); }
.qrbox span { color: var(--muted); font-size: 13px; }

/* 资料详情页 */
.filehead { display: flex; gap: 15px; align-items: flex-start; }
.filehead .ficon { width: 52px; height: 52px; border-radius: 13px; }
.plainlist { list-style: none; margin: 0; padding: 0; }
.plainlist li {
  padding: 8px 0 8px 20px; position: relative;
  color: var(--ink-2); font-size: 14.6px; border-top: 1px dashed var(--line);
}
.plainlist li:first-child { border-top: 0; }
.plainlist li::before {
  content: "·"; position: absolute; left: 6px; top: 8px;
  color: var(--brand); font-weight: 800; font-size: 18px; line-height: 1.4;
}
.desc { color: var(--muted); font-size: 14.6px; margin: 0; line-height: 1.75; }

/* ---------------- 文章 ---------------- */
.postmeta { color: var(--muted); font-size: 13.6px; margin: 12px 0 0 !important; }
.postbody { font-size: 16.5px; line-height: 1.95; }
.postbody h1, .postbody h2, .postbody h3 { letter-spacing: -.2px; }
.postbody h2 { margin-top: 38px; padding-top: 4px; }
.postbody h3 { margin-top: 28px; }
.postbody img { border-radius: var(--radius-sm); margin: 10px 0; }
.postbody pre {
  background: var(--code-bg); color: var(--code-fg); padding: 15px 18px;
  border-radius: var(--radius-sm); overflow-x: auto; font-size: 13.5px; line-height: 1.65;
}
.postbody pre code { background: none; color: inherit; padding: 0; }
.postbody code {
  background: var(--icode-bg); color: var(--icode-fg); padding: 1.5px 6px;
  border-radius: 5px; font-size: .92em;
}
.postbody hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.postbody a { text-decoration: underline; text-underline-offset: 2px; }
.postnav {
  display: flex; gap: 12px; justify-content: space-between;
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line);
}
.postnav a { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 文章编辑器 */
.editor {
  width: 100%; min-height: 380px; padding: 15px 17px; font-size: 14.5px; line-height: 1.8;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Microsoft YaHei", monospace;
  resize: vertical; background: var(--card); color: var(--ink);
}
.editor:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.preview {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 22px; background: var(--card); min-height: 120px;
}
.preview h1, .preview h2, .preview h3 { margin: 18px 0 8px; }
.preview p { margin: 0 0 12px; }

/* 文章里的附件卡片 */
.attach {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 15px 18px; margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.attach .ficon { width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center; color: var(--on-brand); font-size: 11px; font-weight: 800; }
.attach-meta { flex: 1; min-width: 0; }
.attach-meta b { display: block; font-size: 15px; word-break: break-all; }
.attach-meta span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------------- 正文排版（关于我 / 说明页） ---------------- */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 38px; box-shadow: var(--shadow-sm); }
.prose h2 { margin: 34px 0 12px; font-size: 21px; letter-spacing: -.2px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 24px 0 10px; font-size: 17px; }
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 1.4em; color: var(--ink-2); }
.prose li { margin-bottom: 6px; }
.prose blockquote {
  margin: 18px 0; padding: 14px 18px; border-left: 3px solid var(--brand);
  background: var(--brand-soft); border-radius: 0 10px 10px 0; color: var(--ink-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* ---------------- 页头（二级页） ---------------- */
.pagehead {
  background: linear-gradient(160deg, var(--hero-a), var(--hero-b) 60%, var(--hero-c));
  border-bottom: 1px solid var(--line); padding: 40px 0 34px;
}
.crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.pagehead h1 { margin: 0; font-size: clamp(23px, 3.2vw, 31px); letter-spacing: -.4px; font-weight: 800; }
.pagehead p { margin: 10px 0 0; color: var(--ink-2); max-width: 52em; }

/* ---------------- 页脚 ---------------- */
footer.site {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 34px 0; margin-top: 20px;
}
footer.site .wrap {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  color: var(--muted); font-size: 13.5px;
}
footer.site .links { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------------- 提示条 ---------------- */
.notice {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid var(--warn-line);
  color: var(--warn-fg); border-radius: var(--radius-sm);
  padding: 14px 17px; font-size: 14.2px; line-height: 1.7;
}
.notice.info { background: var(--brand-soft); border-color: var(--line-strong); color: var(--brand-dark); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  body { font-size: 15.5px; }
  .nav .wrap { height: 58px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 58px;
    background: var(--card); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 14px 16px; gap: 3px;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 13px; font-size: 15.5px; }
  .nav-links a.cta { margin-left: 0; text-align: center; justify-content: center; }
  .hero .wrap { padding-top: 40px; padding-bottom: 46px; }
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  section.block { padding: 44px 0; }
  .prose { padding: 24px 20px; }
  .item { flex-direction: column; gap: 12px; }
  .item .act { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .hero-stats { gap: 22px; }
}


/* ============================================================
   主题系统
   ------------------------------------------------------------
   每个主题只覆盖 token，不改结构。切换方式：
     · 服务端按 site.json 的 theme 输出 <html data-theme="...">
     · 访客自己选的存 localStorage，由 <head> 里的内联脚本抢先应用（避免闪一下）
   ============================================================ */

/* 标题字体：只有声明了衬线的主题才会变 */
h1, h2, h3, .hero h1, .pagehead h1, .block-head h2, .card h3, .mod h3,
.prose h1, .prose h2, .prose h3, .postbody h1, .postbody h2, .postbody h3 {
  font-family: var(--font-head);
}

/* 小标签的字距（纸感主题会拉开） */
.eyebrow, .hint, .tag, .chip { letter-spacing: var(--track-label); }

/* ---------------- 1. 清爽蓝（默认，即 :root） ---------------- */
[data-theme="blue"] { /* 与 :root 相同，显式写出来方便对照 */ }

/* ---------------- 2. 纸感 · 参考那篇文章的网站 ----------------
   暖白纸底 + 衬线标题 + 陶土红主色 + 大圆角 + 极轻阴影 */
[data-theme="paper"] {
  --ink: #2b2724;
  --ink-2: #4a443e;
  --muted: #8a8178;
  --line: #ebe4d9;
  --bg: #faf7f2;
  --card: #ffffff;
  --card-soft: #f7f2ea;
  --line-strong: #ddcfba;
  --on-brand: #ffffff;

  --brand: #a45a3c;
  --brand-dark: #86452c;
  --brand-soft: #fbeee7;
  --accent: #c98a3f;
  --accent-soft: #fdf3e3;
  --ok: #4a7c59;
  --violet: #7d6b9e;

  --nav-bg: rgba(250, 247, 242, .9);
  --hero-a: #fdf6ee;
  --hero-b: #f7ece0;
  --hero-c: #faf7f2;
  --hero-glow-1: rgba(201, 138, 63, .17);
  --hero-glow-2: rgba(164, 90, 60, .13);
  --hero-dot: rgba(164, 90, 60, .10);
  --hero-card: linear-gradient(180deg, #ffffff, #fbf5ee 70%, #f8f1e8);

  --tint-violet: #f0ebf7;
  --tint-green: #e9f2ea;

  --code-bg: #2b2724;
  --code-fg: #f0e9e0;
  --icode-bg: #f5ece1;
  --icode-fg: #9c4a2f;

  --focus: #e0c3ac;
  --warn-line: #edd9b0;
  --warn-fg: #7a5410;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(80, 60, 40, .05);
  --shadow: 0 4px 14px rgba(80, 60, 40, .07);
  --shadow-lg: 0 18px 44px rgba(80, 60, 40, .12);

  --font-head: Charter, "Iowan Old Style", Georgia, "Songti SC", "SimSun",
    "Noto Serif SC", ui-serif, serif;
  --track-label: .04em;
}

/* ---------------- 3. 墨绿 · 沉静学术 ---------------- */
[data-theme="forest"] {
  --ink: #1c2a23;
  --ink-2: #38483f;
  --muted: #6b7a71;
  --line: #e0e7e2;
  --bg: #f5f8f6;
  --card: #ffffff;
  --card-soft: #eef4f0;
  --line-strong: #c2d4c9;
  --on-brand: #ffffff;

  --brand: #2f6b4f;
  --brand-dark: #235240;
  --brand-soft: #e6f2ea;
  --accent: #b8892f;
  --accent-soft: #fbf3e2;
  --ok: #2f8b57;
  --violet: #6b6f9e;

  --nav-bg: rgba(245, 248, 246, .9);
  --hero-a: #eef5f0;
  --hero-b: #e6f0ea;
  --hero-c: #f5f8f6;
  --hero-glow-1: rgba(184, 137, 47, .14);
  --hero-glow-2: rgba(47, 107, 79, .16);
  --hero-dot: rgba(47, 107, 79, .10);
  --hero-card: linear-gradient(180deg, #ffffff, #f2f7f4 70%, #eef4f0);

  --tint-violet: #eeecf7;
  --tint-green: #e4f2e9;

  --code-bg: #16241d;
  --code-fg: #dce8e1;
  --icode-bg: #e8f0ea;
  --icode-fg: #276346;

  --focus: #a9c8b5;
  --warn-line: #ecd9ae;
  --warn-fg: #7a5410;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 45, 32, .05);
  --shadow: 0 4px 14px rgba(20, 45, 32, .07);
  --shadow-lg: 0 18px 44px rgba(20, 45, 32, .12);

  --font-head: Charter, "Iowan Old Style", Georgia, "Songti SC", "SimSun",
    "Noto Serif SC", ui-serif, serif;
  --track-label: .03em;
}

/* ---------------- 4. 樱花 · 柔和亲和 ---------------- */
[data-theme="sakura"] {
  --ink: #2e2329;
  --ink-2: #4d3f46;
  --muted: #8b7a82;
  --line: #f0e4e9;
  --bg: #fdf8fa;
  --card: #ffffff;
  --card-soft: #fbf0f4;
  --line-strong: #eccfda;
  --on-brand: #ffffff;

  --brand: #c8497b;
  --brand-dark: #a63663;
  --brand-soft: #fdeef4;
  --accent: #d98a3f;
  --accent-soft: #fdf2e6;
  --ok: #3f9169;
  --violet: #8a6fae;

  --nav-bg: rgba(253, 248, 250, .9);
  --hero-a: #fdf2f6;
  --hero-b: #fbe8ef;
  --hero-c: #fdf8fa;
  --hero-glow-1: rgba(138, 111, 174, .15);
  --hero-glow-2: rgba(200, 73, 123, .14);
  --hero-dot: rgba(200, 73, 123, .10);
  --hero-card: linear-gradient(180deg, #ffffff, #fdf3f7 70%, #fbeef3);

  --tint-violet: #f4ecf9;
  --tint-green: #e8f5ee;

  --code-bg: #2e2329;
  --code-fg: #f3e9ee;
  --icode-bg: #fbeef3;
  --icode-fg: #ab3768;

  --focus: #f0c6d7;
  --warn-line: #eedcae;
  --warn-fg: #7a5410;

  --radius: 20px;
  --radius-sm: 13px;
  --shadow-sm: 0 1px 2px rgba(90, 40, 65, .05);
  --shadow: 0 4px 16px rgba(90, 40, 65, .08);
  --shadow-lg: 0 18px 44px rgba(90, 40, 65, .13);

  --font-head: inherit;
  --track-label: .01em;
}

/* ---------------- 5. 夜读 · 深色护眼 ----------------
   晚上看屏幕用。文件类型图标等语义色保持不动。 */
[data-theme="dark"] {
  --ink: #e9e6e1;
  --ink-2: #c2bdb5;
  --muted: #948e85;
  --line: #33322e;
  --bg: #1a1917;
  --card: #24231f;
  --card-soft: #2c2a25;
  --line-strong: #4a463e;
  --on-brand: #1a1917;

  --brand: #d9a05e;
  --brand-dark: #c0863f;
  --brand-soft: #332a1d;
  --accent: #d9b95b;
  --accent-soft: #342e1c;
  --ok: #6fbf8a;
  --violet: #a99bd4;

  --nav-bg: rgba(26, 25, 23, .88);
  --hero-a: #201f1b;
  --hero-b: #232019;
  --hero-c: #1a1917;
  --hero-glow-1: rgba(217, 154, 91, .14);
  --hero-glow-2: rgba(169, 155, 212, .11);
  --hero-dot: rgba(217, 154, 91, .10);
  --hero-card: linear-gradient(180deg, #2a2823, #262420 70%, #232019);

  --tint-violet: #2e2b3a;
  --tint-green: #22302a;

  --code-bg: #121110;
  --code-fg: #ddd8d0;
  --icode-bg: #2e2b24;
  --icode-fg: #e0a98a;

  --focus: #6b5334;
  --warn-line: #5a4a24;
  --warn-fg: #e6c77a;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 16px rgba(0, 0, 0, .38);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);

  --font-head: inherit;
  --track-label: 0;
}

/* 深色主题下几张图/图标要压暗一点，别太刺眼 */
[data-theme="dark"] img { filter: brightness(.92); }
[data-theme="dark"] .nav { box-shadow: 0 1px 0 rgba(255, 255, 255, .04); }

/* ---------------- 主题选择器 ---------------- */
.themebtn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13.5px;
  font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.themebtn:hover { border-color: var(--line-strong); }
.themebtn .dots { display: inline-flex; gap: 2px; }
.themebtn .dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }

.themepop {
  position: absolute; right: 0; top: 46px; z-index: 60;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 7px; min-width: 190px; display: none;
}
.themepop.on { display: block; }
.themepop button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border: 0; background: none; cursor: pointer;
  border-radius: 8px; font-size: 13.5px; color: var(--ink); font-family: inherit;
  text-align: left;
}
.themepop button:hover { background: var(--card-soft); }
.themepop button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.themepop .sw { display: inline-flex; gap: 3px; flex: none; }
.themepop .sw i { width: 12px; height: 12px; border-radius: 4px; display: block; border: 1px solid rgba(0, 0, 0, .07); }
.themepop .cur { margin-left: auto; font-size: 12px; color: var(--muted); }

@media (max-width: 720px) {
  .themebtn .lbl { display: none; }
  .themepop { right: -8px; }
}


/* ---------------- 引流：二维码按端处理 ----------------
   手机上和二维码同屏，扫不了自己的屏幕，所以额外给"长按识别"。 */
.qrbox { text-align: center; margin: 14px 0 6px; }
.qrbox .qr {
  width: 118px; height: 118px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); background: var(--card); padding: 5px;
}
.qrbox .qr-hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.qrbox .qr-touch { display: none; font-size: 12.5px; color: var(--brand); margin-top: 6px; font-weight: 600; }
@media (max-width: 720px) {
  .qrbox .qr-hint { display: none; }
  .qrbox .qr-touch { display: block; }
}

/* 免费渠道（公众号）用不同底色区分 */
.mod.freech { background: var(--brand-soft); border-color: var(--line-strong); }

/* 下载旁边的一行引导 */
.dl-hint {
  font-size: 13px; color: var(--muted); margin: 10px 0 0;
  padding: 9px 13px; background: var(--card-soft); border-radius: var(--radius-sm);
}
.dl-hint a { font-weight: 600; }

/* ---------------- 样张横幅（首页）----------------
   放在「最近更新」和引流区之间：读者刚看完免费资料，
   这里正好是「要不先看看成色」的时机。 */
.sampleband {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1px solid #fcd34d; border-radius: var(--radius);
  padding: 22px 26px; box-shadow: var(--shadow-sm);
}
.sampleband .sb-txt { flex: 1; min-width: 260px; }
.sampleband h3 { margin: 0 0 7px; font-size: 18px; letter-spacing: -.2px; color: #78350f; }
.sampleband p { margin: 0; font-size: 14px; line-height: 1.7; color: #92400e; }
.sampleband .sb-act { flex-shrink: 0; }

/* ---------------- 样张入口条（列表页顶部）----------------
   读者正在挑资料时告诉他「成品可以先看」，比塞在页尾有效。 */
.inhint {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 12px 16px;
  background: var(--brand-soft); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.6;
}
.inhint .ih-ico { font-size: 17px; flex-shrink: 0; }
.inhint .ih-txt { flex: 1; min-width: 200px; color: var(--ink-2); }
.inhint .ih-act {
  flex-shrink: 0; font-weight: 600; color: var(--brand);
  text-decoration: none; white-space: nowrap;
  /* 手机上可点区域至少 44px —— 这个链接一开始只有 22px，被手机端审计抓到了 */
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 10px; margin: -6px -10px;
  border-radius: var(--radius-sm);
}
.inhint .ih-act:hover { text-decoration: underline; }

/* ---------------- 首屏「最新」条 ----------------
   回访的老师第一眼想知道的就是「更新了什么」。
   原来「最近更新」整块在第 2.3 屏，要下拉两屏多才看得到。
   这条只占一行高度，把最新那条提到首屏，完整列表仍然在下面。 */
.latestbar {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  margin: 18px 0 0; padding: 10px 15px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  min-height: 44px;
}
.latestbar:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.latestbar .lb-tag {
  flex: none; font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  background: var(--brand); color: var(--on-brand);
  border-radius: 999px; padding: 3px 10px;
}
.latestbar .lb-txt {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.latestbar .lb-date { flex: none; font-size: 12.5px; color: var(--muted); }
.latestbar .lb-more { flex: none; font-size: 13px; font-weight: 600; color: var(--brand); white-space: nowrap; }
@media (max-width: 640px) {
  .latestbar .lb-txt { white-space: normal; }
  .latestbar .lb-more { display: none; }
}

/* ---------------- 同单元配套资料（独立页底部）----------------
   课件和教案原来是互相孤立的死胡同页面 —— 看完只能点「返回列表」。
   这块把它们串起来：搜索引擎和人都能从一份资料走到旁边那份。 */
.related {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.related h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.2px; }
.related .rl { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.rlist { display: flex; flex-direction: column; gap: 10px; }
.rel {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--card-soft); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: border-color .15s, background .15s;
  /* 手机上可点，得满足 44px；桌面这个高度也自然 */
  min-height: 44px;
}
.rel:hover { border-color: var(--brand); background: var(--brand-soft); }
.rel .ri { flex: none; font-size: 20px; line-height: 1; }
.rel .rb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rel .rb b { font-size: 14.5px; font-weight: 700; line-height: 1.5; }
.rel .rb em {
  font-style: normal; font-size: 12.8px; color: var(--muted);
  line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rel .ra { flex: none; color: var(--brand); font-weight: 700; }
@media (max-width: 640px) {
  .rel .rb em { white-space: normal; }
}

/* ---------------- 文章读完后的引流卡 ---------------- */
.cta-card {
  background: var(--hero-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.cta-head { flex: 1; min-width: 260px; }
.cta-head h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.2px; }
.cta-head p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }
.cta-chs { display: flex; flex-direction: column; gap: 8px; min-width: 230px; }
.cta-ch {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); font-size: 13.5px; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.cta-ch:hover { text-decoration: none; border-color: var(--brand); transform: translateX(2px); }
.cta-ch b { font-weight: 600; }
.cta-ch .muted { color: var(--muted); font-size: 12.5px; }
.cta-ch .arr { margin-left: auto; color: var(--brand); font-weight: 700; }
.cta-ch .tag { flex: none; }

@media (max-width: 720px) {
  .cta-card { padding: 20px; gap: 16px; }
  .cta-chs { min-width: 0; width: 100%; }
}


/* ---------------- 导航分组 ----------------
   桌面端组间用细线分隔（横向空间有限，不放文字标签）；
   手机端导航是竖排，这时把组名显出来。 */
.navlab { display: none; }
.navdiv {
  width: 1px; height: 16px; background: var(--line-strong);
  margin: 0 4px; flex: none; opacity: .7;
}
@media (max-width: 900px) {
  .nav-links { flex-direction: column; align-items: stretch; }
  .navlab {
    display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
    color: var(--muted); text-transform: uppercase;
    padding: 12px 10px 4px; margin-top: 4px;
    border-top: 1px solid var(--line);
  }
  .navlab:first-child { border-top: 0; margin-top: 0; }
  .navdiv { display: none; }
}

/* 页脚的合规说明 */
.footnote {
  grid-column: 1 / -1; font-size: 12.5px; color: var(--muted);
  line-height: 1.7; margin: 14px 0 0; padding-top: 14px;
  border-top: 1px solid var(--line); max-width: 720px;
}
.footnote b { color: var(--ink-2); }

/* ---------------- 免费资料页 ---------------- */
.freepack {
  background: var(--hero-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px; margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}
.fphead { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fpico {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 23px;
  background: var(--brand-soft);
}
.fpmeta { flex: 1; min-width: 220px; }
.fpmeta h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.3px; }
.fpmeta .tags { margin: 0; }
.fpact { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.fphint {
  font-size: 13.5px; color: var(--muted); line-height: 1.75;
  margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--line);
}
.fphint b { color: var(--ink); }
.fphint.ok { color: var(--ok); font-weight: 600; }
.fphint.err { color: #dc2626; font-weight: 600; }

/* 提示词包正文：代码块要能横向滚动，不要撑破版心 */
.packbody pre {
  background: var(--code-bg); color: var(--code-fg);
  padding: 16px 18px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 13px; line-height: 1.75;
  margin: 0 0 18px; white-space: pre;
}
.packbody pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.packbody h2 { margin-top: 38px; }

/* ---------------- 使用说明页 ---------------- */
.terms { max-width: 780px; }
.tsec { margin-bottom: 30px; }
.tsec h2 {
  font-size: 17px; margin: 0 0 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.tsec p { color: var(--ink-2); font-size: 14.5px; line-height: 1.85; margin: 0; }
.tsec .plainlist li { font-size: 14.5px; line-height: 1.8; margin-bottom: 8px; color: var(--ink-2); }
.tsec .plainlist b { color: var(--ink); }
.terms-foot {
  font-size: 13px; color: var(--muted); margin-top: 8px;
  padding-top: 16px; border-top: 1px solid var(--line);
}

/* ---------------- Markdown 表格 ---------------- */
.tablewrap { overflow-x: auto; margin: 0 0 20px; -webkit-overflow-scrolling: touch; }
.prose table, .packbody table {
  border-collapse: collapse; width: 100%; min-width: 480px; font-size: 14px;
}
.prose th, .packbody th {
  background: var(--card-soft); text-align: left; font-weight: 700;
  padding: 10px 13px; border: 1px solid var(--line); white-space: nowrap;
}
.prose td, .packbody td {
  padding: 10px 13px; border: 1px solid var(--line);
  color: var(--ink-2); line-height: 1.7; vertical-align: top;
}

@media (max-width: 720px) {
  .freepack { padding: 18px; }
  .fpact { width: 100%; }
  .fpact .btn { flex: 1; text-align: center; }
}


/* ---------------- 首屏分叉 ----------------
   调研里 English with Lucy 的首屏不问「要不要买」，而是让访客先自我分类。
   这里同理：不问「要不要看我的资料」，而是分两条路。 */
.fork {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 26px 0 4px; max-width: 620px;
}
.forkcard {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.forkcard:hover {
  text-decoration: none; border-color: var(--brand);
  transform: translateY(-2px); box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,.07));
}
.forkcard .fk-ico { font-size: 22px; line-height: 1; }
.forkcard b { font-size: 15.5px; letter-spacing: -.2px; }
.forkcard > span { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.forkcard i { font-style: normal; font-size: 13.5px; font-weight: 600; color: var(--brand); margin-top: 6px; }
.forkcard.alt { background: var(--brand-soft); border-color: var(--line-strong); }

@media (max-width: 640px) {
  .fork { grid-template-columns: 1fr; gap: 10px; }
}

/* 分组小标题（给老师 / 给学生） */
.grouphead {
  font-size: 13.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .06em; margin: 34px 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.grouphead::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.grouphead:first-of-type { margin-top: 0; }

/* 列表卡片上的附件文件名 */
.attname {
  font-size: 12.5px !important; color: var(--ink-2) !important;
  margin: 7px 0 0 !important; padding: 4px 10px;
  background: var(--card-soft); border-radius: 7px;
  display: inline-block; word-break: break-all;
}

/* 文章末尾的工具条：复制全文 + 使用说明 */
.posttools {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 30px 0 6px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.posttools .btn { padding: 8px 18px; font-size: 14px; }
.pt-hint { font-size: 13px; color: var(--ok); font-weight: 600; }
.pt-hint.err { color: #dc2626; }
.pt-terms { font-size: 13px; color: var(--muted); margin-left: auto; }


/* ---------------- 404 ----------------
   静态 404 页和文章详情的 404 都用这套，样式放这里两边共用。 */
.nf404 { max-width: 620px; margin: 0 auto; padding: 72px 20px 60px; text-align: center; }
.nf404 .ico { font-size: 46px; line-height: 1; }
.nf404 h1 { margin: 14px 0 10px; font-size: 24px; letter-spacing: -.4px; }
.nf404 .lead { margin: 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.nf404 .nfgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin: 30px 0 6px;
}
.nf404 .nfcard {
  display: block; padding: 15px 12px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600;
  transition: border-color .16s, transform .16s;
}
.nf404 .nfcard:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.nf404 .nfcard i { display: block; font-style: normal; font-size: 19px; margin-bottom: 7px; }
.nf404 .nfcard.hot { background: var(--brand-soft); border-color: var(--line-strong); }
.nf404 .nfsub { margin-top: 24px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.nf404 .nfsub a { color: var(--brand); }


/* ---------------- 首页：老师名片条 ----------------
   为什么用文字头像：老师不一定想露脸，而且照片放久了会显得没人维护。
   用品牌首字母做一个圆形色块，一样有"人"的感觉。 */
.tstrip {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 20px 24px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.tavatar {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700; letter-spacing: -.5px;
  color: var(--on-brand);
  background: linear-gradient(140deg, var(--brand), var(--tint-violet, #7c3aed));
  font-family: var(--font-head);
}
.tinfo { flex: 1; min-width: 220px; }
.tname { margin: 0 0 5px; font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.ttag {
  margin: 0 0 5px; font-size: 14.5px; color: var(--ink-2);
  line-height: 1.6;
}
.tmeta { margin: 0; font-size: 13px; color: var(--muted); }
.tmore { flex: none; }

@media (max-width: 640px) {
  .tstrip { padding: 16px 18px; gap: 14px; }
  .tavatar { width: 48px; height: 48px; font-size: 21px; }
  .tmore { width: 100%; text-align: center; }
}

/* ---------------- 首页：学生作品墙 ----------------
   展示的是作品，不是学生本人。署名一律用代号。 */
.wgrid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 860px) { .wgrid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 480px) { .wgrid { grid-template-columns: 1fr; } }

.wcell {
  display: flex; flex-direction: column; text-decoration: none;
  color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.wcell:hover {
  text-decoration: none; border-color: var(--brand);
  transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
.wthumb {
  aspect-ratio: 4 / 3; display: grid; place-items: center;
  background: var(--card-soft); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.wthumb img { width: 100%; height: 100%; object-fit: cover; }
.wtype {
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  padding: 5px 13px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
}
.wtype.doc { background: #e8f0fe; color: #1a56b8; }
.wtype.pdf { background: #fdeceb; color: #c0392b; }
.wtype.audio { background: #f3e9fd; color: #7c3aed; }
.wtype.video { background: #fdeef5; color: #b83280; }
.wtype.zip { background: #f1f3f7; color: #4a5568; }
.wtype.other { background: #f1f3f7; color: #4a5568; }

.wcell b {
  font-size: 14.5px; line-height: 1.5; padding: 12px 14px 4px;
  display: block;
}
.wcell > span {
  font-size: 12.5px; color: var(--muted); padding: 0 14px 14px;
  display: block;
}
.wmore { margin: 20px 0 0; font-size: 14px; font-weight: 600; }


/* ---------------- 教育动态：新闻墙 ----------------
   每条给「标题 + 摘要 + 来源时间 + 阅读原文」。
   摘要在列表里就可见，不用先点开面板 —— 手机上尤其重要。 */
.newslist {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.newsrow {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
  transition: background .14s;
}
.newsrow:first-child { border-top: 0; }
.newsrow:hover { background: var(--card-soft); }

/* 可点区：标题 + 摘要，点了开站内面板 */
.nopen {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 15px 18px 6px;
  background: none; border: 0; font: inherit; color: var(--ink);
}
.nopen:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ntitle {
  display: block; font-size: 15px; font-weight: 600; line-height: 1.5;
  letter-spacing: -.1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nsum {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 6px;
  font-size: 13.5px; line-height: 1.7; color: var(--muted);
}

/* 底部一行：来源时间 + 阅读原文。高度撑到 44px，手指点得中。 */
.nfoot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 2px 18px 0; min-height: 44px;
}
.nmeta {
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.nmeta b { color: var(--brand); font-weight: 600; }
.nread {
  flex: none; display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 2px;
  font-size: 13px; font-weight: 600; color: var(--brand);
  text-decoration: none;
}
.nread:hover { text-decoration: underline; }

.nmore {
  margin: 18px 0 0; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.nmore a { display: inline-flex; align-items: center; min-height: 44px; }
.nupd { font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* ---------- 手机：字号放大、摘要给 3 行、留白更松 ---------- */
@media (max-width: 560px) {
  .nopen { padding: 16px 16px 4px; }
  .ntitle { font-size: 15.5px; line-height: 1.55; }
  .nsum { font-size: 14px; line-height: 1.75; margin-top: 8px; -webkit-line-clamp: 3; }
  .nfoot { padding: 4px 16px 2px; min-height: 46px; }
  .nmeta { font-size: 13px; }
  .nread { font-size: 13.5px; }
  .nmore { margin-top: 16px; }
}

/* ---------------- 教育动态：站内阅读面板 ---------------- */
.ndrawer[hidden] { display: none; }
.ndrawer { position: fixed; inset: 0; z-index: 90; }
.nback {
  position: absolute; inset: 0; background: rgba(15, 18, 30, .48);
  animation: nfade .18s ease;
}
@keyframes nfade { from { opacity: 0 } to { opacity: 1 } }
@keyframes nslide { from { transform: translateX(24px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes nup { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }

.npanel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(520px, 92vw); overflow-y: auto;
  background: var(--card); box-shadow: -12px 0 40px rgba(15, 18, 30, .16);
  padding: 30px 30px 40px; animation: nslide .2s ease;
  -webkit-overflow-scrolling: touch;
}
.nclose {
  position: absolute; top: 12px; right: 14px;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--card-soft);
  font-size: 21px; line-height: 1; color: var(--ink-2);
  display: grid; place-items: center;
}
.nclose:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.nsrc2 { margin: 0 0 12px; font-size: 12.5px; font-weight: 600; color: var(--brand); letter-spacing: .02em; }
.ntitle2 { margin: 0 0 16px; font-size: 21px; line-height: 1.45; letter-spacing: -.2px; padding-right: 40px; }
.nsum2 {
  margin: 0 0 26px; font-size: 15px; line-height: 1.9; color: var(--ink-2);
  padding-left: 14px; border-left: 3px solid var(--brand-soft);
}
.next { display: inline-flex; align-items: center; min-height: 46px; }
.nhint { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* 手机：面板改成从底部升起、几乎满屏的抽屉。
   92vw 的侧滑在手机上只剩一条窄缝，读整段导语很难受。 */
@media (max-width: 720px) {
  .npanel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-height: 88vh;
    border-radius: 18px 18px 0 0;
    padding: 22px 20px calc(28px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(15, 18, 30, .2);
    animation: nup .22s ease;
  }
  /* 顶部一条小横杠，暗示可以下滑关闭 */
  .npanel::before {
    content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 2px; background: var(--line);
  }
  .nclose { top: 10px; right: 10px; width: 42px; height: 42px; }
  .nsrc2 { margin: 10px 0 12px; }
  .ntitle2 { font-size: 19px; line-height: 1.5; padding-right: 46px; }
  .nsum2 { font-size: 15px; line-height: 1.95; }
  .next { width: 100%; justify-content: center; min-height: 50px; }
}

/* ---------------- 手机端触摸目标 ----------------
   苹果/谷歌的建议是 ≥44px。原来很多可点元素只有 18–38px，手指点不中。 */
@media (max-width: 720px) {
  .nav-toggle { min-width: 44px; min-height: 44px; }
  .brand { min-height: 44px; display: inline-flex; align-items: center; }
  .foot-links a, footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .more a, .wmore a, .block-head a { display: inline-flex; align-items: center; min-height: 44px; }
  .card.mod .more { min-height: 44px; }
  .crumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .notice a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---------------- 原卷扫描件图库 ----------------
   试卷是固定版式的文档，网页重排还原不了它的排版。
   所以直接放原卷每一页的扫描图 —— 版式百分之百一致。 */
.pages {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.pg {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--card);
  transition: border-color .15s, box-shadow .18s;
}
.pg:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.pg img { display: block; width: 100%; height: auto; }
.pg .pgno {
  display: block; padding: 9px 12px; font-size: 12.5px; color: var(--muted);
  border-top: 1px solid var(--line); text-align: center;
}
@media (max-width: 640px) {
  .pages { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

/* ---------------- 顶部细身份条 ----------------
   紧贴导航下方，56px。目的是让"这是谁做的"在首屏就能看到，
   但又不占地方 —— 原来那张大卡在 1.0 屏（要滚动），
   而且把内容位往后推了约 210px。
   视觉上像导航的延伸，不像一块内容。 */
.tbar {
  background: var(--brand-soft); border-bottom: 1px solid var(--line-strong);
}
.tbar .wrap {
  display: flex; align-items: center; gap: 11px;
  padding-top: 9px; padding-bottom: 9px;
}
.tbar-av {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.tbar-nm { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; color: var(--ink); }
.tbar-tg { font-size: 13.5px; color: var(--ink-2); }
.tbar-role {
  font-size: 12.5px; color: var(--muted);
  padding-left: 11px; border-left: 1px solid var(--line-strong);
}
.tbar-more {
  margin-left: auto; flex: none;
  font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 2px;
}
.tbar-more:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .tbar-tg { display: none; }
  .tbar-role { display: none; }
  .tbar .wrap { gap: 9px; }
}

/* ---------------- 页脚再放一次完整名片 ----------------
   读者翻到最后往往正在犹豫（看完样张、看完成品包），
   这时候"我是谁 / 怎么找我"要能马上看到，不用回顶部。 */
.footcard { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.footcard .tstrip { box-shadow: none; }
.footcard .tmore { margin-left: auto; }

/* ---------------- AI 能力展示模块（方案 A + B） ----------------
   A 卡：真跑过的批改结果，冻结成静态 JSON。谁都能看到真东西。
   B 框：访客自己粘一段，当场调 /api/ai-demo。 */
.aidemo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.ad-col {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.ad-b { border-color: var(--line-strong); background: var(--card-soft); }

.ad-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ad-tag {
  font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: #e7f7ee; color: #0f7a3d;
}
.ad-tag.alt { background: var(--brand-soft); color: var(--brand-dark); }
.ad-sub { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ── A 卡 ── */
.ad-in { background: #fbfaf6; border: 1px solid #ece5d6; border-radius: 10px; padding: 12px 14px; }
.ad-lb { font-size: 11.5px; font-weight: 700; color: #8a7a56; letter-spacing: .3px; margin-bottom: 6px; }
.ad-tx { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink-2); font-style: italic; }
.ad-wc { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ad-arrow { text-align: center; font-size: 12px; color: var(--muted); margin: 12px 0; }

.ad-out { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; }
.ad-score {
  font-size: 13px; color: var(--muted); display: flex; align-items: baseline; gap: 6px; margin-bottom: 12px;
}
.ad-score b { font-size: 30px; font-weight: 800; color: var(--brand); letter-spacing: -1px; }
.ad-score em { font-style: normal; font-size: 12px; color: #b45309; margin-left: auto; }

.ad-fix { list-style: none; margin: 0 0 12px; padding: 0; }
.ad-fix li {
  font-size: 13px; line-height: 1.7; padding: 6px 0; border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline;
}
.ad-fix li:first-child { border-top: 0; }
.ad-fix s { color: #b91c1c; text-decoration-thickness: 1px; }
.ad-fix i { font-style: normal; color: var(--muted); }
.ad-fix b { color: #15803d; font-weight: 600; }
.ad-fix span { width: 100%; font-size: 12px; color: var(--muted); padding-left: 2px; }

.ad-fb {
  margin: 0; font-size: 13.5px; line-height: 1.8; color: var(--ink-2);
  background: #f0f7ff; border-left: 3px solid var(--brand); padding: 10px 13px; border-radius: 0 8px 8px 0;
}

/* ── B 框 ── */
.ad-ta {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; line-height: 1.7;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); resize: vertical;
}
.ad-ta:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ad-act { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ad-hint { font-size: 12px; color: var(--muted); }

.ad-res { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ad-res .ad-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.ad-err { margin: 0; font-size: 13.5px; line-height: 1.7; color: #b45309; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 10px; padding: 11px 14px; }
.ad-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.ad-tip { font-size: 12.5px; line-height: 1.8; color: var(--muted); margin: 12px 0 0;
  padding-top: 12px; border-top: 1px dashed var(--line); }
.ad-tip b { color: var(--ink-2); }

@media (max-width: 860px) {
  .aidemo { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ad-col { padding: 15px 16px; }
  #adGo { width: 100%; min-height: 46px; }
  .ad-act { gap: 8px; }
}

/* AI 块嵌在「给老师」组里，标题用 h3 但要比 grouphead 轻一档，
   读起来像"给老师"下的一个小节，而不是第三个分组。 */
.ai-head { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.ai-head h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.ai-head p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.8; }
.ai-head p strong { color: var(--ink-2); }

/* ---------------- 「去试批」引导条 ----------------
   /ai/ 用它在讲完做法之后把读者送到 /try/。
   一个页面只干一件事：/ai/ 讲怎么做，/try/ 用来试。 */
.trycall {
  display: flex; align-items: center; gap: 15px;
  background: linear-gradient(120deg, var(--brand-soft), #fff);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 16px 20px; margin: 0 0 34px;
}
.trycall .tc-ico { font-size: 24px; line-height: 1; flex: none; }
.trycall .tc-tx { flex: 1; min-width: 0; }
.trycall .tc-tx b { display: block; font-size: 15.5px; margin-bottom: 3px; }
.trycall .tc-tx span { font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.trycall .btn { flex: none; }
@media (max-width: 640px) {
  .trycall { flex-wrap: wrap; padding: 14px 16px; }
  .trycall .tc-tx { flex: 1 1 100%; order: 2; }
  .trycall .btn { order: 3; width: 100%; text-align: center; justify-content: center; }
}

/* ---------------- 底部浏览统计 ----------------
   只显示聚合数字。放在正文最末，是"顺便看一眼"的信息，不抢内容位置。 */
.vstat {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card-soft);
  font-size: 13px; color: var(--muted);
}
.vstat .vs-ico { font-size: 17px; line-height: 1; }
.vstat .vs-item b {
  font-size: 16px; font-weight: 800; color: var(--ink);
  letter-spacing: -.3px; font-variant-numeric: tabular-nums;
}
.vstat .vs-sep { width: 1px; height: 18px; background: var(--line-strong); }
.vstat .vs-note {
  margin-left: auto; font-size: 12px; color: var(--muted); opacity: .85;
}
@media (max-width: 640px) {
  .vstat { gap: 8px 10px; padding: 12px 14px; }
  .vstat .vs-note { margin-left: 0; width: 100%; }
}

/* ---------------- 几个名字的对照（方案 D：互相指认） ----------------
   四个渠道名字不一致，读者会怀疑是不是同一个人。
   这里把对照关系摆出来，页脚和关于我页共用。 */
.samewho {
  font-size: 13.5px; color: var(--muted); line-height: 1.85;
  margin: 10px 0 0;
}
.samewho b { color: var(--ink); font-weight: 700; }
.samewho a { color: var(--brand); text-decoration: none; white-space: nowrap; }
.samewho a:hover { text-decoration: underline; }
p.footnote.samewho {
  border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 14px;
}
.namemap {
  width: 100%; border-collapse: collapse; margin: 16px 0 20px;
  font-size: 14.5px;
}
.namemap th, .namemap td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.namemap th {
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .04em; background: var(--card-soft);
  border-bottom: 1px solid var(--line-strong);
}
.namemap td:first-child { white-space: nowrap; color: var(--muted); font-size: 13.5px; }
.namemap td:nth-child(2) { white-space: nowrap; }
.namemap tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .namemap { font-size: 13.5px; }
  .namemap th, .namemap td { padding: 9px 8px; }
  .namemap td:nth-child(3) { font-size: 12.5px; }
}
