/* =========================================================
   浙里安行 · 设计令牌
   冷调石白 / 墨黑 / 单一朱砂强调色；统一 2px 圆角
   ========================================================= */

:root {
  --bg: #edeeea;
  --surface: #f7f7f4;
  --surface-2: #e2e3dd;
  --ink: #15171a;
  --ink-2: #3c4147;
  --ink-3: #6b7076;
  --line: #c9cbc4;
  --line-strong: #9aa098;
  --accent: #a8442e;
  --accent-ink: #fdf7f4;
  --accent-soft: rgba(168, 68, 46, 0.10);
  --overlay: rgba(12, 13, 15, 0.94);
  --mat: #e8e9e4;
  --skeleton-a: #e2e3dd;
  --skeleton-b: #d3d5cd;
  --radius: 2px;
  --shell: min(1440px, 100% - 5.5rem);
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, "Segoe UI", sans-serif;
  --mark: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 72px;
}

:root[data-theme="dark"] {
  --bg: #101215;
  --surface: #16191d;
  --surface-2: #1d2126;
  --ink: #e8e9e5;
  --ink-2: #b9bdb8;
  --ink-3: #83888a;
  --line: #2b3036;
  --line-strong: #454b52;
  --accent: #d4684d;
  --accent-ink: #17110f;
  --accent-soft: rgba(212, 104, 77, 0.16);
  --overlay: rgba(8, 9, 11, 0.96);
  --mat: #191c20;
  --skeleton-a: #1d2126;
  --skeleton-b: #262b31;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

.shell { width: var(--shell); margin-inline: auto; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ============================ 页头 ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  white-space: nowrap;
}
/* 页头标志直接用作品集标题手迹（assets/title-zheli-anxing.png）。
   原图为黑墨，深色主题下反相并回转色相，朱印仍为朱红。 */
.brand-logo {
  width: auto;
  height: 60px;
  transition: filter 0.4s var(--ease);
}
:root[data-theme="dark"] .brand-logo { filter: invert(1) hue-rotate(180deg); }
.brand-en {
  font-family: var(--mark);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--ink-3);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
  min-width: 0;
}
.site-nav a {
  position: relative;
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  padding: 0.35rem 0;
  transition: color 0.25s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.theme-toggle-track {
  position: relative;
  width: 26px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  display: inline-block;
}
.theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}
:root[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(12px);
  background: var(--accent);
}

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.85rem 1.9rem;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.15s var(--ease);
}
.btn-solid {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-solid:active { transform: translateY(1px); }

.text-link {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  font-size: 0.95rem;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.text-link:hover { color: var(--accent); border-color: var(--accent); }

/* 「查看全部」幽灵按钮：仅窄屏出现，负责把首页四件作品接到专题页 */
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost-invert { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost-invert:hover { border-color: #edeeea; background: #edeeea; color: #121417; }
.more-arrow {
  margin-left: 0.6rem;
  transition: transform 0.25s var(--ease);
}
.btn-ghost:hover .more-arrow { transform: translateX(3px); }
.more-row { display: none; margin-top: 2rem; }
.more-row-invert { text-align: left; }

/* ============================ 首屏 ============================ */
.hero {
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 3.5rem 0 4.5rem;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(2.25rem, 5vw, 4rem);
  align-items: center;
}

.hero-copy { max-width: 34rem; }

.hero-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  color: var(--accent);
  margin-bottom: 1.6rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.9rem, 6.4vw, 5.6rem);
  line-height: 1.14;
  letter-spacing: 0.06em;
  margin-bottom: 1.8rem;
}

.hero-lede {
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 2;
  color: var(--ink-2);
  max-width: 30rem;
  margin-bottom: 2.6rem;
}

/* 序：拆掉封面图后以文字立版——左侧大号「序」与朱砂印位，右侧多栏序文 */
.hero-preface {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: clamp(1.75rem, 3vw, 2.75rem);
}

.hero-preface > summary {
  list-style: none;
  cursor: pointer;
}
.hero-preface > summary::-webkit-details-marker { display: none; }
.hero-preface > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0.45rem;
  border-radius: 2px;
}

.preface-mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3rem, 5vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: 0.06em;
  color: var(--ink);
}
/* 朱砂印位：呼应原封面钤印，不做图案化处理 */
.preface-mark::after {
  content: "";
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 1.1rem;
  margin-left: 0.15rem;
  background: var(--accent);
  border-radius: 1px;
}

.preface-body {
  columns: 3;
  column-gap: clamp(1.75rem, 3.2vw, 3.5rem);
  padding-left: clamp(1.1rem, 2.2vw, 2rem);
  border-left: 1px solid var(--line);
  font-size: clamp(0.82rem, 0.95vw, 0.9rem);
  line-height: 2.05;
  color: var(--ink-2);
  max-width: 82rem;
}
.preface-body p { text-indent: 2em; }
.preface-body p + p { margin-top: 0.55rem; }
.preface-sign {
  text-indent: 2em;
  letter-spacing: 0.24em;
  color: var(--ink-3);
}

