:root {
  --bg: #FAF8F5;
  --primary: #1C1917;
  --accent: #B45309;
  --text: #44403C;

  --line: rgba(28, 25, 23, 0.12);
  --accent-line: rgba(180, 83, 9, 0.40);
  --muted: rgba(68, 64, 60, 0.72);
  --header-bg: rgba(250, 248, 245, 0.92);

  --font-sans: "Geist", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 72px;

  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-48: 48px;
  --s-64: 64px;
  --s-96: 96px;
  --s-128: 128px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}

main:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--s-12);
  z-index: 60;
  padding: var(--s-8) var(--s-16);
  background-color: var(--primary);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}

.skip-link:focus-visible {
  top: var(--s-12);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 4px;
  transition: color 0.2s ease, border-color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.arrow-ext {
  display: inline-block;
  transition: transform 0.2s var(--ease-out-expo);
}

a:hover .arrow-ext,
a:focus-visible .arrow-ext {
  transform: translate(2px, -2px);
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--s-24);
}

/* 顶部极简吸顶导航 + 阅读进度轨 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: var(--s-16) 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-16);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-24);
  flex-wrap: wrap;
}

.nav a {
  position: relative;
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
  color: var(--muted);
}

.nav a:hover {
  color: var(--primary);
}

.nav a[aria-current="location"] {
  color: var(--primary);
  font-weight: 600;
}

.nav a[aria-current="location"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--s-4));
  height: 1px;
  background-color: var(--accent);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
  overflow: hidden;
}

.scroll-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
}

main[id] {
  scroll-margin-top: var(--header-h, 72px);
}

.section[id] {
  scroll-margin-top: calc(var(--header-h, 72px) + var(--s-16));
}

/* 首屏 */
.hero {
  padding: var(--s-64) 0;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 var(--s-24);
}

.eyebrow-dot {
  width: var(--s-8);
  height: var(--s-8);
  border-radius: 50%;
  background-color: var(--accent);
  flex-shrink: 0;
}

.hero-title-row {
  display: flex;
  align-items: baseline;
  gap: var(--s-16);
  flex-wrap: wrap;
  margin-bottom: var(--s-8);
}

h1 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.handle {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.hero-role {
  margin: 0 0 var(--s-24);
  font-size: 24px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero-lead {
  margin: 0 0 var(--s-32);
  max-width: 640px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--s-24);
  flex-wrap: wrap;
}

.link-primary {
  display: inline-block;
  padding-bottom: var(--s-4);
  color: var(--primary);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.link-primary:hover {
  color: var(--accent);
}

.link-secondary {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--muted);
  text-decoration-color: var(--line);
}

.link-secondary:hover {
  color: var(--primary);
}

/* 通用章节与关于我 */
.section {
  padding: var(--s-64) 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-12);
  margin-bottom: var(--s-32);
}

.section-num {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--accent);
  font-weight: 600;
}

h2 {
  margin: 0;
  color: var(--primary);
  font-size: 24px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.intro-p {
  margin: 0 0 var(--s-32);
  font-size: 16px;
  line-height: 1.75;
}

.pillar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-24);
}

.pillar-item {
  padding-left: var(--s-16);
  border-left: 1px solid var(--accent-line);
}

.pillar-title {
  margin: 0 0 var(--s-4);
  color: var(--primary);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 600;
}

.pillar-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
}

/* Harness 工程闭环流水线（纯细线 + 等宽排版） */
.harness-flow {
  margin-top: var(--s-48);
  padding-top: var(--s-32);
  border-top: 1px solid var(--line);
}

.harness-label {
  margin: 0 0 var(--s-24);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.harness-track {
  display: none;
}

.harness-panels {
  display: flex;
  flex-direction: column;
  gap: var(--s-16);
}

.harness-panel {
  padding-left: var(--s-16);
  border-left: 1px solid var(--line);
}

.harness-panel-id {
  margin: 0 0 var(--s-4);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--primary);
}

.harness-panel-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.js-enhanced .harness-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-12);
  padding-bottom: var(--s-24);
  border-bottom: 1px solid var(--line);
}

.js-enhanced .harness-rail {
  position: absolute;
  top: var(--s-12);
  left: var(--s-4);
  right: var(--s-4);
  height: 1px;
  background-color: var(--line);
  pointer-events: none;
}

.js-enhanced .harness-pulse {
  position: absolute;
  top: 50%;
  left: 0;
  width: var(--s-24);
  height: 2px;
  background-color: var(--accent);
  transform: translate(0, -50%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.js-enhanced .harness-node {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: var(--s-8) 0 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
  text-align: left;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.js-enhanced .harness-dot {
  width: var(--s-8);
  height: var(--s-8);
  border-radius: 50%;
  background-color: var(--bg);
  border: 1px solid var(--accent-line);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.js-enhanced .harness-node-num {
  margin-top: var(--s-8);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  transition: color 0.2s ease;
}

.js-enhanced .harness-node-title {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s ease;
}

.js-enhanced .harness-node:hover .harness-node-title {
  color: var(--accent);
}

.js-enhanced .harness-node[aria-selected="true"] .harness-dot {
  background-color: var(--accent);
  border-color: var(--accent);
}

.js-enhanced .harness-node[aria-selected="true"] .harness-node-num {
  color: var(--accent);
  font-weight: 600;
}

.js-enhanced .harness-node[aria-selected="true"] .harness-node-title {
  color: var(--primary);
  font-weight: 600;
}

.js-enhanced .harness-node.is-pulsed .harness-dot {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.22);
}

.js-enhanced .harness-panels {
  display: block;
  padding-top: var(--s-24);
  min-height: var(--s-96);
}

.js-enhanced .harness-panel {
  padding-left: 0;
  border-left: 0;
}

.js-enhanced .harness-panel[hidden] {
  display: none;
}

/* 我在做什么 */
.work-list {
  display: flex;
  flex-direction: column;
}

.work-item {
  position: relative;
  padding: var(--s-24) 0;
}

.work-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--line);
  transform-origin: left center;
}

.work-item::after {
  content: "";
  position: absolute;
  left: calc(-1 * var(--s-12));
  top: var(--s-24);
  bottom: var(--s-24);
  width: 2px;
  background-color: var(--accent);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.25s var(--ease-out-expo);
  pointer-events: none;
}

.work-item:last-child {
  border-bottom: 1px solid var(--line);
}

.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-16);
  flex-wrap: wrap;
  margin-bottom: var(--s-8);
}

