@charset "utf-8";

/* ============================================================
   我的第三大道 · 纪念站
   设计语言：发丝线分区 + 等宽数字 + 极克制的强调色
   颜色取自原设计稿，结构与排版在此基础上重做
   ============================================================ */

:root {
  /* 浅色屏 */
  --bg:        #f2f4f8;
  --surface:   #f7f9fc;
  --ink:       #26313f;
  --body:      #5a6678;
  --muted:     #6a707c;   /* 4.50:1 on --bg（原 #8b94a3 只有 2.78:1） */
  --accent:    #637599;   /* 品牌色，与 Logo 同色，不许改动 */
  --accent-text: #576686; /* 只给小号文字用：5.21:1，与品牌色同色系；品牌色本身保持 #637599 不动 */
  /* 暖金在深底上没问题（8.9:1），但在浅底上原始值只有 2.03:1，所以浅底单用一档深色 */
  --gold:      #c9a87c;
  --gold-on-light: #7d684c;   /* 4.75:1 on --bg */
  --muted-2:   #626772;       /* 落在 --slot 这类浅灰底上的次要文字：4.72:1 */
  --line:      rgba(99, 117, 153, .16);
  --line-2:    rgba(99, 117, 153, .30);
  --slot:      #e8edf4;
  --slot-card: #eef2f8;

  /* 深色屏 */
  --bg-d:      #05080f;
  --ink-d:     #eef1f7;
  --sub-d:     #93a1bb;
  --muted-d:   #6b7893;
  --accent-d:  #9db0d4;
  --line-d:    rgba(147, 166, 205, .15);
  --line-d2:   rgba(147, 166, 205, .34);

  --container: 1200px;
  --pad-x:     clamp(20px, 8.3vw, 120px);

  /* 声明「这个站点两套配色都支持」：滚动条等浏览器自带的界面元素
     会跟着设备的深浅偏好走，而不是永远画成浅色的 */
  color-scheme: light dark;

  --sans: "MiSans VF", -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
          "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei",
          "Hiragino Sans GB", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* 网页端只加载 MiSans VF 可变字体。它的 wght 轴用字体内部刻度（150–700），
     不是 CSS 常用刻度：330=Regular、380=Medium、450=Demibold、630=Bold。
     页面里的 font-weight 写的都是这套内部值，改字重时照这张表换算。 */
  /* 全站统一 MiSans：--mono 原来是系统等宽栈，现在直接跟随 --sans。
     数字对齐改由 font-variant-numeric: tabular-nums 负责，不再切换字体家族。 */
  --mono: var(--sans);

  --ease-out:  cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html { height: 100%; }

body {
  margin: 0;
  background: var(--bg-d);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 330;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  line-height: 30px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 只有首页用整屏滚动容器；子页面是普通文档流 */
body.home {
  height: 100%;
  overflow: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* 键盘焦点统一成 2px 环：浏览器默认的 1px auto 太细，和索引轨的自定义环也不一致 */
:focus-visible {
  outline: 2px solid var(--accent-c, var(--accent));
  outline-offset: 2px;
}

h1, h2, h3, p, dl, dd, dt, ol, ul, li, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
strong { font-weight: 630; }
svg { display: block; }

/* ============================================================
   主题变量：每个屏自己决定明暗，组件只认变量
   ============================================================ */

.screen[data-theme="light"] {
  --bg-c: var(--bg);
  --surface-c: var(--surface);
  --ink-c: var(--ink);
  --body-c: var(--body);
  --muted-c: var(--muted);
  --accent-c: var(--accent);
  --accent-t: var(--accent-text);
  --gold-c: var(--gold-on-light);
  --line-c: var(--line);
  --line-c2: var(--line-2);
  --slot-c: var(--slot);
  background: var(--bg-c);
  color: var(--ink-c);
}

.screen[data-theme="dark"] {
  --bg-c: var(--bg-d);
  --surface-c: rgba(18, 24, 38, .6);
  --ink-c: var(--ink-d);
  --body-c: var(--sub-d);
  --muted-c: var(--muted-d);
  --accent-c: var(--accent-d);
  --accent-t: var(--accent-d);
  --gold-c: var(--gold);
  --line-c: var(--line-d);
  --line-c2: var(--line-d2);
  --slot-c: rgba(20, 27, 42, .7);
  background: var(--bg-c);
  color: var(--ink-c);
}

/* ============================================================
   滚动容器
   ============================================================ */

.deck {
  height: 100vh;
  height: 100svh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.deck::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* 位置还原完成之前先不画首页那一屏：刷新时不会先闪一帧首屏、再跳到上次看到的那一屏。
   booting 只在脚本可用时加上（见 index.html 头部的内联脚本），main.js 还原完就摘掉；
   另外还有定时兜底，不会出现「一直不显示」这种最坏情况。 */
html.booting .deck { visibility: hidden; }

/* 内容装不下一屏时（补了截图或文档），吸附自动放宽，避免卡在中间 */
.deck[data-flow="1"] { scroll-snap-type: y proximity; }

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(52px, 8.5vh, 100px) var(--pad-x);
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  overflow: hidden;
}

/* 深浅屏交界处的柔和过渡 */
.screen--blend::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: clamp(60px, 9vh, 120px);
  background: linear-gradient(to bottom, var(--bg-d), rgba(5, 8, 15, 0));
  pointer-events: none;
  z-index: 1;
}

.wrap {
  position: relative;
  z-index: 2;
  margin: auto;
  width: 100%;
  max-width: var(--container);
}

.cols {
  display: grid;
  grid-template-columns: 520px 560px;
  column-gap: 120px;
  align-items: start;
}

/* ============================================================
   基础排版元件
   ============================================================ */

p {
  font-size: 15px;
  line-height: 30px;
  color: var(--body-c);
}

p + p { margin-top: 30px; }

/* 发丝线：替代设计稿里的短横线，作为贯穿的分区语言 */
.hr {
  display: block;
  height: 1px;
  background: var(--line-c);
}

.eyebrow,
.sec-head__idx,
.sec-head__of,
.pm-date,
.block-head,
.card__date,
.linkcards__url,
.facts dd {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   区块标题
   ------------------------------------------------------------ */

.sec-head__bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sec-head__idx {
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--gold-c);
  line-height: 1;
}

.sec-head__rule {
  flex: 1;
  height: 1px;
  background: var(--line-c);
}

.sec-head__of {
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted-c);
  line-height: 1;
}

.sec-head__title {
  margin-top: 26px;
  font-size: 41px;
  font-weight: 630;
  line-height: 1.15;
  letter-spacing: -.005em;
  color: var(--ink-c);
}

.sec-head__sub {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 380;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted-c);
  line-height: 1;
}

