/* 闫少涵个人网站样式表 · 克制工程杂志风（支持深色/浅色双主题与打印排版） */
:root {
  --bg: #0d0f12;
  --bg-elev: #14171c;
  --bg-card: #181c22;
  --bg-hover: #1f242c;
  --border: #262b34;
  --border-strong: #363d49;
  --text: #edece8;
  --text-sec: #a0a6b1;
  --text-muted: #8b93a1;
  --accent: #e06c3b;
  --accent-soft: rgba(224, 108, 59, 0.14);
  --green: #2fb36d;
  --green-soft: rgba(47, 179, 109, 0.14);
  --amber: #d99b26;
  --red: #e05252;
  --code-bg: #090b0d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", sans-serif;
}

[data-theme="light"] {
  --bg: #f6f5f0;
  --bg-elev: #eeece5;
  --bg-card: #ffffff;
  --bg-hover: #f1efe9;
  --border: #dedbd2;
  --border-strong: #c5c1b6;
  --text: #17191c;
  --text-sec: #4f5560;
  --text-muted: #5f6672;
  --accent: #c85220;
  --accent-soft: rgba(200, 82, 32, 0.1);
  --green: #1d8a4e;
  --green-soft: rgba(29, 138, 78, 0.1);
  --amber: #b57908;
  --red: #c93b3b;
  --code-bg: #f0efe9;
  --shadow: 0 16px 40px rgba(23, 25, 28, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 顶部导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  /* 不支持 color-mix 的旧浏览器用这条不透明底色兜底 */
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-sec);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

/* 首屏 Hero */
.hero {
  padding: 76px 0 56px;
  border-bottom: 1px solid var(--border);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12.5px;
  color: var(--text-sec);
  margin-bottom: 22px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 40px;
  align-items: start;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 750;
}

.hero h1 .hl {
  color: var(--accent);
}

.hero-lead {
  margin: 0 0 26px;
  font-size: 16.5px;
  color: var(--text-sec);
  max-width: 610px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid transparent;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: filter 0.15s;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

/* 右侧工程速览面板 */
.spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.spec-title {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
}

.spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spec-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.spec-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.spec-k {
  color: var(--text-muted);
  white-space: nowrap;
}

.spec-v {
  text-align: right;
  font-weight: 500;
}

/* 关键指标横条 */
.metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 42px;
}

.metric-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.metric-num {
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 12.8px;
  color: var(--text-sec);
  margin-top: 4px;
}

/* 通用章节 */
.section {
  padding: 68px 0;
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-head h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 6px 0 0;
  color: var(--text-sec);
  font-size: 14.5px;
  max-width: 580px;
}

/* 筛选标签 */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  background: transparent;
  color: var(--text-sec);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}

/* 代表作网格 */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.18s, transform 0.18s;
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.proj-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.proj-cat {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 600;
}

