:root {
  --bg: #faf9f6;
  --bg-soft: #f3f1ec;
  --ink: #1c1b18;
  --ink-soft: #5a564f;
  --ink-faint: #8a857c;
  --line: #e4e1d9;
  --accent: #9a8c7a;
  --font-serif: "Georgia", "Songti SC", "SimSun", serif;
  --font-sans: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Consolas", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--ink);
  text-decoration: none;
}
.nav { display: flex; gap: 28px; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 3px;
  transition: color .2s;
}
.nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  padding: 120px 28px 90px;
  text-align: center;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(56px, 10vw, 104px);
  font-weight: 400;
  letter-spacing: 6px;
  line-height: 1;
  animation: heroIn 1.2s cubic-bezier(.16,1,.3,1) both;
}
.hero-sub {
  margin-top: 24px;
  font-size: 16px;
  letter-spacing: 6px;
  color: var(--ink-soft);
  animation: heroIn 1.2s cubic-bezier(.16,1,.3,1) .15s both;
}
.hero-line {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--ink-faint);
  animation: heroIn 1.2s cubic-bezier(.16,1,.3,1) .3s both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 28px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 4px;
  margin-bottom: 44px;
  position: relative;
  padding-bottom: 16px;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 1px;
  background: var(--accent);
}

/* 画廊布局：以第一张图宽度为基准的定宽列
   所有行（单图/双图/三图/竖图）的总宽度都对齐第一张图宽度 --gallery-w */
.editorial {
  display: block;
  --gallery-w: 100%;           /* 第一张图的宽度 = 内容区满宽 */
  --gap: 28px;                 /* 同行多图之间的间距 */
}

.work {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .9s cubic-bezier(.16,1,.3,1),
              transform .9s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.work.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* 单件作品内部：图 + 图注 */
.work-inner {
  display: flex;
  flex-direction: column;
}

/* 图片 */
.work .frame {
  width: 100%;
  overflow: hidden;
  cursor: pointer;
}
.work .frame img,
.work .frame svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 1.1s cubic-bezier(.16,1,.3,1);
}
.work:hover .frame img,
.work:hover .frame svg { transform: scale(1.03); }

/* 图注：图下方独立留白，短装饰线 + 标题 + 英文简介 */
.work-copy {
  width: 100%;
  margin-top: 26px;
  text-align: left;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  position: relative;
}
.work-copy::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--accent);
}
.work-copy .work-kind {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.work-copy .work-title {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 1px;
  font-weight: 400;
  margin-bottom: 8px;
}
.work-copy .work-desc {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* 满宽单件（第一件基准） */
.work:not(.w-half) .frame { aspect-ratio: 20 / 9; }
/* 直接位于画廊容器下的满宽作品，独立留出间距 */
.editorial > .work {
  margin-bottom: 120px;
}
.editorial > .work:last-child {
  margin-bottom: 0;
}

/* 两件并排 */
.work-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: 120px;
}
.work-row .work .frame { aspect-ratio: 4 / 3; }

/* 三件拼版：左一大竖图 + 右上下两小图 */
.work-trio {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: var(--gap);
  margin-bottom: 120px;
}
.work-trio .trio-left .frame { aspect-ratio: 3 / 4; }
.work-trio .trio-right {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
}
.work-trio .trio-right .frame { aspect-ratio: 4 / 3; }

/* —— 瀑布流区（未置顶作品）—— */
.masonry {
  columns: 3;
  column-gap: var(--gap);
  margin-top: 20px;
}
.masonry-item {
  break-inside: avoid;
  margin-bottom: calc(var(--gap) * 1.6);
}
.masonry-item .frame {
  width: 100%;
  overflow: hidden;
  cursor: pointer;
}
.masonry-item .frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 1.1s cubic-bezier(.16,1,.3,1);
}
.masonry-item:hover .frame img { transform: scale(1.03); }
.masonry-copy {
  padding: 14px 2px 0;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  position: relative;
}
.masonry-copy .work-kind {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.masonry-copy .work-title {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 1px;
  font-weight: 400;
  margin-bottom: 8px;
}
.masonry-copy .work-desc {
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* 移动端：保持并排/拼版的错落风格，只缩小间距和字号 */
@media (max-width: 860px) {
  .section { padding: 50px 18px; }
  .work-row {
    grid-template-columns: 1fr 1fr;   /* 手机也保持两件并排 */
    gap: 14px;
    margin-bottom: 48px;
  }
  .work-row .work .frame { aspect-ratio: 4 / 3; }

  /* 三件拼版：保持左大右小 */
  .work-trio {
    grid-template-columns: 1.15fr 1fr;
    gap: 14px;
    margin-bottom: 48px;
  }
  .work-trio .trio-left .frame { aspect-ratio: 3 / 4; }
  .work-trio .trio-right {
    grid-template-rows: 1fr 1fr;
    grid-template-columns: none;
    gap: 14px;
  }
  .work-trio .trio-right .frame { aspect-ratio: 4 / 3; }

  /* 图注字号缩小 */
  .work-copy { margin-top: 16px; padding-top: 12px; }
  .work-copy .work-title { font-size: 16px; }
  .work-copy .work-desc { font-size: 12px; }

  /* 瀑布流保持 2 列 */
  .masonry { columns: 2; column-gap: 14px; }
  .masonry-copy .work-title { font-size: 14px; }
  .masonry-copy .work-desc { font-size: 11px; }
}
@media (max-width: 520px) {
  /* 超窄屏：并排太挤，改为单列堆叠 */
  .work-row {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .work-row .work .frame { aspect-ratio: 4 / 3; }
  .work-trio {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .work-trio .trio-left .frame { aspect-ratio: 4 / 3; }
  .work-trio .trio-right {
    grid-template-rows: none;
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .work-trio .trio-right .frame { aspect-ratio: 4 / 3; }
  .masonry { columns: 1; column-gap: 0; }
}

/* About */
.about { max-width: 640px; }
.about p {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 2;
}
.about .about-en {
  font-size: 15px;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.9;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.about-contact { margin-top: 28px; font-size: 14px !important; color: var(--ink-soft) !important; }
.mono { font-family: var(--mono); color: var(--ink); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 28px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 2px;
}
.site-footer .footer-beian {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 1px;
}
.site-footer .footer-beian a {
  color: var(--ink-faint);
  text-decoration: none;
}
.site-footer .footer-beian a:hover {
  color: var(--ink-soft);
  text-decoration: underline;
}

/* Lightbox —— 用 opacity + 缩放过渡，让照片从容浮现 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 17, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 100;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .38s ease, visibility 0s linear .38s;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity .38s ease;
}
.lightbox img {
  max-width: 90vw;
  max-height: 78vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.92);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2,.7,.3,1), opacity .45s ease;
}
.lightbox.open img {
  transform: scale(1);
  opacity: 1;
}
.lightbox-cap {
  margin-top: 20px;
  color: #e8e5de;
  font-family: var(--font-serif);
  letter-spacing: 2px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease .12s, transform .45s ease .12s;
}
.lightbox.open .lightbox-cap {
  opacity: 1;
  transform: translateY(0);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #e8e5de;
  font-size: 40px;
  cursor: pointer;
  line-height: 1;
  transition: transform .3s ease, opacity .3s ease;
}
.lightbox-close:hover {
  transform: rotate(90deg);
  opacity: 0.7;
}
