/* ============================================================
   知序造物 ZHIXU WORKS — r5 clean
   纯静态站，无构建步骤。维护说明见 README.md
   ============================================================ */
:root {
  --font-sans: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 亮色 */
  --bg-canvas: linear-gradient(135deg, #eef2f6 0%, #e6ecf5 50%, #f0eff5 100%);
  --bg-page: #eef2f6;
  --surface: rgba(255, 255, 255, .62);
  --surface-solid: #ffffff;
  --surface-hover: rgba(255, 255, 255, .9);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .16);
  --accent: #0284c7;
  --accent-strong: #0369a1;
  --accent-soft: rgba(2, 132, 199, .08);
  --nav-bg: rgba(238, 242, 246, .78);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 10px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, .12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* 氛围光（冷光） */
  --orb-cyan: rgba(56, 189, 248, .55);
  --orb-violet: rgba(168, 85, 247, .32);
  --orb-orange: rgba(251, 146, 60, .30);
  --emblem-bg: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
}

[data-theme="dark"] {
  --bg-canvas: linear-gradient(135deg, #09090b 0%, #0d0f14 50%, #12131a 100%);
  --bg-page: #09090b;
  --surface: rgba(20, 20, 25, .65);
  --surface-solid: #141419;
  --surface-hover: rgba(255, 255, 255, .08);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .18);
  --accent: #38bdf8;
  --accent-strong: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, .12);
  --nav-bg: rgba(9, 9, 11, .72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
  --emblem-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* 氛围预设：暖调 / 夜色 */
[data-ambience="warm"] {
  --orb-cyan: rgba(251, 191, 36, .45);
  --orb-violet: rgba(192, 132, 252, .30);
  --orb-orange: rgba(251, 146, 60, .55);
}
[data-ambience="night"] {
  --orb-cyan: rgba(56, 89, 199, .5);
  --orb-violet: rgba(76, 29, 149, .45);
  --orb-orange: rgba(30, 58, 138, .4);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-canvas);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: .88em; }

.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

/* 锚点定位：给 sticky 导航留出空间，标题不再被遮挡 */
section[id] { scroll-margin-top: calc(var(--nav-h) + 24px); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--text-primary); color: var(--bg-page);
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; font-size: 14px;
}
.skip-link:focus { left: 0; }

/* ---------------- 导航 ---------------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: min(1120px, calc(100% - 40px)); margin-inline: auto;
  height: 100%; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; }
[data-theme="dark"] .brand-mark,
[data-theme="dark"] .brand-card-mark,
[data-theme="dark"] .brand-card-word,
[data-theme="dark"] .emblem-mark,
[data-theme="dark"] .emblem-word,
[data-theme="dark"] .empty-mark,
[data-theme="dark"] .work-cover-fallback img { filter: invert(1); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .06em; }
.brand-sub { font-size: 10px; letter-spacing: .14em; color: var(--text-muted); font-weight: 500; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--text-secondary);
  padding: 8px 13px; border-radius: 999px; transition: background .2s, color .2s;
}
.nav-links a:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-links a.is-active { color: var(--accent-strong); background: var(--accent-soft); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }
.icon-btn, .lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover, .lang-btn:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--border-strong); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
.menu-btn { display: none; }

/* ---------------- Hero ---------------- */
.hero { position: relative; overflow: hidden; padding: 84px 0 40px; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; transition: background 1s var(--ease); }
.orb-cyan { width: 520px; height: 520px; top: -160px; right: -60px; background: radial-gradient(circle, var(--orb-cyan) 0%, transparent 70%); }
.orb-violet { width: 420px; height: 420px; top: 240px; left: -140px; background: radial-gradient(circle, var(--orb-violet) 0%, transparent 70%); }
.orb-orange { width: 360px; height: 360px; bottom: -140px; right: 22%; background: radial-gradient(circle, var(--orb-orange) 0%, transparent 70%); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .22em; color: var(--accent);
  text-transform: uppercase; margin: 0 0 18px;
}
.hero h1 { font-size: clamp(42px, 6vw, 68px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.hero-sub { margin-top: 22px; font-size: 17px; color: var(--text-secondary); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 999px; font-size: 15px; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--text-primary); color: var(--bg-page); box-shadow: var(--shadow-md); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost:hover { background: var(--surface-hover); }
.ambience { display: flex; align-items: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.ambience-label { font-size: 13px; color: var(--text-muted); margin-right: 4px; }
.amb-btn {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer;
  transition: all .2s;
}
.amb-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.amb-btn.is-active { background: var(--text-primary); color: var(--bg-page); border-color: transparent; }

/* Hero 视觉：品牌徽章卡 */
.hero-visual { position: relative; }
.emblem-card {
  position: relative; aspect-ratio: 1 / 1; max-width: 460px; margin-inline: auto; width: 100%;
  border-radius: 28px; background: var(--emblem-bg);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  overflow: hidden;
}
.emblem-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 20%, var(--orb-cyan) 0%, transparent 55%);
  opacity: .5; transition: background 1s var(--ease);
}
.orbit { position: absolute; border: 1px dashed var(--border-strong); border-radius: 50%; opacity: .7; }
.orbit-1 { width: 300px; height: 300px; }
.orbit-2 { width: 380px; height: 380px; opacity: .45; }
.orbit-3 { width: 220px; height: 220px; opacity: .9; }
.emblem-mark { position: relative; width: 118px; height: 118px; animation: slow-spin 60s linear infinite; }
.emblem-word { position: relative; width: 158px; height: auto; }
@keyframes slow-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .emblem-mark { animation: none; } }
.chip {
  position: absolute; padding: 7px 13px; border-radius: 999px;
  background: var(--surface-solid); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
}
.chip-1 { top: 9%; left: 6%; }
.chip-2 { top: 22%; right: 4%; }
.chip-3 { bottom: 10%; right: 9%; }