.sec-head + p,
.sec-head + .lead { margin-top: 40px; }

/* ------------------------------------------------------------
   主城影像 / 元信息
   ------------------------------------------------------------ */

.figure img {
  width: 100%;
  height: min(330px, 37vh);
  min-height: 170px;
  object-fit: cover;
}

.figure figcaption {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: .04em;
  color: var(--muted-c);
}

.facts {
  margin-top: 30px;
  border-top: 1px solid var(--line-c);
}

.facts > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-c);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--body-c);
}

.facts dt { color: var(--muted-c); white-space: nowrap; }

.facts dt::after {
  content: "·";
  margin-left: 8px;
  opacity: .6;
}

/* ============================================================
   首屏
   ============================================================ */

.screen--hero {
  display: grid;
  /* 署名块占满整屏后居中；星空、路、信息带都由画布与绝对定位负责 */
  grid-template-rows: 1fr;
  padding: 0 var(--pad-x);
}

.starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.hero__inner {
  grid-row: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* 略微高于几何中心：底部还有信息带，视觉重心才算真的在中间 */
  transform: translateY(-1.5vh);
  pointer-events: none;
}

.hero__logo {
  /* 让标志里的「第三大道」字样和下面的标题字号看起来一样重 */
  width: min(300px, 30vw);
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  /* 只加一层柔光让它从近黑底上浮起来。
     不要再加 brightness()：图里的墨色本来就是品牌色 #637599 那一族，
     提亮就不是它了（这张图以前带着白边，才用提亮去补，白边已经修掉了） */
  filter: drop-shadow(0 0 26px rgba(99, 117, 153, .30));
}

/* 标志与标题并排，中间一条竖发丝线 */
.hero__lockup {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 30px);
}

.hero__rule {
  display: block;
  flex: none;
  width: 1px;
  height: clamp(46px, 6.2vh, 62px);
  background: rgba(147, 166, 205, .42);
}

.hero__text { text-align: left; }

.hero__title {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 630;
  line-height: 1.12;
  letter-spacing: .01em;
  color: var(--ink-d);
}

.hero__sub {
  margin-top: 13px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 330;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--accent-d);
  line-height: 1;
}

/* 星点可点，给一句提示；它是星链唯一的操作入口 */
.hero__note {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  /* 星空是活动背景，小字用 --sub-d 才稳过 4.5:1（实测 --muted-d 只有 4.1） */
  color: var(--sub-d);
  line-height: 1;
}

.hero__meta {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: .05em;
  /* 这一条落在「路」的渐隐带上，同样要留足对比度余量 */
  color: var(--sub-d);
}

.scroll-hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--muted-c);
}

/* 底部信息带：左边是元信息，右边是向下滚动，用一条发丝线收住首屏 */
.hero__bar {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: clamp(22px, 4.4vh, 52px);
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px 24px;
  padding-top: clamp(12px, 1.8vh, 18px);
  border-top: 1px solid rgba(147, 166, 205, .16);
}

.hero__hint {
  flex: none;
  pointer-events: auto;
  color: var(--sub-d);
  animation: hint-float 2.4s ease-in-out infinite;
}

@keyframes hint-float {
  0%, 100% { transform: translateY(0);   opacity: .75; }
  50%      { transform: translateY(5px); opacity: 1; }
}

.scroll-hint--inline { margin-top: clamp(40px, 8vh, 84px); }

/* 跳转链接：平时收在屏幕外，键盘聚焦时才落下来 */
.skip-link {
  position: fixed;
  left: var(--pad-x);
  top: 0;
  z-index: 60;
  padding: 10px 16px;
  border-radius: 0 0 3px 3px;
  background: var(--bg-d);
  color: var(--ink-d);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  transform: translateY(-112%);
  transition: transform .18s var(--ease-out);
}

.skip-link:focus-visible { transform: none; }

/* ============================================================
   02 正代周目 · 时间轴
   ============================================================ */

