/* ============================================================
   拾羽集 · 极简鸟类摄影画廊
   设计：中性色为底 / 衬线标题 + 无衬线正文 / 大量留白 / 图片为主角
   ============================================================ */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --text: #33332f;
  --muted: #8b8b85;
  --faint: #b6b6af;
  --line: #e8e6e0;
  --line-soft: #f0eee9;
  --accent: #4a5a4e;          /* 极克制的灰绿，仅用于激活态 */
  --backdrop: rgba(18, 18, 17, 0.96);

  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --wrap: 1440px;
  --read: 720px;
  --gap: clamp(14px, 2vw, 26px);
  --pad: clamp(18px, 4vw, 56px);
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

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

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

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1.3; margin: 0; }

::selection { background: #dfe4dd; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.read { max-width: var(--read); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(250, 250, 248, 0.82);
  backdrop-filter: saturate(1.1) blur(12px);
  -webkit-backdrop-filter: saturate(1.1) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .cn { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; color: var(--ink); letter-spacing: 0.06em; }
.brand .en { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); }

.nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 38px); }
.nav a {
  position: relative; font-size: 0.92rem; color: var(--muted);
  padding: 6px 0; transition: color 0.25s var(--ease); letter-spacing: 0.04em;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--ink); }
.nav-toggle svg { width: 22px; height: 22px; }