/* 原则条 */
.principles {
  position: relative; margin-top: 72px; padding-top: 36px;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.principle h3 { font-size: 17px; margin-bottom: 6px; }
.principle p { font-size: 14.5px; color: var(--text-secondary); }

/* ---------------- 通用区块 ---------------- */
.section { padding: 88px 0; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4vw, 40px); font-weight: 700; letter-spacing: -.02em; }
.section-intro { margin-top: 14px; font-size: 16.5px; color: var(--text-secondary); }
.section-note { margin-top: 28px; font-size: 14.5px; color: var(--text-muted); }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 24px; box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card h3 { font-size: 17.5px; margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--text-secondary); }
.direction-num {
  display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--accent); letter-spacing: .08em; margin-bottom: 14px;
}

/* ---------------- 时间线 ---------------- */
.timeline { list-style: none; margin: 44px 0 0; padding: 0; }
.timeline-item {
  display: grid; grid-template-columns: 170px 1fr; gap: 28px;
  padding: 26px 0; border-top: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: 1px solid var(--border); }
.timeline-date { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.timeline-date time { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.status-live {
  font-size: 12px; font-weight: 600; color: #047857;
  background: rgba(16, 185, 129, .14); border: 1px solid rgba(16, 185, 129, .3);
  padding: 3px 10px; border-radius: 999px;
}
[data-theme="dark"] .status-live { color: #34d399; }
.timeline-body h3 { font-size: 19px; margin-bottom: 8px; }
.timeline-body p { font-size: 15px; color: var(--text-secondary); max-width: 62ch; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; }
.tag-list li {
  font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border);
  padding: 4px 11px; border-radius: 999px;
}

/* ---------------- 作品 ---------------- */
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.work-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s;
  display: flex; flex-direction: column;
}
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.work-cover { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--emblem-bg); }
.work-cover-fallback {
  aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
  background: var(--emblem-bg); border-bottom: 1px solid var(--border);
}
.work-cover-fallback img { width: 54px; height: 54px; opacity: .85; }
.work-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.work-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.work-code { font-family: var(--font-mono); font-weight: 600; color: var(--accent); letter-spacing: .06em; }
.work-category { color: var(--text-muted); }
.work-body h3 { font-size: 18px; }
.work-body h3 small { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.work-body p { font-size: 14.5px; color: var(--text-secondary); flex: 1; }
.work-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.work-tags span {
  font-size: 12px; color: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 999px;
}
.empty-state {
  margin-top: 28px; text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 56px 24px 48px; background: var(--surface);
}
.empty-mark { margin: 0 auto 20px; opacity: .8; }
.empty-state h3 { font-size: 20px; margin-bottom: 10px; }
.empty-state p { color: var(--text-secondary); font-size: 15px; max-width: 46ch; margin: 0 auto; }
.empty-hint { margin-top: 18px !important; font-size: 13.5px !important; color: var(--text-muted) !important; }
.empty-hint code {
  background: var(--surface-solid); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 6px; color: var(--accent-strong);
}

/* ---------------- 研究 ---------------- */
.keyword-chips {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px;
  margin: 32px 0 0; padding: 0;
}
.keyword-chips li {
  font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-primary);
}

/* ---------------- 关于 ---------------- */
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: stretch; }
.about-lede { font-size: 21px; line-height: 1.6; font-weight: 600; }
.about-copy > p + p { margin-top: 16px; color: var(--text-secondary); font-size: 15.5px; }
.author { margin: 32px 0 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.author > div {
  display: grid; grid-template-columns: 90px 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px;
}
.author dt { color: var(--text-muted); }
.author dd { margin: 0; font-weight: 600; }
.brand-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 36px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center;
}
.brand-card-mark { width: 72px; height: 72px; }
.brand-card-word { width: 180px; height: auto; }
.brand-card-tag { font-size: 14px; color: var(--text-muted); letter-spacing: .08em; }

/* ---------------- 页脚 ---------------- */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0 36px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-secondary); }
.footer-brand .brand-mark { width: 26px; height: 26px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 13.5px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--text-primary); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero { padding-top: 56px; }
  .hero-visual { order: -1; }
  .emblem-card { max-width: 340px; }
  .emblem-mark { width: 88px; height: 88px; }
  .principles { grid-template-columns: 1fr; gap: 20px; margin-top: 52px; }
  .cards-3 { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 10px; }
  .timeline-date { flex-direction: row; align-items: center; }
}
@media (max-width: 720px) {
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 10px 20px 16px;
    background: var(--nav-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 11px 13px; font-size: 15px; }
  .menu-btn { display: inline-flex; }
  .brand-sub { display: none; }
  .theme-label { display: none; }
  .icon-btn, .lang-btn { padding: 0 9px; }
  .section { padding: 64px 0; }
  .hero h1 { font-size: clamp(36px, 10vw, 48px); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