.proj-status {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.project-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.proj-tagline {
  margin: 0 0 16px;
  color: var(--text-sec);
  font-size: 14.2px;
}

.proj-highlights {
  margin: 0 0 20px;
  padding-left: 18px;
  color: var(--text-sec);
  font-size: 13.6px;
}

.proj-highlights li {
  margin-bottom: 6px;
}

.proj-highlights strong {
  color: var(--text);
  font-weight: 600;
}

.proj-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

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

.tech-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

.text-link {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.text-link:hover {
  text-decoration: underline;
}

/* 交互式原理演示盒：字幕时间轴校准对比 */
.lab-box {
  margin-top: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.lab-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.lab-head h3 {
  margin: 0;
  font-size: 16.5px;
}

.lab-head p {
  margin: 4px 0 0;
  font-size: 13.2px;
  color: var(--text-sec);
}

.seg-switch {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.seg-btn {
  background: transparent;
  color: var(--text-sec);
  border: 0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.8px;
  cursor: pointer;
  font-family: inherit;
}

.seg-btn.active {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.timeline-stage {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.track-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.track-row:last-child {
  margin-bottom: 0;
}

.track-label {
  color: var(--text-muted);
  font-size: 12px;
}

.track-bar {
  position: relative;
  height: 34px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.seg-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: left 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s;
}

.seg-audio {
  background: rgba(47, 179, 109, 0.22);
  border: 1px solid var(--green);
  color: var(--text);
}

.seg-silence {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  border-left: 1px dashed var(--border-strong);
  border-right: 1px dashed var(--border-strong);
}

.seg-sub-ok {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--text);
}

.seg-sub-bad {
  background: rgba(224, 82, 82, 0.2);
  border: 1px solid var(--red);
  color: var(--text);
}

.lab-caption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-sec);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* 工程方法论 / 能力矩阵 */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.stack-card h3 {
  margin: 0 0 10px;
  font-size: 16.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack-card p {
  margin: 0 0 14px;
  font-size: 13.8px;
  color: var(--text-sec);
}

.stack-items {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13.2px;
  color: var(--text-sec);
}

.stack-items li {
  padding: 6px 0;
  border-top: 1px dashed var(--border);
}

/* 实战排障手记列表 */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.note-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.note-date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.note-main h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.note-main p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-sec);
}

.note-arrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

/* 关于与联系 */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}

.principles-card, .contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.principles-card h3, .contact-card h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.principle-item {
  margin-bottom: 14px;
}

.principle-item:last-child {
  margin-bottom: 0;
}

.principle-item strong {
  display: block;
  font-size: 14.5px;
  margin-bottom: 3px;
}

.principle-item span {
  font-size: 13.6px;
  color: var(--text-sec);
}

.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  gap: 12px;
}

.contact-row:first-of-type {
  border-top: 0;
}

.mono {
  font-family: var(--mono);
}

.site-footer {
  padding: 34px 0 48px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* 详情模态阅读抽屉 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.drawer-backdrop.open {
  display: flex;
}

.drawer-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  max-width: 780px;
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.drawer-hd {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.drawer-hd h3 {
  margin: 0;
  font-size: 18px;
}

.drawer-close {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 14.8px;
  line-height: 1.75;
}

.drawer-body h4 {
  margin: 22px 0 8px;
  font-size: 15.5px;
  color: var(--text);
}

.drawer-body h4:first-child {
  margin-top: 0;
}

.drawer-body p, .drawer-body li {
  color: var(--text-sec);
}

.drawer-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.6px;
  line-height: 1.6;
  color: var(--text);
}

.drawer-body code {
  font-family: var(--mono);
  font-size: 12.8px;
  background: var(--bg-elev);
  padding: 2px 5px;
  border-radius: 4px;
}

.drawer-body pre code {
  background: none;
  padding: 0;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
  display: none;
}

/* ───────────────────────── 通用可访问性 ───────────────────────── */
/* 键盘焦点可见（鼠标点击不触发） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 跳转到主内容：Tab 第一下出现 */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 300;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: top 0.18s ease;
}
.skip-link:focus {
  top: 12px;
}

/* 锚点跳转时避让吸顶导航 */
main[id],
section[id] {
  scroll-margin-top: 86px;
}

/* 打印专用抬头，屏幕隐藏 */
.print-only {
  display: none;
}

/* 手记条目已改为 <button>，重置按钮默认外观 */
button.note-row {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.note-main {
  display: block;
  min-width: 0;
}

.note-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 4px;
}

.note-summary {
  display: block;
  font-size: 13.5px;
  color: var(--text-sec);
  line-height: 1.6;
}

/* 弹窗打开时锁滚动（改用 body 类名，保持可被 CSS 覆盖） */
body.drawer-open {
  overflow: hidden;
}

/* 空分类占位 */
.proj-empty {
  color: var(--text-sec);
  font-size: 14px;
  grid-column: 1 / -1;
  padding: 24px 0;
}

.nav-links a.active {
  color: var(--text);
  background: var(--bg-hover);
}

.project-card:focus-within {
  border-color: var(--accent);
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s, border-color 0.15s;
  box-shadow: var(--shadow);
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 禁用脚本时的兜底说明 */
.noscript-note {
  padding: 40px 24px 8px;
}
.noscript-note h2 {
  margin: 0 0 12px;
}
.noscript-note p {
  color: var(--text-sec);
  margin: 0 0 10px;
}

/* ───────────────────────── 响应式 ───────────────────────── */
@media (max-width: 860px) {
  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 0;
    row-gap: 8px;
  }
  /* 移动端保留完整导航：横向可滚动，不再直接隐藏 */
  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding-bottom: 2px;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-links a {
    white-space: nowrap;
    padding: 6px 10px;
  }
  .icon-btn {
    padding: 6px 10px;
    font-size: 12.5px;
  }
  .hero {
    padding: 48px 0 40px;
  }
  .hero-grid,
  .projects-grid,
  .stack-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }
  .metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 30px;
  }
  .section {
    padding: 48px 0;
  }
  .note-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .track-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .drawer-panel {
    max-height: 88vh;
  }
}

@media (max-width: 520px) {
  .wrap {
    padding: 0 16px;
  }
  .metrics-bar {
    grid-template-columns: 1fr;
  }
  .metric-num {
    font-size: 20px;
  }
  .hero-lead {
    font-size: 15.5px;
  }
  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  .proj-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .to-top {
    right: 14px;
    bottom: 14px;
  }
}

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ───────────────────────── 打印 / 导出单页简历 ───────────────────────── */
@media print {
  :root,
  [data-theme="dark"],
  [data-theme="light"] {
    --bg: #ffffff;
    --bg-elev: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #ffffff;
    --border: #d2d2d2;
    --border-strong: #9a9a9a;
    --text: #111111;
    --text-sec: #333333;
    --text-muted: #555555;
    --accent: #a8410f;
    --accent-soft: #f6eae4;
    --code-bg: #f6f6f4;
    --shadow: none;
  }
  body {
    background: #ffffff;
    color: #111111;
    font-size: 10.5pt;
    line-height: 1.55;
  }
  .site-header,
  .lab-box,
  .filter-bar,
  .hero-cta,
  .text-link,
  .to-top,
  .toast,
  .drawer-backdrop,
  .status-pill,
  .skip-link,
  .noscript-note {
    display: none !important;
  }
  .print-only {
    display: block !important;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border-strong);
    margin-bottom: 12px;
  }
  .print-only h1 {
    margin: 0 0 4px;
    font-size: 18pt;
  }
  .print-only p {
    margin: 2px 0;
    color: var(--text-sec);
    font-size: 9.5pt;
  }
  .section,
  .hero {
    padding: 14px 0;
    border-color: var(--border);
  }
  .projects-grid,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
  }
  .project-card,
  .stack-card,
  .principles-card,
  .contact-card,
  .metric-item,
  .note-row {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
  }
  .project-card:hover {
    transform: none;
  }
  .note-row {
    grid-template-columns: 78px 1fr;
    gap: 10px;
  }
  .note-arrow,
  .tag-row {
    display: none;
  }
  a {
    color: #111111;
    text-decoration: underline;
  }
  .drawer-body pre,
  .timeline-stage {
    white-space: pre-wrap;
    overflow: visible;
  }
  @page {
    margin: 14mm;
  }
}
