/* 运动会影像档案 · Phase 1 视觉规范落地（暗房皮肤，无皮肤切换） */

:root {
  --color-bg: #141210;
  --color-surface: #1C1917;
  --color-surface-raised: #24201D;
  --color-line: #332E29;
  --color-line-strong: #4A423A;
  --color-text: #F2EDE6;
  --color-text-muted: #A79E93;
  --color-text-faint: #756C62;
  --color-accent: #E3B85C;
  --color-accent-strong: #F2D493;
  --color-accent-on: #1B1407;

  --shadow-float: 0 18px 48px rgba(10, 8, 7, .55);
  --shadow-inset-hairline: inset 0 0 0 1px rgba(242, 237, 230, .12);
  --shadow-inset-accent: inset 0 0 0 1px var(--color-accent);
  --shadow-nav: 0 8px 24px rgba(10, 8, 7, .28);

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px;--space-16: 64px;
  --space-24: 96px;--space-32: 128px;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans:  "Outfit", "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono:  "SFMono-Regular", "JetBrains Mono", "Space Mono", ui-monospace, Menlo, monospace;

  --nav-bg: rgba(20, 18, 16, .86);
  --lb-overlay: rgba(12, 10, 9, .96);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--color-bg); }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; }

.shell { max-width: 1440px; margin-inline: auto; padding-inline: var(--space-16); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.micro {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  line-height: 1.2; letter-spacing: .12em; color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed; left: var(--space-8); top: -100px; z-index: 200;
  padding: 12px 16px; background: var(--color-surface-raised);
  color: var(--color-text); border: 1px solid var(--color-accent);
  font-size: 14px; transition: top 150ms ease-out;
}
.skip-link:focus { top: var(--space-2); }

/* ---------- 吸顶导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: 64px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
  box-shadow: var(--shadow-nav);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: var(--space-8); }
.brand {
  display: inline-flex; align-items: baseline; gap: var(--space-3);
  font-family: var(--font-serif); font-size: 20px; font-weight: 600;
  letter-spacing: -.01em; color: var(--color-text); white-space: nowrap;
}
.brand__meta { font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: .12em; color: var(--color-text-faint); font-variant-numeric: tabular-nums; }
.nav { margin-left: auto; display: flex; gap: var(--space-8); }
.nav__link {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  font-size: 14px; font-weight: 500; letter-spacing: .04em;
  color: var(--color-text-muted); transition: color 150ms ease-out;
}
.nav__link:hover { color: var(--color-text); }
.nav__link[aria-current="true"] { color: var(--color-accent); }
.nav__link[aria-current="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px;
  height: 2px; background: var(--color-accent);
}
.menu-toggle, .menu__panel { display: none; }

/* ---------- 报头（纯文字，不是 Hero） ---------- */
.masthead {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-6); align-items: start;
  min-height: 280px; padding: var(--space-16) 0 var(--space-12);
  border-bottom: 1px solid var(--color-line); scroll-margin-top: 80px;
}
.masthead__lead { grid-column: 1 / span 6; }
.masthead__rule { display: block; width: 48px; height: 3px; background: var(--color-accent); margin-bottom: var(--space-6); }
.masthead h1 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-serif); font-size: 56px; font-weight: 700;
  line-height: 1.12; letter-spacing: -.02em; color: var(--color-text);
}
.masthead p { margin: 0; font-size: 16px; line-height: 1.75; color: var(--color-text-muted); }
.masthead__meta {
  grid-column: 9 / span 4; justify-self: end;
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2);
  text-align: right;
}
.masthead__meta span:not(.micro) { font-size: 14px; line-height: 1.4; color: var(--color-text-muted); }

/* ---------- 筛选 ---------- */
.filter { position: relative; padding: var(--space-4) 0; border-bottom: 1px solid var(--color-line); scroll-margin-top: 80px; }
.filter__track { display: flex; align-items: center; gap: var(--space-8); }
.chip {
  position: relative; display: inline-flex; align-items: baseline; gap: var(--space-1);
  min-height: 44px; padding-bottom: 4px; border-bottom: 2px solid transparent;
  font-size: 14px; font-weight: 500; letter-spacing: .04em; white-space: nowrap;
  color: var(--color-text-muted);
  transition: color 150ms ease-out, border-color 150ms ease-out;
}
.chip sup {
  font-family: var(--font-mono); font-size: 11px; font-weight: 400;
  letter-spacing: .12em; color: inherit; font-variant-numeric: tabular-nums;
}
.chip:hover { color: var(--color-text); border-bottom-color: var(--color-line-strong); }
.chip[aria-current="true"] { color: var(--color-accent-strong); border-bottom-color: var(--color-accent); }
.chip[aria-current="true"] sup { color: var(--color-accent); }

