/* ============ 基础 ============ */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #8b8b8b;
  --faint: #f4f4f4;
  --line: rgba(17, 17, 17, 0.10);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --pad: clamp(20px, 5vw, 72px);
  --max: 1280px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: ui-serif, "Songti SC", "Noto Serif CJK SC", Georgia,
           "Times New Roman", serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--faint);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ============ 通用排版 ============ */
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 132px) var(--pad);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}

.count {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--pad);
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease),
              padding 0.4s var(--ease), backdrop-filter 0.5s var(--ease);
}

.site-header.scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}

.brand {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
}

.nav a {
  position: relative;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.06em;
  transition: color 0.3s var(--ease);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav a:hover { color: var(--fg); }
.nav a:hover::after { transform: scaleX(1); }

/* ============ 首屏 ============ */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px var(--pad) 90px;
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--faint);
  display: grid;
  place-items: center;
  margin-bottom: 34px;
  filter: grayscale(100%);
  transition: filter 0.6s var(--ease), transform 0.6s var(--ease);
}

.avatar:hover {
  filter: grayscale(0%);
  transform: scale(1.03);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--muted);
  user-select: none;
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero-tagline {
  margin: 18px 0 0;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: #555;
  letter-spacing: 0.08em;
}

.hero-eyebrow {
  margin: 34px 0 0;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-hint {
  margin-top: clamp(46px, 8vw, 84px);
  width: 1px;
  height: 60px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.scroll-hint span {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 34%;
  background: var(--fg);
  animation: scrollLine 2.2s var(--ease) infinite;
}

@keyframes scrollLine {
  0%   { transform: translateY(-100%); }
  55%  { transform: translateY(190%); }
  100% { transform: translateY(190%); }
}

/* ============ 画廊 ============ */
.grid {
  columns: 3;
  column-gap: clamp(12px, 1.6vw, 20px);
}

.gallery-item {
  position: relative;
  margin: 0 0 clamp(12px, 1.6vw, 20px);
  break-inside: avoid;
  overflow: hidden;
  background: var(--faint);
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: auto;
  transition: transform 1s var(--ease), filter 1s var(--ease);
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 46%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after { opacity: 1; }

.gallery-item:hover img { transform: scale(1.035); }

.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 18px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}

.gallery-item:hover figcaption,
.gallery-item:focus-visible figcaption {
  opacity: 1;
  transform: none;
}

.gallery-item:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}

.hint {
  margin: 34px 0 0;
  padding: 16px 18px;
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--line);
  background: #fcfcfc;
}

/* ============ 关于 ============ */
.about-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(24px, 6vw, 96px);
  align-items: start;
}

.about-lead {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.about-body p:not(.about-lead) {
  margin: 0 0 18px;
  color: #4a4a4a;
  font-size: 0.95rem;
  line-height: 1.95;
}

.about-meta {
  padding-top: 6px;
  font-size: 12px !important;
  letter-spacing: 0.1em;
  color: var(--muted) !important;
}

/* ============ 页脚 ============ */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 56px) var(--pad) 36px;
  border-top: 1px solid var(--line);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.footer-bottom a { transition: color 0.3s var(--ease); }
.footer-bottom a:hover { color: var(--fg); }

/* ============ 灯箱 ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lb-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: scale(0.97);
  transition: transform 0.5s var(--ease);
}

.lightbox.open .lb-figure { transform: scale(1); }

.lb-figure img {
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lb-figure figcaption {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.62);
  min-height: 1em;
}

.lb-btn {
  position: absolute;
  background: none;
  border: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: color 0.3s var(--ease), opacity 0.3s var(--ease),
              transform 0.3s var(--ease);
  line-height: 1;
}

.lb-btn:hover { color: #fff; }

.lb-close {
  top: clamp(16px, 3vw, 34px);
  right: clamp(18px, 3vw, 40px);
  font-size: 20px;
}

.lb-close:hover { transform: rotate(90deg); }

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 46px;
  font-family: var(--serif);
  padding: 8px 16px;
}

.lb-prev { left: clamp(4px, 2vw, 28px); }
.lb-next { right: clamp(4px, 2vw, 28px); }

.lb-prev:hover { transform: translateY(-50%) translateX(-4px); }
.lb-next:hover { transform: translateY(-50%) translateX(4px); }

.lb-counter {
  position: absolute;
  bottom: clamp(16px, 3vw, 30px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.55);
}

/* ============ 渐入动画 ============ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .grid { columns: 2; }
}

@media (max-width: 760px) {
  .about-body { grid-template-columns: 1fr; }
  .hero { min-height: 82vh; }
  .nav { gap: 18px; }
  .nav a { font-size: 12px; }
  .lb-prev, .lb-next { font-size: 36px; padding: 6px 10px; }
}

@media (max-width: 560px) {
  .grid { columns: 1; }
  .hero-eyebrow { letter-spacing: 0.22em; }
  .avatar { width: 88px; height: 88px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ============ 动效偏好 ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
