/* ============================================================
   摄影影廊 · 深挖暗色（Deep Mode）
   概念：纪录者的「田野图录」——锐利影像 + 等宽字段标签 + 大留白。
   依据 YifengBranding：影像物料用深挖模式 · 锐度而非柔化 · 禁止圆角柔光渐变 · 左基线。
   ============================================================ */
.photo-page {
  /* 深挖模式取色（对齐 assets/variables.css 的 .deep-mode 级联） */
  --ground: #1c2124;
  --surface-2: #2a3134;
  --paper: #f4f3f0;
  --soft: #8fa0a4; /* 深色底上的次级文字 / 等宽标签 */
  --soft-dim: #6f7d81;
  --line: #394145; /* 深挖模式分界线 */
  --line-strong: #4c5b60; /* 岩石青灰：唯一强调，仅作细线/基线 */
  --line-bright: #b4c0c3;

  --font-cn: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-en: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;

  margin: 0;
  min-height: 100vh;
  /* 墙面：深墙 + 顶部环境光 + 极淡石膏纹理 */
  background-color: var(--ground);
  background-image:
    radial-gradient(135% 90% at 50% -18%, rgba(180, 192, 195, 0.05), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  color: var(--paper);
  font-family: var(--font-en), var(--font-cn);
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.photo-page ::selection {
  background: var(--line-strong);
  color: var(--paper);
}

.photo-wrap {
  width: min(1280px, 100% - 8vw);
  margin-inline: auto;
}

/* ---------- 顶栏 ---------- */
.photo-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ground), transparent 8%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.photo-topbar .photo-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.photo-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.photo-logo img {
  height: 38px;
  width: auto;
  display: block;
}
.photo-topnav {
  display: flex;
  gap: 26px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.photo-topnav a {
  color: var(--soft);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}
.photo-topnav a:hover {
  color: var(--paper);
}
.photo-topnav a[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--line-strong);
}

/* ---------- 图录头（左基线） ---------- */
.photo-masthead {
  padding: clamp(56px, 9vw, 120px) 0 34px;
}
.mast-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--line-bright);
}
.photo-masthead h1 {
  margin: 16px 0 0;
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: clamp(2.6rem, 8.5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: 0.03em;
  color: var(--paper);
}
.mast-intro {
  max-width: 34rem;
  margin: 22px 0 0;
  color: color-mix(in srgb, var(--paper), transparent 16%);
  line-height: 1.85;
  font-size: 1rem;
}
.mast-catalogue {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--soft);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mast-catalogue .dot {
  width: 5px;
  height: 5px;
  background: var(--line-strong);
  display: inline-block;
}

/* 等高线分隔：呼应品牌测绘符号，克制用一次 */
.photo-contour {
  height: 22px;
  margin: 6px 0 0;
  background: url("../img/contour-divider.svg") left center / auto 100% repeat-x;
  opacity: 0.24;
  filter: invert(1) grayscale(1);
}

/* ---------- 分类过滤（等宽字段） ---------- */
.photo-filters {
  position: sticky;
  top: 57px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 22px 0 18px;
  margin-bottom: 8px;
  background: linear-gradient(var(--ground) 72%, transparent);
}
.filter-chip {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--soft);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter-chip .count {
  color: var(--soft-dim);
  font-size: 0.72rem;
  margin-left: 6px;
}
.filter-chip:hover {
  color: var(--paper);
  border-color: var(--line);
}
.filter-chip[aria-pressed="true"] {
  color: var(--ground);
  background: var(--line-bright);
  border-color: var(--line-bright);
}
.filter-chip[aria-pressed="true"] .count {
  color: color-mix(in srgb, var(--ground), transparent 35%);
}

/* ---------- 影廊（沙龙密集挂法 · 裱框上墙） ---------- */
.photo-grid {
  columns: 4;
  column-gap: 32px;
  padding-bottom: 8px;
}
.photo-tile {
  break-inside: avoid;
  display: block;
  width: 100%;
  margin: 0 0 44px;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

/* 一件挂在墙上的裱框作品：卡纸(mat) + 细硬边框 + 方向性硬投影 + 顶部画廊打光 */
.artwork {
  position: relative;
  margin: 0;
  padding: 7.5%; /* 卡纸留白 */
  background: linear-gradient(180deg, #efece4 0%, #e5e1d7 60%, #dbd7cb 100%); /* 卡纸，顶部受光 */
  box-shadow:
    0 0 0 1px rgba(15, 18, 20, 0.92), /* 细硬边框线 */
    inset 0 1px 0 rgba(255, 255, 255, 0.4), /* 卡纸顶沿受光 */
    0 20px 30px -14px rgba(0, 0, 0, 0.72), /* 方向性投影（下） */
    0 6px 12px -2px rgba(0, 0, 0, 0.45);
  transition:
    box-shadow 0.45s ease,
    transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* 顶部画廊打光：墙上一小片光晕，悬停增强 */
.artwork::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -20%;
  width: 128%;
  height: 46%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, rgba(214, 221, 214, 0.16), transparent 68%);
  opacity: 0.42;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.45s ease;
}
/* 照片在卡纸里的下沉窗口（裁切 + 内缘阴影，像真实卡纸开窗） */
.photo-window {
  position: relative;
  display: block;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(15, 18, 20, 0.3),
    inset 0 2px 6px rgba(0, 0, 0, 0.34);
}
.artwork img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(0.96) saturate(0.98) contrast(1.02);
  transition:
    filter 0.45s ease,
    transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.photo-tile:hover .artwork,
.photo-tile:focus-visible .artwork {
  transform: translateY(-5px);
  box-shadow:
    0 0 0 1px rgba(15, 18, 20, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 36px 48px -18px rgba(0, 0, 0, 0.8),
    0 12px 20px -4px rgba(0, 0, 0, 0.5);
}
.photo-tile:hover .artwork::before,
.photo-tile:focus-visible .artwork::before {
  opacity: 1;
}
.photo-tile:hover .artwork img,
.photo-tile:focus-visible .artwork img {
  filter: brightness(1.03) saturate(1) contrast(1.02);
  transform: scale(1.015);
}

/* 墙签（museum placard）：裱框下方的说明 */
.placard {
  position: relative;
  padding: 15px 2px 0;
}
.placard::before {
  /* 左基线：hover 时从左划入的岩青灰细线 */
  content: "";
  position: absolute;
  top: 0;
  left: 2px;
  width: 0;
  height: 1.6px;
  background: var(--line-strong);
  transition: width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.photo-tile:hover .placard::before,
.photo-tile:focus-visible .placard::before {
  width: 46px;
}
.placard .t {
  display: block;
  font-family: var(--font-cn);
  font-weight: 500;
  font-size: 1rem;
  color: var(--paper);
  line-height: 1.4;
}
.placard .t.is-untitled {
  color: var(--soft);
  font-style: italic;
}
.placard .m {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.placard .m .cat {
  color: var(--line-bright);
}

/* ---------- 翻页 ---------- */
.photo-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 22px 0 clamp(60px, 9vw, 110px);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--soft);
}
.pager-btn {
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pager-btn:hover:not(:disabled) {
  border-color: var(--line-bright);
  background: color-mix(in srgb, var(--paper), transparent 92%);
}
.pager-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

/* ---------- 状态 ---------- */
.photo-state {
  padding: clamp(50px, 10vw, 120px) 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--soft);
}
.photo-state h2 {
  font-family: var(--font-cn);
  font-weight: 700;
  color: var(--paper);
  margin: 0 0 10px;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--ground), transparent 3%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.lb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 56px);
  width: 100%;
  max-width: 1180px;
  max-height: 100%;
}
.lb-figure {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  /* 灯箱里也裱一层卡纸+细框，呼应墙上的挂法 */
  padding: 1.4%;
  background: linear-gradient(180deg, #efece4 0%, #e2ded4 100%);
  box-shadow:
    0 0 0 1px rgba(15, 18, 20, 0.92),
    0 34px 66px -22px rgba(0, 0, 0, 0.82);
}
.lb-figure img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.34);
}

