/* ============================================================
   zmeety · AI Agent 工程笔记
   复古纸张底 / 朱砂单一强调 / 衬线标题 + 等宽数据标签
   ============================================================ */

:root {
  /* 纸 */
  --bg: #f5e8c9;
  --bg-alt: #efe0bb;
  --panel: #fcf5e2;
  --panel-2: #f8efd6;
  --line: rgba(90, 70, 44, 0.16);
  --line-2: rgba(90, 70, 44, 0.28);
  /* 墨 */
  --fg: #2b2318;
  --dim: #4f3e2b;
  --mute: #6b5740;
  /* 朱砂 */
  --accent: #8f3a20;
  --accent-dim: #6f2c17;
  --accent-soft: rgba(163, 70, 42, 0.08);
  --accent-line: rgba(163, 70, 42, 0.32);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --wrap: 1140px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}


*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 纸面：陈旧斑 + 纤维纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 80% -8%, rgba(163, 70, 42, 0.07), transparent 62%),
    radial-gradient(720px 460px at 4% 4%, rgba(120, 90, 45, 0.09), transparent 60%),
    radial-gradient(640px 420px at 52% 104%, rgba(120, 90, 45, 0.06), transparent 66%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(120, 92, 55, 0.011) 4px 5px);
  pointer-events: none;
}

/* 纸纹噪点 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(90, 70, 44, 0.1);
  color: #4a3a26;
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------------- 无障碍 ---------------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff8ea;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------- 滚动进度 ---------------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff8ea;
  font-weight: 600;
}
.btn-primary:hover { background: #8e3a20; }

.btn-ghost {
  border-color: var(--line-2);
  color: var(--fg);
  background: rgba(90, 70, 44, 0.04);
}
.btn-ghost:hover { border-color: rgba(163, 70, 42, 0.45); background: var(--accent-soft); }

.btn-outline {
  border-color: var(--line-2);
  color: var(--dim);
  background: transparent;
}
.btn-outline:hover { border-color: var(--accent-line); color: var(--accent); }

.btn-text {
  color: var(--dim);
  padding: 0 4px;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 13px;
}
.btn-text:hover { color: var(--accent); }

.btn-sm { min-height: 36px; padding: 0 13px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 15px; }

/* ---------------- 顶栏 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 232, 201, 0.94);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border-bottom: 1px solid rgba(90, 70, 44, 0.07);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fdf8eb;
  border: 1px solid rgba(163, 70, 42, 0.35);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}
.brand-text {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--mute);
  text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--dim);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav a:hover { color: var(--fg); background: rgba(90, 70, 44, 0.06); }
.nav a.is-active { color: var(--accent); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 4px auto;
  background: var(--fg);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
body.nav-open .menu-btn span:first-child { transform: translateY(2.75px) rotate(45deg); }
body.nav-open .menu-btn span:last-child { transform: translateY(-2.75px) rotate(-45deg); }

/* ---------------- HERO ---------------- */
.hero {
  position: relative;
  padding: clamp(56px, 9vw, 104px) 0 clamp(44px, 6vw, 72px);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -180px;
  right: -80px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(163, 70, 42, 0.09), transparent 66%);
  filter: blur(10px);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
/* 防止长内容（代码块、URL）把网格列撑破，导致整页横向溢出 */
.hero-grid > *,
.project-featured > *,
.project-grid > *,
.stack-grid > *,
.principles > *,
.timeline > * { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: rgba(90, 70, 44, 0.04);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 70, 42, 0.16);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(163, 70, 42, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(163, 70, 42, 0.05); }
}

