/* ============================================
   大昌 · AI Coding 工程师 —— 站点样式
   设计基调：中性浅色 + 细边框圆角卡片（shadcn 风格）
   ============================================ */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0a0a0a;
  --card: #ffffff;
  --card-fg: #0a0a0a;
  --muted: #f4f4f5;
  --muted-fg: #8b8b8f;
  --border: #e8e8ea;
  --ring: #b4b4b7;
  --primary: #171717;
  --primary-fg: #fafafa;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-lift: 0 12px 28px -8px rgba(0, 0, 0, .14);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113;
  --fg: #ededef;
  --card: #1c1c1f;
  --card-fg: #ededef;
  --muted: #252528;
  --muted-fg: #a1a1a6;
  --border: #ffffff1a;
  --ring: #55555a;
  --primary: #ededef;
  --primary-fg: #171717;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lift: 0 14px 32px -8px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist Variable", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px 72px; }
.narrow { max-width: 760px; }

/* ---------- 顶栏 ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-in {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand .dot { width: 8px; height: 8px; border-radius: 3px; background: var(--fg); }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top nav a {
  padding: 6px 12px; border-radius: 8px; font-size: 14px; color: var(--muted-fg);
  transition: background-color .15s, color .15s;
}
.top nav a:hover { background: var(--muted); color: var(--fg); }
.top nav a.on { background: var(--muted); color: var(--fg); font-weight: 500; }
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  color: var(--fg); cursor: pointer; font-size: 14px; line-height: 1;
  transition: background-color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--muted); }
html[data-theme="dark"] .theme-sun { display: inline; }
html[data-theme="dark"] .theme-moon { display: none; }
.theme-sun { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500;
  color: var(--muted-fg); background: var(--muted); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 {
  margin: 0 0 6px; font-size: clamp(2rem, 5.2vw, 3.15rem);
  line-height: 1.12; letter-spacing: -.035em; font-weight: 650;
}
.hero .sub { margin: 14px 0 0; font-size: 17px; color: var(--muted-fg); max-width: 620px; line-height: 1.7; }
.hero .mail { margin: 22px 0 0; font-size: 15px; color: var(--muted-fg); }
.hero .mail a { color: var(--fg); border-bottom: 1px solid var(--ring); }
.hero .mail a:hover { border-bottom-color: var(--fg); }
.hero-actions { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 18px;
  border-radius: 10px; font-size: 14.5px; font-weight: 500; border: 1px solid var(--border);
  background: var(--card); color: var(--fg); cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn .arw { font-size: 12px; opacity: .7; }

/* ---------- 区块 ---------- */
section { margin-top: 64px; }
.sec-head { margin-bottom: 22px; }
.sec-head h2 { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; font-weight: 650; }
.sec-head p { margin: 8px 0 0; color: var(--muted-fg); font-size: 15px; }
.sec-head .more { float: right; font-size: 14px; color: var(--muted-fg); padding-top: 10px; }
.sec-head .more:hover { color: var(--fg); }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--ring); }
.card .thumb {
  aspect-ratio: 16 / 9; border-radius: 10px; margin: -18px -18px 2px;
  display: flex; align-items: flex-end; padding: 12px;
  background: linear-gradient(135deg, var(--muted), color-mix(in srgb, var(--muted) 55%, var(--fg)));
  position: relative; overflow: hidden;
}
.card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 12% 8%, #ffffff40, transparent 62%);
}
.card .thumb span {
  position: relative; z-index: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #ffffffd8;
  text-shadow: 0 1px 3px #0006;
}
.card .thumb img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .3s ease;
}
a.card:hover .thumb img { transform: scale(1.04); }
.card .kicker { font-size: 12.5px; color: var(--muted-fg); display: flex; align-items: center; gap: 8px; }
.card h3 { margin: 0; font-size: 1.02rem; line-height: 1.45; font-weight: 600; letter-spacing: -.01em; }
.card p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted-fg);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
  font-size: 11.5px; padding: 2px 9px; border-radius: 6px;
  background: var(--muted); color: var(--muted-fg); border: 1px solid var(--border);
}
.chip.local { color: var(--fg); border-color: var(--ring); }
.chip .ext { color: var(--fg); }
.card .go { margin-left: auto; font-size: 12px; color: var(--muted-fg); transition: transform .18s, color .18s; }
a.card:hover .go { transform: translateX(3px); color: var(--fg); }

