:root {
  /* ==================== 月白底色与墨色层次 ==================== */
  --color-bg: oklch(0.985 0.002 240);
  --color-surface: oklch(0.968 0.003 230);
  --color-note: oklch(0.970 0.004 80);
  --color-ink: oklch(0.145 0.012 240);
  --color-muted: oklch(0.400 0.012 240);
  --color-soft: oklch(0.580 0.008 240);
  --color-primary: oklch(0.300 0.044 240);
  --color-accent: oklch(0.430 0.125 28);
  --color-line: oklch(0.910 0.003 240);
  --color-line-soft: oklch(0.940 0.002 240);

  --space-page: clamp(24px, 6vw, 96px);
  --card-gap: clamp(32px, 5vw, 64px);
  color-scheme: light;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", serif;
  background: var(--color-bg);
  color: var(--color-ink);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--color-bg);
}

/* 宣纸纤维肌理 — 极克制 */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(ellipse 900px 600px at 85% 8%, oklch(0.95 0.006 240 / 0.22), transparent 70%),
    var(--color-bg);
}

/* 远景淡墨雾气 — 仅两团，更克制 */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 43% 57% 41% 59% / 57% 45% 55% 43%;
  filter: blur(120px);
  will-change: transform, border-radius;
}

body::before {
  top: -30%;
  left: -22%;
  width: min(70vw, 900px);
  height: min(70vw, 900px);
  background: radial-gradient(circle, oklch(0.30 0.04 240 / 0.35) 0%, transparent 72%);
  opacity: 0.06;
  animation: morphing-ink 34s infinite alternate ease-in-out;
}

body::after {
  right: -24%;
  bottom: -32%;
  width: min(60vw, 800px);
  height: min(60vw, 800px);
  background: radial-gradient(circle, oklch(0.18 0.01 240 / 0.28) 0%, transparent 72%);
  opacity: 0.045;
  animation: morphing-ink 42s -10s infinite alternate ease-in-out;
}

.ink-filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* 不再使用中间云雾层 */
.ink-cloud {
  display: none;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

main {
  position: relative;
  z-index: 1;
  overflow: clip;
}

/* ==================== 首屏 — 纵向叙事 ==================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(56px, 10vw, 140px) var(--space-page) clamp(40px, 4vw, 60px);
}

.hero-text {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: clamp(36px, 5vw, 72px);
  animation: title-in 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.exhibit-meta,
.kept-line,
.site-footer,
.section-head p,
.site-mark {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* 书脊竖排标签 — 固定在左侧边缘 */
.site-mark {
  position: absolute;
  top: clamp(64px, 10vw, 150px);
  left: clamp(10px, 2vw, 28px);
  margin: 0;
  color: var(--color-accent);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  font-weight: 500;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  opacity: 0.55;
  animation: title-in 1400ms 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif", Georgia, serif;
  font-size: clamp(3.8rem, 9vw, 8rem);
  line-height: 0.88;
  letter-spacing: -0.025em;
  text-wrap: balance;
  font-weight: 300;
  font-style: normal;
}

/* 全宽发丝线 — 代替短朱砂条 */
.hero-hairline {
  width: 100%;
  max-width: 120px;
  height: 1px;
  margin: clamp(24px, 3.5vw, 40px) auto;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-accent) 30%,
    var(--color-accent) 70%,
    transparent
  );
  opacity: 0.45;
}

h1::after {
  display: none;
}

.intro {
  max-width: 22rem;
  margin: 0 auto;
  color: var(--color-muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.85;
  text-wrap: pretty;
}

/* ==================== 呼吸节点 — 引言条 ==================== */
.pull-quote {
  max-width: 560px;
  margin: clamp(56px, 8vw, 120px) auto clamp(24px, 4vw, 48px);
  padding: clamp(24px, 4vw, 40px) clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  text-align: center;
}

.pull-quote p {
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif", Georgia, serif;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-style: italic;
  font-weight: 400;
  color: var(--color-muted);
  letter-spacing: 0.04em;
  line-height: 2;
}

/* ==================== 画廊网格 ==================== */
.hero-cabinet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--card-gap);
  align-items: stretch;
  align-self: stretch;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* 第一件展品全宽 — 画廊的视觉中心 */