.hero h1 {
  font-size: clamp(2.35rem, 5.6vw, 4.05rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.hl {
  position: relative;
  color: var(--accent);
  white-space: nowrap;
}
.hl::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.02em;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.45;
}

.hero-lead {
  max-width: 33em;
  margin-top: 26px;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.8;
  color: var(--dim);
}
.hero-note {
  max-width: 33em;
  margin-top: 14px;
  padding-left: 13px;
  border-left: 2px solid var(--accent-line);
  font-size: 14px;
  line-height: 1.75;
  color: var(--mute);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

/* 终端卡片 */
.terminal {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fdf9ef, #faf2dd);
  box-shadow: 0 24px 60px -30px rgba(92, 68, 40, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(90, 70, 44, 0.03);
}
.t-dots { display: inline-flex; gap: 6px; }
.t-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(90, 70, 44, 0.22);
}
.t-path {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--mute);
}
.terminal-body {
  padding: 18px 18px 16px;
  font-family: var(--mono);
  font-size: 12.3px;
  line-height: 1.75;
  color: var(--dim);
  overflow-x: auto;
}
.terminal-body p { white-space: nowrap; }
.t-prompt { color: var(--accent); margin-right: 4px; }
.t-cmd { color: #3a2e1f; }
.t-out { color: var(--mute); padding-left: 14px; }
.t-gap { margin-top: 12px !important; }
.t-json {
  margin: 6px 0 0;
  padding-left: 14px;
  font-family: var(--mono);
  font-size: 11.8px;
  line-height: 1.8;
  color: var(--mute);
  white-space: pre;
}
.t-key { color: #7a4b2e; }
.t-str { color: #4f6b3d; }
.t-log { color: #5c4a35; }
.t-cursor { padding-left: 14px; margin-top: 2px; }
.t-caret {
  display: inline-block;
  width: 7px;
  height: 0.95em;
  margin-left: 6px;
  vertical-align: -0.1em;
  background: var(--accent);
  opacity: 0.8;
  animation: blink 1.1s step-end infinite;
}
.t-cursor span {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  opacity: 0.75;
  animation: blink 1.1s step-end infinite;
  vertical-align: -2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------------- 指标条 ---------------- */
.metrics-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(120, 90, 45, 0.055), transparent);
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.metric {
  padding: 26px 22px;
  border-left: 1px solid var(--line);
}
.metric:first-child { border-left: 0; padding-left: 0; }
.metric-num {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--mono);
  font-size: clamp(1.7rem, 2.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.metric-num small {
  font-size: 0.5em;
  font-weight: 400;
  color: var(--mute);
  margin-left: 2px;
}
.metric-range { font-size: clamp(1.35rem, 2.1vw, 1.75rem); }
.metric-range .arrow { color: var(--accent); margin: 0 4px; font-size: 0.8em; }
.metric-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--dim);
}
.metric-src {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.01em;
}

/* ---------------- 区块 ---------------- */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-alt {
  background: linear-gradient(180deg, transparent, rgba(120, 90, 45, 0.055) 12%, rgba(120, 90, 45, 0.055) 88%, transparent);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head { max-width: 720px; margin-bottom: clamp(34px, 5vw, 54px); }
.section-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: clamp(1.7rem, 3.1vw, 2.35rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.section-note {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--mute);
  max-width: 40em;
}

/* ---------------- 项目卡片 ---------------- */
.project-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fdf8eb, #fbf3df);
  padding: 28px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
.project-card:hover {
  border-color: rgba(163, 70, 42, 0.26);
  transform: translateY(-3px);
  box-shadow: 0 18px 44px -28px rgba(92, 68, 40, 0.22);
}

.project-featured {
  display: grid;
  grid-template-columns: 1.55fr 0.85fr;
  gap: 34px;
  padding: 32px;
  margin-bottom: 22px;
}
.project-featured::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(520px 260px at 92% 0%, rgba(163, 70, 42, 0.06), transparent 70%);
  pointer-events: none;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.project-index {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
  margin-right: 2px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--mute);
}
.tag-accent { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.tag-live { border-color: rgba(163, 70, 42, 0.3); color: var(--accent); }
.tag-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.project-card h3 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
}
.project-sub {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--mute);
}
.project-desc {
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--dim);
}
.project-points {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}
.project-points li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.78;
  color: #5f4e38;
}
.project-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: var(--accent-line);
}

.project-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips li {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(90, 70, 44, 0.04);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--mute);
}
.chips-lg li { font-size: 11.5px; padding: 5px 10px; }

.foot-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.link-out {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.link-out:hover { border-bottom-color: var(--accent-line); }

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.project-grid .project-foot { align-items: center; }
.project-grid .foot-actions { margin-left: auto; }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mini-stats > div { display: flex; flex-direction: column; gap: 2px; }
.mini-stats b {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.mini-stats span {
  font-size: 11px;
  color: var(--mute);
  line-height: 1.4;
}

.project-side {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(238, 225, 198, 0.55);
  align-self: start;
}
.side-stat { display: flex; align-items: baseline; gap: 12px; }
.side-num {
  min-width: 62px;
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.side-arrow { color: var(--mute); font-size: 0.7em; margin: 0 2px; }
.side-label {
  font-size: 12px;
  line-height: 1.5;
  color: #5f4e38;
}
.side-note {
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
}

/* ---------------- 时间线 ---------------- */
.timeline { display: grid; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.tl-item:last-child { border-bottom: 1px solid var(--line); }
.tl-date {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--mute);
  padding-top: 4px;
}
.tl-body h3 {
  font-size: 17px;
  letter-spacing: -0.01em;
}
.tl-body h3 span {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--mute);
}
.tl-body p {
  margin-top: 10px;
  max-width: 62em;
  font-size: 14px;
  line-height: 1.8;
  color: var(--dim);
}
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.tl-tags li {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  font-size: 11px;
  color: #8a4a2e;
}

/* ---------------- 技能 ---------------- */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stack-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fdf8eb;
}
.stack-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.stack-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
}
.stack-card dl {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.stack-card dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b5a43;
}
.stack-card dd {
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--dim);
}
.stack-foot {
  margin-top: 22px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--mute);
}

