/* ==========================================================================
   智慧教育，海燕翱翔 —— 全站公共样式
   主题：深海蓝 + 海燕青，寓意“海燕翱翔于智慧之海”
   ★ 2026-10-03 科技风改版：深空蓝黑底 + 霓虹青/紫光效（参考 AI素材 视觉）
   ========================================================================== */

:root {
  --deep: #050b18;
  --deep-2: #0a1426;
  --sea: #0e2340;
  --sea-light: #1e4a7a;
  --cyan: #22d3ee;
  --sky: #0f1c33;
  --sand: #131d2f;
  --gold: #67e8f9;
  --gold-soft: #14324d;
  --ink: #e8f1ff;
  --ink-2: #b6c7de;
  --ink-3: #7e92b0;
  --line: #1d3350;
  --white: #0b1526;
  --primary: #22d3ee;
  --primary-soft: #0e2a41;
  --primary-glow: rgba(34, 211, 238, 0.30);
  --violet: #8b5cf6;
  --violet-glow: rgba(139, 92, 246, 0.30);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.45);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 26px;
  --maxw: 1200px;
  --nav-h: 68px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* 初中主题：珊瑚橙 */
body.grade-junior {
  --primary: #e2653a;
  --primary-soft: #fdeae2;
  --primary-glow: rgba(226, 101, 58, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #f5f9fd;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

.wrap { width: min(var(--maxw), 92vw); margin-inline: auto; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------ 顶部导航 ------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex; align-items: center; gap: 18px;
  min-height: var(--nav-h);
}

.brand { display: flex; align-items: center; gap: 12px; flex: none; }

.brand__mark {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: linear-gradient(140deg, var(--deep), var(--sea-light));
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(9, 48, 84, 0.28);
  overflow: hidden;
}
.brand__mark svg { width: 30px; height: 30px; }

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__title {
  font-size: 19px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(100deg, var(--deep), var(--sea-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__sub { font-size: 11px; color: var(--ink-3); letter-spacing: 2.6px; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.nav__link {
  position: relative; padding: 9px 15px; border-radius: 999px;
  font-size: 15px; color: var(--ink-2); font-weight: 600;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.nav__link:hover { background: var(--sky); color: var(--sea); }
.nav__link.is-active { background: var(--primary-soft); color: var(--primary); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px;
  width: 16px; height: 3px; border-radius: 3px; transform: translateX(-50%);
  background: var(--primary);
}

.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); margin-left: auto;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink-2);
}

/* ------------------------------ 学段切换 ------------------------------ */
.grade-switch {
  display: inline-flex; padding: 4px; gap: 4px;
  background: #eef4fa; border: 1px solid var(--line); border-radius: 999px;
}
.grade-switch__btn {
  padding: 7px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  color: var(--ink-2); transition: all 0.18s; white-space: nowrap;
}
.grade-switch__btn:hover { color: var(--primary); }
.grade-switch__btn.is-active {
  background: var(--primary); color: #fff;
  box-shadow: 0 6px 16px var(--primary-glow);
}
.grade-switch--float {
  position: fixed; right: 22px; bottom: 26px; z-index: 70;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}

/* 深色背景（页头 / 首屏 / 个人页横幅）上的学段切换 */
.grade-switch--on-dark {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.34);
}
.grade-switch--on-dark .grade-switch__btn { color: rgba(255, 255, 255, 0.9); }
.grade-switch--on-dark .grade-switch__btn:hover { color: #fff; }
.grade-switch--on-dark .grade-switch__btn.is-active {
  background: #fff; color: var(--primary);
  box-shadow: 0 6px 16px rgba(4, 24, 42, 0.28);
}
body.grade-junior .grade-switch--on-dark .grade-switch__btn.is-active { color: var(--primary); }

/* ------------------------------ 页头 ------------------------------ */
.page-head {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(120deg, var(--deep), var(--sea) 62%, var(--sea-light));
  padding: 54px 0 60px;
}
.page-head::before,
.page-head::after {
  content: ""; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 68%);
}
.page-head::before { width: 460px; height: 460px; right: -120px; top: -190px; }
.page-head::after { width: 320px; height: 320px; left: -120px; bottom: -190px; }
.page-head .wrap { position: relative; z-index: 2; }
.page-head__tag {
  display: inline-block; padding: 4px 13px; border-radius: 999px; font-size: 12.5px;
  letter-spacing: 2px; background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3); margin-bottom: 14px;
}
.page-head h1 { margin: 0 0 10px; font-size: clamp(25px, 3.4vw, 38px); letter-spacing: 1px; }
.page-head p { margin: 0; max-width: 760px; color: rgba(255, 255, 255, 0.88); }
.page-head__actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; }

.breadcrumb { font-size: 13.5px; color: rgba(255, 255, 255, 0.78); margin-bottom: 12px; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; font-size: 15px; font-weight: 700;
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s, color 0.16s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary {
  background: linear-gradient(120deg, var(--primary), var(--sea-light));
  color: #fff; box-shadow: 0 10px 24px var(--primary-glow);
}
.btn--primary:hover { box-shadow: 0 14px 32px var(--primary-glow); transform: translateY(-2px); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.14); color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.26); }
.btn--line {
  background: #fff; color: var(--primary); border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn--line:hover { border-color: var(--primary); transform: translateY(-2px); }
.btn--sm { padding: 8px 15px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ------------------------------ 区块 ------------------------------ */
.section { padding: 62px 0; }
.section--tight { padding: 40px 0; }
.section--sky { background: linear-gradient(180deg, #f0f7fd, #ffffff); }
.section--sand { background: linear-gradient(180deg, var(--sand), #ffffff); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 28px;
}
.section-head__left { max-width: 720px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 2.4px;
  color: var(--primary); text-transform: uppercase; margin-bottom: 8px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--primary);
}
.section-title { margin: 0 0 8px; font-size: clamp(21px, 2.6vw, 29px); letter-spacing: 0.6px; }
.section-desc { margin: 0; color: var(--ink-3); }

/* ------------------------------ 卡片 ------------------------------ */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #c6ddf0; }
.card__media {
  height: 128px; position: relative;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--deep), var(--sea-light));
  color: #fff; font-size: 34px; font-weight: 800; letter-spacing: 2px;
}
.card__media::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.28), transparent 60%);
}
.card__body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__title { margin: 0; font-size: 17.5px; font-weight: 800; letter-spacing: 0.3px; }
.card__text { margin: 0; color: var(--ink-3); font-size: 14.3px; }
.card__foot {
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--ink-3);
}

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  background: var(--sky); color: var(--sea);
}
.tag--gold { background: var(--gold-soft); color: #a86a00; }
.tag--primary { background: var(--primary-soft); color: var(--primary); }
.tag--junior { background: #fdeae2; color: #c04d24; }
.tag--plain { background: #f0f4f8; color: var(--ink-2); font-weight: 600; }

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* ------------------------------ 学段分区 ------------------------------ */
.zone {
  border-radius: var(--radius-lg); padding: 26px;
  border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.zone + .zone { margin-top: 34px; }
.zone--primary { background: linear-gradient(180deg, #f2f8fe, #ffffff 42%); }
.zone--junior { background: linear-gradient(180deg, #fef4ef, #ffffff 42%); }
.zone::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(180deg, var(--sea), var(--cyan));
}
.zone--junior::before { background: linear-gradient(180deg, #e2653a, var(--gold)); }
.zone__head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px dashed var(--line); margin-bottom: 22px;
}
.zone__badge {
  width: 52px; height: 52px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, var(--sea), var(--sea-light));
  letter-spacing: 1px; text-align: center; line-height: 1.05;
}
.zone--junior .zone__badge { background: linear-gradient(140deg, #d6542a, #f09447); }
.zone__title { margin: 0; font-size: 20px; font-weight: 800; }
.zone__desc { margin: 2px 0 0; font-size: 13.6px; color: var(--ink-3); }
.zone__count { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.zone.is-locked .zone__body { display: none; }

/* ------------------------------ 筛选栏 ------------------------------ */
.filters {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 26px;
  display: flex; flex-direction: column; gap: 14px;
}
.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-row__label {
  font-size: 13px; font-weight: 800; color: var(--ink-2);
  min-width: 62px; letter-spacing: 1px;
}
.chip {
  padding: 6px 14px; border-radius: 999px; font-size: 13.4px; font-weight: 600;
  background: #f2f6fa; color: var(--ink-2); border: 1px solid transparent;
  transition: all 0.16s;
}
.chip:hover { background: var(--sky); color: var(--sea); }
.chip.is-active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 6px 14px var(--primary-glow);
}

.search-box { position: relative; flex: 1; min-width: 210px; }
.search-box input {
  width: 100%; padding: 10px 16px 10px 40px; border-radius: 999px;
  border: 1px solid var(--line); background: #f8fbfe; color: var(--ink);
  outline: none; transition: border-color 0.16s, box-shadow 0.16s;
}
.search-box input:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.search-box::before {
  content: "🔍"; position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); font-size: 14px; opacity: 0.6;
}

.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; font-size: 13.6px; color: var(--ink-3);
  margin-bottom: 16px;
}

/* ------------------------------ 列表条目 ------------------------------ */
.item {
  display: flex; gap: 16px; padding: 16px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform 0.18s, box-shadow 0.18s;
}
.item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.item__icon {
  width: 54px; height: 54px; border-radius: 15px; flex: none;
  display: grid; place-items: center; font-size: 24px;
  background: var(--sky); color: var(--sea);
}
.item__main { flex: 1; min-width: 0; }
.item__title {
  margin: 0 0 5px; font-size: 16.4px; font-weight: 800;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.item__desc { margin: 0 0 8px; font-size: 13.8px; color: var(--ink-3); }
.item__meta {
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.6px; color: var(--ink-3);
}
.item__side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex: none; }

/* ------------------------------ 名师 ------------------------------ */
.teacher-card { text-align: left; }
.teacher-card .avatar {
  width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
  font-size: 21px; font-weight: 800; color: #fff; letter-spacing: 1px;
  background: linear-gradient(140deg, var(--sea), var(--cyan));
  box-shadow: 0 8px 20px var(--primary-glow);
}
.teacher-card .avatar--warm { background: linear-gradient(140deg, #e2653a, #f6a623); }
.quote {
  border-left: 4px solid var(--primary); background: var(--primary-soft);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.6px; color: var(--ink); margin: 0;
}
.quote--warm { border-color: var(--gold); background: var(--gold-soft); }

/* ------------------------------ 详情抽屉 ------------------------------ */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(6, 32, 56, 0.42);
  backdrop-filter: blur(3px); z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity 0.22s;
}
.drawer-mask.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 94vw);
  background: #fff; z-index: 95; box-shadow: -18px 0 50px rgba(6, 32, 56, 0.24);
  transform: translateX(102%); transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer__head {
  padding: 20px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 14px;
  background: linear-gradient(120deg, var(--deep), var(--sea));
  color: #fff;
}
.drawer__head h3 { margin: 0 0 6px; font-size: 19px; }
.drawer__head p { margin: 0; font-size: 13.4px; color: rgba(255, 255, 255, 0.85); }
.drawer__close {
  margin-left: auto; width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 17px;
  display: grid; place-items: center;
}
.drawer__close:hover { background: rgba(255, 255, 255, 0.3); }
.drawer__body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer__foot {
  padding: 16px 22px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; flex-wrap: wrap; background: #fafdff;
}

/* ------------------------------ 个人页 ------------------------------ */
.profile-hero {
  background: linear-gradient(120deg, var(--deep), var(--sea) 65%, var(--sea-light));
  color: #fff; border-radius: var(--radius-lg); padding: 28px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.profile-hero__avatar {
  width: 86px; height: 86px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 30px; font-weight: 800;
  background: rgba(255, 255, 255, 0.18); border: 2px solid rgba(255, 255, 255, 0.5);
}
.profile-hero__name { margin: 0 0 4px; font-size: 24px; }
.profile-hero__meta { margin: 0; font-size: 13.8px; color: rgba(255, 255, 255, 0.86); }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.stat__num {
  font-size: 27px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(120deg, var(--primary), var(--sea-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { font-size: 13px; color: var(--ink-3); }

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel__head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.panel__head h3 { margin: 0; font-size: 17px; }
.panel__head .hint { font-size: 12.6px; color: var(--ink-3); }
.panel__body { padding: 20px; }

.progress {
  height: 9px; border-radius: 999px; background: #eaf2f9; overflow: hidden;
}
.progress__bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--sea), var(--cyan));
  transition: width 0.4s ease;
}

.plan-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
}
.plan-item:last-child { border-bottom: 0; }
.plan-item__check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line);
  flex: none; display: grid; place-items: center; font-size: 12px; color: #fff;
  transition: all 0.16s; cursor: pointer; background: #fff;
}
.plan-item__check.is-done { background: var(--primary); border-color: var(--primary); }
.plan-item.is-done .plan-item__text { text-decoration: line-through; color: var(--ink-3); }
.plan-item__text { font-size: 14.4px; flex: 1; }
.plan-item__tag { font-size: 12px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px; background: var(--line);
}
.timeline__item { position: relative; padding: 0 0 16px 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -20px; top: 8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.timeline__time { font-size: 12.4px; color: var(--ink-3); }
.timeline__text { font-size: 14.3px; margin: 2px 0 0; }

.empty {
  text-align: center; padding: 40px 18px; color: var(--ink-3);
  border: 1px dashed var(--line); border-radius: var(--radius); background: #fbfdff;
}
.empty__icon { font-size: 34px; margin-bottom: 8px; }

/* ------------------------------ 表单 ------------------------------ */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field input, .field select, .field textarea {
  padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #f8fbfe; outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-glow);
}

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 24px);
  background: var(--deep); color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow-lg); z-index: 120;
  opacity: 0; pointer-events: none; transition: all 0.24s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------ 页脚 ------------------------------ */
.footer {
  margin-top: 40px; padding: 44px 0 96px; color: rgba(255, 255, 255, 0.82);
  background: linear-gradient(180deg, var(--deep-2), #041c33);
}
.footer__grid {
  display: grid; gap: 26px; grid-template-columns: 1.5fr 1fr 1fr 1fr;
  padding-bottom: 26px; border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}
.footer h4 { margin: 0 0 12px; font-size: 15px; color: #fff; }
.footer p { margin: 0 0 8px; font-size: 13.6px; }
.footer a { font-size: 13.6px; color: rgba(255, 255, 255, 0.82); display: block; padding: 4px 0; }
.footer a:hover { color: var(--cyan); }
.footer__bottom {
  padding-top: 18px; display: flex; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; font-size: 12.8px; color: rgba(255, 255, 255, 0.6);
}

/* ------------------------------ 首页专用 ------------------------------ */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(125deg, #041f39 0%, var(--deep) 34%, var(--sea) 72%, var(--sea-light) 100%);
  padding: 68px 0 76px;
}
.hero__inner {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center;
}
.hero__tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 15px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3); font-size: 13px; letter-spacing: 1.6px;
}
.hero h1 {
  margin: 20px 0 8px; font-size: clamp(32px, 5vw, 54px); line-height: 1.16;
  letter-spacing: 2px;
}
.hero h1 .accent {
  background: none; color: var(--ink); -webkit-background-clip: initial; background-clip: initial;
}
.hero__slogan { margin: 0 0 14px; font-size: 17px; letter-spacing: 3px; color: rgba(255, 255, 255, 0.9); }
.hero__desc { margin: 0 0 26px; max-width: 620px; color: rgba(255, 255, 255, 0.84); }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__stats {
  display: flex; gap: 34px; flex-wrap: wrap; margin-top: 34px;
  padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.hero__stat b { display: block; font-size: 26px; letter-spacing: 1px; }
.hero__stat span { font-size: 13px; color: rgba(255, 255, 255, 0.72); }

.hero__art { position: relative; }
.hero__art-card {
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg); padding: 22px; backdrop-filter: blur(6px);
  box-shadow: var(--shadow-lg);
}
.hero__art-card h3 { margin: 0 0 14px; font-size: 16px; letter-spacing: 1px; }
.hero__art-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16); font-size: 14px;
}
.hero__art-list li:last-child { border-bottom: 0; }
.hero__art-list .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--cyan); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2);
}
.hero__art-list .when { margin-left: auto; font-size: 12.4px; color: rgba(255, 255, 255, 0.7); }