.media-caption {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

/* ============================ 通用媒体 ============================ */
.media {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--skeleton-a) 20%, var(--skeleton-b) 42%, var(--skeleton-a) 62%);
  background-size: 300% 100%;
  animation: skeleton 1.4s linear infinite;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.media.is-loaded::after { opacity: 0; }

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.media.is-loaded img { opacity: 1; }

@keyframes skeleton {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

/* ============================ 区块框架 ============================ */
.section { padding: clamp(5rem, 9vw, 9rem) 0; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-head h2,
.closing h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  line-height: 1.2;
  letter-spacing: 0.1em;
}

.section-note {
  color: var(--ink-2);
  line-height: 1.95;
  max-width: 38rem;
}

/* 标题中的数量标记 */
.count {
  font-family: var(--mark);
  font-size: 0.34em;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--accent);
  vertical-align: 0.55em;
  margin-left: 0.55em;
}
.count-invert { color: #c96046; }

/* ============================ 入展总览 ============================ */
.overview { padding-top: clamp(3.25rem, 5vw, 4.75rem); }

.overview-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 3rem;
  align-items: end;
  padding-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
  border-bottom: 1px solid var(--line);
}
.overview-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  line-height: 1.2;
  letter-spacing: 0.1em;
}

.overview-total {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  white-space: nowrap;
}
.overview-number {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.4rem, 7vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
}
.overview-unit {
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(1.75rem, 3vw, 2.5rem);
}

.overview-cell {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.overview-cell-number {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.2vw, 2.9rem);
  line-height: 1;
  letter-spacing: 0.02em;
}
.overview-cell-name {
  font-size: 0.84rem;
  letter-spacing: 0.2em;
  color: var(--ink-2);
}

.overview-cell-bar {
  display: block;
  height: 1px;
  margin-top: 0.9rem;
  background: var(--line);
}
.overview-cell-bar > span {
  display: block;
  height: 1px;
  width: var(--w, 0%);
  background: var(--accent);
  transition: width 1s var(--ease) 0.15s;
}
.reveal:not(.is-visible) .overview-cell-bar > span { width: 0; }

.overview-note {
  color: var(--ink-2);
  line-height: 1.95;
  max-width: 46rem;
}

/* ============================ 作品卡 ============================ */
.card-btn {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
}

.card-btn .media { transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease); }
.card-btn:hover .media,
.card-btn:focus-visible .media {
  transform: translateY(-6px);
  box-shadow: 0 26px 44px -30px rgba(10, 12, 14, 0.6);
}
.card-btn:active .media { transform: translateY(-2px); }