/* ---------------- 原则 ---------------- */
.principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.principles li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fdf8eb;
}
.p-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding-top: 2px;
}
.principles h3 {
  font-size: 15.5px;
  line-height: 1.5;
}
.principles p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.8;
  color: #5f4e38;
}

/* ---------------- 联系 ---------------- */
.contact { padding-bottom: clamp(72px, 10vw, 120px); }
.contact-inner {
  position: relative;
  padding: clamp(32px, 5vw, 56px);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background:
    radial-gradient(700px 300px at 88% 0%, rgba(163, 70, 42, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(251, 245, 230, 0.75), rgba(250, 243, 226, 0.9));
  overflow: hidden;
}
.contact h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 18em;
}
.contact-inner > p {
  margin-top: 16px;
  max-width: 38em;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--dim);
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.about-contact {
  margin-top: 26px;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 10px 44px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.contact-list li { display: flex; flex-direction: column; gap: 3px; }
.contact-list span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}
.contact-list a { color: var(--fg); border-bottom: 1px solid var(--line-2); }
.contact-list a:hover { color: var(--accent); border-bottom-color: var(--accent-line); }
.contact-list em { font-style: normal; color: var(--dim); }

/* ---------------- 页脚 ---------------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 22px 28px;
  font-size: 12px;
  color: var(--mute);
}
.footer-note { font-family: var(--mono); font-size: 10.5px; white-space: nowrap; }

/* ---------------- 弹层 ---------------- */
body.modal-open { overflow: hidden; }

.project-dialog {
  width: min(900px, calc(100vw - 32px));
  height: fit-content;
  max-height: min(88vh, 940px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: #f7efdc;
  color: var(--fg);
  overflow: hidden;
  box-shadow: 0 40px 100px -40px rgba(92, 68, 40, 0.28);
}
.project-dialog[open] { display: flex; flex-direction: column; }
.project-dialog::backdrop {
  background: rgba(43, 35, 24, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(6px);
}

.dlg-head {
  position: relative;
  flex: 0 0 auto;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(420px 160px at 85% 0%, rgba(163, 70, 42, 0.07), transparent 70%),
    #f2e7cf;
}
.dlg-kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.dlg-head h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  padding-right: 44px;
}
.dlg-sub {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}
.dlg-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgba(90, 70, 44, 0.05);
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.dlg-close:hover { color: var(--accent); border-color: var(--accent-line); }

.dlg-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(88vh - 150px);
  overflow-y: auto;
  padding: 26px;
  overscroll-behavior: contain;
}
.dlg-section + .dlg-section {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.dlg-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b5a43;
  margin-bottom: 14px;
}
.dlg-section h3::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}
.dlg-section > p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--dim);
}
.dlg-section > p + p { margin-top: 10px; }

.dlg-items { display: grid; gap: 18px; }
.dlg-item h4 {
  font-size: 14px;
  color: var(--fg);
  margin-bottom: 6px;
}
.dlg-item p {
  font-size: 13.5px;
  line-height: 1.8;
  color: #5f4e38;
}

.qa { border-bottom: 1px solid var(--line); }
.qa:first-of-type { border-top: 1px solid var(--line); }
.qa summary {
  position: relative;
  padding: 14px 30px 14px 0;
  font-size: 14px;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  transition: color 0.18s var(--ease);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 16px;
  color: var(--mute);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}
.qa summary:hover { color: var(--accent); }
.qa[open] summary { color: var(--accent); }
.qa[open] summary::after { content: "−"; color: var(--accent); }
.qa-body { padding: 0 30px 16px 0; }
.qa-body p {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--mute);
}
.qa-body p + p { margin-top: 8px; }