/* ---------- 分区标题 ---------- */
.event { padding-top: var(--space-24); scroll-margin-top: 80px; }
.event:first-child { padding-top: var(--space-16); }
.event__head { padding-bottom: var(--space-3); margin-bottom: var(--space-8); border-bottom: 1px solid var(--color-line); }
.event__title {
  display: flex; align-items: center; gap: var(--space-3); margin: 0;
  font-family: var(--font-serif); font-size: 32px; font-weight: 700;
  line-height: 1.25; letter-spacing: -.01em; color: var(--color-text);
}
.event__bar { flex: none; width: 3px; height: 32px; background: var(--color-accent); }
.event__count {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px;
  font-weight: 600; letter-spacing: .12em; color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- 图流：5 张一循环的 12 栏刊版 ---------- */
.shot-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-6); row-gap: var(--space-16);
}
.shot { display: block; min-width: 0; color: inherit; scroll-margin-top: 80px; }
.shot--lead { grid-column: 1 / span 8; }
.shot--tall { grid-column: 10 / span 3; margin-top: 72px; }
.shot--mid  { grid-column: 2 / span 4; }
.shot--wide { grid-column: 6 / span 7; margin-top: 56px; }
.shot--end  { grid-column: 1 / span 7; }

.shot__media {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden; border-radius: var(--radius-sm); background: var(--color-surface);
}
/* 竖图保留原比例；落进宽槽时只限宽限高，栏位与偏移不变，不裁切 */
.shot--portrait .shot__media { aspect-ratio: 2156 / 3840; width: min(100%, 480px); max-height: 78vh; }
.shot__media img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  transition: transform 240ms ease-out;
}
.shot__caption {
  display: flex; align-items: baseline; gap: var(--space-3); margin-top: var(--space-3);
  font-size: 13px; line-height: 1.5; letter-spacing: .02em;
  color: var(--color-text-muted); white-space: nowrap; min-width: 0;
}
.shot__no {
  flex: none; font-family: var(--font-mono); font-size: 11px;
  color: var(--color-text-muted); font-variant-numeric: tabular-nums;
}
.shot__cat { flex: none; }
.shot__desc { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

@media (hover: hover) {
  .shot:hover .shot__media { box-shadow: var(--shadow-inset-hairline); }
  .shot:hover .shot__media img { transform: scale(1.02); }
  .shot:hover .shot__caption { color: var(--color-text); }
  .shot:hover .shot__no { color: var(--color-accent); }
}
.shot.is-active .shot__media { box-shadow: var(--shadow-inset-accent); }
.shot:focus-visible { outline-offset: 4px; }

.empty { padding: var(--space-16) 0; border-bottom: 1px solid var(--color-line); }
.empty p { margin: 0 0 var(--space-4); font-family: var(--font-serif); font-size: 32px; }
.empty a { font-size: 14px; color: var(--color-accent); text-decoration: underline; }

/* ---------- 页脚：5 / 3 / 4 非等宽三栏 ---------- */
.site-footer { margin-top: var(--space-32); border-top: 1px solid var(--color-line); }
.site-footer__inner {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-6); padding-top: var(--space-16); padding-bottom: var(--space-12);
}
.site-footer__col--a { grid-column: 1 / span 5; }
.site-footer__col--b { grid-column: 6 / span 3; display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer__col--c { grid-column: 9 / span 4; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3); }
.site-footer__line { margin: 0 0 var(--space-2); font-family: var(--font-serif); font-size: 20px; font-weight: 600; }
.site-footer__note { margin: 0; font-size: 13px; color: var(--color-text-muted); }
.footer__link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 14px; color: var(--color-text-muted);
  transition: color 150ms ease-out, border-color 150ms ease-out;
  border-bottom: 1px solid transparent;
}
.footer__link:hover { color: var(--color-text); border-bottom-color: var(--color-line-strong); }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-rows: auto 1fr auto; gap: var(--space-6);
  padding: var(--space-6) var(--space-8) calc(var(--space-6) + env(safe-area-inset-bottom));
  background: var(--lb-overlay);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: var(--shadow-float);
  opacity: 0; transition: opacity 180ms ease-out;
}
.lightbox.is-open { opacity: 1; }
.lightbox__top { display: flex; align-items: center; justify-content: space-between; }
.lightbox__counter { font-family: var(--font-mono); font-size: 13px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; flex: none;
  background: var(--color-surface); color: var(--color-text-muted);
  border: 1px solid var(--color-line-strong); border-radius: var(--radius-sm);
  font-size: 24px; line-height: 1; cursor: pointer;
  transition: color 150ms ease-out, background 150ms ease-out, border-color 150ms ease-out, transform 240ms ease-out;
}
.icon-btn:hover { color: var(--color-text); background: var(--color-surface-raised); border-color: var(--color-accent); }
.icon-btn:active { color: var(--color-accent); transform: translateY(1px); }
.lightbox__close { font-size: 24px; }
.lightbox__stage {
  position: relative; justify-self: center; align-self: center;
  width: min(92vw, 1600px); max-width: 100%;
  height: min(84vh, 1200px);
  /* 84vh 是图片上限；同时扣掉顶部计数/关闭与底部图注/胶片，避免控件被挤出视口 */
  height: min(84vh, 1200px, calc(100dvh - 240px));
}
.lightbox__stage img {
  position: absolute; inset: 0; margin: auto;
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: var(--radius-sm);
}
.lightbox__full { opacity: 0; box-shadow: var(--shadow-inset-hairline), var(--shadow-float); transition: opacity 200ms ease-out; }
.lightbox__full.is-visible { opacity: 1; }
.lightbox__placeholder { filter: blur(8px); opacity: .6; pointer-events: none; transition: filter 200ms ease-out, opacity 200ms ease-out; }
.lightbox__placeholder.is-sharp { filter: none; opacity: 1; }
.lightbox__placeholder.is-hidden { opacity: 0; }

