/* ==========================================================================
   dydev.top — 个人技术博客
   零依赖、纯静态。所有颜色、间距集中在此文件。
   ========================================================================== */

:root {
  color-scheme: dark;

  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --bg: #0a0c0e;
  --bg-soft: #0e1114;
  --surface: #111519;
  --surface-2: #161b21;
  --header-bg: rgba(10, 12, 14, 0.78);

  --text: #e7ecef;
  --text-soft: #a6b0b8;
  --text-dim: #737f88;

  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.18);

  --accent: #7fe3b4;
  --accent-hover: #9bf0c9;
  --accent-deep: #4ecb8f;
  --accent-ink: #06231a;
  --accent-soft: rgba(127, 227, 180, 0.1);

  --code-bg: #0c1013;
  --code-key: #7fe3b4;
  --code-str: #e5c07b;
  --code-com: #6b767e;

  --grid: rgba(255, 255, 255, 0.04);
  --shadow: 0 28px 70px -34px rgba(0, 0, 0, 0.85);

  --radius: 16px;
  --radius-sm: 10px;
  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f8f6;
  --bg-soft: #eef3ef;
  --surface: #ffffff;
  --surface-2: #f2f6f3;
  --header-bg: rgba(246, 248, 246, 0.82);

  --text: #101614;
  --text-soft: #4b5652;
  --text-dim: #74807b;

  --line: rgba(16, 22, 20, 0.1);
  --line-strong: rgba(16, 22, 20, 0.22);

  --accent: #0c7a56;
  --accent-hover: #096647;
  --accent-deep: #0a6a4b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(12, 122, 86, 0.09);

  --code-bg: #eef3f0;
  --code-key: #0a6a4b;
  --code-str: #8a5a00;
  --code-com: #74807b;

  --grid: rgba(16, 22, 20, 0.05);
  --shadow: 0 26px 60px -36px rgba(16, 22, 20, 0.3);
}

/* ---------- 基础 ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding-left: 1.25em;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 22px -6px var(--accent);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 2px;
  background: var(--accent-ink);
}

.brand-caret {
  color: var(--accent);
  animation: caret-blink 1.4s steps(2, start) infinite;
}

@keyframes caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
}

.nav-links a {
  position: relative;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-soft);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

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

.nav-links a.is-active {
  color: var(--text);
}

.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.5rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.icon-link,
.theme-toggle,
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.icon-link:hover,
.theme-toggle:hover,
.menu-btn:hover {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--line);
}

.theme-toggle svg,
.menu-btn svg,
.icon-link svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon,
:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.menu-btn {
  display: none;
}

/* ---------- 通用区块 ---------- */

main {
  display: block;
}

.section {
  padding: 5.5rem 0;
}

.section-tight {
  padding: 3.5rem 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.section-head p {
  margin-top: 0.4rem;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.link-more {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--text-soft);
  transition: color 0.2s var(--ease), gap 0.2s var(--ease);
}

.link-more:hover {
  color: var(--accent);
  gap: 0.6rem;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- 首页 Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4.5rem;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  top: -24rem;
  left: -10rem;
  width: 46rem;
  height: 46rem;
  background: radial-gradient(circle, rgba(127, 227, 180, 0.16), transparent 62%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 45% 0%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse at 45% 0%, #000 25%, transparent 72%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: 3.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.15rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 750;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-lead {
  max-width: 34rem;
  margin-top: 1.4rem;
  color: var(--text-soft);
  font-size: 1.06rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-top: 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-deep);
}

/* 终端名片 */

.hero-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(127, 227, 180, 0.35), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.window-bar .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.window-bar .dot:nth-child(1) {
  background: #ff6b6b;
}
.window-bar .dot:nth-child(2) {
  background: #f5c451;
}
.window-bar .dot:nth-child(3) {
  background: #59d68b;
}

.window-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.hero-card pre {
  margin: 0;
  padding: 1.3rem 1.35rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.85;
  color: var(--text-soft);
  tab-size: 2;
}

.hero-card code {
  font-family: inherit;
}

.tok-key {
  color: var(--code-key);
}
.tok-str {
  color: var(--code-str);
}
.tok-com {
  color: var(--code-com);
}
.tok-fn {
  color: var(--text);
}

/* ---------- 项目卡片 ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.project-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 1.45rem;
  right: 1.45rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

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

.project-card:hover::after {
  opacity: 1;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.project-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
}

.project-arrow {
  color: var(--text-dim);
  font-size: 1rem;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.project-card:hover .project-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.project-card h3 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.project-card h3 .lang {
  margin-left: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-dim);
}

.project-card p {
  margin-top: 0.55rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  background: var(--bg-soft);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: auto;
  padding-top: 1.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-soft);
  transition: color 0.2s var(--ease);
}

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

.project-links svg {
  width: 13px;
  height: 13px;
}

/* ---------- 文章列表 ---------- */

.post-list {
  border-top: 1px solid var(--line);
}

.post-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 1.5rem;
  align-items: start;
  gap: 1.5rem;
  padding: 1.55rem 0.25rem;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s var(--ease), padding 0.25s var(--ease);
}