/* ---------- 首页 hero（克制） ---------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(24px, 4vw, 40px); text-align: center; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: 0.08em; }
.hero .tagline { margin: 16px auto 0; max-width: 34em; color: var(--muted); font-size: clamp(0.95rem, 2vw, 1.08rem); line-height: 1.9; }
.hero .rule { width: 40px; height: 1px; background: var(--faint); margin: 26px auto 0; }

/* ---------- 筛选条 ---------- */
.filter-bar {
  position: sticky; top: var(--header-h); z-index: 40;
  background: rgba(250, 250, 248, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 0;
}
.filter-bar .wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.filter-btn {
  border: 1px solid transparent; background: none; color: var(--muted);
  font-size: 0.88rem; letter-spacing: 0.05em; padding: 7px 16px; border-radius: 999px;
  transition: all 0.25s var(--ease);
}
.filter-btn:hover { color: var(--ink); background: var(--line-soft); }
.filter-btn[aria-pressed="true"] { color: var(--surface); background: var(--ink); }
.filter-count { width: 100%; text-align: center; color: var(--faint); font-size: 0.78rem; margin-top: 4px; letter-spacing: 0.08em; }

/* ---------- 瀑布流画廊 ---------- */
.gallery { padding: clamp(24px, 4vw, 48px) 0 clamp(48px, 7vw, 90px); }
.masonry { column-count: 4; column-gap: var(--gap); }
@media (max-width: 1200px) { .masonry { column-count: 3; } }
@media (max-width: 820px)  { .masonry { column-count: 2; } }
@media (max-width: 480px)  { .masonry { column-count: 1; } }

.card {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  margin: 0 0 var(--gap); position: relative; display: block; width: 100%;
  background: var(--surface); border-radius: 3px; overflow: hidden;
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.card.is-in { opacity: 1; transform: none; }
.card.is-hidden { display: none; }

.ph-media { position: relative; width: 100%; overflow: hidden; background: var(--tone, #ddd); }
.ph-media img {
  width: 100%; height: auto; opacity: 0; transform: scale(1.03);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease);
}
.ph-media img.is-loaded { opacity: 1; transform: scale(1); }

.card-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px; color: #fff;
  background: linear-gradient(to top, rgba(15,15,14,0.62) 0%, rgba(15,15,14,0.12) 42%, rgba(15,15,14,0) 70%);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.card:hover .card-overlay, .card:focus-visible .card-overlay { opacity: 1; }
.card-overlay .sp-cn { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; letter-spacing: 0.04em; }
.card-overlay .sp-en { font-size: 0.74rem; font-style: italic; opacity: 0.82; margin-top: 2px; }
.card-overlay .loc { font-size: 0.78rem; opacity: 0.9; margin-top: 8px; letter-spacing: 0.04em; display: flex; align-items: center; gap: 5px; }
.card-overlay .loc svg { width: 12px; height: 12px; flex: none; }
.card .view-hint {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.16); backdrop-filter: blur(4px); display: grid; place-items: center;
  opacity: 0; transform: translateY(-4px); transition: all 0.35s var(--ease); color: #fff;
}
.card:hover .view-hint { opacity: 1; transform: none; }
.card .view-hint svg { width: 15px; height: 15px; }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: var(--backdrop);
  display: flex; flex-direction: column; opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lb-stage { flex: 1; display: grid; place-items: center; padding: 56px 64px 12px; min-height: 0; }
.lb-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  transform: scale(0.97); opacity: 0; transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.lightbox.is-open .lb-stage img { transform: scale(1); opacity: 1; }
.lb-caption { color: #e9e7e2; text-align: center; padding: 14px 24px 22px; }
.lb-caption .sp { font-family: var(--serif); font-size: 1.2rem; }
.lb-caption .sp em { font-style: italic; font-size: 0.85rem; color: #b7b5ae; margin-left: 8px; }
.lb-caption .meta { font-size: 0.8rem; color: #a3a19a; margin-top: 6px; letter-spacing: 0.03em; }
.lb-caption .exif { font-size: 0.76rem; color: #8d8b84; margin-top: 8px; font-variant-numeric: tabular-nums; }
.lb-caption .detail-link { display: inline-block; margin-top: 12px; font-size: 0.8rem; color: #cfcdc6; border-bottom: 1px solid #55534d; padding-bottom: 2px; transition: color .25s, border-color .25s; }
.lb-caption .detail-link:hover { color: #fff; border-color: #fff; }

.lb-btn {
  position: absolute; background: rgba(255,255,255,0.07); border: 0; color: #e9e7e2;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  transition: background 0.25s var(--ease); backdrop-filter: blur(4px);
}
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-counter { position: absolute; top: 26px; left: 24px; color: #8d8b84; font-size: 0.8rem; letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }

/* ---------- 文章列表 ---------- */
.page-head { padding: clamp(44px, 7vw, 80px) 0 clamp(20px, 3vw, 32px); }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: 0.06em; }
.page-head .sub { color: var(--muted); margin-top: 12px; font-size: 1rem; }

.post-list { display: grid; gap: clamp(28px, 4vw, 52px); padding-bottom: clamp(48px, 7vw, 90px); }
.post-item { display: grid; grid-template-columns: 300px 1fr; gap: clamp(20px, 3vw, 40px); align-items: center; }
.post-item .cover { border-radius: 3px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--tone, #ddd); }
.post-item .cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s var(--ease), transform .9s var(--ease); transform: scale(1.03); }
.post-item .cover img.is-loaded { opacity: 1; transform: scale(1); }
.post-item:hover .cover img { transform: scale(1.04); }
.post-item .date { font-size: 0.78rem; color: var(--faint); letter-spacing: 0.1em; }
.post-item h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 8px 0 10px; transition: color .25s; }
.post-item:hover h2 { color: var(--accent); }
.post-item .excerpt { color: var(--muted); font-size: 0.96rem; line-height: 1.85; }
.post-item .tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 0.74rem; color: var(--muted); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; letter-spacing: 0.04em; }
@media (max-width: 720px) { .post-item { grid-template-columns: 1fr; } .post-item .cover { aspect-ratio: 16 / 9; } }

/* ---------- 文章正文 ---------- */
.article { padding-bottom: clamp(48px, 7vw, 90px); }
.article-head { padding: clamp(44px, 7vw, 80px) 0 clamp(24px, 4vw, 40px); text-align: center; }
.article-head .date { font-size: 0.8rem; color: var(--faint); letter-spacing: 0.14em; }
.article-head h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); margin: 14px auto 0; max-width: 18em; letter-spacing: 0.03em; }
.article-head .tags { margin-top: 20px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.article-body { font-size: 1.06rem; line-height: 2; color: var(--text); }
.article-body p { margin: 0 0 1.7em; }
.article-body h2 { font-size: 1.5rem; margin: 2.2em 0 0.9em; letter-spacing: 0.03em; }
.article-body blockquote {
  margin: 2.4em 0; padding: 0 0 0 1.4em; border-left: 2px solid var(--faint);
  font-family: var(--serif); font-size: 1.28rem; line-height: 1.8; color: var(--ink); font-style: normal;
}
.article-figure { margin: 2.6em 0; }
.article-figure .ph-media { border-radius: 3px; }
.article-figure figcaption { margin-top: 14px; font-size: 0.84rem; color: var(--muted); line-height: 1.8; text-align: center; }
.article-figure figcaption .sp { color: var(--ink); font-weight: 600; }

.article-nav { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); margin-top: 3em; padding-top: 2em; }
.article-nav a { font-size: 0.9rem; color: var(--muted); transition: color .25s; max-width: 46%; }
.article-nav a:hover { color: var(--ink); }
.article-nav .next { text-align: right; margin-left: auto; }
.article-nav .label { display: block; font-size: 0.72rem; color: var(--faint); letter-spacing: 0.1em; margin-bottom: 4px; }

/* ---------- 图片详情页 ---------- */
.photo-detail { display: grid; grid-template-columns: 1fr 340px; gap: clamp(24px, 3vw, 48px); padding: clamp(24px, 4vw, 48px) 0 clamp(48px, 7vw, 80px); align-items: start; }
.photo-stage { position: relative; background: var(--surface); border-radius: 3px; overflow: hidden; min-height: 60vh; display: grid; place-items: center; }
.photo-stage .ph-media { width: 100%; }
.photo-stage img { width: 100%; height: auto; max-height: 86vh; object-fit: contain; margin: 0 auto; }
.photo-side { position: sticky; top: calc(var(--header-h) + 24px); }
.photo-side h1 { font-size: 1.7rem; letter-spacing: 0.03em; }
.photo-side .sci { font-style: italic; color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.photo-side .story { margin: 20px 0; font-size: 0.96rem; line-height: 1.95; color: var(--text); }

.exif-table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; }
.exif-table caption { text-align: left; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding-bottom: 10px; }
.exif-table td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem; }
.exif-table td:first-child { color: var(--muted); width: 42%; }
.exif-table td:last-child { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }

.loc-card { border: 1px solid var(--line); border-radius: 4px; padding: 16px; background: var(--surface); }
.loc-card .loc-name { font-size: 0.95rem; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.loc-card .loc-name svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.loc-card .coords { font-size: 0.78rem; color: var(--faint); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.loc-map { margin-top: 12px; border-radius: 3px; overflow: hidden; background: #eef0ec; }
.loc-map svg { width: 100%; height: auto; display: block; }
.loc-card .map-link { display: inline-block; margin-top: 12px; font-size: 0.8rem; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 1px; }

.photo-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; transition: color .25s; }
.photo-back:hover { color: var(--ink); }
.photo-back svg { width: 15px; height: 15px; }

@media (max-width: 900px) {
  .photo-detail { grid-template-columns: 1fr; }
  .photo-side { position: static; }
  .photo-stage { min-height: 40vh; }
}

/* ---------- 关于我 ---------- */
.about-hero { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; padding: clamp(44px, 7vw, 88px) 0; }
.about-hero .portrait { border-radius: 3px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--tone, #ddd); }
.about-hero .portrait img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s var(--ease); }
.about-hero .portrait img.is-loaded { opacity: 1; }
.about-hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: 0.05em; }
.about-hero .role { color: var(--faint); font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase; margin-top: 10px; }
.about-hero .intro { margin-top: 22px; color: var(--text); line-height: 2; font-size: 1.02rem; }
@media (max-width: 820px) { .about-hero { grid-template-columns: 1fr; } .about-hero .portrait { aspect-ratio: 16 / 10; order: -1; } }

.about-section { padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); }
.about-section h2 { font-size: 1.4rem; letter-spacing: 0.05em; margin-bottom: 22px; }
.philosophy { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.philosophy li { position: relative; padding-left: 26px; line-height: 1.95; color: var(--text); }
.philosophy li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 12px; height: 1px; background: var(--faint); }
.gear-list { list-style: none; padding: 0; margin: 0; }
.gear-list li { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.gear-list .g-name { color: var(--ink); font-weight: 600; font-size: 0.96rem; }
.gear-list .g-note { color: var(--muted); font-size: 0.86rem; }
.contact-line { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.contact-line a, .contact-line span { font-size: 0.95rem; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.contact-line a { border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color .25s, border-color .25s; }
.contact-line a:hover { color: var(--accent); border-color: var(--accent); }
.contact-line svg { width: 16px; height: 16px; color: var(--muted); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; margin-top: 20px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer .copy { font-size: 0.82rem; color: var(--faint); letter-spacing: 0.04em; }
.site-footer .foot-nav { display: flex; gap: 22px; }
.site-footer .foot-nav a { font-size: 0.82rem; color: var(--muted); transition: color .25s; }
.site-footer .foot-nav a:hover { color: var(--ink); }

/* ---------- 空状态 / 工具 ---------- */
.empty { text-align: center; color: var(--faint); padding: 80px 0; font-size: 0.95rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- 移动端导航 ---------- */
@media (max-width: 680px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 16px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .nav a::after { display: none; }
  .lb-stage { padding: 52px 12px 8px; }
  .lb-prev { left: 6px; } .lb-next { right: 6px; }
  .lb-btn { width: 40px; height: 40px; }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .card { opacity: 1; transform: none; }
  .ph-media img { opacity: 1; transform: none; }
}