.hero-cabinet .exhibit-card:first-child {
  grid-column: 1 / -1;
}

.collection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--card-gap);
  align-items: stretch;
  max-width: 1400px;
  margin: 0 auto;
}

/* ==================== 展品卡片 — 纵向画框 ==================== */
.exhibit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
  translate: 0 var(--parallax-y, 0);
  will-change: translate;
}

/* JS 已加载时：隐藏收藏区卡片等待滚动入场 */
.js-ready .collection-grid .exhibit-card {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--stagger, 0) * 100ms);
}

/* 首屏展品用 animation 入场（不依赖 JS） */
.hero-cabinet .exhibit-card {
  animation: record-in 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--stagger, 0) * 120ms + 400ms);
}

/* JS 滚动入场触发 */
.js-ready .collection-grid .exhibit-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== 展品画框 ==================== */
.exhibit-media {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--color-surface);
  border-radius: 3px;
  overflow: hidden;
  box-shadow:
    0 1px 3px oklch(0 0 0 / 0.04),
    0 0 0 1px oklch(0 0 0 / 0.03);
  transition:
    box-shadow 800ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* 全宽首件展品的画幅 */
.hero-cabinet .exhibit-card:first-child .exhibit-media {
  aspect-ratio: 16 / 7;
}

/* 图片 — 全彩展示，极轻去饱和保留水墨一致感 */
.exhibit-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.02);
  transform: scale(1.01);
  transition:
    transform 1.4s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 悬停：全彩 + 微妙放大 + 墨晕阴影 */
.exhibit-card:hover .exhibit-media {
  transform: translateY(-5px);
  box-shadow:
    0 16px 40px oklch(0.18 0.01 240 / 0.08),
    0 4px 12px oklch(0.18 0.01 240 / 0.04),
    0 0 0 1px oklch(0.18 0.01 240 / 0.05);
}

.exhibit-card:hover .exhibit-media img {
  filter: saturate(1.05) contrast(1.04);
  transform: scale(1.035);
}

/* 墨化滤镜激活状态 */
.exhibit-card.ink-active .exhibit-media img {
  filter: url("#ink-bleed-filter") saturate(1.05) contrast(1.04);
}

/* 空图回退 */
.exhibit-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  background:
    linear-gradient(160deg, var(--color-surface), oklch(0.95 0.004 240));
}

.exhibit-fallback span {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  letter-spacing: -0.03em;
  opacity: 0.35;
}

/* ==================== 展签（卡片文字区） ==================== */
.exhibit-copy {
  min-width: 0;
  padding: clamp(14px, 2vw, 20px) 2px 0;
}

.exhibit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--color-muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* 黛色链接下划线动效 */
.source-link {
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
}

.source-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.source-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.exhibit-card h2,
.section-head h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
  font-weight: 400;
}

.exhibit-card h2 {
  max-width: 18em;
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  font-weight: 500;
}

/* 全宽首件展品的标题更大 */
.hero-cabinet .exhibit-card:first-child h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.exhibit-card p {
  max-width: 36rem;
  margin: 8px 0 0;
  color: oklch(0.340 0.010 240);
  font-size: 0.9rem;
  line-height: 1.8;
  text-wrap: pretty;
}

.exhibit-description {
  white-space: pre-line;
}

.kept-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin-top: 14px !important;
  color: var(--color-soft) !important;
  font-size: 0.73rem !important;
  line-height: 1.45 !important;
}

.kept-line span {
  color: var(--color-accent);
}

/* ==================== 札记类 — 纸签展品 ==================== */
.exhibit-text-only .exhibit-copy {
  flex: 1;
  min-height: clamp(200px, 22vw, 320px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--color-line-soft);
  border-left: 2px solid var(--color-accent);
  border-radius: 3px;
  background:
    linear-gradient(175deg, oklch(0.988 0.003 80), var(--color-note));
  padding: clamp(28px, 4vw, 44px);
  transition:
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 800ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.02);
}