.dlg-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.dlg-metrics > div {
  padding: 16px;
  background: #faf3e2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dlg-metrics b {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.dlg-metrics span {
  font-size: 11px;
  line-height: 1.5;
  color: var(--mute);
}
.dlg-footnote {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--mute);
}
.dlg-footnote a { color: var(--accent); border-bottom: 1px solid var(--accent-line); }

/* ---------------- 动效 ---------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .terminal { max-width: 560px; }
  .project-featured { grid-template-columns: 1fr; }
  .project-side {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
  }
  .side-stat { flex-direction: column; gap: 4px; }
  .side-note { grid-column: 1 / -1; margin-top: 0; }
  .contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 20px 16px;
    background: rgba(246, 238, 220, 0.99);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }
  body.nav-open .nav { display: flex; }
  .nav a { padding: 11px 12px; font-size: 14px; }
  .nav a.is-active::after { display: none; }
  .menu-btn { display: block; }

  .metrics-grid { grid-template-columns: 1fr; }
  .metric { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0; }
  .metric:first-child { border-top: 0; }
  .metric { padding: 22px 20px; }
  .metric:nth-child(odd) { border-left: 0; padding-left: 0; }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .project-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }

  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-date { padding-top: 0; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .header-inner { min-height: 60px; }
  .brand-sub { display: none; }
  .header-actions .btn-ghost { display: none; }

  .hero { padding-top: 40px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-actions .btn-text { flex-basis: 100%; justify-content: flex-start; }

  .metric { padding: 18px 14px; }
  .metric-num { font-size: 1.45rem; }
  .metric-range { font-size: 1.12rem; }

  .project-card, .project-featured { padding: 22px; }
  .project-side { grid-template-columns: 1fr 1fr; }
  .side-num { font-size: 22px; min-width: 0; }

  .mini-stats { grid-template-columns: 1fr 1fr; }
  .mini-stats > div:last-child { grid-column: 1 / -1; }

  .contact-inner { padding: 26px 22px; }
  .contact-actions .btn { width: 100%; }
  .contact-list { grid-template-columns: 1fr; gap: 12px; }

  .dlg-head { padding: 20px 20px 16px; }
  .dlg-body { padding: 20px; }
  .dlg-metrics { grid-template-columns: 1fr 1fr; }

  .footer-inner { padding: 20px; flex-direction: column; align-items: flex-start; }
}

/* ---------------- 减少动效 ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* 只停循环播放的装饰动画；一次性的过渡是空间导航的一部分，保留 */
  .scroll-hint-line { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
}


/* ---------------- 技术笔记列表 ---------------- */
.notes-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.note-item {
  text-decoration: none;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 24px;
  gap: 24px;
  align-items: start;
  width: 100%;
  padding: 22px 10px 22px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s var(--ease), padding-left 0.22s var(--ease);
}
.note-item:hover { background: rgba(163, 70, 42, 0.035); padding-left: 10px; }
.note-item:focus-visible { outline-offset: -3px; }

.note-kicker {
  display: block;
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--accent);
}

.note-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.note-title {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--fg);
  text-wrap: pretty;
}
.note-desc {
  display: block;
  font-size: 13.5px;
  line-height: 1.72;
  color: #5f4e38;
}

.note-arrow {
  display: block;
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--mute);
  transition: transform 0.22s var(--ease), color 0.22s var(--ease);
}
.note-item:hover .note-arrow { transform: translateX(5px); color: var(--accent); }

@media (max-width: 720px) {
  .note-item {
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 8px 12px;
    padding: 20px 4px 20px 0;
  }
  .note-kicker { grid-column: 1 / -1; padding-top: 0; }
  .note-body { grid-column: 1; grid-row: 2; }
  .note-arrow { grid-column: 2; grid-row: 2; align-self: center; padding-top: 0; }
  .note-title { font-size: 15.5px; }
}

/* 笔记弹层的长标题 */
.project-dialog .dlg-head h2 { max-width: 22em; }


/* ---------------- 纸张主题：衬线标题 / 选中色 ---------------- */
h1, h2, h3,
.brand-text,
.note-title { font-family: var(--serif); }

h1 { letter-spacing: -0.015em; }
.section-head h2,
.contact h2 { letter-spacing: -0.01em; }

::selection { background: rgba(163, 70, 42, 0.2); color: var(--fg); }

/* 纸面上的卡片：更轻的暖投影 */
.site-header { box-shadow: 0 1px 0 rgba(90, 70, 44, 0.06); }


/* ============================================================
   文章页
   ============================================================ */
.post-main { padding: clamp(40px, 6vw, 76px) 0 clamp(64px, 9vw, 110px); }