.lightbox__bottom {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end; gap: var(--space-6);
  width: min(92vw, 1600px); justify-self: center;
}
.lightbox__info { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.lightbox__title { font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--color-text); }
.lightbox__desc { font-size: 13px; color: var(--color-text-muted); }
.lightbox__error { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); }
.lightbox__error button {
  min-height: 44px; padding: 0 var(--space-1); border: 0; background: none;
  font: inherit; color: var(--color-accent); text-decoration: underline; cursor: pointer;
}
.lightbox__nav { grid-column: 3; grid-row: 1; justify-self: end; display: flex; gap: var(--space-2); }
.lightbox__film { grid-column: 2; grid-row: 1; justify-self: center; display: flex; gap: var(--space-2); }
.film__item {
  position: relative; flex: none; width: 48px; height: 64px; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: var(--color-surface);
  opacity: .45; cursor: pointer; transition: opacity 150ms ease-out;
}
.film__item img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.film__item:hover, .film__item[aria-current="true"] { opacity: 1; }
.film__item[aria-current="true"]::before {
  content: ""; position: absolute; z-index: 1; left: 0; right: 0; top: 0;
  height: 2px; background: var(--color-accent);
}

.noscript { margin: 0; padding: var(--space-2) var(--space-8); font-size: 13px; color: var(--color-text-muted); }

/* ---------- 721–1024px：8 栏 ---------- */
@media (max-width: 1024px) {
  .shell { padding-inline: var(--space-8); }
  .masthead { grid-template-columns: repeat(8, minmax(0, 1fr)); min-height: 240px; }
  .masthead__lead { grid-column: 1 / span 5; }
  .masthead__meta { grid-column: 6 / span 3; }
  .masthead h1 { font-size: 48px; }
  .nav { gap: 20px; }

  .shot-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); row-gap: 48px; }
  .shot--lead { grid-column: 1 / span 8; }
  .shot--tall { grid-column: 6 / span 3; margin-top: 36px; }
  .shot--mid  { grid-column: 1 / span 3; }
  .shot--wide { grid-column: 3 / span 6; margin-top: 28px; }
  .shot--end  { grid-column: 1 / span 7; }
  .shot--portrait .shot__media { width: min(100%, 360px); }

  .lightbox__stage { width: 92vw; height: 78vh; height: min(78vh, calc(100dvh - 240px)); }
  .lightbox__bottom { width: 92vw; }
  .site-footer__col--a { grid-column: 1 / span 4; }
  .site-footer__col--b { grid-column: 5 / span 2; }
  .site-footer__col--c { grid-column: 7 / span 2; }
}