/* ---------- 统计栏 ---------- */
.stats {
  margin-top: 64px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden;
}
.stats div { padding: 20px 22px; border-right: 1px solid var(--border); }
.stats div:last-child { border-right: 0; }
.stats dt { font-size: 12.5px; color: var(--muted-fg); margin: 0 0 4px; }
.stats dd { margin: 0; font-size: 1.32rem; font-weight: 650; letter-spacing: -.02em; }

/* ---------- 工具栏 / 标签 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
#q {
  flex: 1 1 260px; background: var(--card); border: 1px solid var(--border); color: var(--fg);
  padding: 10px 14px; border-radius: 10px; font-size: 14.5px; font-family: inherit;
}
#q::placeholder { color: var(--muted-fg); }
#q:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 24px; }
.tag {
  background: var(--card); border: 1px solid var(--border); color: var(--muted-fg);
  padding: 4px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.tag:hover { color: var(--fg); border-color: var(--ring); }
.tag.on { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
#count { color: var(--muted-fg); font-size: 13.5px; margin: 18px 0 0; }
#empty {
  color: var(--muted-fg); font-size: 15px; padding: 36px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius);
}

/* ---------- Markdown 正文 ---------- */
#content h1 { font-size: 2.1rem; line-height: 1.25; margin: 0 0 10px; letter-spacing: -.03em; font-weight: 680; }
#content h2 {
  font-size: 1.32rem; margin: 48px 0 14px; padding-bottom: 9px;
  border-bottom: 1px solid var(--border); font-weight: 650; letter-spacing: -.01em;
}
#content h3 { font-size: 1.08rem; margin: 30px 0 10px; font-weight: 640; }
#content h4 { font-size: 1rem; margin: 24px 0 8px; color: var(--muted-fg); }
#content p { margin: 16px 0; }
#content ul, #content ol { padding-left: 24px; margin: 16px 0; }
#content li { margin: 7px 0; }
#content strong { font-weight: 640; }
#content a { color: var(--fg); border-bottom: 1px solid var(--ring); }
#content a:hover { border-bottom-color: var(--fg); }
#content blockquote {
  margin: 24px 0; padding: 4px 20px; background: var(--muted);
  border-left: 3px solid var(--fg); border-radius: 0 10px 10px 0; color: var(--muted-fg);
}
#content blockquote p { margin: 12px 0; }
#content code {
  background: var(--muted); border: 1px solid var(--border); padding: 2px 6px;
  border-radius: 6px; font-size: .875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
#content pre {
  background: var(--muted); border: 1px solid var(--border); padding: 16px 18px;
  border-radius: 12px; overflow-x: auto; line-height: 1.6;
}
#content pre code { background: none; border: 0; padding: 0; }
#content hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
#content table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14.5px; }
#content th, #content td { border: 1px solid var(--border); padding: 10px 13px; text-align: left; vertical-align: top; }
#content th { background: var(--muted); font-weight: 620; }
#content img { max-width: 100%; border-radius: 12px; }

.doc-meta {
  margin: 0 0 30px; padding-bottom: 22px; border-bottom: 1px solid var(--border);
  color: var(--muted-fg); font-size: 13.5px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.back {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted-fg);
  margin-bottom: 26px; padding: 5px 12px 5px 9px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--card);
}
.back:hover { color: var(--fg); border-color: var(--ring); }

/* ---------- 学习计划：左侧时间线 + 右侧详情 ---------- */
.plan-wrap {
  max-width: 1240px;
  display: grid; grid-template-columns: 268px minmax(0, 1fr);
  gap: 52px; align-items: start;
}
.plan-main { min-width: 0; }
.plan-main .hero { padding: 56px 0 28px; }

.plan-side {
  position: sticky; top: 80px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 104px);
  padding: 18px 14px 14px; margin-top: 56px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
}
.plan-side-eyebrow {
  font-size: 11.5px; letter-spacing: .12em; color: var(--muted-fg);
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  align-self: flex-start; margin-bottom: 10px;
}
.plan-side-title { font-size: 15.5px; font-weight: 640; line-height: 1.45; letter-spacing: -.01em; }
.plan-side-meta { margin-top: 5px; font-size: 12.5px; color: var(--muted-fg); line-height: 1.6; }