.timeline {
  position: relative;
  margin-top: clamp(44px, 9vh, 92px);
  display: flex;
  justify-content: space-between;
  padding-inline: 46px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 1px;
  background: var(--line-c2);
}

/* 零宽列：节点精确落在轴上的等分点 */
.timeline li {
  position: relative;
  flex: 0 0 auto;
  width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: max-content;
}

.tl-node {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  /* 走 --accent-c 而不是品牌色本身：深色模式（含本来就是深色的屏）会自动换成浅一档，
     浅色屏上仍然是品牌色，和以前一样 */
  background: var(--accent-c);
  transition: transform .3s var(--ease-out), background-color .3s linear;
}

/* 特殊周目用空心节点区分 */
.timeline li[data-kind="special"] .tl-node {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--gold-c);
}

.tl-date {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  color: var(--muted-c);
  font-variant-numeric: tabular-nums;
  transition: color .3s linear;
}

.tl-name {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 630;
  line-height: 1.2;
  color: var(--ink-c);
  white-space: nowrap;
}

.timeline li[data-kind="special"] .tl-name { color: var(--accent-t); font-weight: 450; }

.timeline a:hover .tl-node,
.timeline a:focus-visible .tl-node { transform: scale(1.6); }
.timeline a:hover .tl-date { color: var(--accent-t); }

/* ============================================================
   周目屏
   ============================================================ */

.pm-head { display: block; }

.pm-icons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(16px, 2.6vh, 28px);
}

.pm-icons .pm-icon { margin-bottom: 0; }

.pm-icon {
  width: clamp(46px, 6.2vh, 56px);
  height: auto;
  margin-bottom: clamp(16px, 2.6vh, 28px);
  image-rendering: -webkit-optimize-contrast;
}

/* 合并屏右栏的小节 */
.pm-block + .pm-block { margin-top: clamp(22px, 3.4vh, 36px); }
.pm-block .block-head { margin-bottom: 14px; }
.pm-block .pm-text { margin-top: 0; }

/* ============================================================
   一、二周目（合并屏）
   两道都很短、又没有影像与文档，用左右两栏会在宽屏上显得很空，
   所以改成通栏的两行对照 + 一条合并说明：横向铺满、发丝线分隔。
   ============================================================ */

.pm-icon--lg { width: clamp(56px, 7.4vh, 74px); }

.merge-rows {
  list-style: none;
  margin: clamp(20px, 3.2vh, 36px) 0 0;
  padding: 0;
  border-top: 1px solid var(--line-c);
}

.merge-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  column-gap: clamp(24px, 3.4vw, 64px);
  padding: clamp(16px, 2.6vh, 28px) 0;
  border-bottom: 1px solid var(--line-c);
}

.merge-row__id {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.merge-row__name {
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 630;
  color: var(--ink-c);
}

.merge-row__date {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted-c);
}

.merge-row__text,
.merge-note__text {
  font-size: 14.5px;
  line-height: 29px;
  color: var(--body-c);
  max-width: 68ch;
}

.merge-note { margin-top: clamp(24px, 4vh, 46px); }
.merge-note__text { margin-top: 14px; }

.pm-date {
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 630;
  line-height: 1;
  letter-spacing: -.01em;
  /* 同上：这一屏最大的数字，深底上要用浅一档的强调色才不发闷 */
  color: var(--accent-c);
}

/* 周目名后面挂 Minecraft 版本，按基线对齐 */
.pm-name-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: clamp(10px, 1.6vh, 16px);
}

.pm-name-row .pm-name { margin-top: 0; }

.pm-ver {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--accent-t);
  white-space: nowrap;
}

.pm-ver:empty { display: none; }

.pm-name {
  margin-top: clamp(10px, 1.6vh, 16px);
  font-size: clamp(30px, 3.05vw, 44px);
  font-weight: 630;
  line-height: 1.15;
  letter-spacing: -.005em;
  color: var(--ink-c);
}

.pm-head + .hr { margin-top: clamp(18px, 2.8vh, 30px); }

.hr + .pm-text { margin-top: clamp(20px, 3vh, 30px); }

.pm-text + .pm-text { margin-top: 20px; }

.col--media { padding-top: 2px; }

.media-block + .media-block { margin-top: clamp(24px, 4vh, 40px); }

/* 区块小标题：标签 + 发丝线 + 值 */
.block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted-c);
  line-height: 1;
}

.block-head__rule {
  flex: 1;
  height: 1px;
  background: var(--line-c);
}

.block-head__val { letter-spacing: .06em; opacity: .8; }

/* ------------------------------------------------------------
   影像位：按数量自适应，多给几张也不会撑破
   ------------------------------------------------------------ */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.gallery .shot {
  min-height: clamp(84px, 13vh, 122px);
}

.gallery.is-lead > .shot:first-child {
  grid-column: 1 / -1;
  min-height: clamp(168px, 27vh, 248px);
}

.gallery[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.gallery[data-count="1"] > .shot:first-child { min-height: clamp(150px, 23vh, 210px); }
.gallery[data-count="2"] > .shot:first-child { min-height: clamp(120px, 19vh, 178px); }

.shot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--slot-c);
  overflow: hidden;
}

/* 空位：用一圈虚线示意「这里之后要放图」，比纯色块更像有意为之 */
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed var(--line-c2);
  border-radius: inherit;
  opacity: .5;
  pointer-events: none;
}

.shot:has(img)::after { display: none; }