/* ---------- ≤720px：单列 ---------- */
@media (max-width: 720px) {
  .shell { padding-inline: 20px; }
  .site-header__inner { gap: var(--space-3); }
  .brand__meta { display: none; }
  .nav__link { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; margin-left: auto; padding: 0 var(--space-2);
    background: none; border: 0; color: var(--color-text-muted);
    font-size: 14px; font-weight: 500; cursor: pointer;
  }
  .menu-toggle[aria-expanded="true"] { color: var(--color-accent); }
  .menu__panel {
    position: absolute; top: 64px; left: 0; right: 0; z-index: 60;
    height: calc(100vh - 64px); height: calc(100dvh - 64px); display: none;
    flex-direction: column; align-items: flex-start; gap: var(--space-6);
    padding: var(--space-12) 20px; background: var(--color-bg);
  }
  .nav.is-open .menu__panel { display: flex; }
  .menu__link {
    display: inline-flex; align-items: center; min-height: 44px;
    font-family: var(--font-serif); font-size: 32px; color: var(--color-text);
  }
  .menu__link[aria-current="true"] { color: var(--color-accent); }

  .masthead { grid-template-columns: 1fr; min-height: 0; gap: var(--space-8); padding: var(--space-12) 0 var(--space-8); }
  .masthead__lead, .masthead__meta { grid-column: 1 / -1; justify-self: start; align-items: flex-start; text-align: left; }
  .masthead h1 { font-size: 36px; }
  .masthead__meta { flex-direction: row; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
  .masthead__meta span:not(.micro) { font-size: 13px; }

  .filter::after {
    content: ""; position: absolute; z-index: 1; top: 0; right: 0; bottom: 0;
    width: 24px; pointer-events: none;
    background: linear-gradient(to right, transparent, var(--color-bg));
  }
  .filter__track {
    overflow-x: auto; scroll-snap-type: x proximity;
    scrollbar-width: none; -ms-overflow-style: none; padding-right: 24px;
  }
  .filter__track::-webkit-scrollbar { display: none; }
  .chip { scroll-snap-align: start; }

  .event { padding-top: var(--space-16); }
  .event:first-child { padding-top: var(--space-12); }
  .event__title { font-size: 24px; }
  .shot-grid { grid-template-columns: 1fr; row-gap: 40px; }
  .shot-grid .shot { grid-column: 1 / -1; margin-top: 0; }
  .shot--portrait .shot__media { width: 100%; max-width: none; max-height: 78vh; }

  .site-footer { margin-top: var(--space-24); }
  .site-footer__inner { grid-template-columns: 1fr; gap: var(--space-8); }
  .site-footer__col--a, .site-footer__col--b, .site-footer__col--c { grid-column: 1 / -1; }
  .site-footer__col--c { align-items: flex-start; }

  .lightbox { padding: var(--space-4) 20px calc(var(--space-4) + env(safe-area-inset-bottom)); gap: var(--space-4); }
  .lightbox__stage { width: 96vw; height: 70vh; height: min(70vh, calc(100dvh - 300px)); }
  .lightbox__bottom { width: 100%; grid-template-columns: 1fr; gap: var(--space-4); justify-items: start; }
  .lightbox__info { grid-column: 1; grid-row: 1; }
  .lightbox__nav { grid-column: 1; grid-row: 2; justify-self: start; }
  .lightbox__film { grid-column: 1; grid-row: 3; justify-self: center; }
}

/* ---------- 触屏：取消 hover 缩放，改用 :active ---------- */
@media (hover: none) {
  .shot__media img { transition: none; }
  .shot:hover .shot__media { box-shadow: none; }
  .shot:hover .shot__media img { transform: none; }
  .shot:active .shot__media { opacity: .85; }
  .chip:hover:not([aria-current="true"]) { color: var(--color-text-muted); border-bottom-color: transparent; }
  .nav__link:hover:not([aria-current="true"]) { color: var(--color-text-muted); }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
