/* =========================================================
   拾光集 · 个人博客
   全站共享样式
   ========================================================= */

/* ---------- 主题变量 ---------- */
:root {
  --bg: #f7f7fb;
  --bg-soft: #eef0f8;
  --surface: #ffffff;
  --surface-2: #f4f5fa;
  --text: #171a2b;
  --text-soft: #4a5068;
  --muted: #7b8199;
  --border: #e4e6f0;
  --accent: #5b5bd6;
  --accent-soft: #ececfd;
  --accent-2: #e0607e;
  --shadow-sm: 0 1px 2px rgba(23, 26, 43, .06), 0 2px 8px rgba(23, 26, 43, .04);
  --shadow-md: 0 6px 20px rgba(23, 26, 43, .08);
  --shadow-lg: 0 18px 45px rgba(23, 26, 43, .12);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

html[data-theme="dark"] {
  --bg: #0e1017;
  --bg-soft: #12151f;
  --surface: #171b27;
  --surface-2: #1d2231;
  --text: #e9ecf5;
  --text-soft: #b9c0d4;
  --muted: #868ea6;
  --border: #262c3d;
  --accent: #8b8bfa;
  --accent-soft: #232a45;
  --accent-2: #f2809b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }

p { margin: 0 0 1em; }

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- 布局工具 ---------- */
.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }

.section { padding: 4.5rem 0; }
.section-sm { padding: 2.5rem 0; }

.section-head { margin-bottom: 2.25rem; }
.section-head .eyebrow {
  display: inline-block;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: .5rem;
}
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .35rem; }
.section-head p { color: var(--muted); margin: 0; max-width: 60ch; }

.head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 68px;
}

.brand { display: flex; align-items: center; gap: .65rem; font-weight: 800; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 1rem; }
.brand-text em {
  font-style: normal;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.nav a {
  position: relative;
  padding: .5rem .8rem;
  border-radius: 8px;
  font-size: .94rem;
  color: var(--text-soft);
  font-weight: 500;
  transition: color .2s ease, background .2s ease;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); font-weight: 700; }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 1px;
  width: 16px; height: 3px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: var(--accent);
}

.header-actions { display: flex; align-items: center; gap: .4rem; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.menu-toggle { display: none; }

html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 5rem 0 4.5rem; overflow: hidden; }
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  width: 420px; height: 420px;
  background: var(--accent);
  top: -140px; right: -80px;
  opacity: .28;
}
.hero::after {
  width: 340px; height: 340px;
  background: var(--accent-2);
  bottom: -160px; left: -100px;
  opacity: .2;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .75fr; gap: 3rem; align-items: center; }
.hero .pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.hero .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); margin-bottom: 1rem; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead { font-size: 1.08rem; color: var(--text-soft); max-width: 52ch; margin-bottom: 1.75rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 1.5rem; }
.hero-stats span { font-size: .82rem; color: var(--muted); }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transform: rotate(1.5deg);
}
.hero-card img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; }
.hero-card .cap { margin-top: 1rem; display: flex; align-items: center; gap: .75rem; }
.hero-card .cap b { font-size: .95rem; display: block; }
.hero-card .cap span { font-size: .8rem; color: var(--muted); }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.card-cover { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.card-body { padding: 1.35rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.card-body h3 a:hover { color: var(--accent); }
.card-body p { color: var(--muted); font-size: .92rem; flex: 1; }

.card-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .75rem;
}
.card-meta .tag { color: var(--accent); font-weight: 700; }

.tag {
  display: inline-block;
  padding: .22rem .6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .74rem;
  font-weight: 600;
}

.read-more { font-weight: 700; color: var(--accent); font-size: .88rem; margin-top: 1rem; display: inline-flex; gap: .35rem; align-items: center; }
.read-more::after { content: "→"; transition: transform .2s ease; }
.card:hover .read-more::after { transform: translateX(4px); }

/* 横向文章条 */
.post-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-row:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.post-row img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.post-row .num { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--border); }
.post-row h4 { font-size: 1rem; margin: 0 0 .25rem; }
.post-row small { color: var(--muted); font-size: .8rem; }

/* ---------- 页面头 ---------- */
.page-head {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(600px 260px at 15% -40%, color-mix(in srgb, var(--accent) 14%, transparent), transparent),
    var(--bg-soft);
}
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .5rem; }
.page-head p { color: var(--muted); margin: 0; max-width: 62ch; }

.breadcrumb { font-size: .84rem; color: var(--muted); margin-bottom: .9rem; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 .4rem; }