.work-title {
  margin: 0;
  color: var(--primary);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 600;
}

.work-tag {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
}

.work-desc {
  margin: 0 0 var(--s-12);
  font-size: 16px;
  line-height: 1.75;
}

.work-item.no-links .work-desc {
  margin-bottom: 0;
}

.work-links {
  display: flex;
  align-items: center;
  gap: var(--s-16);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
}

@media (hover: hover) and (pointer: fine) {
  .work-item:hover::after,
  .work-item:focus-within::after {
    transform: scaleY(1);
  }
}

/* 联系方式 */
.contact-lead {
  margin: 0 0 var(--s-24);
  font-size: 16px;
  line-height: 1.75;
}

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s-16);
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: var(--s-16);
  flex-wrap: wrap;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  min-width: var(--s-64);
}

.copy-btn {
  display: none;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.js-enhanced .copy-btn {
  display: inline-block;
}

.copy-btn:hover {
  color: var(--accent);
}

.copy-btn.is-copied {
  color: var(--accent);
  font-weight: 600;
}

.copy-btn.is-error {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.copy-status {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* 极简页脚 */
.site-footer {
  padding: var(--s-48) 0 var(--s-64);
}

.footer-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* 精密编辑风装饰动效层（仅 js-motion 启用） */
.js-motion [data-hero-step] {
  transition:
    opacity 0.35s var(--ease-out-expo) calc(var(--step-i, 0) * 40ms),
    transform 0.35s var(--ease-out-expo) calc(var(--step-i, 0) * 40ms);
}

.js-motion:not(.is-hero-ready) [data-hero-step] {
  opacity: 0;
  transform: translateY(8px);
}

.js-motion.is-hero-ready [data-hero-step] {
  opacity: 1;
  transform: translateY(0);
}

.js-motion .pillar-item {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
}

.js-motion .pillar-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.js-motion .work-item {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease-out-expo), transform 0.45s var(--ease-out-expo);
}

.js-motion .work-item::before {
  transform: scaleX(0);
  transition: transform 0.5s var(--ease-out-expo);
}

.js-motion .work-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.js-motion .work-item.is-visible::before {
  transform: scaleX(1);
}

.reveal {
  opacity: 1;
  transform: translateY(0);
}

.js-motion .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.js-motion .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  a,
  .arrow-ext,
  .copy-btn,
  .work-item::after,
  .js-enhanced .harness-dot,
  .js-enhanced .harness-node-num,
  .js-enhanced .harness-node-title {
    transition: none;
  }
  .js-motion [data-hero-step],
  .js-motion:not(.is-hero-ready) [data-hero-step],
  .js-motion .pillar-item,
  .js-motion .work-item,
  .js-motion .work-item::before,
  .js-motion .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .js-enhanced .harness-pulse {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 var(--s-16);
  }
  .hero {
    padding: var(--s-48) 0;
  }
  .section {
    padding: var(--s-48) 0;
  }
  .pillar-list {
    gap: var(--s-16);
  }
  .harness-flow {
    margin-top: var(--s-32);
    padding-top: var(--s-24);
  }
  .js-enhanced .harness-track {
    grid-template-columns: 1fr;
    gap: var(--s-8);
    padding: 0 0 var(--s-16) 0;
    border-bottom: 0;
  }
  .js-enhanced .harness-rail {
    top: var(--s-12);
    bottom: var(--s-24);
    left: var(--s-12);
    right: auto;
    width: 1px;
    height: auto;
  }
  .js-enhanced .harness-pulse {
    top: 0;
    left: 50%;
    width: 2px;
    height: var(--s-24);
    transform: translate(-50%, 0);
  }
  .js-enhanced .harness-node {
    padding: var(--s-4) 0 var(--s-4) var(--s-24);
    flex-direction: row;
    align-items: center;
    gap: var(--s-8);
  }
  .js-enhanced .harness-dot {
    position: absolute;
    left: var(--s-8);
    top: 50%;
    transform: translateY(-50%);
  }
  .js-enhanced .harness-node-num {
    margin-top: 0;
  }
  .js-enhanced .harness-panels {
    padding-top: var(--s-16);
    border-top: 1px solid var(--line);
    min-height: var(--s-128);
  }
  .work-item {
    padding: var(--s-16) 0;
  }
  .work-item::after {
    display: none;
  }
}
