/* ============================================================
   光影手记 · 个人摄影作品集
   深色优雅主题 —— 可通过下方变量一键换肤
   ============================================================ */

:root {
  --bg: #101013;
  --bg-soft: #17171b;
  --panel: #1d1d22;
  --text: #e9e6e0;
  --muted: #9b968e;
  --faint: #6a665f;
  --accent: #c9a876;
  --accent-dim: rgba(201, 168, 118, .16);
  --line: #2a2a30;
  --radius: 6px;
  --serif: Georgia, "Times New Roman", "Songti SC", "STSong", SimSun, serif;
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", Consolas, "Cascadia Mono", Menlo, monospace;
  --gap: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

/* ---------- 顶栏 ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 64px);
  background: linear-gradient(to bottom, rgba(16,16,19,.92), rgba(16,16,19,.55) 70%, transparent);
  backdrop-filter: blur(8px);
}

.brand {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .12em;
  color: var(--text);
}
.brand-sub {
  display: block;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .5em;
  color: var(--faint);
  margin-top: -2px;
}

.site-nav { display: flex; gap: 28px; }
.site-nav a {
  font-size: 13px;
  letter-spacing: .25em;
  color: var(--muted);
  transition: color .2s;
}
.site-nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  animation: heroDrift 26s ease-in-out infinite alternate;
  filter: saturate(1.05);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(16,16,19,.55), rgba(16,16,19,.25) 40%, var(--bg) 96%),
    radial-gradient(ellipse at center, transparent 30%, rgba(16,16,19,.5) 100%);
}

@keyframes heroDrift {
  from { transform: scale(1.06) translateY(0); }
  to   { transform: scale(1.12) translateY(-1.5%); }
}

.hero-inner { position: relative; padding: 120px 24px 80px; }

.hero-kicker {
  font-size: 12px;
  letter-spacing: .55em;
  color: var(--accent);
  margin-bottom: 26px;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.25;
  letter-spacing: .06em;
  text-shadow: 0 2px 30px rgba(0,0,0,.55);
}

.hero-sub {
  margin-top: 22px;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: .05em;
  text-shadow: 0 1px 12px rgba(0,0,0,.6);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 6vw, 64px);
  margin-top: 44px;
}
.hero-stats .stat b {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  color: var(--text);
}
.hero-stats .stat span {
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--faint);
}

.hero-cta {
  display: inline-block;
  margin-top: 48px;
  padding: 12px 44px;
  border: 1px solid rgba(201,168,118,.55);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--accent);
  transition: background .25s, color .25s;
}
.hero-cta:hover { background: var(--accent); color: #141410; }

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

.gallery-section, .about {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) clamp(16px, 3.5vw, 48px) 32px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: .18em;
}
.section-title-en {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .5em;
  color: var(--faint);
  margin-left: 16px;
  vertical-align: middle;
}

/* ---------- 筛选 ---------- */

.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 7px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .12em;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.filter-btn .n { font-size: 11px; color: var(--faint); margin-left: 4px; }
.filter-btn.active .n { color: var(--accent); }

.gallery-count {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: .2em;
  margin: 14px 0 18px;
}

/* ---------- 瀑布流 ---------- */

.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: 520px)  { .masonry { column-count: 1; } }

.card {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: var(--gap);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
  transform: translateZ(0);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}

.card .thumb {
  width: 100%;
  aspect-ratio: var(--ar, 3/2);
  object-fit: cover;
  background: linear-gradient(110deg, #1b1b20 30%, #24242b 45%, #1b1b20 60%);
  background-size: 240% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.card .thumb.loaded { animation: none; background: none; }

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.card .overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 36px 14px 12px;
  background: linear-gradient(to top, rgba(10,10,12,.85), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s, transform .25s;
}
.card:hover .overlay { opacity: 1; transform: translateY(0); }
.card .overlay .t {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .overlay .d {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .15em;
}

.card .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(12,12,14,.72);
  backdrop-filter: blur(4px);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
}
.card .badge.video {
  right: 10px;
  left: auto;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card .badge.video::before { content: "▶"; font-size: 9px; }

.empty-hint {
  text-align: center;
  color: var(--faint);
  padding: 80px 0;
  letter-spacing: .2em;
}

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

.about {
  border-top: 1px solid var(--line);
  margin-top: 48px;
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  margin-top: 36px;
}
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

.about-text p { color: var(--muted); margin-bottom: 18px; max-width: 62ch; }
.about-text b { color: var(--text); font-weight: 500; }
.about-gear {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: .05em;
}

.about-note {
  align-self: start;
  padding: 28px 26px;
  border-left: 2px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.about-note p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2;
  color: var(--text);
}

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

.site-footer {
  margin-top: 72px;
  padding: 36px 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: .2em;
}
.footer-note { margin-top: 6px; font-size: 11px; color: #4c4a45; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(10,10,12,.94);
  backdrop-filter: blur(10px);
  animation: lbIn .22s ease;
}
.lightbox[hidden] { display: none; }   /* 必须显式覆盖,否则 display:flex 会压过 hidden */
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px 12px;
}
.lb-stage img,
.lb-stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 20px 80px rgba(0,0,0,.6);
}
.lb-stage img { animation: lbImgIn .28s ease; }
@keyframes lbImgIn {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

.lb-caption {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 6vw, 72px) 22px;
}

.lb-title {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .05em;
}
.lb-desc { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 70ch; }

.exif-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.exif-chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  letter-spacing: .03em;
}
.exif-chip.cam { color: var(--accent); border-color: rgba(201,168,118,.4); }

.lb-counter {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.lb-close {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 110;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  transition: background .2s;
}
.lb-close:hover { background: var(--accent); color: #141410; }

.lb-nav {
  position: fixed;
  top: 50%;
  z-index: 110;
  transform: translateY(-50%);
  width: 52px;
  height: 72px;
  border: none;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 30px;
  transition: background .2s;
}
.lb-nav:hover { background: var(--accent); color: #141410; }
.lb-prev { left: 14px; border-radius: 0 8px 8px 0; }
.lb-next { right: 14px; border-radius: 8px 0 0 8px; }

@media (max-width: 640px) {
  .lb-stage { padding: 52px 8px 8px; }
  .lb-nav { width: 40px; height: 56px; font-size: 22px; }
  .lb-caption { flex-direction: column; align-items: flex-start; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2e2e35; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3c3c45; }