.exhibit-card:hover.exhibit-text-only .exhibit-copy {
  transform: translateY(-5px);
  box-shadow:
    0 16px 36px oklch(0.43 0.125 28 / 0.06),
    0 0 0 1px oklch(0.43 0.125 28 / 0.05);
}

.ink-active.exhibit-text-only .exhibit-copy {
  filter: url("#ink-bleed-filter");
}

/* ==================== 收藏区 ==================== */
.collection {
  padding: clamp(60px, 10vw, 140px) var(--space-page);
  border-top: 1px solid var(--color-line);
}

.section-head {
  max-width: 1400px;
  margin: 0 auto clamp(40px, 6vw, 72px);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.section-head h2 {
  font-size: clamp(2.2rem, 5.5vw, 4.8rem);
}

.section-head p {
  max-width: 26rem;
  margin: 0;
  color: var(--color-muted);
  line-height: 1.75;
}

/* ==================== 页脚 ==================== */
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(40px, 8vw, 100px);
  padding: 28px var(--space-page) 40px;
  border-top: 1px solid var(--color-line-soft);
  color: var(--color-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.site-footer p {
  margin: 0;
  max-width: 42rem;
}

.filing-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
}

.icp-link,
.public-security-record a {
  text-decoration: none;
  color: var(--color-soft);
  transition: color 300ms ease;
}

.public-security-record {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.public-security-record > img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.icp-link:hover,
.public-security-record a:hover {
  color: var(--color-primary);
}


/* ==================== 入场与流变动画 ==================== */
@keyframes title-in {
  from {
    opacity: 0.001;
    filter: blur(5px);
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes record-in {
  from {
    opacity: 0.001;
    filter: blur(4px);
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes morphing-ink {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    border-radius: 43% 57% 41% 59% / 57% 45% 55% 43%;
  }
  50% {
    transform: translate3d(6%, 4%, 0) rotate(90deg) scale(1.08);
    border-radius: 70% 30% 52% 48% / 60% 40% 60% 40%;
  }
  100% {
    transform: translate3d(-4%, -6%, 0) rotate(180deg) scale(0.95);
    border-radius: 35% 65% 30% 70% / 40% 60% 50% 50%;
  }
}

/* ==================== 响应式 ==================== */
@media (max-width: 960px) {
  .hero {
    min-height: auto;
    padding-top: clamp(60px, 10vw, 100px);
  }

  .hero-cabinet,
  .collection-grid {
    grid-template-columns: 1fr;
  }

  .hero-cabinet .exhibit-card:first-child {
    grid-column: 1;
  }

  .hero-cabinet .exhibit-card:first-child .exhibit-media {
    aspect-ratio: 3 / 2;
  }
}

@media (max-width: 760px) {
  body::before,
  body::after {
    width: 110vw;
    height: 110vw;
    filter: blur(90px);
    opacity: 0.04;
  }

  .hero-text {
    text-align: left;
    margin: 0;
  }

  .site-mark {
    position: static;
    writing-mode: horizontal-tb;
    text-orientation: initial;
    margin-bottom: clamp(12px, 2vw, 20px);
    opacity: 0.8;
  }

  .hero-hairline {
    margin-left: 0;
    margin-right: auto;
  }

  h1::after {
    display: none;
  }

  .section-head,
  .site-footer {
    display: block;
  }

  .section-head p,
  .filing-links {
    margin-top: 12px;
  }

  .filing-links {
    justify-content: flex-start;
  }

  .exhibit-text-only .exhibit-copy {
    min-height: 180px;
  }
}

@media (max-width: 520px) {
  .hero {
    padding-inline: 18px;
  }

  .hero-cabinet,
  .collection-grid {
    gap: 24px;
  }

  .exhibit-media {
    aspect-ratio: 4 / 3;
  }
}

/* ==================== reduced-motion ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  body::before,
  body::after {
    animation: none !important;
  }

  .exhibit-card {
    opacity: 1 !important;
    transform: none !important;
    translate: 0 0 !important;
  }
}
