:root {
  --bg: #f6f1e6;
  --bg-elev: #fdfaf3;
  --section-alt: #e9dcc0;
  --ink: #2a2320;
  --ink-soft: #5a534a;
  --ink-faint: #9a907f;
  --line: rgba(42, 35, 32, 0.12);
  --line-strong: rgba(42, 35, 32, 0.24);
  --accent: #b03a2e;
  --accent-soft: rgba(176, 58, 46, 0.10);
  --accent-2: #8a2a20;
  --seal: #b03a2e;
  --glow: rgba(176, 58, 46, 0.16);
  --header-bg: rgba(246, 241, 230, 0.85);
  --shadow: 0 24px 60px -30px rgba(42, 35, 32, 0.25);
  --firefly-warm: #c8963f;
  --firefly-cool: #b6a88a;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0d0f13;
  --bg-elev: #14171c;
  --section-alt: #181c24;
  --ink: #ece6da;
  --ink-soft: #a5abb3;
  --ink-faint: #6f757d;
  --line: rgba(236, 230, 218, 0.12);
  --line-strong: rgba(236, 230, 218, 0.22);
  --accent: #e6b96a;
  --accent-soft: rgba(230, 185, 106, 0.12);
  --accent-2: #74c0d6;
  --glow: rgba(230, 185, 106, 0.30);
  --header-bg: rgba(13, 15, 19, 0.72);
  --shadow: 0 30px 70px -35px rgba(0, 0, 0, 0.8);
  --firefly-warm: #e6b96a;
  --firefly-cool: #74c0d6;
  --seal: #c14b3a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  transition: background 0.45s ease, color 0.45s ease;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: var(--accent);
  font-size: 1.05rem;
  background: var(--accent-soft);
}
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  font-size: 0.92rem;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle, .nav-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg, .nav-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 17px; height: 1.6px; background: var(--ink); border-radius: 1px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(880px, 100vh);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 100px 0 120px;
  background: var(--section-alt);
  border-bottom: 1px solid var(--line);
}
.fireflies {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: 48px;
}
.hero-kicker {
  margin: 0 0 18px;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
}
.hero-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(4rem, 12vw, 8.5rem);
  line-height: 1.05;
  letter-spacing: 0.06em;
}
.hero-sub {
  margin: 20px 0 0;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--ink-soft);
}
.hero-poem {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}
.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-visual { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.mayfly { width: min(300px, 62vw); height: auto; overflow: visible; }
.mayfly .wing { stroke: var(--accent); stroke-width: 1.4; fill: var(--accent-soft); opacity: 0.85; }
.mayfly .vein { stroke: var(--accent); stroke-width: 0.8; opacity: 0.55; }
.mayfly .head, .mayfly .body { stroke: var(--ink); stroke-width: 1.8; fill: var(--ink); }
.mayfly .head { stroke-width: 1.8; }
.mayfly .tail { stroke: var(--ink-soft); stroke-width: 1.1; opacity: 0.75; }

.hero-now { text-align: center; }
.now-label, .now-note { display: block; font-size: 0.78rem; letter-spacing: 0.28em; color: var(--ink-faint); }
.now-time {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 4px 0;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
}
.hero-scroll i {
  width: 1px;
  height: 34px;
  background: var(--line-strong);
  overflow: hidden;
  position: relative;
}
.hero-scroll i::after {
  content: "";
  position: absolute;
  left: 0;
  top: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine { 0% { top: -100%; } 55% { top: 100%; } 100% { top: 100%; } }

/* ---------- Sections ---------- */
.section { padding: 110px 0; scroll-margin-top: 68px; }
.section-alt { background: var(--section-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 52px; }
.section-index { font-family: var(--serif); font-size: 0.9rem; color: var(--accent); letter-spacing: 0.15em; }
.section-title { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; }
.section-note { margin: 0 0 0 auto; font-size: 0.85rem; color: var(--ink-faint); }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }
.about-lead { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.5; }
.about-body p { margin: 0 0 18px; color: var(--ink-soft); }
.about-body p:last-child { margin-bottom: 0; }
.fact-strip {
  list-style: none;
  margin: 60px 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.fact-strip li { display: flex; flex-direction: column; gap: 6px; }
.fact-strip span { font-size: 0.75rem; letter-spacing: 0.18em; color: var(--ink-faint); text-transform: uppercase; }
.fact-strip li { font-family: var(--serif); font-size: 1.15rem; }

/* Education */
.edu-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
  padding: 38px 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
}
.edu-school { margin: 0 0 8px; font-family: var(--serif); font-size: 1.7rem; }
.edu-meta { margin: 0 0 12px; color: var(--accent); font-size: 0.95rem; }
.edu-desc { margin: 0; color: var(--ink-soft); max-width: 620px; }
.edu-side { display: flex; gap: 28px; }
.edu-stat { display: flex; flex-direction: column; min-width: 88px; }
.edu-stat strong { font-size: 0.75rem; letter-spacing: 0.15em; color: var(--ink-faint); font-weight: 500; }
.edu-stat span { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); }
.courses { margin-top: 40px; }
.courses h4, .awards h4 { margin: 0 0 18px; font-size: 0.85rem; letter-spacing: 0.18em; color: var(--ink-faint); font-weight: 500; text-transform: uppercase; }

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip-list li {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  background: var(--bg-elev);
}
.chip-sm li { padding: 5px 12px; font-size: 0.8rem; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-card { padding: 30px 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.skill-card h3 { margin: 0 0 18px; font-family: var(--serif); font-size: 1.25rem; }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project-card {
  display: flex;
  flex-direction: column;
  padding: 30px 30px 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow); }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.project-num { font-family: var(--serif); color: var(--ink-faint); }
.project-tag { font-size: 0.74rem; letter-spacing: 0.12em; color: var(--accent); border: 1px solid var(--accent); padding: 3px 10px; border-radius: 999px; }
.project-card h3 { margin: 0 0 12px; font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; }
.project-card p { margin: 0 0 20px; color: var(--ink-soft); font-size: 0.94rem; flex: 1; }
.project-link { margin-top: 18px; font-size: 0.9rem; color: var(--accent); }
.project-link:hover { text-decoration: underline; }

/* Projects · 卡片式（随笔同款风格） */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.project-cover {
  position: relative;
  height: 128px;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, var(--pc, rgba(176, 58, 46, 0.25)), transparent 72%), var(--accent-soft);
  overflow: hidden;
}
.project-glyph {
  font-family: var(--serif);
  font-size: 3.6rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.9;
  user-select: none;
}
.project-status {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 11px;
}
.project-card .card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.project-title { margin: 0 0 6px; font-family: var(--serif); font-size: 1.18rem; line-height: 1.4; }
.project-tags { margin: 0 0 12px; font-size: 0.8rem; color: var(--ink-faint); letter-spacing: 0.02em; }
.project-desc { margin: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.8; flex: 1; }

/* 研究 · 占位（整理中） */
.research-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--bg-elev);
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-faint);
}
.research-empty p { margin: 0; font-size: 0.95rem; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 160px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.timeline-item { display: grid; grid-template-columns: 160px 1fr; gap: 40px; padding: 0 0 40px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 156px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-date { font-family: var(--serif); color: var(--accent); font-size: 0.95rem; }
.timeline-body h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 1.25rem; }
.timeline-body p { margin: 0; color: var(--ink-soft); }

/* 行迹 · 晋升链（同一组织多角色） */
.role-chain {
  display: inline-block;
  margin: 0 0 12px;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 2px 12px;
}
.role-steps {
  list-style: none;
  margin: 0;
  padding: 0 0 0 6px;
  border-left: 1px solid var(--line-strong);
}
.role-steps li { position: relative; padding: 0 0 16px 26px; }
.role-steps li:last-child { padding-bottom: 0; }
.role-steps li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.role-time {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 0.9rem;
  margin-right: 14px;
  white-space: nowrap;
}
.role-name { font-weight: 600; font-size: 0.98rem; }
.role-desc { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.9rem; }
.awards { margin-top: 44px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: start; }
.contact-lead { margin: 0 0 14px; font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.5; }
.contact-sub { margin: 0; color: var(--ink-soft); }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.contact-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.contact-list li:first-child { padding-top: 0; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list span:first-child { font-size: 0.78rem; letter-spacing: 0.15em; color: var(--ink-faint); text-transform: uppercase; }
.contact-list a { color: var(--accent); }
.contact-list a:hover { text-decoration: underline; }
.muted { color: var(--ink-faint); }

/* Footer */
.site-footer { padding: 60px 0; border-top: 1px solid var(--line); text-align: center; color: var(--ink-faint); font-size: 0.88rem; }
.footer-poem { font-family: var(--serif); font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 8px; letter-spacing: 0.1em; }
.site-footer p { margin: 0; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-scroll i::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { min-height: auto; padding: 80px 0 100px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-visual { order: -1; }
  .mayfly { width: 200px; }
  .hero-name { font-size: clamp(3.4rem, 18vw, 6rem); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .fact-strip { grid-template-columns: repeat(2, 1fr); }
  .edu-card { grid-template-columns: 1fr; gap: 24px; padding: 28px; }
  .timeline::before { left: 8px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; padding-left: 30px; }
  .timeline-item::before { left: 4px; }

  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 18px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .site-nav a:last-child { border-bottom: 0; }
}

/* ---------- Sub-sections (求索) ---------- */
.sub-section { margin-top: 68px; padding-top: 44px; border-top: 1px solid var(--line); }
.section-head + .sub-section { margin-top: 0; padding-top: 0; border-top: 0; }
.sub-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; }
.sub-index { font-family: var(--serif); font-size: 0.8rem; color: var(--accent); letter-spacing: 0.12em; }
.sub-title { margin: 0; font-family: var(--serif); font-size: 1.45rem; font-weight: 700; }

/* ---------- Journal (记录) ---------- */
.journal-lead { margin: -24px 0 40px; color: var(--ink-soft); font-family: var(--serif); font-size: 1.1rem; }
.journal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.journal-block {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  padding: 28px 28px 22px;
}
.journal-title { margin: 0 0 6px; font-family: var(--serif); font-size: 1.3rem; }
.journal-desc { margin: 0 0 18px; color: var(--ink-soft); font-size: 0.9rem; }

.journal-list { list-style: none; margin: 0; padding: 0; }
.journal-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.journal-item:last-child { border-bottom: 0; }
.journal-link { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.journal-item-title { font-family: var(--serif); color: var(--ink); }
.journal-link:hover .journal-item-title { color: var(--accent); }
.journal-item-date { font-size: 0.8rem; color: var(--ink-faint); letter-spacing: 0.08em; white-space: nowrap; }
.journal-item-desc { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.86rem; }
.journal-item-body { margin-top: 2px; }
.journal-empty { color: var(--ink-faint); font-size: 0.86rem; }
.journal-empty a { color: var(--accent); }
.journal-empty a:hover { text-decoration: underline; }

.book-list { list-style: none; margin: 0; padding: 0; }
.book-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.book-item:last-child { border-bottom: 0; }
.book-title { font-family: var(--serif); color: var(--ink); }
.book-author { font-size: 0.82rem; color: var(--ink-faint); text-align: right; }
.book-note { grid-column: 1 / -1; color: var(--ink-soft); font-size: 0.86rem; }

/* ---------- Archive (归档) ---------- */
.archive-list { display: flex; flex-direction: column; gap: 14px; }
.archive-group {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  overflow: hidden;
}
.archive-group summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color 0.2s ease;
}
.archive-group summary:hover { color: var(--accent); }
.archive-group summary::-webkit-details-marker { display: none; }
.archive-group summary::after {
  content: "+";
  font-family: var(--sans);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.25s ease;
}
.archive-group[open] summary::after { transform: rotate(45deg); }
.archive-body { padding: 0 22px 20px; }

.archive-links { list-style: none; margin: 0; padding: 0; }
.archive-links li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.archive-links li:last-child { border-bottom: 0; }
.archive-link { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.archive-link-title { color: var(--ink); }
.archive-link:hover .archive-link-title { color: var(--accent); }
.archive-link-desc { color: var(--ink-faint); font-size: 0.82rem; text-align: right; }

/* ---------- Responsive (新增板块) ---------- */
@media (max-width: 860px) {
  .journal-grid { grid-template-columns: 1fr; }
  .journal-lead { margin-bottom: 28px; }
}

/* ---------- 主题质感：暗色空灵 / 亮色书卷 ---------- */
/* 亮色：宣纸纸纹（极淡纤维噪点） */
html:not([data-theme="dark"]) body {
  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.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* 亮色：朱红点缀（古籍印章） */
html:not([data-theme="dark"]) .brand-mark {
  border-color: var(--seal);
  color: var(--seal);
  background: rgba(176, 58, 46, 0.08);
  border-radius: 6px;
}
html:not([data-theme="dark"]) .section-index,
html:not([data-theme="dark"]) .sub-index {
  color: var(--seal);
}

/* 亮色：蜉蝣改为水墨墨色（朱红留给点缀） */
html:not([data-theme="dark"]) .mayfly .wing {
  stroke: var(--ink-soft);
  fill: rgba(42, 35, 32, 0.05);
}
html:not([data-theme="dark"]) .mayfly .vein {
  stroke: var(--ink-faint);
}

/* 暗色：飘渺空灵的雾 */
html[data-theme="dark"] .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 18% 22%, rgba(116, 192, 214, 0.10), transparent 62%),
    radial-gradient(50% 45% at 82% 30%, rgba(230, 185, 106, 0.08), transparent 60%),
    radial-gradient(40% 40% at 50% 92%, rgba(116, 192, 214, 0.06), transparent 60%);
}

/* 卡片级联显现（仅显现时延迟，收回即时） */
.js .journal-grid > .reveal.in:nth-child(2) { transition-delay: 0.08s; }
.js .journal-grid > .reveal.in:nth-child(3) { transition-delay: 0.16s; }
.js .journal-grid > .reveal.in:nth-child(4) { transition-delay: 0.24s; }
.js .entry-list > .reveal.in:nth-child(2) { transition-delay: 0.08s; }
.js .entry-list > .reveal.in:nth-child(3) { transition-delay: 0.16s; }
.js .entry-list > .reveal.in:nth-child(4) { transition-delay: 0.24s; }
.js .entry-list > .reveal.in:nth-child(5) { transition-delay: 0.32s; }

/* ---------- 板块导语 ---------- */
.section-lead {
  margin: -28px 0 36px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.05rem;
}

/* ---------- 关于：版图与近况 ---------- */
.field-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 44px 0 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.field-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  min-width: 72px;
  flex-shrink: 0;
}
.now-lines { margin: 22px 0 0; }
.now-lines p {
  display: flex;
  gap: 14px;
  margin: 0 0 8px;
  color: var(--ink-soft);
}

/* ---------- 折叠条目（研究/项目/行迹/我思） ---------- */
.entry-list { display: flex; flex-direction: column; gap: 14px; }
.entry {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  overflow: hidden;
}
.entry summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
  transition: color 0.2s ease;
}
.entry summary:hover { color: var(--accent); }
.entry summary::-webkit-details-marker { display: none; }
.entry summary::after {
  content: "+";
  font-family: var(--sans);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.entry[open] summary::after { transform: rotate(45deg); }
.entry-title { flex: 1 1 auto; font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }
.entry-status {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.entry-meta, .entry-tags { font-size: 0.8rem; color: var(--ink-faint); white-space: nowrap; }
.entry-body { padding: 16px 22px 20px; border-top: 1px solid var(--line); }
.entry-body p { color: var(--ink-soft); margin: 0 0 12px; }
.entry-body p:last-child { margin-bottom: 0; }
.entry-link { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 0.9rem; }
.entry-link:hover { text-decoration: underline; }

/* ---------- 响应式：折叠条目 ---------- */
@media (max-width: 860px) {
  .entry summary { flex-wrap: wrap; row-gap: 6px; }
  .entry-meta, .entry-tags { white-space: normal; }
  .now-lines p { flex-direction: column; gap: 2px; }
}

/* ---------- 我思：自述信条 ---------- */
.credo {
  max-width: 720px;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 2;
  color: var(--ink);
}
.credo p { margin: 0 0 22px; }
.credo .credo-sign { text-align: right; color: var(--ink-faint); font-size: 1rem; margin: 0; }

/* ---------- 行迹：时间线 ---------- */
.journey-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 26px;
}
.journey-list::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: var(--line-strong);
}
.journey-list .entry { position: relative; overflow: visible; }
.journey-list .entry::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 27px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.journey-time {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 0.92rem;
  white-space: nowrap;
  min-width: 104px;
  flex-shrink: 0;
}

/* 行迹：角色 · 组织 */
.timeline-org { color: var(--ink-soft); font-weight: 400; }

/* ---------- 随笔：coverflow 轮播 ---------- */
.carousel { position: relative; height: 410px; overflow: hidden; margin-top: 8px; }
.carousel-track { position: relative; height: 100%; }
.carousel-card {
  position: absolute;
  left: 50%;
  top: 0;
  width: 300px;
  margin-left: -150px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  overflow: hidden;
  opacity: 0.3;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
  will-change: transform, opacity;
  cursor: grab;
}
.carousel-card.is-active { opacity: 1; box-shadow: var(--shadow); cursor: default; }
.carousel-card a { color: inherit; display: block; }
.carousel-card .card-cover { width: 100%; height: 175px; object-fit: cover; display: block; }
.carousel-card .card-body { padding: 16px 18px 18px; min-height: 92px; }
.cc-meta { display: block; font-size: 0.78rem; color: var(--ink-faint); letter-spacing: 0.1em; margin-bottom: 10px; }
.cc-title { margin: 0 0 10px; font-family: var(--serif); font-size: 1.2rem; line-height: 1.4; }
.cc-desc { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.carousel-btn:hover { border-color: var(--accent); color: var(--accent); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-more { text-align: center; margin-top: 14px; }
.books-block { margin-top: 56px; }

/* ---------- 行迹：荣誉分栏 ---------- */
.awards { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.awards h4 { margin: 0 0 20px; font-family: var(--serif); font-size: 1.2rem; font-weight: 700; letter-spacing: 0.08em; text-transform: none; color: var(--ink); }
.awards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px; }
.award-col h5 { margin: 0 0 12px; font-family: var(--serif); font-size: 1.1rem; color: var(--ink); }
.award-col ul { list-style: none; margin: 0; padding: 0; }
.award-col li { padding: 7px 0; color: var(--ink-soft); font-size: 0.95rem; border-bottom: 1px dashed var(--line); }
.award-col li:last-child { border-bottom: 0; }
.award-col .more-item { display: none; }
.award-col.expanded .more-item { display: block; }
.award-more-btn {
  margin-top: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--accent);
  font-family: inherit;
}
.award-more-btn:hover { text-decoration: underline; }

/* ---------- 我思：自述 + 书法 ---------- */
.credo-grid { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 48px; align-items: center; }
.credo-art { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.calli-img {
  display: none;
  height: min(560px, 64vh);
  width: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .calli-dark { display: block; }
html:not([data-theme="dark"]) .calli-light { display: block; }
.vertical-quote {
  writing-mode: vertical-rl;
  font-family: "Xingkai SC", "STXingkai", "Kaiti SC", "STKaiti", "KaiTi", "华文行楷", "楷体", serif;
  font-size: 1.35rem;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  margin: 0;
  line-height: 2.2;
}
.seal {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid var(--seal);
  color: var(--seal);
  font-family: var(--serif);
  font-size: 1rem;
  border-radius: 8px;
  writing-mode: vertical-rl;
  letter-spacing: 0.14em;
  line-height: 1;
}

/* ---------- essays.html 二级页 ---------- */
.page-hero { padding: 90px 0 70px; }
.hero-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.page-art { display: flex; justify-content: center; align-items: center; }
.art-img { display: none; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
html[data-theme="dark"] .art-dark { display: block; }
html:not([data-theme="dark"]) .art-light { display: block; }
.page-title { margin: 0; font-family: var(--serif); font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; }
.page-sub { margin: 16px 0 0; color: var(--ink-soft); font-size: 1.1rem; }
.essay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.essay-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.essay-card .card-cover { width: 100%; height: 160px; object-fit: cover; display: block; }
.essay-card .card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.essay-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.essay-date { font-size: 0.78rem; color: var(--ink-faint); letter-spacing: 0.08em; }
.essay-title { margin: 10px 0 8px; font-family: var(--serif); font-size: 1.15rem; line-height: 1.4; }
.essay-desc { margin: 0; color: var(--ink-soft); font-size: 0.9rem; flex: 1; }
.follow-grid { display: flex; align-items: center; justify-content: center; gap: 80px; flex-wrap: wrap; margin: 0 auto; }
.follow-copy { max-width: 400px; }
.qr-frame {
  display: inline-block;
  padding: 10px;
  border: 2px dashed rgba(90, 90, 90, 0.55);
  border-radius: 20px;
  background: #fff;
  line-height: 0;
  box-shadow: var(--shadow);
}
.qr-img {
  width: 258px; height: 258px;
  border-radius: 8px;
  display: block;
}
.follow-name { margin: 0 0 10px; font-family: var(--serif); font-size: 1.5rem; }
.follow-copy p { margin: 0 0 8px; color: var(--ink-soft); }

/* ---------- friends.html 友邻页 ---------- */
.friend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.friend-card {
  display: flex; flex-direction: row; align-items: center; gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  padding: 20px 22px;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.friend-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.friend-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 1px solid var(--line-strong);
  background: var(--bg);
}
.friend-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.friend-name { font-family: var(--serif); font-size: 1.1rem; line-height: 1.35; color: var(--ink); }
.friend-desc { color: var(--ink-soft); font-size: 0.88rem; }
.friend-host { font-size: 0.75rem; color: var(--ink-faint); letter-spacing: 0.05em; word-break: break-all; }
.friend-empty {
  max-width: 560px; margin: 0 auto; padding: 60px 28px;
  border: 1px dashed var(--line-strong); border-radius: 16px;
  text-align: center;
}
.friend-empty-mark {
  display: inline-block; width: 52px; height: 52px; line-height: 52px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  font-family: var(--serif); font-size: 1.4rem; color: var(--ink-faint);
  margin-bottom: 18px;
}
.friend-empty h3 { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 12px; }
.friend-empty p { color: var(--ink-soft); margin: 0 0 24px; }
.apply-copy { max-width: 480px; }
.apply-copy h3 { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 12px; }
.apply-copy p { margin: 0 0 10px; color: var(--ink-soft); }
.apply-copy .host { font-size: 0.85rem; color: var(--ink-faint); word-break: break-all; }
@media (max-width: 860px) {
  .friend-grid { grid-template-columns: 1fr; }
}

/* 响应式：轮播 + 二级页 */
@media (max-width: 860px) {
  .carousel { height: 460px; }
  .carousel-card { width: 78vw; margin-left: -39vw; }
  .essay-grid { grid-template-columns: 1fr; }
  .follow-grid { gap: 48px; flex-direction: column; text-align: center; }
  .awards-grid { grid-template-columns: 1fr; }
  .credo-grid { grid-template-columns: 1fr; }
  .credo-art { display: none; }
  .hero-split { grid-template-columns: 1fr; }
  .page-art { display: none; }
}