.card-body {
  display: block;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
.card-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.card-author {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  line-height: 1.65;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

.tag {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  line-height: 1.6;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-2);
}
.tag-group { border-color: var(--accent); color: var(--accent); }
.tag-invited { border-color: var(--line-strong); }

/* ============================ 分类辑 ============================ */
.cat-section {
  padding: clamp(4.5rem, 8vw, 8rem) 0;
  border-bottom: 1px solid var(--line);
}
.cat-section-photo { background: var(--surface); }

.cat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
  align-items: end;
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.cat-index {
  font-size: 0.76rem;
  letter-spacing: 0.34em;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.cat-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: 0.12em;
}

.cat-note {
  color: var(--ink-2);
  line-height: 1.95;
  max-width: 34rem;
}

/* 自然比例砖墙：书法与美术保留作品原始长宽比 */
.masonry {
  column-gap: clamp(1rem, 1.6vw, 1.75rem);
}
.masonry > li {
  break-inside: avoid;
  margin-bottom: clamp(1.5rem, 2.6vw, 2.6rem);
}
.masonry-calligraphy { column-count: 5; }
.masonry-painting { column-count: 4; }

.masonry .media {
  background: var(--mat);
  border: 1px solid var(--line);
}
.masonry .card-btn:hover .media,
.masonry .card-btn:focus-visible .media { transform: none; box-shadow: 0 20px 38px -28px rgba(10, 12, 14, 0.55); }

.masonry .card-title { font-size: 1rem; }
.masonry .card-author { letter-spacing: 0.1em; }

/* 摄影：等高行墙——每行等高、按封面原始比例定宽，不裁切画面
   行宽由 script.js 计算（layoutPhotoGrid），CSS 只负责排列与间隙 */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: clamp(1.25rem, 2.4vw, 2.5rem) clamp(1rem, 1.8vw, 1.75rem);
}
.photo-grid > li {
  flex: 1 1 16rem;
  min-width: 0;
}
.photo-grid .media {
  background: var(--surface-2);
}
.photo-grid .media img { object-fit: cover; object-position: center; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

/* ============================ 诗 ============================ */
.poetry-section {
  /* 显式深色，不能写成 var(--ink)：本区块把 --ink 局部改成了浅色文字色 */
  background: #121417;
  color: #edeeea;
  --ink: #edeeea;
  --ink-2: #b9bdb8;
  --ink-3: #83888a;
  --line: #363b40;
  --line-strong: #5a6066;
  --accent: #c96046;
  --skeleton-a: #1d2126;
  --skeleton-b: #262b31;
  padding: clamp(4.5rem, 8vw, 8rem) 0;
}

.cat-head-invert { border-bottom-color: var(--line); }

.poem-list {
  column-count: 3;
  column-gap: clamp(1.5rem, 4vw, 4rem);
}
.poem-item {
  break-inside: avoid;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0 0.6rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.poem-no {
  font-family: var(--mark);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  padding-top: 0.28rem;
}
.poem-name {
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
}
.poem-by {
  grid-column: 2;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin-top: 0.25rem;
}
.poem-item .tag { margin-left: 0.5rem; vertical-align: 0.16em; }

/* 专题页：篇目改为可展开的诗卡，栏数由多栏切到网格 */
.poem-list-full {
  column-count: initial;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: 0 clamp(1.75rem, 4vw, 4rem);
  align-items: start;
}

.poem-item-full {
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: start;
  padding: 1.15rem 0 1.35rem;
}

.poem-main { display: block; }
.poem-item-full .poem-name { font-weight: 500; }
.poem-item-full .poem-by { grid-column: auto; margin-top: 0.35rem; }

.poem-text {
  margin-top: 1rem;
  padding-left: 1.1rem;
  border-left: 1px solid var(--line);
}
.poem-text[hidden] { display: none; }
.poem-lines {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 2.15;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.poem-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0.3rem 0.85rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
              background-color 0.25s var(--ease);
}
.poem-toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.poem-toggle-mark {
  font-family: var(--mark);
  font-size: 0.72rem;
  line-height: 1;
}

/* ============================ 专题页 ============================ */
/* 专题页没有首屏，故补足页头下方的呼吸区；末区块不外再描边 */
.topic-section {
  padding-top: clamp(2.75rem, 5vw, 4.25rem);
  padding-bottom: clamp(4.5rem, 8vw, 8rem);
  border-bottom: 0;
}

.topic-crumbs {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}
.topic-crumbs a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.topic-crumbs a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.topic-crumbs .crumb-sep { color: var(--line-strong); }

/* 专题页首屏即分类标题，去掉重复的入场留白 */
.topic-section .cat-head { margin-bottom: clamp(2rem, 4vw, 3.25rem); }

/* ============================ 结语与页脚 ============================ */
.closing { padding: clamp(5rem, 10vw, 10rem) 0; }
.closing-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.closing-title { margin: 0; }
.closing-title-image {
  display: block;
  width: min(100%, 500px);
  height: auto;
}
.closing p {
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 2.1;
  max-width: 40rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0 3.5rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2.5rem;
}
.footer-brand {
  font-family: var(--serif);
  letter-spacing: 0.18em;
  font-size: 1.05rem;
}
.footer-credit {
  flex: 1 1 24rem;
  font-size: 0.78rem;
  line-height: 1.9;
  color: var(--ink-3);
}
.footer-inner .text-link { font-size: 0.82rem; }

/* ============================ 灯箱 ============================ */
.lightbox {
  width: min(1240px, 95vw);
  max-height: 94dvh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--overlay);
  color: #f2f2ee;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(6, 7, 9, 0.82); backdrop-filter: blur(6px); }

.lightbox[open] { animation: lb-in 0.32s var(--ease); }
@keyframes lb-in {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.lb-frame { position: relative; display: flex; flex-direction: column; }

.lb-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  background: rgba(16, 17, 19, 0.72);
  color: #f2f2ee;
  border: 1px solid rgba(242, 242, 238, 0.34);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.lb-close:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lb-esc { opacity: 0.6; font-family: var(--mark); font-size: 0.72rem; }

.lb-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(74dvh, 860px);
  background: #0c0d0f;
  overflow: hidden;
}

.lb-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 13, 15, 0.55);
  border: 1px solid rgba(242, 242, 238, 0.24);
  border-radius: var(--radius);
  color: #f2f2ee;
  font-size: 1.5rem;
  line-height: 1;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease),
              opacity 0.25s var(--ease);
}
.lb-nav:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-nav[hidden] { display: none; }

.lb-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1.5rem;
  align-items: center;
  padding: 1.2rem 1.5rem 1.35rem;
}

.lb-title {
  font-family: var(--serif);
  font-size: 1.22rem;
  letter-spacing: 0.1em;
}
.lb-meta {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: rgba(242, 242, 238, 0.62);
  margin-top: 0.2rem;
}