.post {
  max-width: 764px;
  margin: 0 auto;
  padding: 0 28px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  transition: color 0.2s var(--ease);
}
.post-back:hover { color: var(--accent); }

.post-kicker {
  margin-top: 30px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.post h1 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4.2vw, 2.7rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.post-meta {
  margin-top: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}

.post-body {
  margin-top: 34px;
  font-size: 16px;
  line-height: 1.92;
  color: var(--dim);
}

.post-body > p { margin: 17px 0; }
.post-body .lead {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.9;
  color: var(--fg);
}

.post-body h2 {
  margin: 44px 0 16px;
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--fg);
}
.post-body h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.86em;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -0.04em;
}

.post-body strong { color: var(--fg); font-weight: 600; }
.post-body em { font-style: normal; color: var(--accent); }

.post-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(90, 70, 44, 0.09);
  color: #4a3a26;
  white-space: nowrap;
}

.post-body pre {
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f2e7cf;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.75;
}
.post-body pre code {
  padding: 0;
  background: none;
  white-space: pre;
  color: #3a2e1f;
}

.post-body ul,
.post-body ol { margin: 18px 0; padding-left: 22px; }
.post-body li { margin: 9px 0; padding-left: 4px; }
.post-body ul li { list-style: disc; }
.post-body ol li { list-style: decimal; }
.post-body li::marker { color: var(--accent); }

/* 强调块 */
.callout {
  margin: 26px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
}
.callout p { margin: 0; font-size: 15px; }

.quote {
  margin: 30px 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdf8eb;
}
.quote p { margin: 0; font-size: 15px; color: var(--ink-2, #5c4a35); }
.quote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-style: normal;
  color: var(--mute);
}

/* 表格 */
.table-wrap { margin: 22px 0; overflow-x: auto; }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.6;
}
.post-body th,
.post-body td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.post-body th {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}
.post-body td.up { color: var(--accent); font-weight: 600; }
.post-body td.dim { color: var(--mute); }

.post-end {
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.post-related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.post-related-label {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--mute);
}
.post-related a {
  font-size: 14px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.post-related a:hover { border-bottom-color: var(--accent-line); }

@media (max-width: 640px) {
  .post { padding: 0 20px; }
  .post-body { font-size: 15.5px; line-height: 1.85; }
  .post-body h2 { margin-top: 36px; }
  .post-body pre { font-size: 12px; padding: 14px; }
}


/* ============================================================
   指针动效：纸张上的触感（只用 transform / opacity）
   ============================================================ */
.project-card {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg))
             translateY(var(--lift, 0px));
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
              border-color 0.3s var(--ease);
  will-change: transform;
}
.project-card:hover {
  --lift: -4px;
  border-color: rgba(163, 70, 42, 0.3);
  box-shadow: 0 20px 44px -30px rgba(92, 68, 40, 0.55);
}
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%),
              rgba(163, 70, 42, 0.09), transparent 68%);
}
.project-card:hover::after { opacity: 1; }

.note-item {
  position: relative;
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
}
.note-item::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  opacity: 0;
  transition: height 0.3s var(--ease), opacity 0.3s var(--ease);
}
.note-item:hover {
  background: linear-gradient(90deg, rgba(163, 70, 42, 0.055), transparent 62%);
  padding-left: 8px;
}
.note-item:hover::before { height: 58%; opacity: 1; }
.note-item:hover .note-arrow { transform: translateX(5px); color: var(--accent); }
.note-arrow { transition: transform 0.28s var(--ease), color 0.28s var(--ease); }

.btn {
  transition: transform 0.22s var(--ease), box-shadow 0.25s var(--ease),
              background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn-primary:hover { box-shadow: 0 12px 26px -14px rgba(163, 70, 42, 0.6); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); }

.nav a { position: relative; }
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }

.terminal {
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.terminal:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px -32px rgba(92, 68, 40, 0.5);
}

.post-body a {
  border-bottom: 1px solid var(--accent-line);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.post-body a:hover { background: var(--accent-soft); border-color: var(--accent); }


/* ============================================================
   翻页布局 + 聚拢入场
   ============================================================ */
.pages .page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
}

/* 数据页：放大数字，撑起一屏 */
.metrics-band.page .metrics-grid { width: 100%; }
.metrics-band.page .metric { padding: 34px 26px; }
.metrics-band.page .metric-num { font-size: clamp(2.6rem, 5vw, 4rem); }
.metrics-band.page .metric-label { margin-top: 10px; font-size: 15px; }