.plan-toc {
  position: relative; flex: 1 1 auto; min-height: 0;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--ring) transparent;
}
.plan-toc::-webkit-scrollbar { width: 6px; }
.plan-toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.plan-toc::-webkit-scrollbar-track { background: transparent; }

.toc-group + .toc-group { margin-top: 14px; }
.toc-stage {
  display: block; padding: 5px 8px; margin-bottom: 3px; border-radius: 8px;
  font-size: 11.5px; font-weight: 620; color: var(--muted-fg);
  line-height: 1.5; letter-spacing: .01em;
  transition: background-color .15s, color .15s;
}
.toc-stage:hover { background: var(--muted); color: var(--fg); }
.toc-stage.on { color: var(--fg); }
.toc-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 5px 8px; border-radius: 8px;
  font-size: 13px; line-height: 1.5; color: var(--muted-fg);
  transition: background-color .15s, color .15s;
}
.toc-item:hover { background: var(--muted); color: var(--fg); }
.toc-dot {
  flex: 0 0 auto; width: 7px; height: 7px; margin-top: 7px;
  border-radius: 50%; background: var(--border);
  transition: background-color .15s, box-shadow .15s;
}
.toc-item.on { background: var(--muted); color: var(--fg); font-weight: 600; }
.toc-item.on .toc-dot {
  background: var(--fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg) 16%, transparent);
}
.toc-text { min-width: 0; }

.plan-side-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.plan-bar { height: 4px; border-radius: 2px; background: var(--muted); overflow: hidden; }
.plan-bar i { display: block; height: 100%; width: 0; background: var(--fg); transition: width .25s ease; }
.plan-side-foot span { display: block; margin-top: 7px; font-size: 12px; color: var(--muted-fg); }

/* 锚点跳转时避开 56px 固定顶栏 */
#content h2[id], #content h3[id] { scroll-margin-top: 84px; }

/* ---------- 学习计划：完成打卡 ---------- */
.pcheck {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 22px 0 4px; padding: 10px 14px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--muted); transition: border-color .15s, background-color .15s;
}
.pcheck.done { border-style: solid; border-color: color-mix(in srgb, var(--fg) 26%, transparent); }
.pcheck-box {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--fg); cursor: pointer; user-select: none;
}
.pcheck-in { position: absolute; opacity: 0; width: 0; height: 0; }
.pcheck-tick {
  position: relative; width: 17px; height: 17px; flex: 0 0 auto;
  border: 1px solid var(--ring); border-radius: 5px; background: var(--card);
  transition: background-color .15s, border-color .15s;
}
.pcheck-tick::after {
  content: ""; position: absolute; left: 5px; top: 1.5px;
  width: 4px; height: 9px; border: solid var(--primary-fg);
  border-width: 0 2px 2px 0; transform: rotate(42deg) scale(.4); opacity: 0;
  transition: opacity .12s, transform .12s;
}
.pcheck-in:checked + .pcheck-tick { background: var(--primary); border-color: var(--primary); }
.pcheck-in:checked + .pcheck-tick::after { opacity: 1; transform: rotate(42deg) scale(1); }
.pcheck-in:focus-visible + .pcheck-tick {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent);
}
.pcheck.done .pcheck-txt { font-weight: 640; }