/* 田野台账式图注 */
.lb-placard {
  flex: 0 0 clamp(240px, 26vw, 320px);
  align-self: center;
}
.lb-placard h2 {
  margin: 0 0 4px;
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--paper);
}
.lb-placard h2.is-untitled {
  color: var(--soft);
  font-weight: 700;
}
.lb-caption {
  margin: 0 0 22px;
  color: color-mix(in srgb, var(--paper), transparent 20%);
  line-height: 1.8;
  font-size: 0.98rem;
}
.lb-ledger {
  margin: 0;
  border-top: 1px solid var(--line);
}
.lb-ledger div {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.lb-ledger dt {
  color: var(--soft-dim);
  letter-spacing: 0.08em;
}
.lb-ledger dd {
  margin: 0;
  color: var(--paper);
}
.lb-ledger dd.accent {
  color: var(--line-bright);
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  z-index: 2;
  appearance: none;
  background: color-mix(in srgb, var(--surface-2), transparent 15%);
  border: 1px solid var(--line);
  color: var(--paper);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  transition: border-color 0.2s, background 0.2s;
}
.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  border-color: var(--line-bright);
}
.lb-close {
  top: 18px;
  right: 18px;
  font-size: 1.2rem;
}
.lb-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.lb-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.lb-hint {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--soft-dim);
}

/* ---------- 页脚 ---------- */
.photo-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--soft-dim);
}
.photo-footer .photo-wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.photo-footer a {
  color: var(--soft);
  text-decoration: none;
}
.photo-footer a:hover {
  color: var(--paper);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .photo-grid { columns: 3; }
}
@media (max-width: 760px) {
  .photo-grid { columns: 2; column-gap: 16px; }
  .photo-tile { margin-bottom: 24px; }
  .photo-filters { top: 55px; }
  .lb-stage { flex-direction: column; gap: 18px; overflow-y: auto; }
  .lb-figure img { max-height: 56vh; }
  .lb-placard { flex: 0 0 auto; width: 100%; max-width: 440px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
@media (max-width: 420px) {
  .photo-grid { columns: 1; }
}

/* ---------- 无障碍 ---------- */
.photo-page a:focus-visible,
.photo-page button:focus-visible {
  outline: 2px solid var(--line-bright);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .photo-page *,
  .photo-page *::before,
  .photo-page *::after {
    transition: none !important;
    animation: none !important;
  }
  .artwork,
  .artwork img { transform: none !important; }
}