.shot span {
  position: relative;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted-2);
}

.shot img { width: 100%; height: 100%; object-fit: cover; }

/* 首页影像位保持比例、居中裁切并铺满；高度必须锁在按钮内，避免压住图注。 */
.gallery .shot-trigger img {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.shot-trigger {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-d);
  cursor: zoom-in;
  touch-action: manipulation;
}

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

.shot-trigger > .shot-trigger__zoom {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(238, 241, 247, .28);
  border-radius: 2px;
  background: rgba(5, 8, 15, .72);
  color: #eef1f7;
  opacity: .74;
  transition: opacity .2s var(--ease-soft), border-color .2s var(--ease-soft);
}

.shot-trigger__zoom svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shot-trigger:hover .shot-trigger__zoom,
.shot-trigger:focus-visible .shot-trigger__zoom {
  border-color: rgba(238, 241, 247, .58);
  opacity: 1;
}

/* 带备注的截图：图上、备注在下，和详情页的 figure 一个路子。
   备注最多两行，多了省略——它不该把整屏撑高。 */
.shot--cap {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.shot--cap img {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
}

.shot--cap .shot-trigger {
  position: relative;
  inset: auto;
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.shot--cap figcaption {
  flex: none;
  padding: 7px 10px 8px;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: left;
  color: var(--muted-c);
  border-top: 1px solid var(--line-c);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------
   相关文档：发丝线分隔的表
   ------------------------------------------------------------ */

.doclist {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 4px;
}

.doclist[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }

.doc {
  border-bottom: 1px solid var(--line-c);
}

/* 文档行两种形态：有链接的整行可点，没内容的保持纯文本 */
.doc > a,
.doc > span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--body-c);
  transition: color .2s var(--ease-soft), padding-left .2s var(--ease-soft);
}

.doc > a:hover { color: var(--ink-c); padding-left: 8px; }

.doc__body {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.doc__title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.doc__cat,
.chip__cat {
  flex: none;
  padding: 3px 6px;
  border: 1px solid var(--line-c);
  border-radius: 2px;
  background: var(--slot-c);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--accent-t);
  white-space: nowrap;
}

.doc__cat--empty,
.chip__cat--empty {
  border-style: dashed;
  background: transparent;
  color: var(--muted-c);
}

.doc svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: var(--accent-c);
  stroke-width: 1.25;
  stroke-linejoin: round;
  opacity: .8;
}

.doc.is-pending { cursor: default; }
.doc.is-pending > span { color: var(--muted-c); }

/* ------------------------------------------------------------
   「查看更多」
   ------------------------------------------------------------ */

.more {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.5;
  margin-top: clamp(20px, 3.2vh, 30px);
  padding-top: 13px;
  border-top: 1px solid var(--line-c);
  font-size: 13.5px;
  color: var(--body-c);
  transition: color .2s var(--ease-soft);
}

.more__text { font-weight: 450; color: var(--ink-c); }

.more__note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted-c);
}

.more svg {
  width: 15px;
  height: 15px;
  margin-left: auto;
  align-self: center;
  fill: none;
  stroke: var(--accent-c);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .55;
  transition: transform .2s var(--ease-soft), opacity .2s var(--ease-soft);
}

.more:hover svg { opacity: 1; transform: translateX(3px); }

.more--card { margin-top: auto; }

/* 卡片里的紧凑文档入口 */
.card__head { margin-top: clamp(18px, 2.6vh, 24px); }

/* 卡片里的文档库：有几条列几条 */
.doclist--chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  /* 和下面的「查看更多」拉开距离：那条分隔线不能贴着标签 */
  margin-bottom: clamp(20px, 3vh, 28px);
}

.chip {
  font-size: 12.5px;
  line-height: 1;
  padding: 7px 10px;
  border: 1px solid var(--line-c);
  border-radius: 2px;
  color: var(--body-c);
  transition: border-color .2s var(--ease-soft), color .2s var(--ease-soft);
}

.chip--doc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip__title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chip__cat {
  padding: 0 0 0 8px;
  border: 0;
  border-left: 1px solid var(--line-c);
  border-radius: 0;
  background: transparent;
}

a.chip:hover { border-color: var(--line-c2); color: var(--ink-c); }

.chip--pending { border-style: dashed; color: var(--muted-c); }

/* 文档很多时，首页只列前几条 */
.doc__more {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted-c);
  padding: 11px 2px;
}

/* ============================================================
   03 特殊周目
   ============================================================ */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 80px;
  align-items: stretch;
  margin-top: clamp(32px, 5.5vh, 60px);
}

.card {
  display: flex;
  flex-direction: column;
  padding: 0 0 0 26px;
  border-left: 1px solid var(--line-c2);
}

.card__top {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.card__tag {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: .18em;
  padding: 3px 7px;
  border: 1px solid var(--line-c2);
  border-radius: 2px;
  color: var(--muted-c);
}

.card__date {
  font-size: 12.5px;
  line-height: 1.2;
  letter-spacing: .08em;
  color: var(--accent-t);
}

/* 卡片里的周目名 + 版本 */
.card__name-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.card__name-row .card__title { margin-top: 0; }

.card__ver {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.2;
  letter-spacing: .06em;
  color: var(--accent-t);
}

.card__ver:empty { display: none; }

.card__title {
  margin-top: 16px;
  font-size: 25px;
  font-weight: 630;
  line-height: 1.25;
  letter-spacing: -.005em;
  color: var(--ink-c);
}

.card__body {
  margin-top: 14px;
  font-size: 14px;
  line-height: 25px;
  color: var(--body-c);
}

.card .gallery { flex: 1 1 auto; align-content: end; }

.card .gallery > .shot { min-height: 100px; }

.status {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 0;
  /* 让「现状」相对这段文字上下居中 */
  align-items: center;
  margin-top: clamp(26px, 4.4vh, 50px);
  padding-top: 22px;
  border-top: 1px solid var(--line-c2);
}

.status__label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--accent-t);
  justify-self: center;
  text-align: center;
}

