/* 画廊页：暗房 35mm 胶片与印样台（依据 vetta-ui-design 色彩、留白、质感与排版规范） */
.gallery-body {
  --surface: oklch(12.2% 0.008 62);
  --surface-raised: oklch(17.5% 0.01 60);
  --surface-film: oklch(16.2% 0.01 58);
  --surface-frame: oklch(10% 0.008 60);
  --surface-backdrop: oklch(10% 0.008 60);
  --ink: oklch(93.5% 0.008 78);
  --ink-secondary: oklch(78% 0.01 74);
  --muted: oklch(66% 0.011 70);
  --dim: oklch(46% 0.01 64);
  --border: oklch(26% 0.01 60);
  --accent: oklch(76% 0.135 68);
  --accent-soft: oklch(76% 0.135 68 / 0.14);
  --gutter: clamp(20px, 4vw, 48px);
  --container-max: 1280px;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --sprocket: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='12' viewBox='0 0 36 12'><rect x='10' y='1.5' width='16' height='9' rx='2.5' fill='%23070605' stroke='%23ffffff' stroke-opacity='0.14' stroke-width='0.75'/></svg>");

  color-scheme: dark;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--surface);
  color: var(--ink);
}

.gallery-body ::selection {
  background: var(--accent);
  color: oklch(14% 0.01 60);
}

.gallery-body :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.gallery-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
}

.gallery-container {
  width: min(var(--container-max), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 顶部导航：留白分隔，不画多余底线 */
.gallery-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
}

.gallery-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-divider {
  color: var(--dim);
}

.brand-section {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.back-home-link:hover {
  color: var(--ink);
}

/* 主体居中平衡，消除底部空黑区 */
.gallery-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-block: 16px 24px;
}

/* 页头：大号宋体主标题 + 简洁副标题与实绩归档范围 */
.gallery-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  align-items: end;
  gap: 32px;
  padding-top: 24px;
  padding-bottom: 40px;
}

.gallery-title {
  margin: 0;
  padding: 0;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: clamp(48px, 5.8vw, 72px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: var(--ink);
  filter: none;
  animation: none;
}

.gallery-intro {
  justify-self: end;
  width: fit-content;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.gallery-subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-secondary);
  white-space: pre-line;
}

.archive-range {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* 筛选条：靠留白分组，取消上下双边框 */
.gallery-controls {
  display: flex;
  align-items: center;
  padding-bottom: 16px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.filter-chip:hover {
  color: var(--ink);
}

.filter-chip.is-active {
  color: var(--ink);
  font-weight: 500;
}

.filter-chip.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.chip-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}

.filter-chip.is-active .chip-count {
  color: var(--accent);
}

/* 核心质感对象：全宽出血 35mm 胶片条（细颗粒 + 上下物理边线 + 真实圆角齿孔） */
.film-stage {
  position: relative;
  width: 100%;
  background: var(--surface-film);
  box-shadow:
    inset 0 1px 0 oklch(100% 0 0 / 0.09),
    inset 0 -1px 0 oklch(0% 0 0 / 0.7);
}

.film-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.06;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}

.gallery-grid {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  user-select: none;
}

.gallery-grid::-webkit-scrollbar {
  display: none;
}

.gallery-grid.is-single {
  padding-inline: max(var(--gutter), calc((100% - var(--container-max)) / 2 + var(--gutter)));
}

.photo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 460px;
  margin: 0;
  padding: 28px 16px 28px;
  border: 0;
  border-right: 1px solid oklch(100% 0 0 / 0.05);
  background: transparent;
  cursor: grab;
}

.gallery-grid.is-single .photo-card {
  border-left: 1px solid oklch(100% 0 0 / 0.05);
}

.gallery-grid.is-dragging .photo-card {
  cursor: grabbing;
}

/* 35mm 胶片上下圆角齿孔 */
.photo-card::before,
.photo-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background-image: var(--sprocket);
  background-repeat: repeat-x;
  background-position: left center;
  pointer-events: none;
}

.photo-card::before {
  top: 8px;
}

.photo-card::after {
  bottom: 8px;
}

/* 胶片边缘暗房印码（琥珀色帧号 + 多图/实况标记） */
.card-rebate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rebate-code {
  color: var(--accent);
  letter-spacing: 0.06em;
}

.rebate-stock {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12px;
}

.rebate-flags {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rebate-flags > * + *::before {
  content: "·";
  margin-right: 8px;
  color: var(--dim);
}

.rebate-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  color: var(--ink-secondary);
}

.rebate-flag.is-live {
  color: var(--accent);
}