/* 聚拢：方向由 JS 写入 --fx / --fy，scale 从略大收到 1 */
[data-reveal] {
  opacity: 0;
  transform: translate3d(var(--fx, 0px), var(--fy, 24px), 0) scale(var(--fs, 1));
  transition: opacity 0.55s var(--ease) var(--rd, 0ms),
              transform 0.7s var(--ease) var(--rd, 0ms);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* 入场完成后，把卡片自己的 transform 接回来：
   .project-card 的 3D 倾斜（--rx / --ry / --lift 由 app.js 写入）与
   .terminal 的悬停上浮，否则会被上面的 [data-reveal].is-in 永久盖住 */
.project-card[data-reveal].is-in {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg))
             translateY(var(--lift, 0px));
  transition: opacity 0.55s var(--ease) var(--rd, 0ms),
              transform 0.7s var(--ease) var(--rd, 0ms),
              box-shadow 0.35s var(--ease),
              border-color 0.3s var(--ease);
}
.project-card[data-reveal].is-in:hover {
  /* 悬停中跟手要快，离开时沿用入场的缓动回正 */
  transition: transform 0.35s var(--ease),
              box-shadow 0.35s var(--ease),
              border-color 0.3s var(--ease);
}
.terminal[data-reveal].is-in {
  transition: opacity 0.55s var(--ease) var(--rd, 0ms),
              transform 0.7s var(--ease) var(--rd, 0ms),
              box-shadow 0.35s var(--ease);
}
.terminal[data-reveal].is-in:hover {
  transform: translateY(-2px);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

/* 最后一页给页脚留位置 */
.pages .page-last {
  min-height: calc(100svh - 92px);
}

/* 首屏提示 */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--mute);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.scroll-hint.is-off { opacity: 0; transform: translateX(-50%) translateY(8px); }
.scroll-hint-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, transparent, var(--accent-line));
  animation: hintDrift 2.2s ease-in-out infinite;
}
@keyframes hintDrift {
  0%, 100% { transform: scaleY(0.5); transform-origin: top; opacity: 0.5; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
}

/* 移动端不做强制吸附，避免内容超一屏时卡住 */
@media (max-width: 860px) {
  .pages .page { min-height: auto; }
  .pages .page > .wrap { transform: none; opacity: 1; }
  .scroll-hint { display: none; }
}




/* 作品页压到一屏：只留结论，细节在弹层里 */
.pages #work {
  padding-top: 40px;
  padding-bottom: 28px;
}
.pages #work .section-head { margin-bottom: 18px; }
.pages #work .section-kicker { margin-bottom: 8px; }
.pages #work .project-desc,
.pages #work .project-points,
.pages #work .side-note { display: none; }

.pages #work .project-featured { min-height: 0; }
.pages #work .project-featured .project-main { justify-content: flex-start; }




.pages #work .side-stat { padding: 10px 0; }



/* ============================================================
   夜间阅读模式
   ============================================================ */
[data-theme="dark"] {
  --bg: #1b1711;
  --bg-alt: #221d16;
  --panel: #262019;
  --panel-2: #2b241c;
  --line: rgba(240, 230, 210, 0.14);
  --line-2: rgba(240, 230, 210, 0.26);
  --fg: #f0e6d2;
  --dim: #cfc2aa;
  --mute: #a99b82;
  --accent: #d9744f;
  --accent-dim: #e08a68;
  --accent-soft: rgba(217, 116, 79, 0.14);
  --accent-line: rgba(217, 116, 79, 0.42);
}

[data-theme="dark"] body { background: var(--bg); }

/* 深色纸面：光斑换成暖朱，噪点改为叠加 */
[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 520px at 80% -8%, rgba(217, 116, 79, 0.10), transparent 62%),
    radial-gradient(720px 460px at 4% 4%, rgba(217, 116, 79, 0.05), transparent 60%),
    radial-gradient(640px 420px at 52% 104%, rgba(217, 116, 79, 0.04), transparent 66%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, 0.012) 4px 5px);
}
[data-theme="dark"] body::after { opacity: 0.16; mix-blend-mode: screen; }