.status p { font-size: 14px; line-height: 29px; }

/* ============================================================
   04 相关内容：所有条目平级的卡片网格
   ============================================================ */

.linkcards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(30px, 5vh, 54px);
}

.linkcards a {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line-c);
  border-radius: 3px;
  background: var(--surface-c);
  transition: border-color .2s var(--ease-soft), transform .2s var(--ease-soft), background-color .2s var(--ease-soft);
}

.linkcards a:hover {
  border-color: var(--line-c2);
  transform: translateY(-2px);
}

.linkcards__tag {
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  padding: 3px 7px;
  border-radius: 2px;
  background: var(--slot-c);
  color: var(--accent-t);
}

.linkcards__body { min-width: 0; display: block; }

.linkcards__title {
  display: block;
  font-size: 15px;
  font-weight: 450;
  line-height: 1.4;
  color: var(--ink-c);
}

.linkcards__url {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted-c);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linkcards__arrow {
  flex: none;
  width: 15px;
  height: 15px;
  margin-left: auto;
  fill: none;
  stroke: var(--accent-c);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .5;
  transition: opacity .2s var(--ease-soft), transform .2s var(--ease-soft);
}

.linkcards a:hover .linkcards__arrow { opacity: 1; transform: translate(2px, -2px); }

.linkcards__empty {
  grid-column: 1 / -1;
  padding: 28px 20px;
  border: 1px dashed var(--line-c2);
  border-radius: 3px;
  text-align: center;
  font-size: 13px;
  color: var(--muted-c);
}

/* ============================================================
   05 关于本站 + 尾声（同屏）
   ============================================================ */

.screen--final {
  /* 页脚留在正常流里（不再是绝对定位）：内容装得下时靠 .wrap 的自动外边距居中、
     页脚贴底；装不下时整屏长高、页脚被顶到内容下面。
     手机上内容本来就排到一屏半，绝对定位的页脚会直接压住正文。 */
  justify-content: flex-start;
  padding-bottom: clamp(20px, 3.6vh, 42px);
}

/* 这里不要再覆盖 .wrap 的 margin。
   基础样式里的 `margin: auto` 在这块同时管两件事：块轴把内容居中、
   行轴把 1200px 的容器在宽屏上居中。曾经为了垂直居中写成 `margin: auto 0`，
   结果行向的 auto 变成 0 —— 2K 屏上整个关于区贴左，右边空掉一大片。 */
.screen--final .wrap { margin: auto; }

.starfield--quiet { opacity: .85; }

.final__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.final__copy > p:first-child { margin-top: clamp(26px, 4vh, 40px); }
.final__copy p + p { margin-top: 20px; }

.final__copy p {
  font-size: 14.5px;
  line-height: 29px;
  color: var(--sub-d);
}

.contact {
  font-size: 14px;
  color: var(--muted-d);
}

.contact a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-d);
  border-bottom: 1px solid var(--line-d2);
  padding-bottom: 1px;
  transition: border-color .2s var(--ease-soft), color .2s var(--ease-soft);
}

.contact a:hover { border-bottom-color: var(--accent-d); }

.final__memorial {
  padding-top: 26px;
  border-top: 1px solid var(--line-d2);
}

/* 没有 QQ 群时（临时信息撤掉）：整块改为居中排布，不留空洞 */
.memorial--solo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(180px, 26vh, 260px);
}

.memorial--solo .memorial__sub { margin-top: 20px; }

.memorial__title {
  font-size: clamp(22px, 1.9vw, 28px);
  font-weight: 630;
  line-height: 1.45;
  letter-spacing: .12em;
  color: var(--ink-d);
}

.memorial__sub {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--sub-d);
}

.memorial__qq {
  margin-top: clamp(34px, 6vh, 64px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.memorial__qq-label {
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--muted-d);
}

.memorial__qq-num {
  font-family: var(--mono);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 630;
  letter-spacing: .06em;
  line-height: 1.2;
  color: var(--ink-d);
}

.memorial__qq-note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--sub-d);
}

.final__footer {
  margin-top: clamp(26px, 5vh, 60px);
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-d);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted-d);
}

.final__footer a { transition: color .2s linear; }
.final__footer a:hover { color: var(--sub-d); }

/* ============================================================
   右侧索引轨
   ============================================================ */

.rail {
  position: fixed;
  top: 50%;
  right: clamp(12px, 2.2vw, 34px);
  transform: translateY(-50%);
  height: min(58vh, 520px);
  z-index: 30;
  pointer-events: none;
}

.rail__track {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: var(--rl-track);
}

.rail__progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: var(--rl-active);
  opacity: .5;
  transition: height .18s linear;
}