/* ---------- 文章正文 ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article-cover { border-radius: var(--radius); margin-bottom: 2rem; aspect-ratio: 16/8; object-fit: cover; width: 100%; box-shadow: var(--shadow-md); }
.article h2 { font-size: 1.5rem; margin-top: 2.25rem; }
.article h3 { font-size: 1.18rem; margin-top: 1.75rem; }
.article p { color: var(--text-soft); }
.article ul, .article ol { color: var(--text-soft); padding-left: 1.4rem; margin-bottom: 1.25rem; list-style: disc; }
.article ol { list-style: decimal; }
.article li { margin-bottom: .45rem; }
.article a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.article blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.35rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft);
  font-style: italic;
}
.article code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  padding: .15em .4em;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.article pre {
  background: #14161f;
  color: #e6e9f5;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: .88rem;
  line-height: 1.7;
  border: 1px solid #232838;
}
.article pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.article img { border-radius: var(--radius-sm); margin-bottom: 1.25rem; }
.article hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.article-meta {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap;
  color: var(--muted); font-size: .88rem;
  margin-bottom: 1.25rem;
}
.article-meta .avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.toc b { display: block; font-size: .85rem; margin-bottom: .5rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.toc a { display: block; font-size: .9rem; color: var(--text-soft); padding: .22rem 0; }
.toc a:hover { color: var(--accent); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.post-nav a {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease;
}
.post-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-nav small { color: var(--muted); font-size: .78rem; display: block; margin-bottom: .2rem; }
.post-nav b { font-size: .95rem; }
.post-nav .next { text-align: right; }

/* ---------- 项目 ---------- */
.project-card .card-cover { aspect-ratio: 16/9; }
.stack { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .9rem; }
.stack span {
  font-size: .74rem;
  font-family: var(--mono);
  padding: .2rem .55rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

/* ---------- 相册 ---------- */
.gallery { columns: 3; column-gap: 1rem; }
.gallery figure {
  margin: 0 0 1rem;
  break-inside: avoid;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
}
.gallery img { width: 100%; transition: transform .45s ease; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.6rem .9rem .7rem;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #fff;
  font-size: .84rem;
  opacity: 0;
  transition: opacity .3s ease;
}
.gallery figure:hover figcaption { opacity: 1; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(8, 9, 14, .9);
  padding: 5vw;
  backdrop-filter: blur(6px);
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox .lb-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem;
  display: grid; place-items: center;
}

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 340px 1fr; gap: 3rem; align-items: start; }
.about-photo { border-radius: 22px; box-shadow: var(--shadow-lg); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.timeline { border-left: 2px solid var(--border); padding-left: 1.5rem; margin-top: 1rem; }
.timeline-item { position: relative; padding-bottom: 1.75rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.94rem; top: .5rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-item time { font-size: .8rem; color: var(--accent); font-weight: 700; font-family: var(--mono); }
.timeline-item h4 { margin: .2rem 0 .3rem; font-size: 1rem; }
.timeline-item p { font-size: .9rem; color: var(--muted); margin: 0; }

.skills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.skills span {
  padding: .38rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .84rem;
  color: var(--text-soft);
}
.skill-bar { margin-bottom: 1.1rem; }
.skill-bar .top { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .4rem; }
.skill-bar .top span { color: var(--muted); font-family: var(--mono); font-size: .8rem; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }

/* ---------- 联系 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start; }
.contact-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.contact-item .ci-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 1.1rem;
}
.contact-item b { display: block; font-size: .95rem; }
.contact-item span { color: var(--muted); font-size: .88rem; }

.form-field { margin-bottom: 1.1rem; }
.form-field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-soft); }
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .94rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-note { font-size: .88rem; margin-top: .9rem; display: none; }
.form-note.show { display: block; color: var(--accent); font-weight: 600; }

/* ---------- CTA 横幅 ---------- */
.cta-band {
  border-radius: 22px;
  padding: 3rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta-band p { color: rgba(255,255,255,.88); max-width: 52ch; margin-inline: auto; margin-bottom: 1.5rem; }
.cta-band .btn { background: #fff; color: var(--accent); }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 4rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid h5 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .9rem; }
.footer-grid a { display: block; font-size: .9rem; color: var(--text-soft); padding: .22rem 0; }
.footer-grid a:hover { color: var(--accent); }
.footer-grid p { color: var(--muted); font-size: .88rem; }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--muted);
}
.socials { display: flex; gap: .5rem; }
.socials a {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .8rem;
  color: var(--text-soft);
}
.socials a:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- 文章列表页 ---------- */
.toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .92rem;
  font-family: inherit;
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box::before { content: "⌕"; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; }

.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  padding: .45rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: .86rem;
  font-weight: 600;
  transition: all .2s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty { text-align: center; padding: 3rem 0; color: var(--muted); display: none; }
.empty.show { display: block; }

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all .3s ease;
  z-index: 40;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 6rem 0; }
.notfound .code {
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { max-width: 340px; transform: none; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 300px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .gallery { columns: 2; }
}

@media (max-width: 720px) {
  .menu-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    padding: 1rem 1.25rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-120%);
    transition: transform .32s cubic-bezier(.3,.9,.3,1);
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  .nav.open { transform: translateY(0); }
  .nav a { padding: .8rem 1rem; font-size: 1rem; }
  .nav a.active::after { display: none; }
  .nav a.active { background: var(--accent-soft); }

  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .gallery { columns: 1; }
  .section { padding: 3rem 0; }
  .hero { padding: 3.25rem 0 3rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .cta-band { padding: 2rem 1.35rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