.post-row:hover {
  background: var(--accent-soft);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.post-date {
  padding-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.post-body h3 {
  font-size: 1.06rem;
  line-height: 1.45;
  letter-spacing: -0.015em;
  transition: color 0.2s var(--ease);
}

.post-row:hover .post-body h3 {
  color: var(--accent);
}

.post-body p {
  margin-top: 0.35rem;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.65;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.post-tags span::before {
  content: "#";
  color: var(--accent-deep);
}

.post-arrow {
  padding-top: 0.2rem;
  color: var(--text-dim);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.post-row:hover .post-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ---------- 页头（内页） ---------- */

.page-head {
  position: relative;
  padding: 4.5rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.page-head::before {
  content: "";
  position: absolute;
  top: -18rem;
  right: -8rem;
  width: 36rem;
  height: 36rem;
  background: radial-gradient(circle, rgba(127, 227, 180, 0.12), transparent 65%);
  pointer-events: none;
}

.page-head .container {
  position: relative;
}

.page-head h1 {
  max-width: 44rem;
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.page-head p {
  max-width: 40rem;
  margin-top: 1rem;
  color: var(--text-soft);
}

/* ---------- 项目详情页 ---------- */

.repo {
  padding: 3.25rem 0;
  border-bottom: 1px solid var(--line);
}

.repo:last-of-type {
  border-bottom: 0;
}

.repo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 1rem;
  margin-bottom: 0.5rem;
}

.repo-head h2 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.025em;
}

.repo-head .repo-lang {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.repo-summary {
  max-width: 46rem;
  color: var(--text-soft);
}

.repo-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2.5rem;
  margin-top: 1.75rem;
}

.repo-columns h3 {
  margin-bottom: 0.7rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.feature-list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.65;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.feature-list a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
}

.feature-list a:hover {
  text-decoration-color: var(--accent);
}

.repo-facts {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.repo-facts div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem;
  font-size: 0.85rem;
}

.repo-facts dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding-top: 0.15rem;
}

.repo-facts dd {
  margin: 0;
  color: var(--text-soft);
}

.repo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* ---------- 关于页 ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 3rem;
  align-items: start;
}

.about-lead {
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-soft);
}

.about-lead strong {
  color: var(--text);
  font-weight: 600;
}

.about-lead + .about-body {
  margin-top: 1.5rem;
}

.about-body p + p {
  margin-top: 1rem;
}

.about-body p {
  color: var(--text-soft);
}

.stack-group {
  margin-top: 2.2rem;
}

.stack-group h2 {
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stack-group .tag-list {
  margin-top: 0;
}

.stack-group .tag-list li {
  padding: 0.28rem 0.7rem;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.contact-card {
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.contact-card h2 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.contact-card p {
  margin-top: 0.5rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.contact-list {
  display: grid;
  gap: 0.55rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-list a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.contact-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.contact-list svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.note {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: var(--text-soft);
  font-size: 0.85rem;
}

/* ---------- 文章页 ---------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  height: 2px;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.1s linear;
}

.article-head {
  padding: 3.5rem 0 2.25rem;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}

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

.article-head h1 {
  max-width: 46rem;
  font-size: clamp(1.85rem, 4.4vw, 2.85rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.2rem;
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.article-meta .sep {
  width: 3px;
  height: 3px;
  padding: 0;
  border-radius: 50%;
  background: var(--text-dim);
}

.article-body {
  max-width: 46rem;
  padding: 2.75rem 0 4rem;
}

.article-body > p,
.article-body > ul,
.article-body > ol,
.article-body > blockquote,
.article-body > pre,
.article-body > table,
.article-body > h2,
.article-body > h3,
.article-body > figure {
  max-width: 44rem;
}

.article-body p {
  margin: 1.15rem 0;
  color: var(--text-soft);
  line-height: 1.9;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s var(--ease);
}

.article-body a:hover {
  text-decoration-color: var(--accent);
}

.article-body h2 {
  margin: 2.8rem 0 0.9rem;
  font-size: 1.45rem;
  line-height: 1.35;
  letter-spacing: -0.025em;
  scroll-margin-top: 5rem;
}

.article-body h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 0.9rem;
  border-radius: 2px;
  background: var(--accent);
}

.article-body h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.08rem;
  letter-spacing: -0.015em;
  scroll-margin-top: 5rem;
}

.article-body ul,
.article-body ol {
  margin: 1rem 0;
  color: var(--text-soft);
}

.article-body li {
  margin: 0.45rem 0;
  padding-left: 0.2rem;
}

.article-body li::marker {
  color: var(--accent-deep);
}

.article-body blockquote {
  margin: 1.6rem 0;
  padding: 0.35rem 0 0.35rem 1.2rem;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
  font-style: normal;
}

.article-body blockquote p {
  margin: 0;
}

.article-body code {
  padding: 0.12em 0.38em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text);
}

.article-body pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.8;
  color: var(--text-soft);
  tab-size: 2;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  color: inherit;
}

.article-body table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.article-body th,
.article-body td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.article-body td {
  color: var(--text-soft);
}

.article-body hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.copy-code {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.article-body pre:hover .copy-code,
.copy-code:focus-visible {
  opacity: 1;
}

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

.copy-code.is-copied {
  color: var(--accent);
  border-color: var(--accent);
}

.article-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 46rem;
  padding: 1.5rem 0 4rem;
  border-top: 1px solid var(--line);
}

.article-footer .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.article-footer .tags span::before {
  content: "#";
  color: var(--accent-deep);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 46rem;
  padding-bottom: 5rem;
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.post-nav a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.post-nav .nav-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.post-nav .nav-title {
  font-size: 0.92rem;
  color: var(--text);
}

.post-nav .is-empty {
  border-style: dashed;
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- CTA ---------- */

.cta {
  position: relative;
  margin: 2rem 0 0;
  padding: 3rem 2rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  text-align: center;
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--accent-soft), transparent 65%);
  pointer-events: none;
}

.cta h2 {
  position: relative;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.025em;
}

.cta p {
  position: relative;
  max-width: 34rem;
  margin: 0.6rem auto 0;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.cta .hero-actions {
  position: relative;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 2rem;
  padding: 2.75rem 0;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.footer-links a {
  color: var(--text-soft);
  transition: color 0.2s var(--ease);
}

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

.footer-note {
  margin-top: 1.1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ---------- 404 ---------- */

.center-page {
  display: grid;
  place-items: center;
  min-height: 62vh;
  text-align: center;
  padding: 4rem 1.5rem;
}

.center-page .code {
  font-family: var(--font-mono);
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--accent);
}

.center-page h1 {
  margin-top: 1rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.center-page p {
  margin-top: 0.5rem;
  color: var(--text-soft);
}

.center-page .hero-actions {
  justify-content: center;
}

/* ---------- 入场动画 ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js .reveal:nth-child(2) {
  transition-delay: 0.06s;
}

.js .reveal:nth-child(3) {
  transition-delay: 0.12s;
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-card {
    max-width: 34rem;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repo-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 760px) {
  .nav-inner {
    height: 58px;
    gap: 0.5rem;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin: 0;
    padding: 0.6rem 1.5rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
  }

  .nav-links a.is-active::after {
    left: 0.75rem;
    right: auto;
    bottom: 0.45rem;
    width: 14px;
  }

  .menu-btn {
    display: inline-flex;
  }

  .hero {
    padding: 3.5rem 0 3rem;
  }

  .section {
    padding: 3.75rem 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .post-row {
    grid-template-columns: minmax(0, 1fr) 1.25rem;
    gap: 0.75rem;
    padding: 1.3rem 0.25rem;
  }

  .post-date {
    grid-column: 1 / -1;
    padding-top: 0;
    order: -1;
  }

  .post-arrow {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }

  .page-head {
    padding: 3rem 0 2rem;
  }

  .repo {
    padding: 2.4rem 0;
  }

  .repo-facts div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .article-head {
    padding: 2.5rem 0 1.75rem;
  }

  .article-body {
    padding: 2rem 0 3rem;
  }

  .post-nav {
    grid-template-columns: 1fr;
    padding-bottom: 3.5rem;
  }

  .cta {
    padding: 2.25rem 1.25rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .post-nav,
  .reading-progress,
  .copy-code,
  .back-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .article-body {
    max-width: none;
  }
}