.rail__dots {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.rail__dot {
  position: relative;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.rail__dot i {
  display: block;
  /* 4px 太小，浅色屏上根本看不见；6px + 3:1 对比度才够得着 WCAG 1.4.11 */
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--rl-dot);
  transition: width .2s ease-out, height .2s ease-out, background-color .2s ease-out;
}

.rail__dot:hover i { background: var(--rl-hover); }

.rail__dot[aria-current="true"] i {
  width: 10px;
  height: 10px;
  background: var(--rl-active);
  box-shadow: 0 0 0 4px var(--rl-glow), 0 0 12px var(--rl-glow);
}

/* 悬停 / 当前所在时浮出名称 */
.rail__label {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 3px;
  border: 1px solid var(--rl-line);
  background: var(--rl-chip);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--rl-label-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease-soft), transform .18s var(--ease-soft);
}

.rail__dot:hover .rail__label,
.rail__dot:focus-visible .rail__label,
.rail__dot[aria-current="true"] .rail__label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.rail[data-theme="light"] {
  --rl-line: rgba(99, 117, 153, .28);
  --rl-track: rgba(99, 117, 153, .40);
  --rl-dot: #7e8dab;                      /* 3.0:1 on --bg */
  --rl-hover: #637599;
  --rl-active: #637599;
  --rl-glow: rgba(99, 117, 153, .16);
  --rl-chip: rgba(255, 255, 255, .92);
  --rl-label-ink: #26313f;
}

.rail[data-theme="dark"] {
  --rl-line: rgba(147, 166, 205, .3);
  --rl-track: rgba(147, 166, 205, .22);
  --rl-dot: rgba(147, 166, 205, .55);     /* 3.1:1 on --bg-d */
  --rl-hover: #cddcf3;
  --rl-active: #cddcf3;
  --rl-glow: rgba(205, 220, 243, .16);
  --rl-chip: rgba(12, 17, 28, .9);
  --rl-label-ink: #eef1f7;
}

/* ============================================================
   入场动画
   ============================================================ */

html.js .screen [data-anim] {
  transition: opacity .42s linear, transform .42s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

html.js .screen:not(.is-active) [data-anim] {
  opacity: 0;
  transform: translateY(16px);
}

.screen.is-active [data-anim] { opacity: 1; transform: none; }

.screen [data-anim].is-instant { transition-duration: .3s; transition-delay: 0s; }

/* 首屏文字：等七星首轮点亮后再逐级放行 */
html.js .screen--hero [data-hero] {
  transition: opacity .6s linear, transform .6s var(--ease-out);
}

html.js .screen--hero:not(.is-ready) [data-hero] {
  opacity: 0;
  transform: translateY(12px);
}

.screen--hero.is-ready [data-hero] { opacity: 1; transform: none; }
.screen--hero.is-ready [data-hero="2"] { transition-delay: .08s; }
.screen--hero.is-ready [data-hero="3"] { transition-delay: .18s; }
.screen--hero.is-ready [data-hero="4"] { transition-delay: .3s; }
.screen--hero.is-ready [data-hero="5"] { transition-delay: .4s; }
.screen--hero.is-ready [data-hero="6"] { transition-delay: .52s; }

/* 尾声标题：字距由松收到紧 */
.memorial__title { letter-spacing: .26em; transition: letter-spacing .9s var(--ease-out); }
.screen--final.is-active .memorial__title { letter-spacing: .12em; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1180px) {
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(36px, 5vw, 120px); }
  .cards { gap: clamp(24px, 4vw, 80px); }
  .final__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); }
}

/* 平板（iPad 竖屏 768–900 已落到下面的单列，这里处理 901–1180 的横向布局） */
@media (min-width: 901px) and (max-width: 1180px) {
  :root { --pad-x: clamp(32px, 5vw, 64px); }
  .screen { padding-block: clamp(44px, 7vh, 80px); }
  .sec-head__title { font-size: clamp(32px, 3.6vw, 41px); }
  .pm-date { font-size: clamp(34px, 4vw, 48px); }
  .pm-name { font-size: clamp(28px, 3.4vw, 40px); }
  .gallery .shot { min-height: clamp(76px, 11vh, 108px); }
  .gallery.is-lead > .shot:first-child { min-height: clamp(140px, 21vh, 196px); }
  .card .gallery > .shot { min-height: 92px; }
  .timeline { padding-inline: 30px; }
  .status { grid-template-columns: 66px minmax(0, 1fr); }
  .timeline li:first-child .tl-node { margin-left: 0; }
}