.lb-counter {
  font-family: var(--mark);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  color: rgba(242, 242, 238, 0.82);
  white-space: nowrap;
}

.lb-thumbs {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.2rem;
}
.lb-thumbs[hidden] { display: none; }
.lb-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(242, 242, 238, 0.26);
  border-radius: var(--radius);
  background: #0c0d0f;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb:hover { opacity: 0.9; }
.lb-thumb[aria-current="true"] {
  opacity: 1;
  border-color: var(--accent);
}

/* ============================ 滚动揭示 ============================ */
/* 仅做位移，不隐藏内容：即使脚本未执行或未进入视口，作品依然可见可访问 */
.reveal {
  transform: translateY(20px);
  transition: transform 0.75s var(--ease);
}
.reveal.is-visible { transform: none; }

/* ============================ 响应式 ============================ */
@media (max-width: 1200px) {
  .masonry-calligraphy { column-count: 4; }
}

@media (max-width: 1100px) {
  :root { --shell: min(1440px, 100% - 4rem); }
  .site-nav { gap: 1.4rem; }
  .masonry-calligraphy { column-count: 4; }
  .masonry-painting { column-count: 3; }
  .poem-list { column-count: 2; }
  .preface-body { columns: 2; }
}

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .site-nav { gap: 1.4rem; }
  .hero { min-height: auto; padding: 2.5rem 0 4rem; }
  .hero-inner { gap: 2.5rem; }
  .hero-copy { max-width: 40rem; }
  .preface-body { max-width: none; }

  .cat-head { grid-template-columns: 1fr; align-items: start; }
  .cat-note { max-width: 40rem; }

  .masonry-painting { column-count: 3; }
}

@media (max-width: 720px) {
  :root { --shell: min(1440px, 100% - 2.5rem); --header-h: 62px; }

  .overview-head { grid-template-columns: 1fr; align-items: start; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.5rem; }
  .overview-total { justify-content: flex-end; }

  .brand-en { display: none; }
  .brand-logo { height: 60px; }
  .theme-toggle-label { display: none; }
  .site-nav {
    flex: 0 1 auto;
    gap: 1.25rem;
    margin-right: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: 0.85rem; white-space: nowrap; flex: 0 0 auto; }
  .header-inner { gap: 0.9rem; }

  .section { padding: 4rem 0; }
  .cat-section { padding: 3.5rem 0; }

  .masonry-calligraphy { column-count: 2; }
  .masonry-painting { column-count: 2; }
  .photo-grid { gap: 2rem 1rem; }
  .card-title { font-size: 1rem; }

  /* 窄屏首页每个类别只陈列前四件，其余走「查看全部」进专题页 */
  .more-row { display: block; }
  .grid-limit > li:nth-child(n + 5) { display: none; }

  .poem-list { column-count: 1; }

  /* 序：窄屏严格单栏，印位收到「序」字右侧 */
  .hero-preface { grid-template-columns: 1fr; gap: 1.25rem; }
  .preface-mark { display: flex; align-items: center; gap: 0.6rem; font-size: 2.3rem; }
  .preface-mark::after { width: 0.9rem; height: 0.9rem; margin: 0 0 0 0.2rem; }
  .preface-body {
    columns: 1;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 1.35rem;
  }

  .closing-inner { grid-template-columns: 1fr; }

  .lightbox { width: 96vw; max-height: 95dvh; }
  .lb-viewport { height: min(62dvh, 560px); }
  .lb-nav { width: 38px; height: 58px; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
  .lb-bar { padding: 1rem 1.1rem 1.1rem; }
  .lb-title { font-size: 1.05rem; }
  .lb-thumb { width: 62px; height: 44px; }
}

@media (max-width: 480px) {
  .photo-grid { gap: 1.9rem 0; }
  .masonry-calligraphy { column-count: 1; }
  .masonry-painting { column-count: 1; }
  .hero h1 { font-size: 2.6rem; }
  .theme-toggle { padding: 0.35rem 0.5rem; }
  .poem-list-full { grid-template-columns: 1fr; }
  .poem-item-full { grid-template-columns: 2.1rem minmax(0, 1fr); }
}

/* 窄屏页头改为两行：品牌与主题开关一行，导航独占一行后自然排满，
   避免单行时导航被裁成「摄」并压到开关上。 */
@media (max-width: 560px) {
  :root { --header-h: 118px; }
  .site-header { height: auto; }
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding: 0.6rem 0 0.45rem;
  }
  .brand { order: 1; }
  .brand-logo { height: 60px; }
  .theme-toggle { order: 2; margin-left: auto; padding: 0.3rem 0.45rem; }
  .site-nav {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    margin: 0;
    gap: 0.9rem;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .media::after { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .lightbox::backdrop { backdrop-filter: none; }
}