.pcheck-time {
  background: var(--card); color: var(--fg); border: 1px solid var(--border);
  border-radius: 9px; padding: 5px 10px; font-family: inherit; font-size: 13.5px; color-scheme: inherit;
}
.pcheck-time:focus {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}
.pcheck-del {
  background: transparent; color: var(--muted-fg); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; font-family: inherit; font-size: 13px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.pcheck-del:hover { color: #dc2626; border-color: currentColor; }
html[data-theme="dark"] .pcheck-del:hover { color: #f87171; }
.pcheck-note { font-size: 12.5px; color: var(--muted-fg); }
.pcheck.saving { opacity: .6; pointer-events: none; }
.pcheck.locked { opacity: .78; }
.pcheck.locked .pcheck-box,
.pcheck.locked .pcheck-del { cursor: not-allowed; }
.pcheck-time:disabled,
.pcheck-del:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 学习计划：口令解锁条 ---------- */
.plock {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 20px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--muted); font-size: 13.5px; color: var(--muted-fg);
  transition: border-color .15s;
}
.plock.on { border-color: color-mix(in srgb, var(--fg) 26%, transparent); }
.plock-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; flex: 0 0 auto; }
.plock.on .plock-dot { background: #22c55e; }
.plock-txt { min-width: 0; }
.plock-input {
  background: var(--card); color: var(--fg); border: 1px solid var(--border);
  border-radius: 9px; padding: 5px 10px; font-family: inherit; font-size: 13.5px;
  color-scheme: inherit;
}
.plock-input:focus {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}
.plock-btn, .plock-out {
  font-family: inherit; font-size: 13px; cursor: pointer;
  border-radius: 999px; padding: 5px 14px;
}
.plock-btn {
  background: var(--fg); color: var(--card); border: 1px solid var(--fg);
}
.plock-btn:disabled { opacity: .6; cursor: progress; }
.plock-out {
  background: transparent; color: var(--muted-fg); border: 1px solid var(--border);
}
.plock-out:hover { color: var(--fg); border-color: var(--ring); }
.plock-msg { font-size: 12.5px; color: #dc2626; }
html[data-theme="dark"] .plock-msg { color: #f87171; }

@media (max-width: 460px) {
  .pcheck { padding: 10px 12px; gap: 8px; }
  .pcheck-time { flex: 1 1 100%; }
  .plock { padding: 10px 12px; gap: 8px; }
  .plock-input { flex: 1 1 140px; }
}

/* ---------- 评论 ---------- */
.cmt { margin-top: 56px; padding-top: 34px; border-top: 1px solid var(--border); }
.cmt-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.cmt-head h3 { margin: 0; font-size: 1.2rem; font-weight: 640; letter-spacing: -.015em; }
.cmt-head span { font-size: 13px; color: var(--muted-fg); }

.cmt-form {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.cmt-form textarea {
  width: 100%; min-height: 104px; resize: vertical; background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  font-family: inherit; font-size: 14.5px; line-height: 1.7;
}
.cmt-form textarea:focus, .cmt-form input:focus {
  outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}
.cmt-fields { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.cmt-fields input {
  flex: 1 1 150px; background: var(--bg); color: var(--fg); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 13px; font-family: inherit; font-size: 14px;
}
.cmt-fields input::placeholder { color: var(--muted-fg); }
.cmt-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cmt-bar .tip { font-size: 12.5px; color: var(--muted-fg); }
.cmt-msg { font-size: 13.5px; }
.cmt-msg.err { color: #dc2626; }
.cmt-msg.ok { color: #16a34a; }
html[data-theme="dark"] .cmt-msg.err { color: #f87171; }
html[data-theme="dark"] .cmt-msg.ok { color: #4ade80; }

.cmt-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.cmt-item {
  display: grid; grid-template-columns: 36px 1fr; gap: 13px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.cmt-item .av {
  width: 36px; height: 36px; border-radius: 50%; background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--muted-fg); overflow: hidden;
}
.cmt-item .av img { width: 100%; height: 100%; object-fit: cover; }
.cmt-item .who { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.cmt-item .who b { font-size: 14.5px; font-weight: 620; }
.cmt-item .who a { color: var(--fg); text-decoration: none; }
.cmt-item .who a:hover { text-decoration: underline; }
.cmt-item .who time { font-size: 12px; color: var(--muted-fg); }
.cmt-item p { margin: 0; font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt-empty { color: var(--muted-fg); font-size: 14px; padding: 22px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---------- 页脚 ---------- */
footer.site {
  margin-top: 72px; padding-top: 22px; border-top: 1px solid var(--border);
  color: var(--muted-fg); font-size: 13.5px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(2n) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 600px) {
  .wrap, .top-in { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 30px; }
  .top nav a { padding: 6px 9px; font-size: 13.5px; }
  #content h1 { font-size: 1.6rem; }
  #content table { display: block; overflow-x: auto; }
}

/* 学习计划页：窄屏降级为上下布局，时间线变成可滚动的顶部区块 */
@media (max-width: 900px) {
  .plan-wrap { display: block; }
  .plan-main .hero { padding: 40px 0 24px; }
  .plan-side {
    position: static; max-height: none; margin-top: 0; margin-bottom: 26px;
    padding: 16px 14px 12px;
  }
  .plan-toc { max-height: 34vh; }
  .toc-item { font-size: 13.5px; padding: 6px 8px; }
  #content h2[id], #content h3[id] { scroll-margin-top: 72px; }
}
@media (max-width: 460px) {
  .top-in { gap: 8px; }
  .brand { display: none; }
  .top nav {
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { white-space: nowrap; }
}