[data-theme="dark"] .brand-mark { background: #2b241c; color: var(--fg); }
[data-theme="dark"] .site-header { background: rgba(27, 23, 17, 0.86); }

[data-theme="dark"] .terminal {
  background: linear-gradient(180deg, #241e17, #201a13);
  box-shadow: 0 24px 50px -34px rgba(0, 0, 0, 0.9);
}
[data-theme="dark"] .terminal-bar { background: rgba(240, 230, 210, 0.05); }

[data-theme="dark"] .project-card,
[data-theme="dark"] .stack-card,
[data-theme="dark"] .principles li {
  background: linear-gradient(180deg, #262019, #221c15);
}

[data-theme="dark"] .contact-inner {
  background: linear-gradient(180deg, rgba(38, 32, 25, 0.9), rgba(34, 28, 21, 0.95));
}

[data-theme="dark"] .project-dialog { background: #241e17; }
[data-theme="dark"] .dlg-head { background: #2b241c; }
[data-theme="dark"] .dlg-metrics > div { background: #2f271e; }
[data-theme="dark"] .dlg-section h3 { color: var(--fg); }

[data-theme="dark"] .post-body pre,
[data-theme="dark"] .diff,
[data-theme="dark"] .code-card { background: #241e17; }

[data-theme="dark"] .quote { background: #262019; }
[data-theme="dark"] .callout { background: rgba(217, 116, 79, 0.10); }

[data-theme="dark"] .btn-primary { background: #b8552f; color: #fff8ea; }
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-ghost { border-color: var(--line-2); }
[data-theme="dark"] .chips li { background: rgba(240, 230, 210, 0.06); }

/* 开关按钮 */
.theme-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(43, 35, 24, 0.85);
  border-radius: 50%;
  background: #2b2318;
  color: #f5e8c9;
  cursor: pointer;
  box-shadow: 0 14px 30px -14px rgba(43, 35, 24, 0.55);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
              background 0.25s var(--ease), color 0.25s var(--ease);
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--accent-line); }
.theme-toggle:active { transform: translateY(0) scale(0.96); }
.theme-toggle svg {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease);
}
.theme-toggle .tt-sun { opacity: 0; transform: rotate(40deg) scale(0.8); }
.theme-toggle .tt-moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .tt-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .tt-moon { opacity: 0; transform: rotate(-40deg) scale(0.8); }

[data-theme="dark"] .theme-toggle {
  background: #f0e6d2;
  color: #1b1711;
  border-color: rgba(240, 230, 210, 0.9);
}

@media (max-width: 560px) {
  .theme-toggle { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}


/* 夜间：终端与代码块的写死色 */
[data-theme="dark"] .t-cmd { color: #e8dcc4; }
[data-theme="dark"] .t-key { color: #d99a6c; }
[data-theme="dark"] .t-str { color: #9db884; }
[data-theme="dark"] .t-path { color: #a99b82; }

[data-theme="dark"] .post-body code {
  background: rgba(240, 230, 210, 0.08);
  color: #f0c9a8;
}
[data-theme="dark"] .post-body pre code { color: #d8cbb2; }
[data-theme="dark"] .post-body th { background: rgba(240, 230, 210, 0.07); }
[data-theme="dark"] .post-body td { border-color: var(--line); }


/* ============================================================
   首页与指标条合并 · 平滑翻页
   ============================================================ */
.pages .hero {
  padding-top: clamp(76px, 9vh, 100px);
  padding-bottom: clamp(46px, 6vh, 64px);
}
.pages .hero .hero-inner { align-items: center; }
.hero .metrics-grid {
  margin-top: clamp(26px, 4vh, 46px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero .metric { padding: 0 24px; }
.hero .metric:first-child { padding-left: 0; }
.hero .metric:last-child { padding-right: 0; }
.hero .metric-num { font-size: clamp(1.5rem, 2.1vw, 1.95rem); }
.hero .metric-label { margin-top: 6px; font-size: 12.5px; letter-spacing: 0.01em; }

/* 聚拢：位移加大一点，才有「收进来」的感觉 */
[data-reveal] {
  transform: translate3d(var(--fx, 0px), var(--fy, 34px), 0) scale(var(--fs, 0.94));
}


/* 夜间：项目侧栏 */
[data-theme="dark"] .project-side { background: rgba(240, 230, 210, 0.055); }
[data-theme="dark"] .side-label { color: var(--dim); }


/* ============================================================
   项目简介（反问式）与卡片排版
   ============================================================ */
.project-intro {
  margin: 14px 0 0;
  max-width: 68ch;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--dim);
}

/* 侧栏统计已移除，featured 改单列 */
.pages #work .project-featured { display: block; }
.pages #work .project-card {
  display: flex;
  flex-direction: column;
  min-height: 292px;
}
.pages #work .project-main {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.pages #work .project-foot { margin-top: auto; }




/* ============================================================
   正文段落：首行缩进两字
   ============================================================ */
.post-body > p,
.post-body > section > p {
  text-indent: 2em;
  margin: 0 0 1.05em;
}

/* 列表、引用、表格、代码里的段落不缩进 */
.post-body li,
.post-body li p,
.post-body blockquote p,
.post-body .callout p,
.post-body td p,
.post-body th p,
.post-body pre,
.post-body figcaption {
  text-indent: 0;
}

@media (max-width: 640px) {
  .post-body > p,
  .post-body > section > p {
    margin-bottom: 1.15em;
  }
}


/* ============================================================
   作品页：加大呼吸感（覆盖之前的紧凑值）
   ============================================================ */
.pages #work .project-card {
  padding: 26px 28px;
  min-height: 300px;
}
.pages #work .project-meta { margin-bottom: 13px; }
.pages #work .project-head,
.pages #work .project-meta { margin-bottom: 13px; }
.pages #work .project-sub { margin-bottom: 0; }
.pages #work .project-intro {
  margin-top: 17px;
  font-size: 13.5px;
  line-height: 1.88;
  color: var(--dim);
}
.pages #work .project-foot {
  margin-top: auto;
  padding-top: 18px;
}
.pages #work .project-grid {
  gap: 20px;
  margin-top: 20px;
}
.pages #work .chips { gap: 6px; }
.pages #work .chips li {
  padding: 3px 9px;
  font-size: 11.5px;
}
.pages #work h3 { font-size: 1.55rem; letter-spacing: -0.01em; }
.pages #work .project-sub { font-size: 13px; color: var(--mute); }


/* ============================================================
   DevFleet 两栏布局 + 简介分段节奏
   ============================================================ */
.pages #work .project-featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  align-items: stretch;
}
.pages #work .project-aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
  padding-left: 30px;
  border-left: 1px solid var(--line);
}
.pages #work .project-aside .chips { gap: 6px; }
.pages #work .project-aside .btn { align-self: flex-start; }

.pages #work .project-intro + .project-intro { margin-top: 11px; }

@media (max-width: 980px) {
  .pages #work .project-featured {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .pages #work .project-aside {
    border-left: 0;
    padding-left: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
}


/* ============================================================
   笔记分页
   ============================================================ */
.note-item.is-off { display: none; }

.pages #notes .note-item { padding-top: 26px; padding-bottom: 26px; }
.pages #notes .notes-pager { margin-top: 30px; }

.notes-pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.page-dot {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.page-dot:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  transform: translateY(-1px);
}
.page-dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8ea;
}
[data-theme="dark"] .page-dot.is-active { color: #1b1711; }


/* ============================================================
   首屏强化：把标题当海报，纸面给一点光
   ============================================================ */
.pages .hero {
  padding-top: clamp(64px, 7.5vh, 86px);
  padding-bottom: clamp(26px, 4vh, 40px);
}
.pages .hero .wrap { position: relative; z-index: 2; }

.pages .hero h1 {
  font-size: clamp(2.6rem, 5.3vw, 4.7rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
}

/* 高亮词像被朱砂笔划过一道 */
.pages .hero .hl {
  color: var(--accent);
  background: linear-gradient(transparent 74%, rgba(163, 70, 42, 0.16) 74%);
}

.hero-glow {
  width: 860px;
  height: 860px;
  top: -240px;
  right: -120px;
  background: radial-gradient(circle, rgba(163, 70, 42, 0.13), transparent 64%);
  animation: heroBreath 16s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes heroBreath {
  0%, 100% { transform: scale(1); opacity: 0.78; }
  50% { transform: scale(1.09); opacity: 1; }
}

/* 指针所在处，纸面亮一点 */
.pages .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  background: radial-gradient(520px circle at var(--hx, 72%) var(--hy, 46%),
              rgba(255, 250, 238, 0.7), transparent 62%);
}
.pages .hero.is-lit::after { opacity: 1; }
[data-theme="dark"] .pages .hero::after {
  background: radial-gradient(520px circle at var(--hx, 72%) var(--hy, 46%),
              rgba(217, 116, 79, 0.10), transparent 62%);
}

/* 指标数字也放大一档 */
.hero .metrics-grid { margin-top: clamp(18px, 3vh, 34px); }
.hero .metric-num { font-size: clamp(1.6rem, 2.4vw, 2.3rem); }
.hero .metric-label { font-size: 12.5px; }

.hero-lead { margin-top: 22px; }
.hero-note { margin-top: 12px; }

@media (max-width: 860px) {
  .pages .hero h1 { font-size: clamp(2.3rem, 9vw, 3.2rem); }
  .pages .hero::after { display: none; }
}
