:root {
  --paper: #f1eee6;
  --paper-deep: #e7e1d6;
  --ink: #24221e;
  --muted: #706b62;
  --line: rgba(36, 34, 30, 0.18);
  --accent: #986c55;
  --accent-deep: #7d5643;
  --accent-soft: rgba(152, 108, 85, 0.12);
  --display: "Iowan Old Style", "Baskerville", "Noto Serif SC", "Songti SC", serif;
  --sans: "Avenir Next", "Segoe UI", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-soft: 0 1px 2px rgba(36, 34, 30, 0.05), 0 10px 26px -12px rgba(36, 34, 30, 0.22);
  --shadow-lift: 0 4px 10px rgba(36, 34, 30, 0.08), 0 26px 52px -18px rgba(36, 34, 30, 0.34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
img, video { max-width: 100%; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 18px;
  top: -80px;
  z-index: 40;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 18px; }

.site-header {
  width: min(100% - 48px, 1480px);
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: grid;
  gap: 2px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.wordmark span:last-child { color: var(--muted); }
.top-nav { display: flex; align-items: center; gap: 34px; font-size: 12px; }
.top-nav a { text-decoration: none; position: relative; }
.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transition: right 0.35s var(--ease);
}
.top-nav a:hover::after { right: 0; }
.nav-count { color: var(--muted); font-variant-numeric: tabular-nums; }

.hero {
  width: min(100% - 48px, 1480px);
  min-height: calc(100dvh - 88px);
  margin: 0 auto;
  padding: 7vh 0 6vh;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(430px, 1.55fr) 180px;
  grid-template-rows: 1fr auto;
  gap: 28px 5vw;
  align-items: center;
}
.hero-copy { align-self: center; padding-left: clamp(0px, 3vw, 48px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}
h1, h2, h3, p { text-wrap: pretty; }
.hero h1 {
  margin: 0;
  font: 400 clamp(64px, 7vw, 112px) / 0.82 var(--display);
  letter-spacing: -0.075em;
}
.hero h1 em { color: var(--accent); font-weight: 400; }
.hero-intro {
  max-width: 30em;
  margin: 38px 0 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.text-link { display: inline-flex; gap: 36px; padding-bottom: 7px; border-bottom: 1px solid currentColor; text-decoration: none; font-size: 12px; }
.text-link span { transition: transform 0.35s var(--ease); }
.text-link:hover span { transform: translate(4px, 4px); }

.hero-collage {
  height: min(67vh, 720px);
  min-height: 480px;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  grid-template-rows: 0.72fr 1.28fr;
  gap: 14px;
  align-self: center;
}
.hero-media { position: relative; overflow: hidden; background: var(--paper-deep); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); transition: box-shadow 0.5s var(--ease), transform 0.5s var(--ease); }
.hero-media button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.hero-media:first-child { grid-row: 1 / 3; }
.hero-media:nth-child(3) { width: 82%; justify-self: end; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.hero-media:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.hero-media:hover img, .hero-media:hover video { transform: scale(1.04); }
.hero-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  color: #f8f4ed;
  background: rgba(31, 29, 26, 0.6);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}
.hero-meta { align-self: end; display: grid; gap: 22px; padding-bottom: 18px; }
.hero-meta div { padding-top: 11px; border-top: 1px solid var(--line); }
.hero-meta strong { display: block; font: 400 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.hero-meta span, .hero-meta p { color: var(--muted); font-size: 10px; line-height: 1.7; letter-spacing: 0.08em; }
.hero-meta p { margin: 18px 0 0; }

.section-shell { width: min(100% - 48px, 1320px); margin: 0 auto; }
.featured { padding: 160px 0 190px; }
.section-heading {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 8vw;
  align-items: end;
  margin-bottom: 72px;
}
.section-heading h2, .archive-heading h2 {
  margin: 0;
  font: 400 clamp(46px, 5vw, 76px) / 0.98 var(--display);
  letter-spacing: -0.045em;
}
.section-heading > p { max-width: 31em; margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.featured-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 100px 3vw;
  align-items: start;
}
.featured-card { margin: 0; }
.featured-card:nth-child(4n + 2) { margin-top: 140px; }
.featured-card:nth-child(4n + 3) { width: 74%; margin-left: 13%; }
.featured-card:nth-child(4n + 4) { width: 88%; justify-self: end; }
.featured-card button { width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.featured-image { overflow: hidden; background: var(--paper-deep); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); transition: box-shadow 0.55s var(--ease), transform 0.55s var(--ease); }
.featured-image img { width: 100%; height: auto; display: block; transition: transform 0.8s var(--ease), filter 0.8s var(--ease); }
.featured-card button:hover .featured-image { box-shadow: var(--shadow-lift); transform: translateY(-4px); }
.featured-card button:hover img { transform: scale(1.03); filter: saturate(1.05); }
.featured-card button:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.media-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-top: 16px; padding: 0 2px; font-size: 12px; }
.media-caption span:first-child { font-family: var(--display); font-size: 15px; letter-spacing: -0.01em; }
.media-caption span:last-child { color: var(--muted); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }

.archive { padding: 20px 0 160px; }
.archive-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.result-count { margin: 0 0 7px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.filter-zone { position: sticky; top: 0; z-index: 10; margin: 0 -16px 52px; padding: 18px 16px 16px; background: rgba(241, 238, 230, 0.82); backdrop-filter: blur(18px) saturate(1.1); border-bottom: 1px solid var(--line); }
.primary-filters, .category-filters { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.primary-filters::-webkit-scrollbar, .category-filters::-webkit-scrollbar { display: none; }
.category-filters { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.filter-button {
  flex: 0 0 auto;
  padding: 8px 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.filter-button:hover { color: var(--ink); border-color: rgba(36,34,30,.42); transform: translateY(-1px); }
.filter-button:active { transform: scale(0.97); }
.filter-button.is-active { color: var(--paper); background: var(--ink); border-color: var(--ink); box-shadow: 0 6px 16px -8px rgba(36,34,30,.6); }
.category-filters .filter-button.is-active { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 16px -8px rgba(152,108,85,.7); }

.gallery { columns: 3 280px; column-gap: 24px; }
.gallery-item { break-inside: avoid; margin: 0 0 24px; animation: reveal 0.7s var(--ease) both; animation-delay: min(calc(var(--index) * 35ms), 500ms); }
.media-button { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}
.media-frame img { display: block; width: 100%; height: auto; transition: transform 0.75s var(--ease), opacity 0.35s ease; }
.media-button:hover .media-frame { box-shadow: var(--shadow-lift); transform: translateY(-4px); }
.media-button:hover .media-frame img { transform: scale(1.05); }
.media-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: var(--radius); }
.video-badge { position: absolute; inset: auto 10px 10px auto; z-index: 3; min-width: 42px; padding: 6px 9px; color: #f7f2ea; background: rgba(32,30,27,.68); border-radius: 999px; font-size: 9px; letter-spacing: 0.04em; text-align: center; backdrop-filter: blur(8px); }
.video-badge::before { content: "▶ "; }

/* 常显分类角标（分类在前、一眼可见） */
.media-cat-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  padding: 5px 11px;
  color: #f6f1e8;
  background: rgba(32, 30, 27, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.media-button:hover .media-cat-tag { opacity: 0; transform: translateY(-3px); }

/* 悬停信息遮罩 */
.media-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 16px 15px 15px;
  color: #f6f1e8;
  background: linear-gradient(to top, rgba(24, 22, 19, 0.82) 0%, rgba(24, 22, 19, 0.32) 42%, rgba(24, 22, 19, 0) 72%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.media-button:hover .media-overlay { opacity: 1; }
.media-overlay-cat { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: #d8cfc2; transform: translateY(6px); transition: transform 0.45s var(--ease); }
.media-overlay-title { font-family: var(--display); font-size: 15px; line-height: 1.3; letter-spacing: -0.01em; transform: translateY(6px); transition: transform 0.45s var(--ease) 0.03s; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-button:hover .media-overlay-cat, .media-button:hover .media-overlay-title { transform: translateY(0); }
@media (hover: none) {
  .media-overlay { opacity: 1; background: linear-gradient(to top, rgba(24, 22, 19, 0.78) 0%, rgba(24, 22, 19, 0.1) 46%, rgba(24, 22, 19, 0) 66%); }
  .media-overlay-cat, .media-overlay-title { transform: none; }
}
.media-error { min-height: 220px; display: grid; place-items: center; padding: 24px; color: var(--muted); border: 1px solid var(--line); font-size: 11px; text-align: center; }
.empty-state { min-height: 42vh; place-items: center; align-content: center; text-align: center; }
.empty-state:not([hidden]) { display: grid; }
.empty-mark { font: 400 58px var(--display); color: var(--accent); }
.empty-state h3 { margin: 16px 0 6px; font: 400 30px var(--display); }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }

.site-footer { width: min(100% - 48px, 1480px); margin: 0 auto; padding: 38px 0 48px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: 0.12em; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink); text-decoration: none; }

.lightbox { position: fixed; inset: 0; z-index: 30; color: #eee9e0; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(29, 27, 24, 0.96); }
.lightbox-panel { position: relative; width: 100%; height: 100%; padding: 22px 28px 26px; display: grid; grid-template-rows: auto 1fr; }
.lightbox-toolbar { display: flex; justify-content: space-between; align-items: start; gap: 22px; min-height: 72px; }
.lightbox-category { margin: 0 0 5px; color: #aaa49b; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; }
.lightbox-toolbar h2 { margin: 0; font: 400 clamp(20px, 2.6vw, 34px) var(--display); }
.lightbox-actions { display: flex; align-items: center; gap: 18px; color: #aaa49b; font-size: 10px; }
.icon-button, .lightbox-nav { display: grid; place-items: center; color: inherit; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: transparent; cursor: pointer; transition: transform .25s var(--ease), background .25s ease; }
.icon-button { width: 42px; height: 42px; font-size: 23px; }
.icon-button:hover, .lightbox-nav:hover { background: rgba(255,255,255,.09); }
.icon-button:active, .lightbox-nav:active { transform: scale(.94); }
.lightbox-stage { min-height: 0; display: grid; place-items: center; padding: 0 82px 8px; }
.lightbox-stage img, .lightbox-stage video { max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; border-radius: 8px; box-shadow: 0 24px 70px rgba(12,11,10,.34); }
.lightbox-nav { position: absolute; top: 50%; width: 48px; height: 48px; transform: translateY(-50%); }
.lightbox-nav:active { transform: translateY(-50%) scale(.94); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
body.lightbox-open { overflow: hidden; }

.skeleton { position: relative; overflow: hidden; background: var(--paper-deep); border-radius: var(--radius); }
.hero-skeleton, .featured-skeleton { border-radius: var(--radius-lg); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 25%, rgba(255,255,255,.45) 45%, transparent 65%); transform: translateX(-100%); animation: shimmer 1.6s infinite; }
.hero-skeleton-a { grid-row: 1 / 3; }
.hero-skeleton-c { width: 82%; justify-self: end; }
.featured-skeleton { height: 520px; }
.gallery-skeleton { height: 360px; margin-bottom: 22px; break-inside: avoid; }
.gallery-skeleton:nth-child(2) { height: 470px; }
.gallery-skeleton:nth-child(3) { height: 310px; }
.gallery-skeleton:nth-child(4) { height: 420px; }
.noscript { margin: 20px; padding: 16px; color: #fff; background: #7d3e34; }

@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 0.8fr 1.2fr; grid-template-rows: auto auto; gap: 40px; }
  .hero-copy { padding-left: 0; }
  .hero-collage { min-height: 420px; height: 56vh; }
  .hero-meta { grid-column: 1 / 3; grid-template-columns: repeat(3, 1fr); }
  .hero-meta p { margin: 0; }
  .featured { padding-block: 120px 150px; }
}

@media (max-width: 767px) {
  .site-header, .hero, .section-shell, .site-footer { width: calc(100% - 32px); }
  .site-header { height: 70px; }
  .top-nav a { display: none; }
  .hero { min-height: auto; padding: 58px 0 90px; display: block; }
  .hero-copy { padding: 0; }
  .hero h1 { font-size: clamp(66px, 23vw, 90px); }
  .hero-intro { margin-top: 30px; }
  .hero-collage { height: 68vh; min-height: 480px; margin-top: 52px; grid-template-columns: 1.25fr .75fr; gap: 8px; }
  .hero-meta { margin-top: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .hero-meta p { display: none; }
  .section-heading { display: block; margin-bottom: 46px; }
  .section-heading > p { margin-top: 26px; }
  .section-heading h2, .archive-heading h2 { font-size: 48px; }
  .featured { padding: 80px 0 120px; }
  .featured-grid { grid-template-columns: 1fr; gap: 68px; }
  .featured-card:nth-child(n) { width: 100%; margin: 0; }
  .featured-card:nth-child(even) { width: 82%; margin-left: 18%; }
  .archive { padding-bottom: 100px; }
  .archive-heading { display: block; }
  .result-count { margin: 20px 0 0; }
  .filter-zone { margin-bottom: 34px; }
  .gallery { columns: 2 140px; column-gap: 10px; }
  .gallery-item { margin-bottom: 28px; }
  .media-caption { display: block; margin-top: 9px; font-size: 10px; }
  .media-caption span { display: block; }
  .media-caption span:last-child { margin-top: 3px; }
  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer p:nth-child(2) { display: none; }
  .lightbox-panel { padding: 16px; }
  .lightbox-stage { padding: 0 0 62px; }
  .lightbox-nav { top: auto; bottom: 14px; }
  .lightbox-prev { left: calc(50% - 58px); }
  .lightbox-next { right: calc(50% - 58px); }
}

@media (max-width: 420px) {
  .gallery { columns: 1; }
  .featured-card:nth-child(even) { width: 88%; margin-left: 12%; }
}

/* 静态视频封面避免在列表页同时解码几十段视频 */
.media-frame .video-thumb, .featured-image .video-thumb {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper-deep);
  transition: transform 0.75s var(--ease), opacity 0.35s ease, filter 0.8s var(--ease);
}
.media-button:hover .media-frame .video-thumb { transform: scale(1.025); }
.featured-card button:hover .featured-image .video-thumb { transform: scale(1.018); filter: saturate(1.04); }

/* 视频播放指示 */
.media-frame:has(.video-thumb), .featured-image:has(.video-thumb) { position: relative; }
.media-frame:has(.video-thumb)::after, .featured-image:has(.video-thumb)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(32, 30, 27, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(3px);
  pointer-events: none;
  transition: transform 0.3s var(--ease), background 0.3s ease;
}
.media-frame:has(.video-thumb)::before, .featured-image:has(.video-thumb)::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-42%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #f7f2ea;
  pointer-events: none;
}
.media-button:hover .media-frame:has(.video-thumb)::after { transform: translate(-50%, -50%) scale(1.1); background: rgba(152, 108, 85, 0.75); }

/* 搜索 */
.search-zone { position: relative; margin: 0 0 16px; }
.search-zone::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.5;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23706b62' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}
.search-input {
  width: 100%;
  padding: 13px 18px 13px 42px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.search-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.search-input::placeholder { color: var(--muted); }

/* 分类计数 */
.filter-button .chip-count { margin-left: 7px; font-variant-numeric: tabular-nums; opacity: 0.62; font-size: 10px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