.hero__wave { position: absolute; left: 0; right: 0; bottom: -2px; z-index: 2; width: 100%; }
.hero__bird { position: absolute; right: 6%; top: 12%; z-index: 2; opacity: 0.9; }
.hero__glow {
  position: absolute; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.34), transparent 66%);
}
.hero__glow--a { width: 520px; height: 520px; right: -140px; top: -180px; }
.hero__glow--b { width: 380px; height: 380px; left: -160px; bottom: -160px;
  background: radial-gradient(circle, rgba(246, 166, 35, 0.22), transparent 66%); }

.entry-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.entry {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.entry:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.entry::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--sky); opacity: 0.8; transition: transform 0.3s;
}
.entry:hover::after { transform: scale(1.16); }
.entry__icon {
  position: relative; z-index: 2; width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center; font-size: 25px; margin-bottom: 14px;
  background: linear-gradient(140deg, var(--primary-soft), #fff);
  border: 1px solid var(--line);
}
.entry h3 { position: relative; z-index: 2; margin: 0 0 8px; font-size: 17.5px; }
.entry p { position: relative; z-index: 2; margin: 0 0 14px; font-size: 13.8px; color: var(--ink-3); }
.entry__more { position: relative; z-index: 2; font-size: 13.4px; font-weight: 800; color: var(--primary); }

.marquee {
  overflow: hidden; background: #fff; border-block: 1px solid var(--line);
  padding: 12px 0;
}
.marquee__track {
  display: flex; gap: 40px; white-space: nowrap; width: max-content;
  animation: slide 34s linear infinite;
}
.marquee__track span { font-size: 13.6px; color: var(--ink-2); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.steps { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); position: relative;
}
.step__num {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; color: #fff; margin-bottom: 12px;
  background: linear-gradient(140deg, var(--sea), var(--cyan));
}
.step h3 { margin: 0 0 6px; font-size: 16.5px; }
.step p { margin: 0; font-size: 13.7px; color: var(--ink-3); }

.cta {
  border-radius: var(--radius-lg); padding: 38px; color: #fff; text-align: center;
  background: linear-gradient(120deg, var(--deep), var(--sea) 70%, var(--sea-light));
  box-shadow: var(--shadow-lg);
}
.cta h2 { margin: 0 0 10px; font-size: clamp(20px, 2.6vw, 28px); letter-spacing: 1px; }
.cta p { margin: 0 0 22px; color: rgba(255, 255, 255, 0.86); }
.cta__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: 2; }
  .grid--4, .entry-grid, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .nav {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column;
    align-items: stretch; gap: 6px; padding: 14px 5vw 20px;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); margin-left: 0;
    transform: translateY(-130%); transition: transform 0.24s; z-index: 55;
  }
  .nav.is-open { transform: none; }
  .nav__link { padding: 12px 16px; border-radius: 12px; }
  .nav__link.is-active::after { display: none; }
  .nav-toggle { display: flex; }
  .brand__sub { display: none; }

  .grid--2, .grid--3, .grid--4, .entry-grid, .steps, .stat-grid,
  .form-grid { grid-template-columns: 1fr; }
  .item { flex-direction: column; }
  .item__side { align-items: flex-start; flex-direction: row; }
  .footer__grid { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .zone { padding: 18px; }
  .grade-switch--float { right: 12px; bottom: 14px; }
}

@media print {
  .topbar, .footer, .drawer, .drawer-mask, .grade-switch--float { display: none !important; }
}

/* ==========================================================================
   追加样式：四类课程 / 资料管理 / 名师在线编辑 / 学生成长记录
   ========================================================================== */