@media (max-width: 900px) {
  .deck { scroll-snap-type: y proximity; }
  .screen { padding: clamp(48px, 7vh, 76px) var(--pad-x); }

  .cols { grid-template-columns: minmax(0, 1fr); row-gap: 30px; }
  .cols > .col:last-child { order: 2; }

  .sec-head__title { font-size: clamp(27px, 7.4vw, 38px); margin-top: 20px; }
  .sec-head + p, .sec-head + .lead { margin-top: 26px; }

  p { font-size: 14.5px; line-height: 28px; }
  p + p { margin-top: 22px; }

  .pm-date { font-size: clamp(34px, 11.5vw, 50px); }
  .pm-name { font-size: clamp(28px, 8.6vw, 40px); }

  /* 合并屏：窄屏上两行对照改成「周目名在上、正文在下」 */
  .merge-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
  }
  .merge-row__text, .merge-note__text { font-size: 14px; }
  .pm-icon--lg { width: clamp(52px, 15vw, 64px); }

  /* 移动端：首图通栏，其余两两成行，既不丢内容也不至于把屏拉太长 */
  .gallery { gap: 10px; }
  .gallery > .shot { min-height: clamp(84px, 12vh, 112px); }
  .gallery[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
  .gallery[data-count="1"] > .shot:first-child { min-height: clamp(150px, 22vh, 190px); }
  .gallery[data-count="2"] > .shot { min-height: clamp(120px, 17vh, 160px); }
  .gallery.is-lead > .shot:first-child { min-height: clamp(140px, 20vh, 180px); }

  .media-block + .media-block { margin-top: 20px; }
  .doc > a, .doc > span { padding: 10px 2px; font-size: 13.5px; }

  .doclist[data-cols="2"] { grid-template-columns: minmax(0, 1fr); }

  .figure img { height: min(230px, 29vh); min-height: 150px; }

  .cards { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .card { padding-left: 16px; }
  .card__title { font-size: 20px; margin-top: 10px; }
  .card__body { font-size: 13.5px; line-height: 24px; }
  .card .gallery > .shot { min-height: clamp(96px, 13vh, 132px); }
  .card .gallery[data-count="1"] > .shot:first-child { min-height: clamp(96px, 13vh, 132px); }
  .card .gallery { flex: 0 0 auto; }
  .chiprow a { font-size: 12px; padding: 6px 9px; }
  .card__head { margin-top: 16px; }
  .doclist--chips { margin-bottom: 18px; }
  .more { margin-top: 16px; padding-top: 12px; }

  .status { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .status { padding-top: 18px; margin-top: 22px; }
  /* 单栏时标签在正文上方，恢复左对齐 */
  .status { align-items: start; }
  .status__label { justify-self: start; text-align: left; }
  .status p { font-size: 13.5px; line-height: 26px; }

  .linkcards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .linkcards a { padding: 14px 16px; }

  .final__grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .final__memorial { padding-top: 22px; }
  .final__footer { flex-direction: column; gap: 6px; }

  .rail { display: none; }

  /* 窄屏放不下并排，回到上下堆叠 */
  .hero__lockup { flex-direction: column; gap: 0; }
  .hero__text { text-align: center; }
  .hero__logo { width: min(232px, 58vw); }
  .hero__rule { width: 34px; height: 1px; margin-top: 16px; }
  .hero__title { font-size: clamp(27px, 7.6vw, 38px); margin-top: 15px; }
  .hero__sub { font-size: 10.5px; letter-spacing: .24em; margin-top: 11px; }
  .hero__note { margin-top: 17px; font-size: 10.5px; letter-spacing: .12em; }
  /* 窄屏放不下左右并排，改成上下两行 */
  .hero__bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    bottom: clamp(20px, 3.4vh, 34px);
  }
  .hero__meta { font-size: 11.5px; }

  /* 时间轴：竖排，并补上连接线 */
  .timeline {
    display: block;
    padding-inline: 0;
    margin-top: 32px;
  }
  .timeline::before {
    left: 4px;
    right: auto;
    top: 14px;
    bottom: 14px;
    width: 1px;
    height: auto;
  }
  .timeline li { width: auto; display: block; }
  .timeline a {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    text-align: left;
    width: auto;
    padding: 11px 0;
  }
  .tl-node { flex: none; }
  .tl-date { margin-top: 0; width: 78px; flex: none; font-size: 11.5px; }
  .tl-name { margin-top: 0; font-size: 15px; }
}

@media (max-width: 520px) {
  :root { --pad-x: 22px; }
  .final__footer { font-size: 10.5px; }
  .hero__logo { width: min(206px, 54vw); }
  .more { font-size: 13px; }
}

/* 矮屏：压缩竖向节奏，保证整屏仍然装得下 */
@media (min-width: 901px) and (max-height: 780px) {
  .screen { padding-block: clamp(30px, 4.6vh, 52px); }
  /* 矮屏上首屏更挤，署名块整体收一收 */
  .hero__logo { width: min(248px, 21vw); }
  .hero__rule { height: clamp(42px, 6.4vh, 56px); }
  /* 这条同时覆盖矮屏桌面和平板横屏，别把标题压得太小 */
  .hero__title { font-size: clamp(27px, 3.3vw, 39px); }
  .gallery .shot { min-height: clamp(72px, 11vh, 100px); }
  .gallery.is-lead > .shot:first-child { min-height: clamp(140px, 22vh, 200px); }
  .sec-head__title { font-size: clamp(32px, 3.2vw, 41px); margin-top: 18px; }
  .pm-date { font-size: clamp(32px, 3.4vw, 46px); }
  .pm-name { font-size: clamp(28px, 2.9vw, 40px); }
  .timeline { margin-top: clamp(28px, 6vh, 60px); }
  .cards { margin-top: clamp(22px, 3.6vh, 40px); }
  .linkcards { margin-top: clamp(22px, 3.6vh, 40px); }
  .card .gallery > .shot { min-height: 100px; }
  p + p, .pm-text + .pm-text { margin-top: 18px; }
}

/* ============================================================
   降级：减少动态
   ============================================================ */

html.reduced-motion .deck { scroll-behavior: auto; }

html.reduced-motion .screen [data-anim],
html.reduced-motion .screen--hero [data-hero] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

html.reduced-motion .hero__hint { animation: none; opacity: .8; }

@media (prefers-reduced-motion: reduce) {
  .hero__hint { animation: none; opacity: .8; }
  .deck { scroll-behavior: auto; }
  html.js .screen [data-anim],
  html.js .screen--hero [data-hero] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================================
   影像灯箱
   ------------------------------------------------------------
   原生 dialog 负责模态焦点管理；视觉始终用深底，让截图本身成为主体。
   ============================================================ */

html.has-lightbox,
html.has-lightbox .deck {
  overflow: hidden;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #05080f;
  color: #eef1f7;
  overflow: hidden;
}

.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.lightbox::backdrop { background: #05080f; }

.lightbox [hidden] { display: none; }

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding:
    max(8px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    8px
    max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(147, 166, 205, .18);
}

.lightbox__counter {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: .12em;
  color: #aebbd1;
}

.lightbox button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(205, 220, 243, .28);
  border-radius: 2px;
  background: rgba(18, 24, 38, .82);
  color: #eef1f7;
  cursor: pointer;
  transition: border-color .2s var(--ease-soft), background-color .2s var(--ease-soft);
}

.lightbox button:hover {
  border-color: rgba(205, 220, 243, .62);
  background: rgba(28, 38, 57, .96);
}

.lightbox button:focus-visible {
  outline: 2px solid #cddcf3;
  outline-offset: 3px;
}

.lightbox button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox__close {
  margin-left: auto;
}

.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: clamp(16px, 3vh, 34px) clamp(72px, 8vw, 128px);
  overflow: hidden;
}

.lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .22s var(--ease-soft);
}