.rebate-flag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-frame);
}

.card-img,
.card-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.photo-card:hover .card-img,
.photo-card:focus-visible .card-img {
  transform: scale(1.018);
  filter: brightness(1.05);
}

.gallery-grid.is-dragging .photo-card:hover .card-img {
  transform: none;
  filter: none;
}

.card-video {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.photo-card.is-live-playing .card-video {
  opacity: 1;
}

/* 曝光框下方单行说明：中文标题 + 日期地点 */
.card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.photo-card:hover .card-title {
  color: oklch(97% 0.008 78);
}

.card-meta-line {
  margin: 0;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

/* 可选「当下实况」状态条（仅 nowStatus.enabled 为 true 时展示） */
.now-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 32px;
  padding: 16px 20px;
  border-radius: 4px;
  background: var(--surface-raised);
  font-size: 14px;
  color: var(--muted);
}

.now-badge-wrap,
.now-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.now-badge {
  color: var(--accent);
  font-weight: 500;
}

.now-text {
  margin: 0;
  flex: 1 1 320px;
  color: var(--ink-secondary);
}

.live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.gallery-body .empty-note {
  width: 100%;
  margin: 0;
  padding: 64px var(--gutter);
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* 页脚：留白收尾，克制简洁 */
.gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 28px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.gallery-footer p {
  margin: 0;
}

.gallery-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.gallery-footer a:hover {
  color: var(--ink);
}

/* 暗房全屏灯箱：顶部栏 + 居中照片 + 底部双栏说明与同组缩略图 */
.lightbox {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface-backdrop);
  color: var(--ink);
  box-shadow: none;
  overflow: hidden;
}

.lightbox::backdrop {
  background: oklch(8% 0.008 60 / 0.96);
}

.lightbox-container {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  padding: 16px clamp(16px, 4vw, 40px) 24px;
  gap: 16px;
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1160px, 100%);
  margin-inline: auto;
}

.lightbox-counter-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.lightbox-index {
  color: var(--accent);
}

.lightbox-subcount {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--ink-secondary);
  font-size: 12px;
}

.lightbox-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lightbox-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: var(--surface-raised);
  font-size: 13px;
  color: var(--ink-secondary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lightbox-live-btn:hover,
.lightbox-live-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.live-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.lightbox-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lightbox-close:hover {
  background: var(--surface-raised);
  color: var(--ink);
}

.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding-inline: 56px;
  overflow: hidden;
}

.lightbox-figure {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img,
.lightbox-video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox-video {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox-media-wrap.is-live-playing .lightbox-video {
  opacity: 1;
}

.stage-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.stage-nav:hover:not(:disabled) {
  background: var(--surface-raised);
  color: var(--ink);
}

.stage-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.stage-prev { left: 0; }
.stage-next { right: 0; }
.stage-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* 底部双栏说明：左侧宋体标题与正文笔记，右侧元信息与同组缩略图 */
.lightbox-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px 40px;
  width: min(1160px, 100%);
  margin-inline: auto;
  padding-top: 8px;
}

.lightbox-caption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lightbox-title {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.lightbox-note {
  margin: 0;
  max-width: 44em;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.lightbox-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.lightbox-meta-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 24px;
  margin: 0;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 12px;
  color: var(--muted);
}

.meta-value {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.meta-value.is-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.lightbox-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thumb-btn {
  position: relative;
  width: 56px;
  height: 38px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface-frame);
  opacity: 0.6;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.thumb-btn:hover {
  opacity: 0.9;
}

.thumb-btn.is-active {
  border-color: var(--accent);
  opacity: 1;
}

.thumb-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 响应式移动端 */
@media (max-width: 760px) {
  .gallery-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 16px;
    padding-bottom: 28px;
  }

  .gallery-intro {
    justify-self: start;
    align-items: flex-start;
    text-align: left;
  }

  .filter-bar {
    gap: 18px;
  }

  .photo-card {
    flex-basis: min(320px, calc(100vw - 40px));
    padding: 26px 12px 26px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-meta-line {
    font-size: 12px;
  }

  .lightbox-container {
    padding: 12px 16px 20px;
    gap: 12px;
  }

  .lightbox-stage {
    padding-inline: 36px;
  }

  .stage-nav {
    width: 36px;
    height: 36px;
  }

  .lightbox-info {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lightbox-aside {
    align-items: flex-start;
  }

  .lightbox-meta-list {
    justify-content: flex-start;
    gap: 10px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-img,
  .card-video,
  .lightbox-video {
    transition: none !important;
  }
}