.select {
  padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #f8fbfe; color: var(--ink); outline: none; max-width: 100%;
}
.select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-glow); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.hint { font-size: 12.8px; color: var(--ink-3); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px;
  border-radius: 999px; font-size: 12.4px; font-weight: 700;
  background: #eef4fa; color: var(--ink-2); border: 1px solid var(--line);
}
.badge--on { background: #e3f7ec; color: #17794a; border-color: #bfe8d2; }
.badge--warn { background: var(--gold-soft); color: #a86a00; border-color: #f2d59a; }

.notice {
  border: 1px solid var(--line); border-left: 4px solid var(--sea-light);
  background: #f7fbfe; border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px; font-size: 13.8px; color: var(--ink-2); line-height: 1.75;
}
.notice--ok { border-left-color: #2fb27a; background: #f4fcf8; }
.notice--warn { border-left-color: var(--gold); background: #fffaf1; }
.notice code, .deploy-list code { background: #eef4fa; padding: 1px 6px; border-radius: 5px; font-size: 12.6px; }

.deploy-list { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.deploy-list li { list-style: decimal; }

.nice-list { display: grid; gap: 8px; margin: 0 0 16px; }
.nice-list li { font-size: 14.2px; color: var(--ink-2); }
.drawer__body h4 { margin: 18px 0 8px; font-size: 15.4px; }
.drawer__body h4:first-child { margin-top: 0; }

/* ------------------------------ 四类课程卡片 ------------------------------ */
.subject-card {
  display: block; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; position: relative; overflow: hidden;
}
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #c6ddf0; }
.subject-card__icon {
  width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center;
  font-size: 24px; margin-bottom: 12px;
  background: linear-gradient(140deg, var(--primary-soft), #fff); border: 1px solid var(--line);
}
.subject-card h3 { margin: 0 0 6px; font-size: 17px; }
.subject-card p { margin: 0 0 12px; font-size: 13.4px; color: var(--ink-3); }
.subject-card__count { font-size: 13px; font-weight: 800; color: var(--primary); }

.card__media { display: flex; align-items: center; justify-content: center; gap: 10px; }
.card__icon { font-size: 24px; letter-spacing: 0; }

/* ------------------------------ 名师卡片 ------------------------------ */
.teacher-head { display: flex; gap: 14px; align-items: center; }
.teacher-head__name { margin: 0 0 4px; }
.teacher-card .quote { margin: 6px 0 10px; font-size: 14.2px; }
.teacher-card .card__text { font-size: 13.6px; }

.teacher-view__intro { font-size: 15px; color: var(--ink-2); margin: 14px 0 4px; }
.teacher-view__meta { display: block; margin-top: 14px; }
.points-list { display: grid; gap: 10px; }
.points-list li {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fbfdff;
}
.points-list li b { color: var(--primary); display: block; margin-bottom: 4px; }
.points-list li div { font-size: 14.2px; color: var(--ink-2); margin: 0; }
.cases-list { display: grid; gap: 10px; }
.cases-list li { display: flex; gap: 12px; align-items: flex-start; }
.cases-list__time {
  flex: none; min-width: 76px; font-size: 12.4px; font-weight: 800; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px; padding: 2px 10px; text-align: center;
}
.cases-list li div { font-size: 14.2px; color: var(--ink-2); }

/* ------------------------------ 富文本编辑器 ------------------------------ */
.editor { display: grid; gap: 14px; }
.editor__meta { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor__toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.editor__toolbar button {
  padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #f8fbfe; font-size: 12.8px; color: var(--ink-2); font-weight: 600;
}
.editor__toolbar button:hover { border-color: var(--primary); color: var(--primary); background: #fff; }
.editor__preview {
  margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  border: 1px dashed var(--line); background: #fbfdff; font-size: 13.8px; color: var(--ink-2);
  min-height: 20px;
}
.editor__preview:empty { display: none; }
.editor__group { display: grid; gap: 10px; }
.editor__group-head { display: flex; align-items: center; gap: 12px; }
.editor__group-head b { font-size: 14.6px; }
.editor__rows { display: grid; gap: 10px; }
.editor__row {
  display: grid; gap: 8px; grid-template-columns: 150px 1fr 34px;
  align-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fbfdff;
}
.editor__row--dim { grid-template-columns: 130px 60px 80px 1fr 34px; }
.editor__row input, .editor__row textarea, .editor__row select {
  padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; outline: none; width: 100%; font-size: 13.6px;
}
.editor__row textarea { min-height: 44px; resize: vertical; }
.editor__row-del {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-3);
}
.editor__row-del:hover { color: #c0392b; border-color: #f0b6ae; background: #fff5f4; }
.editor__section {
  margin: 22px 0 12px; font-size: 15.4px; display: flex; align-items: center; gap: 12px;
  padding-bottom: 8px; border-bottom: 1px dashed var(--line);
}
.editor__section:first-of-type { margin-top: 0; }

/* ------------------------------ 管理后台 ------------------------------ */
.admin-session { margin-top: 12px !important; font-size: 13.6px; color: rgba(255,255,255,.88); }
.admin-tabs {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.data-table th, .data-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top;
}
.data-table th { background: #f7fbfe; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.diff--up { color: #17794a; font-weight: 700; }
.diff--down { color: #c0392b; font-weight: 700; }

/* ------------------------------ 学生成长记录 ------------------------------ */
.profile-hero__meta { font-size: 13.8px; }
.dim { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.dim:last-child { border-bottom: 0; }
.dim__head { display: flex; justify-content: space-between; font-size: 14.2px; margin-bottom: 6px; }
.dim__note { margin: 6px 0 0; font-size: 12.8px; color: var(--ink-3); }
.radar { width: 100%; max-width: 320px; margin: 0 auto; display: block; }

.bar-chart { display: flex; gap: 18px; align-items: flex-end; height: 220px; padding: 10px 4px 0; }
.bar-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-chart__value { font-size: 13px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.bar-chart__track {
  position: relative; flex: 1; width: 100%; max-width: 54px;
  background: linear-gradient(180deg, #f2f8fe, #fff); border-radius: 10px 10px 4px 4px;
  border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center;
}
.bar-chart__bar {
  position: absolute; bottom: 0; width: 62%; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--sea-light), var(--sea));
}
.bar-chart__avg {
  position: absolute; bottom: 0; width: 90%; border-radius: 6px 6px 0 0;
  background: rgba(47, 155, 216, 0.18); border: 1px dashed rgba(47, 155, 216, 0.5);
}
.bar-chart__label { margin-top: 8px; font-size: 12.4px; color: var(--ink-3); text-align: center; }

.timeline__desc { margin: 2px 0 0; font-size: 13.6px; color: var(--ink-3); }

.honor-list { display: grid; gap: 12px; }
.honor-list li { display: flex; gap: 12px; align-items: flex-start; }
.honor-list__level {
  flex: none; font-size: 12.2px; font-weight: 800; color: #a86a00;
  background: var(--gold-soft); border-radius: 999px; padding: 2px 10px;
}
.honor-list li b { font-size: 14.4px; }
.honor-list__date { margin-left: 8px; font-size: 12.4px; color: var(--ink-3); }
.honor-list__note { margin: 3px 0 0; font-size: 13.2px; color: var(--ink-3); }

.comment-list { display: grid; gap: 14px; }
.comment { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fbfdff; }
.comment__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment__head b { font-size: 14.4px; }
.comment__date { margin-left: auto; font-size: 12.4px; color: var(--ink-3); }
.comment__text { margin: 8px 0 0; font-size: 13.8px; color: var(--ink-2); }

.reflect { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.reflect:last-child { border-bottom: 0; }
.reflect h4 { margin: 0 0 6px; font-size: 14.2px; color: var(--primary); }
.reflect p { margin: 0; font-size: 14px; color: var(--ink-2); }
.reflect--next { background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; border-bottom: 0; }

.item--mine { border-color: #f2d59a; background: linear-gradient(180deg, #fffdf7, #fff); }

/* 提示条（成功 / 失败） */
.toast--error { background: #a33224; }
.toast--ok { background: var(--deep); }

@media (max-width: 1024px) {
  .editor__row, .editor__row--dim { grid-template-columns: 1fr 1fr; }
  .editor__row-del { grid-column: span 2; justify-self: end; }
  .editor__meta { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .bar-chart { gap: 8px; height: 180px; }
  .editor__row, .editor__row--dim { grid-template-columns: 1fr; }
  .editor__row-del { grid-column: auto; justify-self: end; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ==========================================================================
   追加样式：两级分类 / 视频权限 / 卡片角标 / 代码片段
   ========================================================================== */

/* 课程封面上的权限角标 */
.card__media { position: relative; }
.card__badge {
  position: absolute; right: 12px; bottom: 10px; z-index: 2;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, 0.2); color: #fff; border: 1px solid rgba(255, 255, 255, 0.45);
  letter-spacing: 0.4px;
}
.card__badge--on { background: rgba(255, 255, 255, 0.92); color: #17794a; border-color: #fff; }

/* 「无权限观看」提示块 */
.deny {
  text-align: center; padding: 22px 18px; border-radius: var(--radius);
  border: 1px dashed #e6c07a; background: linear-gradient(180deg, #fffaf1, #fff);
}
.deny--inline { text-align: left; margin-bottom: 6px; }
.deny__icon { font-size: 34px; line-height: 1; }
.deny__title { margin: 10px 0 8px; font-size: 19px; color: #a86a00; letter-spacing: 1px; }
.deny__text { margin: 0; font-size: 14px; color: var(--ink-2); }
.deny__meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }

/* 视频就绪区 */
.video-box { display: grid; gap: 12px; }
.video-box__frame {
  height: 168px; border-radius: var(--radius); display: grid; place-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--deep), var(--sea-light)); color: #fff; text-align: center;
}
.video-box__frame p { margin: 0; font-size: 13.4px; color: rgba(255, 255, 255, 0.85); }
.video-box__play {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.22); border: 2px solid rgba(255, 255, 255, 0.6); font-size: 20px;
}

/* 无权限按钮（灰色，但仍可点击查看提示） */
.btn--muted {
  background: #f1f5f9; color: var(--ink-2); border: 1px solid var(--line);
}
.btn--muted:hover { background: #e8eef5; color: var(--ink); }

/* 代码片段（给维护者看的格式示例） */
.code-block {
  margin: 12px 0 0; padding: 14px; border-radius: var(--radius-sm);
  background: #0b2136; color: #cfe8ff; font-size: 12.4px; line-height: 1.7;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* 二级分类行：为空时不占位置 */
.chip-row:empty { display: none; }

/* ==========================================================================
   移动端适配（手机优先修复）
   断点：1024 平板横屏 / 900 折叠屏与小笔记本 / 780 手机横屏与小平板竖屏 /
         560 常见手机竖屏（iPhone 15 等 390—430px 宽）/ 380 超窄屏
   ========================================================================== */

/* 触控与滚动体验基础设置 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  /* ⚠️ 不能用 body { overflow-x: hidden }（踩过）：
     规范规定一轴为 hidden 时另一轴的 visible 会被计算成 auto，
     于是 body 变成滚动容器且高度塌陷（实测只有 125px），
     导致移动端整页无法滚动、position:fixed 元素行为异常。
     改用 overflow-x: clip —— 只横向裁剪，不改另一轴的计算值。 */
  body { overflow-x: clip; }
img, svg, table { max-width: 100%; }

/* 所有横向按钮组：手机上可横向滑动，避免挤压换行 */
@media (max-width: 780px) {
  .chip-row {
    display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px;
    padding-bottom: 6px; margin-inline: -4px; padding-inline: 4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .filter-row { align-items: flex-start; }
  .filter-row__label { min-width: 74px; padding-top: 6px; }
}

/* 表格：手机上横向滚动，首列不塌陷 */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 780px) {
  .table-scroll .data-table { min-width: 640px; }
  .data-table th, .data-table td { padding: 9px 10px; }
}

/* 抽屉：手机上占满屏幕，底部按钮换行更好点 */
@media (max-width: 780px) {
  .drawer { width: 100%; border-radius: 0; }
  .drawer__head { padding: 16px 16px; }
  .drawer__head h3 { font-size: 17px; }
  .drawer__body { padding: 16px; }
  .drawer__foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }
  .drawer__foot .btn { flex: 1 1 auto; justify-content: center; }
}

/* 首屏与页头：手机上收紧留白，标题字号收一档 */
@media (max-width: 780px) {
  .hero { padding: 40px 0 60px; }
  .hero h1 { font-size: clamp(26px, 8vw, 34px); letter-spacing: 1px; }
  .hero__slogan { font-size: 14px; letter-spacing: 2px; }
  .hero__desc { font-size: 14.6px; }
  .hero__stats { gap: 20px; margin-top: 24px; padding-top: 18px; }
  .hero__stat b { font-size: 22px; }
  .hero__stat span { font-size: 12.4px; }
  .hero__art-card { padding: 16px; }
  .hero__art-card h3 { font-size: 15px; }
  .hero__art-list li { font-size: 13.4px; flex-wrap: wrap; }
  .hero__bird { display: none; }

  .page-head { padding: 32px 0 38px; }
  .page-head h1 { font-size: clamp(21px, 6.4vw, 27px); line-height: 1.35; }
  .page-head p { font-size: 14.2px; }
  .page-head__actions { gap: 10px; }
  .page-head__actions .btn { flex: 1 1 auto; }
}

/* 卡片与列表：手机上单列、图片区收矮、操作按钮更好点 */
@media (max-width: 780px) {
  .section { padding: 34px 0; }
  .section--tight { padding: 24px 0; }
  .section-title { font-size: clamp(19px, 5.4vw, 23px); }
  .section-desc { font-size: 13.8px; }

  .card__media { height: 96px; font-size: 24px; }
  .card__body { padding: 14px; gap: 8px; }
  .card__title { font-size: 16.4px; }
  .card__text { font-size: 13.6px; }
  .card__icon { font-size: 20px; }
  .card__badge { right: 10px; bottom: 8px; font-size: 11.4px; padding: 2px 8px; }
  .card__foot { font-size: 12.4px; flex-wrap: wrap; }

  .item { padding: 14px; gap: 12px; }
  .item__icon { width: 46px; height: 46px; font-size: 20px; border-radius: 13px; }
  .item__title { font-size: 15.4px; }
  .item__side { width: 100%; }
  .item__side .btn { flex: 1 1 auto; justify-content: center; }

  .entry { padding: 18px 16px; }
  .entry h3 { font-size: 16.4px; }
  .entry p { font-size: 13.4px; }

  .step { padding: 18px; }
  .zone { padding: 16px; }
  .zone__head { gap: 10px; padding-bottom: 14px; margin-bottom: 16px; }
  .zone__badge { width: 44px; height: 44px; font-size: 13px; border-radius: 13px; }
  .zone__title { font-size: 17px; }
  .zone__count { margin-left: 0; font-size: 12.4px; }

  .filters { padding: 14px; gap: 12px; }
  .select, .search-box input { font-size: 15px; }  /* 15px 以上可避免 iOS 聚焦缩放 */
  .search-box { min-width: 100%; }
  .result-bar { font-size: 12.8px; }
}

/* 筛选栏里的说明文字与二维码级别的细节：手机上隐藏次要信息 */
@media (max-width: 560px) {
  .filters .hint { display: none; }
  .marquee__track span { font-size: 12.6px; }
  .marquee { padding: 10px 0; }

  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat__num { font-size: 22px; }
  .stat__label { font-size: 12.2px; }

  .profile-hero { padding: 20px; gap: 16px; }
  .profile-hero__avatar { width: 64px; height: 64px; font-size: 24px; }
  .profile-hero__name { font-size: 20px; }
  .profile-hero__meta { font-size: 13px; }
  .profile-hero > div[style*="text-align:right"] { text-align: left !important; width: 100%; }

  .panel__head { padding: 13px 15px; }
  .panel__body { padding: 15px; }

  .bar-chart { gap: 6px; height: 160px; }
  .bar-chart__value { font-size: 12px; }
  .bar-chart__label { font-size: 11px; }

  .points-list li, .cases-list li div { font-size: 13.6px; }
  .cases-list li { flex-direction: column; gap: 6px; }
  .cases-list__time { min-width: 0; }

  .exp-card__topic { font-size: 16px; }
  .exp-card__gist { font-size: 13.6px; }
  .editor__row { padding: 9px; }

  .footer { padding: 32px 0 84px; }
  .footer h4 { font-size: 14.4px; }
  .footer a, .footer p { font-size: 13.2px; }
  .footer__bottom { font-size: 12px; }

  .cta { padding: 24px 18px; }
  .cta h2 { font-size: 19px; }
  .cta__actions .btn { flex: 1 1 100%; }
}

/* 超窄屏（旧机型 / 分屏）：进一步压缩 */
@media (max-width: 380px) {
  .wrap { width: 94vw; }
  .brand__title { font-size: 16.4px; }
  .nav__link { font-size: 14.4px; }
  .chip { padding: 5px 11px; font-size: 12.6px; }
  .btn { padding: 10px 16px; font-size: 14.2px; }
  .btn--sm { padding: 7px 12px; font-size: 12.8px; }
  .hero h1 { font-size: 24px; }
}

/* 横屏手机：减少竖向留白，避免内容被折行挤压 */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding: 26px 0 44px; }
  .hero__stats { display: none; }
  .page-head { padding: 22px 0 26px; }
  .section { padding: 26px 0; }
}

/* 支持刘海屏安全区 */
@supports (padding: max(0px)) {
  .topbar__inner { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
  .grade-switch--float {
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

/* 触控设备：按钮最小点击区 44px，去掉 hover 位移以免误触 */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .chip { min-height: 38px; display: inline-flex; align-items: center; }
  .nav__link { min-height: 44px; display: flex; align-items: center; }
  .card:hover, .entry:hover, .item:hover, .subject-card:hover { transform: none; }
  .btn:active { transform: scale(0.98); }
}

/* ==========================================================================
   经验卡片（主题制）：标题是经验主题，供稿人在底部
   ========================================================================== */
.exp-card__topic {
  margin: 0; font-size: 17.4px; font-weight: 800; line-height: 1.45; letter-spacing: 0.2px;
}
.exp-card__gist {
  margin: 0; font-size: 14.2px; color: var(--primary); font-weight: 700;
}
.exp-card__gist::before { content: "结论："; color: var(--ink-3); font-weight: 600; }
.exp-card__intro { margin: 0; }
.exp-card__foot { align-items: center; }
.exp-card__author { font-size: 12.6px; color: var(--ink-3); white-space: nowrap; }

@media (max-width: 780px) {
  .exp-card__foot { flex-wrap: wrap; gap: 8px; }
  .exp-card__author { white-space: normal; }
}

/* ==========================================================================
   追加样式：技术主题页（三层 / 路线 / 媒体）与资料新分类
   ========================================================================== */

/* 三层概览卡 */
.layer-card { display: flex; flex-direction: column; }
.layer-card__count {
  margin: 10px 0 12px; font-size: 13.4px; font-weight: 800; color: var(--primary);
}
.layer-card .btn { margin-top: auto; align-self: flex-start; }

/* 按周路线 */
.route {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 22px;
}
.route__head { padding-bottom: 14px; border-bottom: 1px dashed var(--line); margin-bottom: 18px; }
.route__head h3 { margin: 0 0 8px; font-size: 20px; }
.route__head p { margin: 0 0 10px; color: var(--ink-2); font-size: 14.2px; }
.route__track { margin-bottom: 20px; }
.route__track:last-child { margin-bottom: 0; }
.route__track-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.route__track-head b { font-size: 16px; }
.route__weeks { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.week-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px;
  background: linear-gradient(180deg, #f8fbfe, #fff); display: flex; flex-direction: column; gap: 10px;
}
.week-card__num {
  align-self: flex-start; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--sea-light));
}
.week-card h4 { margin: 0; font-size: 15.4px; line-height: 1.4; }
.week-card__row { font-size: 13.4px; }
.week-card__label {
  display: inline-block; min-width: 34px; font-weight: 800; color: var(--primary); font-size: 12.4px;
}
.week-card__row ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.week-card__row li { list-style: disc; color: var(--ink-2); }
.week-card__extra {
  margin-top: auto; padding: 8px 10px; border-radius: 8px; background: var(--gold-soft);
  font-size: 12.6px; color: #87561a;
}
.week-card__extra b { display: block; margin-bottom: 2px; }
.route__advanced {
  margin-top: 4px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--primary-soft); font-size: 13.6px;
}
.route__advanced b { display: block; margin-bottom: 6px; color: var(--primary); }
.route__advanced ul { padding-left: 18px; display: grid; gap: 4px; }
.route__advanced li { list-style: disc; }

/* 图集 */
.media-card { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.media-card__frame {
  height: 168px; display: grid; place-items: center; background: #f2f7fc; overflow: hidden;
}
.media-card__img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.img--broken {
  width: 100%; height: 100%; background: #eef3f8;
  background-image: linear-gradient(135deg, #e6eef6 25%, #f4f8fb 25%, #f4f8fc 50%, #e6eef6 50%, #e6eef6 75%, #f4f8fc 75%);
  background-size: 18px 18px; color: transparent;
}
.media-card figcaption { padding: 14px; font-size: 13.4px; }
.media-card figcaption b { font-size: 14.6px; }
.media-card figcaption p { margin: 6px 0 8px; color: var(--ink-3); }
.media-card__src { font-size: 11.8px; color: var(--ink-3); }

/* 视频卡 */
.video-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow-sm); padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.video-card__frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm);
  overflow: hidden; background: linear-gradient(135deg, var(--deep), var(--sea-light));
}
.video-card__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-card__frame--link { display: grid; place-items: center; color: #fff; text-align: center; gap: 4px; }
.video-card__frame--link span { font-size: 30px; }
.video-card__frame--link p { margin: 0; font-size: 13px; color: rgba(255,255,255,.85); }
.video-card h4 { margin: 4px 0 0; font-size: 15.4px; }
.video-card p { margin: 0; font-size: 13.4px; color: var(--ink-2); }

/* 内容块 */
.block-p { margin: 10px 0; font-size: 14.4px; color: var(--ink-2); line-height: 1.8; }
.block-list { display: grid; gap: 6px; margin: 8px 0 14px; padding-left: 18px; }
.block-list li { list-style: disc; font-size: 14.2px; color: var(--ink-2); }
.outcome-box {
  margin: 14px 0 6px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); font-size: 14px;
}
.outcome-box b { display: block; margin-bottom: 4px; color: var(--primary); }
.outcome-box p { margin: 0; color: var(--ink-2); }
.outcome-box .hint { display: block; margin-top: 6px; }
.card__outcome { margin: 0; font-size: 13.2px; color: var(--primary); font-weight: 600; }
.card__media--tech { background: linear-gradient(135deg, var(--deep), var(--sea)); }

/* 面板内的小条目（相关经验 / 资料） */
.mini-item {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfdff; cursor: pointer; transition: border-color 0.16s, background 0.16s;
}
.mini-item + .mini-item { margin-top: 10px; }
.mini-item:hover { border-color: var(--primary); background: #fff; }
.mini-item b { font-size: 14.6px; }
.mini-item p { margin: 6px 0; font-size: 13.4px; color: var(--ink-3); }

/* 响应式：路线的周卡在窄屏改成单列 */
@media (max-width: 1024px) {
  .route__weeks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .route { padding: 16px; }
  .route__weeks { grid-template-columns: 1fr; }
  .route__head h3 { font-size: 17px; }
  .media-card__frame { height: 140px; }
  .video-card { padding: 12px; }
}

/* ==========================================================================
   ★ 2026-10-03 科技风改版：深空霓虹 + 博客式侧边栏
   参考：AI素材（深色 + 霓虹青/紫光效）、上传参考图（顶栏 + 左栏 + 内容）
   说明：仅追加覆盖，不改动原有层次结构与容器 id。
   ========================================================================== */

/* ------------------------------ 全局底色与科技网格 ------------------------------ */
body {
  background: #050b18;
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(800px 460px at 100% 0%, rgba(139, 92, 246, 0.10), transparent 55%),
    radial-gradient(760px 520px at 50% 115%, rgba(23, 106, 170, 0.14), transparent 60%),
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px);
  background-size: auto, auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}
::selection { background: rgba(34, 211, 238, 0.28); color: #eaf6ff; }

/* ------------------------------ 顶栏 / 移动抽屉 ------------------------------ */
.topbar {
  background: rgba(6, 12, 26, 0.82);
  border-bottom: 1px solid rgba(34, 211, 238, 0.16);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
@media (max-width: 780px) { .nav { background: #081020; border-bottom: 1px solid var(--line); } }
.nav__link:hover { background: rgba(34, 211, 238, 0.10); color: var(--cyan); }
.nav__link.is-active { background: rgba(34, 211, 238, 0.14); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(34,211,238,0.35); }
.brand__title { background: linear-gradient(100deg, var(--cyan), var(--violet)); }
.brand__sub { color: var(--ink-3); }
.nav-toggle { border-color: var(--line); }
.nav-toggle span { background: var(--ink-2); }

/* ------------------------------ 页头 / 首屏 / CTA：加霓虹光 ------------------------------ */
.page-head { background: linear-gradient(120deg, #060d1d, var(--sea) 62%, #143a5e); }
.hero { background: linear-gradient(125deg, #040a17 0%, var(--deep) 34%, var(--sea) 72%, #164a70 100%); }
.cta { background: linear-gradient(120deg, #060d1d, var(--sea) 70%, #1a3f66); box-shadow: 0 0 0 1px rgba(34,211,238,0.18), var(--shadow-lg); }
.hero h1 .accent { color: var(--ink); background: none; -webkit-background-clip: initial; background-clip: initial; }
.hero__wave path { fill: #050b18 !important; }
.hero__glow--a { background: radial-gradient(circle, rgba(34, 211, 238, 0.4), transparent 66%); }
.hero__glow--b { background: radial-gradient(circle, rgba(139, 92, 246, 0.28), transparent 66%); }
.eyebrow { color: var(--cyan); }
.eyebrow::before { background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.section-title:hover { text-shadow: 0 0 18px rgba(34, 211, 238, 0.45); }

/* ------------------------------ 区块底色：浅色 -> 深色面板 ------------------------------ */
.section--sky { background: linear-gradient(180deg, #081020, #050b18); }
.section--sand { background: linear-gradient(180deg, var(--sand), #050b18); }

.card, .panel, .filters, .item, .stat, .zone, .entry, .step, .route, .media-card,
.video-card, .mini-item, .comment, .points-list li, .subject-card, .admin-tabs, .empty,
.marquee { background: var(--white); }

.zone--primary { background: linear-gradient(180deg, #0a1830, #0b1526 42%); }
.zone--junior { background: linear-gradient(180deg, #1a1430, #0b1526 42%); }
.card:hover, .entry:hover, .item:hover, .subject-card:hover, .mini-item:hover,
.zone:hover, .route:hover { border-color: rgba(34, 211, 238, 0.5); box-shadow: 0 0 0 1px rgba(34,211,238,0.14), var(--shadow); }

.chip { background: #16233a; color: var(--ink-2); }
.chip:hover { background: rgba(34, 211, 238, 0.12); color: var(--cyan); }
.chip.is-active { background: linear-gradient(120deg, var(--cyan), var(--violet)); color: #04121f; border-color: transparent; box-shadow: 0 6px 18px var(--primary-glow); }

.search-box input, .select, .field input, .field select, .field textarea,
.editor__toolbar button, .editor__row input, .editor__row textarea, .editor__row select,
.editor__row-del, .btn--line, .plan-item__check { background: #0d1830; color: var(--ink); }
.search-box input:focus, .select:focus, .field input:focus, .field select:focus,
.field textarea:focus { background: #0e1c36; border-color: var(--primary); }
.editor__preview, .editor__row, .points-list li, .mini-item, .comment,
.notice, .empty { background: #0d1a2e; }
.editor__toolbar button:hover, .editor__row-del:hover { background: #16233a; color: var(--cyan); }
.tag--plain, .badge { background: #16233a; color: var(--ink-2); }
.btn--muted { background: #16233a; color: var(--ink-2); }
.btn--muted:hover { background: #1c2c46; color: var(--ink); }
.btn--primary { background: linear-gradient(120deg, var(--cyan), var(--violet)); color: #04121f; }
.notice code, .deploy-list code { background: #1a2c46; }
.progress { background: #142238; }
.plan-item__check.is-done { background: var(--primary); border-color: var(--primary); }
.data-table th { background: #0f2036; }
.grade-switch { background: #0d1830; }
.grade-switch--float { background: rgba(10, 18, 36, 0.94); }
.drawer { background: #0b1526; box-shadow: -18px 0 50px rgba(0, 0, 0, 0.6); }
.drawer__foot { background: #0d1a2e; }
.bar-chart__track { background: linear-gradient(180deg, #0f2036, #0b1526); }
.img--broken {
  background: #0f1c33;
  background-image: linear-gradient(135deg, #13223c 25%, #16263f 25%, #16263f 50%, #13223c 50%, #13223c 75%, #16263f 75%);
  background-size: 18px 18px;
}
.media-card__frame { background: #0f2036; }
.week-card { background: linear-gradient(180deg, #0d1a30, #0b1526); }
.deny { background: linear-gradient(180deg, #1a2036, #0b1526); border-color: rgba(246, 201, 69, 0.4); }
.deny__title { color: #f6c945; }
.honor-list__level { color: #f6c945; }
.item--mine { background: linear-gradient(180deg, #141a30, #0b1526); border-color: rgba(246,201,69,0.35); }
.subject-card__icon, .entry__icon { background: linear-gradient(140deg, rgba(34,211,238,0.16), #0b1526); }
.cases-list__time { color: var(--cyan); }
.outcome-box, .route__advanced, .reflect--next, .quote { background: rgba(34, 211, 238, 0.08); }
.quote { border-left-color: var(--cyan); }

/* ------------------------------ 按钮与表格霓虹 ------------------------------ */
.data-table th { color: var(--cyan); }
.badge--on { background: rgba(34, 197, 94, 0.16); color: #4ade80; border-color: rgba(34,197,94,0.35); }
.badge--warn { background: rgba(246, 201, 69, 0.14); color: #f6c945; border-color: rgba(246,201,69,0.35); }
.diff--up { color: #4ade80; }
.diff--down { color: #f87171; }

/* ==========================================================================
   博客式侧边栏布局（参考上传图：顶栏 + 左栏 + 内容）
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding-top: 34px;
}
.sidebar { position: sticky; top: calc(var(--nav-h) + 18px); display: grid; gap: 18px; }
/* 「✕ 关闭目录」只在移动端抽屉里出现，桌面默认隐藏（移动端媒体查询里再显示） */
.toc__close { display: none; }
/* ★ 2026-10-11：AI编程 / 芯片·电路 两个主题页已删掉顶部导航与大横幅，
   页面从最顶端开始，故 sticky 与间距不能再减去导航高度。 */
.layout--doc > .sidebar { top: 18px; }
.layout--doc { padding-top: 18px; }
.layout > .content { min-width: 0; }

.side-card {
  background: var(--white);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.side-card--brand {
  background:
    radial-gradient(240px 160px at 100% 0%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(200px 160px at 0% 100%, rgba(34, 211, 238, 0.14), transparent 60%),
    var(--white);
  border-color: rgba(34, 211, 238, 0.3);
}
.side-brand { display: flex; align-items: center; gap: 12px; }
.side-brand__mark {
  width: 50px; height: 50px; border-radius: 15px; flex: none;
  display: grid; place-items: center; font-size: 26px;
  background: linear-gradient(140deg, var(--cyan), var(--violet));
  box-shadow: 0 8px 22px var(--primary-glow);
}
.side-brand__name { font-size: 15.4px; font-weight: 800; line-height: 1.25; }
.side-brand__slogan { font-size: 11.6px; color: var(--ink-3); line-height: 1.5; margin-top: 3px; }
.side-card__title {
  font-size: 12.4px; font-weight: 800; letter-spacing: 2px; color: var(--cyan);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.side-card__title::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side-stat {
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 12px; padding: 10px; text-align: center;
}
.side-stat b {
  display: block; font-size: 20px; font-weight: 800;
  background: linear-gradient(100deg, var(--cyan), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.side-stat span { font-size: 11.8px; color: var(--ink-3); }
.side-links { display: grid; gap: 6px; }
.side-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 11px; font-size: 14px; font-weight: 600;
  color: var(--ink-2); border: 1px solid transparent;
  transition: all 0.16s;
}
.side-links a:hover { background: rgba(34, 211, 238, 0.10); color: var(--cyan); border-color: rgba(34,211,238,0.25); transform: translateX(3px); }
.side-quote { margin: 0; font-size: 13.6px; line-height: 1.75; color: var(--ink-2); }
.side-quote::before { content: "\201C"; color: var(--cyan); font-size: 22px; font-weight: 800; }
.side-card--glow { background: linear-gradient(135deg, rgba(34,211,238,0.08), rgba(139,92,246,0.10)), var(--white); }
.side-chip-card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: var(--shadow); min-height: 118px;
}
.side-chip-card img { width: 100%; height: 118px; object-fit: cover; }
.side-chip-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(4, 11, 23, 0.85));
}
.side-chip-card span {
  position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2;
  color: #eaf6ff; font-size: 13px; font-weight: 700;
}
.side-chip-card span b { display: block; color: var(--cyan); font-size: 11.6px; letter-spacing: 1px; }

/* ===== 侧边栏响应式：平板改单列横排，手机简化 ===== */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-card--brand, .side-card--glow { grid-column: auto; }
  .side-chip-card { min-height: 0; }

  /* ★ 2026-10-11 文档库布局（AI编程 / 芯片·电路）：目录改为「☰ 目录」抽屉 */
  .layout--doc > .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: min(320px, 86vw); grid-template-columns: 1fr;
    background: var(--deep-2); border-right: 1px solid var(--line);
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    overflow-y: auto; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.toc-open .layout--doc > .sidebar { transform: none; }
  body.toc-open::after {
    content: ""; position: fixed; inset: 0; z-index: 55;
    background: rgba(3, 7, 16, .62);
  }
  .layout--doc .toc { position: static; max-height: none; }
  /* ★ 移动端显示「☰ 目录」。为压过后面那条无条件 display:none，
     这里用 !important —— 否则用户打不开目录（曾发生的 bug）。 */
  .toc-toggle { display: inline-flex !important; }
  /* ★★ 关键：按钮必须**悬浮**。
     它原本在文档流里、位于文章上方，用户往下读文章后就够不到了
     （实测 top:-79px 已滚出视口）。挂在左下角悬浮，全程可点。
     ⚠️ 选择器只能用 `.toc-toggle` —— 这个按钮由 app.js 动态创建，
        插入点是 `layout.parentNode.insertBefore(btn, layout)`，
        即它是 `.layout--doc` 的**兄弟节点而非后代**，
        所以 `.layout--doc .toc-toggle` 后代选择器永远匹配不上（踩过）。
     这个按钮只在文档库页面（ai/chip）由 initTechPage 创建，
     改这里不会影响其它页面。 */
  .toc-toggle {
    position: fixed; left: 14px; bottom: calc(16px + env(safe-area-inset-bottom));
    margin: 0; z-index: 58;
    background: rgba(9, 20, 38, .94); backdrop-filter: blur(8px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
    border: 1px solid rgba(34, 211, 238, .5);
  }
  /* 抽屉打开时按钮让位，避免压住抽屉内容 */
  body.toc-open .toc-toggle { display: none !important; }
}
@media (max-width: 640px) {
  .sidebar { grid-template-columns: 1fr; }
  .side-chip-card { display: none; }
}

/* ===== 分层媒体块（AI学习新思维 / 芯片学习新思维）===== */
.media-block { margin: 0 0 30px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(13,27,51,.55), rgba(5,11,24,.35)); }
.media-block__head { display: flex; flex-direction: column; gap: 6px; }
.media-block__head h3 { margin: 0; font-size: 19px; color: var(--primary); letter-spacing: .5px; }
.media-block__head p { margin: 0; font-size: 13.5px; color: var(--ink-3); max-width: 760px; }
.site-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.site-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: #0b1a30; color: var(--ink); text-decoration: none; transition: border-color .2s, transform .2s, box-shadow .2s; }
.site-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(34,211,238,.25), 0 10px 26px rgba(0,0,0,.35); }
.site-card b { color: var(--primary); font-size: 15px; }
.site-card span { font-size: 12.8px; color: var(--ink-3); line-height: 1.5; }
@media (max-width: 640px) {
  .media-block { padding: 14px; }
  .site-list { grid-template-columns: 1fr; }
}

/* ===== 三改：横幅背景 + 渐变标题（2026-10-03）===== */
.page-head { position: relative; overflow: hidden; }
.page-head--ai { background: linear-gradient(180deg, rgba(5,11,24,.86), rgba(5,11,24,.58) 55%, rgba(5,11,24,.94)), url("../img/banner-ai-coding.jpg") center/cover no-repeat; }
.page-head--chip { background: linear-gradient(180deg, rgba(5,11,24,.86), rgba(5,11,24,.58) 55%, rgba(5,11,24,.94)), url("../img/banner-chip-cpu.jpg") center/cover no-repeat; }
.page-head--materials { background: linear-gradient(180deg, rgba(5,11,24,.86), rgba(5,11,24,.58) 55%, rgba(5,11,24,.94)), url("../img/banner-learning-path.jpg") center/cover no-repeat; }
.page-head--experience { background: linear-gradient(180deg, rgba(5,11,24,.86), rgba(5,11,24,.58) 55%, rgba(5,11,24,.94)), url("../img/banner-learning-stairs.jpg") center/cover no-repeat; }
.hero { background: linear-gradient(180deg, rgba(4,10,23,.78), rgba(5,11,24,.6) 55%, rgba(5,11,24,.94)), url("../img/hero-ai-chip.jpg") center/cover no-repeat; }
.brand__sub { background: linear-gradient(100deg, var(--cyan), #a5f3fc 40%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 { background: linear-gradient(100deg, var(--cyan), #a5f3fc 40%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 780px) {
  .page-head--ai, .page-head--chip, .page-head--materials, .page-head--experience { background-position: center 30%; }
}

/* ===== 六改：顶栏品牌标题去除，仅保留下方中文并居中（2026-10-03）===== */
.brand__title { display: none; }
.brand__sub {
  font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
  text-align: center; line-height: 1.2;
  background: linear-gradient(100deg, var(--cyan), #a5f3fc 40%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ===== 宣发视频区块（2026-10-06）===== */
.promo-video { margin: 4px 0 30px; scroll-margin-top: 88px; text-align: center; }
.promo-video__title {
  margin: 0 0 20px; font-size: 30px; font-weight: 800; letter-spacing: 1.5px; line-height: 1.3;
  background: linear-gradient(100deg, var(--cyan), #a5f3fc 40%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-align: center;
  filter: drop-shadow(0 0 18px var(--primary-glow));
}
.promo-video__frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid rgba(34, 211, 238, .25); background: #000; aspect-ratio: 16 / 9;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 44px var(--primary-glow);
}
.promo-video__frame video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
@media (max-width: 780px) {
  .promo-video__title { font-size: 20px; }
  .promo-video__frame { aspect-ratio: 16 / 10; }
}

/* ==========================================================================
   文档库布局（AI编程 / 芯片·电路）  —— ★ 2026-10-11 新增
   左侧目录树 + 右侧单篇正文，与参考站 ai.codefather.cn/library 一致。
   仅作用于 .layout--doc，其它页面不受影响。
   ========================================================================== */
.layout--doc { grid-template-columns: 300px minmax(0, 1fr); }

/* ---- 移动端「☰ 目录」按钮（宽屏隐藏） ---- */
/* ⚠️ 顺序陷阱（踩过）：这里**不能**写无条件的 display:none ——
   它在文件里排在 @media (max-width:1024px) 之后，同优先级下会覆盖媒体查询，
   导致移动端「☰ 目录」按钮永远不显示、抽屉打不开。
   正确做法：默认隐藏 + 用同一条媒体查询显式显示。
   下面这条 min-width 规则负责「宽屏隐藏」。 */
.toc-toggle {
  display: none; align-items: center; gap: 6px;
  margin: 14px 22px 0; padding: 7px 15px;
  font-size: 13px; color: var(--cyan); cursor: pointer;
  background: var(--primary-soft); border: 1px solid rgba(34, 211, 238, .38);
  border-radius: 999px;
}

/* ---------------------------- 目录树 ---------------------------- */
.toc {
  position: sticky; top: 18px;   /* ★ 主题页无顶部导航（见上） */
  /* ★ 2026-10-11：40px → 20px。原来留白过多导致目录可视高度偏小、
     更早出现内部滚动条，配合滚动传导问题加重了「拉不动」的观感。
     放宽后大多数屏幕能一屏看完目录，从根上减少需要滚动的情况。 */
  max-height: calc(100vh - 40px);   /* ★ 无导航：只需留约 2×18px 边距 */
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid rgba(34, 211, 238, .2);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.toc__search { padding: 11px; border-bottom: 1px solid var(--line); }
.toc__search input {
  width: 100%; padding: 8px 12px; font-size: 13px; color: var(--ink-2);
  background: #08111f; border: 1px solid var(--line); border-radius: 9px; outline: none;
}
.toc__search input:focus { border-color: rgba(34, 211, 238, .55); }
.toc__search input::placeholder { color: var(--ink-3); }

/* ⚠️ 不要加 overscroll-behavior: contain（踩过）：
   它会让「目录滚到头」时不再把滚动传给页面，用户鼠标停在左侧时
   感觉整页「拉不动」。默认 chaining 行为才是对的。 */
.toc__scroll { flex: 1; min-height: 0; overflow-y: auto; }
.toc__scroll::-webkit-scrollbar { width: 7px; }
.toc__scroll::-webkit-scrollbar-thumb { background: #1c3350; border-radius: 4px; }

.toc__grp { border-bottom: 1px solid rgba(29, 51, 80, .65); }
.toc__grp:last-child { border-bottom: 0; }

.toc__head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 13px; cursor: pointer; text-align: left;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink);
  background: transparent; border: 0;
}
.toc__head:hover { background: rgba(34, 211, 238, .06); }
.toc__caret { font-size: 10px; color: var(--ink-3); transition: transform .18s; }
.toc__ic { font-size: 14px; }
.toc__t { flex: 1; min-width: 0; }
.toc__n { font-size: 11.5px; font-weight: 400; color: var(--ink-3); white-space: nowrap; }

.toc__desc {
  margin: 0 13px 9px 30px; font-size: 11.8px; line-height: 1.6; color: var(--ink-3);
}
.toc__items { padding-bottom: 8px; }
.toc__grp.is-folded .toc__caret { transform: rotate(-90deg); }
.toc__grp.is-folded .toc__desc,
.toc__grp.is-folded .toc__items { display: none; }

.toc__item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 13px 8px 30px; text-decoration: none;
  font-size: 13px; line-height: 1.6; color: var(--ink-2);
  border-left: 3px solid transparent;
}
.toc__item:hover { background: rgba(34, 211, 238, .06); color: var(--ink); }
.toc__item.is-on {
  background: rgba(34, 211, 238, .12); color: var(--cyan);
  border-left-color: var(--cyan); font-weight: 600;
}
.toc__it { flex: 1; min-width: 0; }
.toc__ih { font-size: 11px; color: var(--ink-3); white-space: nowrap; padding-top: 2px; }
.toc__item.is-on .toc__ih { color: var(--cyan); opacity: .85; }

.toc__foot { border-top: 1px solid var(--line); padding: 6px 0; }
.toc__link {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 14px; cursor: pointer; text-align: left;
  font: inherit; font-size: 13px; color: var(--ink-2);
  background: transparent; border: 0; border-left: 3px solid transparent;
}
.toc__link:hover { background: rgba(34, 211, 238, .06); color: var(--ink); }
.toc__link.is-on {
  background: rgba(34, 211, 238, .12); color: var(--cyan);
  border-left-color: var(--cyan); font-weight: 600;
}
.toc__link .toc__t { flex: 1; min-width: 0; }

/* ---------------------------- 右侧正文 ---------------------------- */
.techdoc { min-width: 0; }
.techdoc__crumb { font-size: 12.5px; color: var(--ink-3); margin: 0 0 13px; }
.techdoc__crumb b { color: var(--ink-2); font-weight: 400; }

.techdoc__article {
  /* position:relative 是「✎ 编辑本页」按钮绝对定位的锚点 ——
     缺了它，按钮会定位到最近的定位祖先（.content）上，落到正文中部。 */
  position: relative;
  padding: 30px 34px 34px;
  background: var(--white); border: 1px solid rgba(34, 211, 238, .16);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.techdoc__article > h1 { margin: 0 0 13px; font-size: 26px; line-height: 1.42; }

.techdoc__meta { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
.techdoc__badge {
  font-size: 11.8px; padding: 2px 10px; border-radius: 999px;
  color: var(--ink-2); border: 1px solid rgba(34, 211, 238, .3);
}
.techdoc__badge--hot { color: #67e8f9; border-color: rgba(103, 232, 249, .5); }

.techdoc__lead {
  margin: 0 0 20px; padding: 2px 0 2px 15px; font-size: 15px; line-height: 1.8;
  color: var(--ink-2); border-left: 3px solid var(--cyan);
}
.techdoc__sub { margin: 0 0 22px; font-size: 13.6px; color: var(--ink-3); }

/* 正文内的内容块（h2 由 renderBlocks 的 heading 选项产生） */
.techdoc__article h2 {
  margin: 32px 0 13px; padding-left: 13px; font-size: 19px;
  border-left: 4px solid var(--cyan);
}
.techdoc__article h3 { margin: 24px 0 10px; font-size: 16px; color: var(--cyan); }
.techdoc__article h4 { margin: 20px 0 9px; font-size: 15px; color: var(--cyan); }
.techdoc__article .block-p { margin: 0 0 15px; font-size: 14.4px; line-height: 1.85; color: var(--ink-2); }
.techdoc__article .block-list { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); }
.techdoc__article .block-list li { margin-bottom: 8px; font-size: 14.4px; line-height: 1.8; }
/* ⚠️ 选择器必须同时覆盖 `pre` —— 迁移生成的代码块是裸 <pre><code>，
   没有 code-block 类（迁移脚本有意不加自定义类，只用标准语义标签）。
   只写 .code-block 会完全匹配不上，白改一轮（踩过）。 */
.techdoc__article .code-block,
.techdoc__article pre {
  margin: 15px 0; padding: 14px 16px;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.8;
  color: #a5f3fc; background: #050d1a; border: 1px solid var(--line); border-radius: var(--radius-sm);
  /* ★ 长代码改为自动换行：原来 overflow-x:auto 会让超长单行（如那行 AST 解析）
     撑出横向滚动条，在窄屏上干扰纵向滚动。 */
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  overflow-x: hidden;
}
.techdoc__article pre code { background: none; border: 0; padding: 0; color: inherit; }
.techdoc__article .table-scroll { margin: 16px 0; overflow-x: auto; }
.techdoc__article .notice {
  margin: 17px 0; padding: 14px 17px; font-size: 14px; line-height: 1.8;
  color: var(--ink-2); background: rgba(103, 232, 249, .07);
  border: 1px solid rgba(103, 232, 249, .25); border-left: 3px solid var(--cyan);
  border-radius: var(--radius-sm);
}
.techdoc__article .notice b { color: #67e8f9; }
.techdoc__article .notice code {
  padding: 1px 6px; font-size: 12.6px; border-radius: 5px;
  background: rgba(34, 211, 238, .12); color: #a5f3fc;
}

/* 本层配套素材（复用分层媒体卡片样式） */
.techdoc__media { margin-top: 30px; }
.techdoc__media:empty { display: none; }
.techdoc__media .media-block { margin-bottom: 0; }

/* 上一篇 / 下一篇 */
.techdoc__pager { display: flex; gap: 14px; margin-top: 30px; }
.techdoc__pager a {
  flex: 1; min-width: 0; padding: 13px 17px; text-decoration: none;
  font-size: 13.6px; line-height: 1.6; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.techdoc__pager a:hover { border-color: rgba(34, 211, 238, .45); color: var(--ink); }
.techdoc__pager a small { display: block; margin-bottom: 4px; font-size: 11.8px; color: var(--ink-3); }
.techdoc__pager a.is-next { text-align: right; }

.techdoc__more { margin: 22px 0 0; }

/* ------------------- 概览页：三层卡片 ------------------- */
.lcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 22px 0 4px; }
.lcard {
  padding: 18px; background: rgba(13, 27, 51, .5);
  border: 1px solid rgba(34, 211, 238, .2); border-radius: var(--radius);
}
.lcard__ic {
  display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 12px;
  font-size: 17px; border-radius: 10px;
  background: linear-gradient(135deg, #0e7490, var(--cyan));
}
.lcard h3 { margin: 0 0 9px; font-size: 15.5px; }
.lcard p { margin: 0 0 9px; font-size: 12.8px; line-height: 1.7; color: var(--ink-3); }
.lcard__goal { color: var(--ink-2) !important; }
.lcard__n { color: var(--ink-3) !important; margin-bottom: 13px !important; }

/* ------------------- 资料 / 经验列表 ------------------- */
.docmat, .docexp {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 15px 0; border-bottom: 1px solid rgba(29, 51, 80, .7);
}
.docmat:last-of-type, .docexp:last-of-type { border-bottom: 0; }
.docmat__ic {
  flex: 0 0 38px; display: grid; place-items: center; height: 38px;
  font-size: 17px; border-radius: 10px; background: rgba(34, 211, 238, .1);
}
.docmat__b { flex: 1; min-width: 0; }
.docmat__b b, .docexp b { display: block; margin-bottom: 5px; font-size: 14.6px; }
.docmat__b p, .docexp p { margin: 0 0 6px; font-size: 13.2px; line-height: 1.75; color: var(--ink-3); }
.docmat > .btn { flex: 0 0 auto; align-self: center; }

/* ------------------- 文档库布局的窄屏处理 ------------------- */
@media (max-width: 1240px) {
  .layout--doc { grid-template-columns: 268px minmax(0, 1fr); }
  .lcards { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .layout--doc { grid-template-columns: 1fr; }
  .techdoc__article { padding: 24px 20px 26px; }
  .techdoc__article > h1 { font-size: 22px; }
}
@media (max-width: 640px) {
  .techdoc__pager { flex-direction: column; }
  .techdoc__pager a.is-next { text-align: left; }
  .docmat { flex-wrap: wrap; }
  .docmat > .btn { width: 100%; text-align: center; }
  .techdoc__article { padding: 20px 16px 22px; }
}



/* ------------------- 单元正文的编辑入口（仅管理员可见） ------------------- */
/* ★ 2026-10-11 新增：正文改为可在线编辑，入口放在文章右上角。
   默认 hidden，由 app.js 的 paintAdminBits() 按登录态切换 [data-admin-only]。 */
.techdoc__edit {
  position: absolute; top: 20px; right: 22px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
  color: #050b18; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
}
.techdoc__edit:hover { filter: brightness(1.08); }

/* ------------------- 正文里内嵌的图片与链接列表 ------------------- */
/* 媒体已并入正文（见 tools/migrate-tech-units.mjs），此处提供排版样式。
   刻意只用语义标签选择器，因为 sanitizeClass 会剥离自定义 class。 */
.techdoc__article figure { margin: 20px 0; }
.techdoc__article figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #08111f;
}
.techdoc__article figcaption {
  margin-top: 9px; font-size: 12.6px; line-height: 1.75; color: var(--ink-3);
}
.techdoc__article figcaption b { display: block; margin-bottom: 3px; color: var(--ink-2); font-size: 13.6px; }
.techdoc__article figcaption small { font-size: 11.8px; color: var(--ink-3); }
.techdoc__article figcaption a { color: var(--cyan); }

/* 图片较多时两列排布（宽屏），避免每张都占满整行 */
@media (min-width: 1100px) {
  .techdoc__body > figure { display: inline-block; width: calc(50% - 11px); vertical-align: top; }
  .techdoc__body > figure:nth-of-type(odd) { margin-right: 18px; }
}

/* 视频 / 网站链接列表：标题为链接，说明为小字 */
.techdoc__article ul li a { color: var(--cyan); }
.techdoc__article ul li small {
  display: block; margin-top: 4px; font-size: 12.3px; line-height: 1.7; color: var(--ink-3);
}
.techdoc__article > h2 + ul { margin-bottom: 20px; }

/* 窄屏：编辑按钮换行，不遮挡标题 */
@media (max-width: 640px) {
  .techdoc__edit { position: static; margin-bottom: 12px; }
}


/* ------------------- 「已保存」反馈（★ 2026-10-11 新增） ------------------- */
/* 保存后显示在「✎ 编辑本页」按钮右侧，4 秒后自动隐藏。
   为什么需要：保存后若不回读接口（避免 D1 读延迟），页面变化可能很细微，
   需要明确反馈让用户确认保存成功。 */
.techdoc__saved {
  position: absolute; top: 24px; right: 128px;
  font-size: 12.2px; color: #4ade80; white-space: nowrap;
  animation: techdocSavedIn .22s ease;
}
@keyframes techdocSavedIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------- 移动端抽屉打开时锁定页面滚动 ------------------- */
/* 否则背景页面会跟着手指滚动，观感错乱。
   注意：只在窄屏生效，且必须与 .layout--doc 的抽屉条件一致。 */
@media (max-width: 1024px) {
  body.toc-open { overflow: hidden; }
  body.toc-open .layout--doc > .sidebar { overflow-y: auto; }
}

/* 窄屏：编辑按钮与「已保存」改为静态排布，避免互相压住 */
@media (max-width: 640px) {
  .techdoc__saved { position: static; display: block; margin: 0 0 10px; }
}


/* ==========================================================================
   ★ 2026-10-11 主题页（AI编程 / 芯片·电路）重构相关
   ========================================================================== */

/* 「← 返回首页」—— 两个主题页已删除顶部导航，这是唯一的回站入口 */
.toc__home {
  display: block; margin: 0 0 2px; padding: 9px 12px 8px;
  font-size: 12.6px; color: var(--cyan); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.toc__home:hover { background: rgba(34, 211, 238, .07); color: #8ef1ff; }

/* 目录里的「后台文章」节点：与单元节点区分（左侧一道绿色竖线 + ✍️ 前缀） */
.toc__item--art { border-left: 2px solid rgba(74, 222, 128, .55); }
.toc__item--art .toc__ih { color: rgba(74, 222, 128, .85); }
.toc__item--art.is-on { border-left-color: #4ade80; }

/* 文章正文底部的「上一篇 / 下一篇」 */
.techdoc__nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px;
}
@media (max-width: 640px) { .techdoc__nav { grid-template-columns: 1fr; } }
.techdoc__navbtn {
  display: flex; flex-direction: column; gap: 4px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s;
}
.techdoc__navbtn:hover { border-color: var(--primary); transform: translateY(-2px); }
.techdoc__navbtn span { font-size: 12.2px; color: var(--ink-3); }
.techdoc__navbtn b { font-size: 14px; color: var(--ink); }
.techdoc__navbtn--next { text-align: right; }
.techdoc__navbtn.is-off { opacity: .5; pointer-events: none; }


/* ==========================================================================
   ★ 2026-10-12 移动端目录抽屉重构（对齐参考站 ai.codefather.cn 的效果）
   --------------------------------------------------------------------------
   设计要点（按用户提供的参考截图）：
     1) 浅色全屏面板，左侧滑入，右侧露出半透明遮罩
     2) 顶部圆角搜索框
     3) 目录为折叠列表：大字 + 右侧 ˅ + 图标
     4) 当前项高亮：浅色底 + 左侧竖条
     5) 右上角关闭按钮
   作用域：只匹配 .layout--doc 下的 .sidebar（即 ai.html / chip.html），
          其它页面的 .sidebar 完全不受影响。
   ========================================================================== */
@media (max-width: 1024px) {

  /* ---------- 面板本体：浅色全屏 ---------- */
  .layout--doc > .sidebar {
    width: min(88vw, 420px);
    /* 浅色面板：本项目的 --white/--ink 都是深色，故写死浅色值 */
    background: #ffffff;
    color: #1f2d3d;
    border-right: 0;
    padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 0 46px rgba(2, 8, 20, .55);
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(-102%); transition: transform .24s ease;
  }
  body.toc-open .layout--doc > .sidebar { transform: none; }

  /* 遮罩：更接近参考站的浅灰遮罩 */
  body.toc-open::after {
    content: ""; position: fixed; inset: 0; z-index: 55;
    background: rgba(15, 23, 42, .45);
  }

  /* ---------- 关闭按钮（右上角） ---------- */
  .toc__close {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    width: 32px; height: 32px; padding: 0; margin: 0;
    border: 0; border-radius: 8px; cursor: pointer;
    background: transparent; color: #7e92b0;
    font-size: 19px; line-height: 1;
    display: grid; place-items: center;
  }
  .toc__close:hover, .toc__close:focus-visible { background: #eef4fb; color: #1f2d3d; }

  /* ---------- 卡片：去掉深色边框，做成干净的浅色列表 ---------- */
  .layout--doc .toc {
    position: static; max-height: none;
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
    overflow: visible;
  }

  /* ---------- 返回首页 ---------- */
  .layout--doc .toc__home {
    display: block; margin: 0 0 12px; padding: 8px 6px;
    font-size: 13px; color: #7e92b0; text-decoration: none;
    border-bottom: 1px solid #eef2f7;
  }
  .layout--doc .toc__home:hover { color: #0d7fa8; }

  /* ---------- 搜索框：圆角浅底 ---------- */
  .layout--doc .toc__search { padding: 0; margin: 0 0 14px; border: 0; }
  .layout--doc .toc__search input {
    width: 100%; padding: 11px 13px; font-size: 14px;
    color: #1f2d3d; background: #f2f5f9;
    border: 1px solid #e2e9f2; border-radius: 10px; outline: none;
  }
  .layout--doc .toc__search input:focus { border-color: #22b8d8; background: #ffffff; }
  .layout--doc .toc__search input::placeholder { color: #9aa8ba; }

  /* ---------- 分组：折叠列表 ---------- */
  .layout--doc .toc__grp { border-bottom: 1px solid #eef2f7; }
  .layout--doc .toc__grp:last-child { border-bottom: 0; }

  .layout--doc .toc__head {
    width: 100%; display: flex; align-items: center; gap: 9px;
    padding: 14px 6px; margin: 0; border: 0; cursor: pointer; text-align: left;
    background: transparent; color: #1f2d3d;
    font-size: 15.4px; font-weight: 600;
  }
  .layout--doc .toc__head:hover { background: #f6f9fc; }
  /* 参考站是「大字 + 右侧 ˅」，把 caret 放到图标之后、名称之前更直观；
     这里保持 DOM 不变，只把 caret 缩小并染灰。 */
  .layout--doc .toc__caret { order: -1; color: #93a3b8; font-size: 11px; width: 13px; }
  .layout--doc .toc__ic { font-size: 17px; }
  .layout--doc .toc__t { flex: 1; }
  .layout--doc .toc__n { font-size: 12px; color: #93a3b8; font-weight: 400; }

  /* 描述文字：参考站没有，弱化到极小并只在收起时留白 */
  .layout--doc .toc__desc {
    margin: -6px 6px 8px; font-size: 12px; line-height: 1.6; color: #8c9bb0;
  }

  /* ---------- 子项：缩进 + 大点击区 + 当前项高亮 ---------- */
  .layout--doc .toc__items { padding: 0 0 8px; }
  .layout--doc .toc__item {
    display: flex; align-items: center; gap: 8px;
    margin: 1px 0; padding: 11px 10px 11px 14px;
    border-radius: 8px; color: #48586e;
    font-size: 13.8px; line-height: 1.5; text-decoration: none;
    border-left: 3px solid transparent;
  }
  .layout--doc .toc__item:hover { background: #f4f8fc; }
  .layout--doc .toc__item.is-on {
    background: #eaf3ff; border-left-color: #1c9ec4;
    color: #0d5f86; font-weight: 600;
  }
  .layout--doc .toc__it { flex: 1; }
  .layout--doc .toc__ih { font-size: 11.6px; color: #9aa8ba; white-space: nowrap; }
  .layout--doc .toc__item.is-on .toc__ih { color: #4a90c2; }

  /* 文章节点：浅绿左条（与单元区分），选中时更明显 */
  .layout--doc .toc__item--art { border-left-color: #b7e4c7; }
  .layout--doc .toc__item--art.is-on { background: #eafaf0; border-left-color: #34a853; color: #1c6b36; }
  .layout--doc .toc__item--art.is-on .toc__ih { color: #34a853; }

  /* ---------- 概览项 ---------- */
  .layout--doc .toc__link {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 13px 6px; margin: 0; border: 0; border-radius: 8px;
    background: transparent; cursor: pointer; text-align: left;
    color: #1f2d3d; font-size: 14.6px; font-weight: 600;
  }
  .layout--doc .toc__link:hover { background: #f6f9fc; }
  .layout--doc .toc__link.is-on { background: #eaf3ff; color: #0d5f86; }
  .layout--doc .toc__link .toc__t { flex: 1; }
  .layout--doc .toc__link .toc__n { font-size: 12px; color: #93a3b8; font-weight: 400; }

  /* 底部固定项（本组资料 / 经验）：与分组同风格 */
  .layout--doc .toc__foot { border-top: 1px solid #eef2f7; padding-top: 4px; margin-top: 4px; }

  /* 自定义细滚动条，贴近参考站观感 */
  .layout--doc .toc__scroll::-webkit-scrollbar { width: 0; }
}

/* 窄屏（常见手机）进一步收紧，保证一屏能看更多 */
@media (max-width: 560px) {
  .layout--doc > .sidebar { width: 90vw; padding: 12px 10px calc(16px + env(safe-area-inset-bottom)); }
  .layout--doc .toc__head { padding: 13px 5px; font-size: 15px; }
  .layout--doc .toc__item { padding: 10px 8px 10px 12px; font-size: 13.4px; }
}