.lightbox__image.is-ready { opacity: 1; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
}

.lightbox__nav--prev { left: max(14px, env(safe-area-inset-left)); }
.lightbox__nav--next { right: max(14px, env(safe-area-inset-right)); }

.lightbox__foot {
  min-height: 58px;
  padding:
    11px
    max(20px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  border-top: 1px solid rgba(147, 166, 205, .18);
}

.lightbox__caption {
  max-width: 860px;
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
  color: #b7c3d8;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .lightbox__bar {
    min-height: 54px;
    padding:
      max(6px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      6px
      max(16px, env(safe-area-inset-left));
  }

  .lightbox__stage {
    padding: 14px 12px;
  }

  .lightbox__nav--prev { left: max(8px, env(safe-area-inset-left)); }
  .lightbox__nav--next { right: max(8px, env(safe-area-inset-right)); }

  .lightbox__foot {
    min-height: 52px;
    padding:
      9px
      max(16px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox button,
  .lightbox__image,
  .shot-trigger__zoom {
    transition: none;
  }
}

/* ============================================================
   深色模式：跟着设备走（系统 / 浏览器的深浅偏好），页面里不放开关
   ------------------------------------------------------------
   首屏（星空）和「关于本站」本来就是深色，继续用它们自己那套，这里不动；
   这个区块只把「浅色屏」与子页面的调色板换成深色版 ——
   它们都从 :root 上这几个变量取值，所以覆盖 :root 就够了。

   深色模式下的内容屏底色（#0e131d）比首屏那条 --bg-d（#05080f）提了一档：
   「首屏最深 → 内容屏微微浮起 → 尾屏再落回最深」的明暗节奏才还在，
   否则整页糊成一整块黑，滚到哪一屏都分不出来。

   对比度（在 #0e131d / 槽位 #171e2b 上实算，全部 ≥4.5:1）：
   标题 15.8 / 正文 8.9 / 次要 6.5 / 强调 8.5 / 亮金 8.3 / 槽位上次要文字 6.5。
   品牌色 #637599 在深底上只有 4.0:1（大字号勉强够，小字不够），
   所以小号文字、描边和标签换用同色系浅一档的 --accent-d——
   这也正是「深色屏」原本就在用的那一档，全站深色下统一。
   ============================================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0e131d;
    --surface:     #151b27;
    --ink:         #e9edf5;
    --body:        #a9b4c7;
    --muted:       #8f99ae;
    --muted-2:     #98a2b6;
    --line:        rgba(147, 166, 205, .16);
    --line-2:      rgba(147, 166, 205, .34);
    --slot:        #171e2b;
    --slot-card:   #141a26;
    --accent-text: #9db0d4;
  }

  /* 「浅色屏」换深底之后，描边/小标签与金色也要换到深底那一档 */
  .screen[data-theme="light"] {
    --accent-c: var(--accent-d);
    --gold-c:   var(--gold);
  }

  /* 右侧索引轨：平时是跟着当前屏取浅色/深色一套的，
     现在浅色屏变深了，它也得跟着变，否则整条轨道会亮得跳出来 */
  .rail[data-theme="light"] {
    --rl-line: rgba(147, 166, 205, .3);
    --rl-track: rgba(147, 166, 205, .22);
    --rl-dot: rgba(147, 166, 205, .55);
    --rl-hover: #cddcf3;
    --rl-active: #cddcf3;
    --rl-glow: rgba(205, 220, 243, .16);
    --rl-chip: rgba(12, 17, 28, .9);
    --rl-label-ink: #eef1f7;
  }
}

@media print {
  body { overflow: visible; }
  .deck { height: auto; overflow: visible; }
  .screen { min-height: 0; page-break-after: always; }
  .rail, .starfield { display: none; }
}
