/* ============================================================================
 *  光影档案 · 编辑杂志风样式表
 *  ---------------------------------------------------------------------------
 *  设计约束（不可违反）：
 *    · 纯单色体系，禁止任何彩色强调色
 *    · 禁止阴影、禁止渐变、禁止圆角（一律直角）
 *    · 背景 #F9F8F6 暖米色，文字 #1C1C1C 柔和黑，层次全部靠透明度
 *    · 标题衬线、正文无衬线、标签大写字距
 * ========================================================================== */

/* ── 设计令牌 ─────────────────────────────────────────────────────────── */
:root {
  --bg: #F9F8F6;
  --fg: #1C1C1C;

  --fg-80: rgba(28, 28, 28, 0.8);
  --fg-60: rgba(28, 28, 28, 0.6);
  --fg-40: rgba(28, 28, 28, 0.4);
  --fg-20: rgba(28, 28, 28, 0.2);
  --fg-10: rgba(28, 28, 28, 0.1);
  --fg-05: rgba(28, 28, 28, 0.05);
  --fg-02: rgba(28, 28, 28, 0.02);
  --bg-60: rgba(249, 248, 246, 0.6);
  --bg-90: rgba(249, 248, 246, 0.9);

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;

  --nav-h: 64px;
  --gutter: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --slow: 1000ms;
}

/* ── 归零 ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
}

p { margin: 0; }
ul, ol, dl, dd, dt { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--fg); color: var(--bg); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 3px;
}

.sprite { display: none; }

.ico {
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}
.ico--lg { width: 22px; height: 22px; }

/* ── 排版基元 ─────────────────────────────────────────────────────────── */
.label {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-40);
  line-height: 1.4;
}

.italic { font-style: italic; color: var(--fg-60); }

.wrap {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.dot { color: var(--fg-20); margin: 0 0.6em; }

/* hover 下划线：从右往左退场，从左往右登场 */
.u {
  position: relative;
  display: inline-block;
}
.u::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.5s var(--ease);
}
.u:hover::after,
.u:focus-visible::after,
.u[aria-current="true"]::after { transform: scaleX(1); transform-origin: bottom left; }

.link {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-60);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.link:hover { color: var(--fg); border-bottom-color: var(--fg-20); }
.link--inv { color: rgba(249, 248, 246, 0.55); }
.link--inv:hover { color: var(--bg); border-bottom-color: rgba(249, 248, 246, 0.3); }

/* ── 按钮 ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  padding: 14px 26px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease), border-color 0.45s var(--ease);
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: var(--fg); }

.btn--solid { background: var(--fg); color: var(--bg); }
.btn--solid:hover { background: transparent; color: var(--fg); }
.btn--quiet { border-color: var(--fg-20); color: var(--fg-60); }
.btn--quiet:hover { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn--line { border-color: var(--fg-20); }
.btn--line:hover { border-color: var(--fg); }
.btn--text {
  border: 0;
  padding: 12px 0;
  gap: 0.9em;
}
.btn--text .ico { transition: transform 0.5s var(--ease); }
.btn--text:hover { background: transparent; color: var(--fg); }
.btn--text:hover .ico { transform: translateX(8px); }
.btn--text::after {
  content: "";
  position: absolute;
  left: 0; bottom: 6px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0.18);
  transform-origin: bottom left;
  transition: transform 0.6s var(--ease);
}
.btn--text { position: relative; }
.btn--text:hover::after { transform: scaleX(1); }

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  color: var(--fg-60);
  transition: color 0.4s var(--ease);
}
.iconbtn:hover { color: var(--fg); }
.iconbtn--inv { color: rgba(249, 248, 246, 0.5); }
.iconbtn--inv:hover { color: var(--bg); }

/* ── 启动态 ───────────────────────────────────────────────────────────── */
.boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bg);
  z-index: 200;
}
.boot__mark {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}
.boot__line {
  width: 96px; height: 1px;
  background: var(--fg-10);
  overflow: hidden;
}
.boot__line::after {
  content: "";
  display: block;
  width: 40%; height: 100%;
  background: var(--fg);
  animation: bootslide 1.4s var(--ease) infinite;
}
@keyframes bootslide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ── 登录门 ───────────────────────────────────────────────────────────── */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  background: var(--bg);
  z-index: 150;
  overflow-y: auto;
}
.gate__inner {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 96px var(--gutter) 48px;
}
.gate__title {
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 18px 0 0;
}
.gate__sub { margin-top: 20px; font-size: 15px; }
.gate__form { margin-top: 56px; max-width: 380px; }
.gate__actions { margin-top: 36px; }
.gate__error {
  min-height: 1.6em;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--fg-10);
  font-size: 12px;
  font-style: italic;
  color: var(--fg-60);
}
.gate__meta {
  margin-top: 88px;
  padding-top: 16px;
  border-top: 1px solid var(--fg-10);
  max-width: 380px;
  color: var(--fg-40);
}

/* ── 浮动标签输入 ─────────────────────────────────────────────────────── */
.field { position: relative; }
.field__input,
.field select {
  width: 100%;
  padding: 22px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--fg-20);
  background: transparent;
  border-radius: 0;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.01em;
  transition: border-color 0.5s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field__input:focus,
.field select:focus { outline: none; border-bottom-color: var(--fg); }
.field__label {
  position: absolute;
  left: 0; top: 22px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-40);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.45s var(--ease), color 0.45s var(--ease);
}
.field__input:focus + .field__label,
.field__input:not(:placeholder-shown) + .field__label {
  transform: translateY(-20px) scale(0.72);
  letter-spacing: 0.16em;
  color: var(--fg-60);
}
.field--line select { font-size: 16px; padding-right: 20px; }
/* 下拉框总是有值，标签直接停在上方 */
.field--line .field__label { transform: translateY(-20px) scale(0.72); letter-spacing: 0.16em; color: var(--fg-60); }
.field--line select:focus + .field__label { color: var(--fg); }
.field--line::after {
  content: "";
  position: absolute;
  right: 0; bottom: 14px;
  width: 7px; height: 7px;
  border-right: 1px solid var(--fg-40);
  border-bottom: 1px solid var(--fg-40);
  transform: rotate(45deg) translateY(-3px);
  pointer-events: none;
}

/* ── 顶部导航 ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  background: var(--bg-90);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--fg-10);
}
.nav__inner {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo { flex: none; }
.nav__mark {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav__links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav__side { display: flex; align-items: center; gap: 16px; flex: none; }

.navlink {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-60);
  padding: 6px 0;
  position: relative;
  transition: color 0.4s var(--ease);
}
.navlink:hover, .navlink[aria-current="true"] { color: var(--fg); }
.navlink::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.5s var(--ease);
}
.navlink:hover::after, .navlink[aria-current="true"]::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}
.navlink--icon { display: inline-flex; align-items: center; padding: 12px 2px; }
.navlink--icon::after { display: none; }

.nav__progress { height: 1px; background: var(--fg-10); overflow: hidden; }
.nav__progress i {
  display: block;
  height: 100%;
  width: 30%;
  background: var(--fg);
  animation: bootslide 1.5s var(--ease) infinite;
}

/* ── 主区域 ───────────────────────────────────────────────────────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; padding-top: var(--nav-h); }

/* ── 刊头 ─────────────────────────────────────────────────────────────── */
.hero { padding: 72px 0 56px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
.hero__edition { display: flex; align-items: center; gap: 0; color: var(--fg-40); }
.hero__title {
  font-size: clamp(2.6rem, 9vw, 6.5rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 16px 0 0;
  word-break: break-word;
}
.hero__sub { margin-top: 22px; max-width: 34em; font-size: 15px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--fg-10);
}
.stats dd {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* ── 工具栏 ───────────────────────────────────────────────────────────── */
.toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: var(--bg-90);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid var(--fg-10);
  border-bottom: 1px solid var(--fg-10);
}
.toolbar__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.toolbar__albums {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.toolbar__albums::-webkit-scrollbar { display: none; }

.chip {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-40);
  white-space: nowrap;
  padding: 4px 0;
  position: relative;
  transition: color 0.4s var(--ease);
}
.chip:hover { color: var(--fg-80); }
.chip[aria-selected="true"] { color: var(--fg); }
.chip[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--fg);
}

.toolbar__tools {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.searchfield {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 220px;
  min-width: 0;
  border-bottom: 1px solid var(--fg-20);
  padding-bottom: 6px;
  transition: border-color 0.5s var(--ease);
}
.searchfield:focus-within { border-bottom-color: var(--fg); }
.searchfield .ico { color: var(--fg-40); }
.searchfield input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  padding: 4px 0;
}
.searchfield input:focus { outline: none; }
.searchfield input::-webkit-search-cancel-button { display: none; }
.searchfield__clear { color: var(--fg-40); display: inline-flex; }
.searchfield__clear:hover { color: var(--fg); }

.selects { display: flex; gap: 18px; }
.sel { display: flex; align-items: baseline; gap: 8px; }
.sel select {
  border: 0;
  border-bottom: 1px solid var(--fg-20);
  background: transparent;
  font-family: var(--sans);
  font-size: 12px;
  padding: 2px 16px 4px 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.4s var(--ease);
}
.sel { position: relative; }
.sel::after {
  content: "";
  position: absolute;
  right: 2px; bottom: 10px;
  width: 6px; height: 6px;
  border-right: 1px solid var(--fg-40);
  border-bottom: 1px solid var(--fg-40);
  transform: rotate(45deg);
  pointer-events: none;
}
.sel select:focus { outline: none; border-bottom-color: var(--fg); }

.viewswitch { display: flex; gap: 2px; }
.viewswitch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 34px;
  color: var(--fg-40);
  transition: color 0.4s var(--ease), background-color 0.4s var(--ease);
}
.viewswitch button:hover { color: var(--fg); background: var(--fg-02); }
.viewswitch button[aria-pressed="true"] { color: var(--fg); background: var(--fg-05); }

.toolbar__note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar__view {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

/* ── 画廊：杂志网格 ───────────────────────────────────────────────────── */
.gallery-wrap { padding: 40px 0 80px; flex: 1; }

.gallery { display: grid; grid-template-columns: 1fr; gap: 40px 24px; }
/* 卡片是选择框与悬浮操作按钮的定位基准 */
.card { position: relative; }
.gallery[data-view="magazine"] .card { display: flex; flex-direction: column; }

.card__frame {
  position: relative;
  overflow: hidden;
  background: var(--fg-02);
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
}
.card__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  color: var(--fg-40);
  background: var(--fg-02);
}
.card__img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform var(--slow) var(--ease), opacity 0.8s var(--ease), filter 0.7s var(--ease);
}
.card__img[data-loaded="false"] { opacity: 0; }
.card__img[data-loaded="true"] { opacity: 1; }
body.is-gray .card__img { filter: grayscale(1) contrast(1.02); }
body.is-gray .card:hover .card__img,
body.is-gray .card:focus-within .card__img { filter: grayscale(0); }

.card__caption {
  padding-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.card__no {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--fg-40);
  font-variant-numeric: tabular-nums;
  flex: none;
  padding-top: 2px;
  transition: font-style 0.5s var(--ease), color 0.5s var(--ease);
}
.card__text { min-width: 0; flex: 1; }
.card__name {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--fg-80);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.4s var(--ease), font-style 0.5s var(--ease);
}
.card__meta { display: block; margin-top: 3px; }
.card:hover .card__name, .card:focus-within .card__name { color: var(--fg); font-style: italic; }

.card__pick {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fg-20);
  background: rgba(249, 248, 246, 0.86);
  color: transparent;
  opacity: 0;
  transition: opacity 0.4s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
body.is-selecting .card__pick { opacity: 1; }
.card__pick:hover { background: var(--bg); color: var(--fg-40); border-color: var(--fg-40); }
.card.is-picked .card__pick { background: var(--fg); border-color: var(--fg); color: var(--bg); opacity: 1; }
.card.is-picked .card__frame { outline: 1px solid var(--fg); outline-offset: -1px; }

.card__q { position: absolute; right: 10px; top: 10px; display: flex; gap: 1px; opacity: 0; transition: opacity 0.4s var(--ease); }
.card:hover .card__q, .card:focus-within .card__q { opacity: 1; }
.card__q button {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(249, 248, 246, 0.88);
  color: var(--fg-80);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.card__q button:hover { background: var(--fg); color: var(--bg); }

/* 桌面：12 栏杂志节奏 */
@media (min-width: 1024px) {
  .gallery[data-view="magazine"] {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 56px 32px;
    align-items: start;
  }
  .gallery[data-view="magazine"] .card { grid-column: span 4; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 1) { grid-column: span 7; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 2) { grid-column: span 5; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 3) { grid-column: span 4; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 4) { grid-column: span 4; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 5) { grid-column: span 4; }
  .gallery[data-view="magazine"] .card:nth-child(6n) { grid-column: span 12; }

  .gallery[data-view="magazine"] .card:nth-child(6n + 1) .card__frame { aspect-ratio: 3 / 2; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 2) .card__frame { aspect-ratio: 4 / 5; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 3) .card__frame { aspect-ratio: 1 / 1; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 4) .card__frame { aspect-ratio: 4 / 5; }
  .gallery[data-view="magazine"] .card:nth-child(6n + 5) .card__frame { aspect-ratio: 3 / 2; }
  .gallery[data-view="magazine"] .card:nth-child(6n) .card__frame { aspect-ratio: 21 / 9; }

  .gallery[data-view="magazine"] .card__img {
    height: 100%;
    object-fit: cover;
  }
  .gallery[data-view="magazine"] .card:hover .card__img { transform: scale(1.04); }
  .gallery[data-view="magazine"] .card:nth-child(6n) .card__name { font-size: 22px; }
}

/* 平板：两列 */
@media (min-width: 601px) and (max-width: 1023px) {
  .gallery[data-view="magazine"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 20px; }
}

/* ── 画廊：瀑布流 ─────────────────────────────────────────────────────── */
.gallery[data-view="masonry"] { display: block; column-count: 2; column-gap: 20px; }
.gallery[data-view="masonry"] .card { break-inside: avoid; margin-bottom: 40px; }
.gallery[data-view="masonry"] .card__img { width: 100%; height: auto; }
.gallery[data-view="masonry"] .card:hover .card__img { transform: scale(1.03); }
@media (min-width: 760px) { .gallery[data-view="masonry"] { column-count: 3; } }
@media (min-width: 1180px) { .gallery[data-view="masonry"] { column-count: 4; column-gap: 28px; } }

/* ── 画廊：编号档案列表 ───────────────────────────────────────────────── */
.gallery[data-view="list"] { display: block; border-top: 1px solid var(--fg-10); }
.gallery[data-view="list"] .card {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--fg-10);
  transition: border-color 0.5s var(--ease);
}
.gallery[data-view="list"] .card:hover { border-bottom-color: var(--fg-40); }
.gallery[data-view="list"] .card__frame {
  grid-column: 1;
  width: 30px; height: 30px;
  display: none;
}
.gallery[data-view="list"] .card__caption { grid-column: 2; padding: 0; display: block; }
.gallery[data-view="list"] .card__no { display: none; }
.gallery[data-view="list"] .card__pick { position: static; grid-column: 1; opacity: 1; border-color: var(--fg-20); background: transparent; color: transparent; }
.gallery[data-view="list"] .card.is-picked .card__pick { background: var(--fg); color: var(--bg); }
.gallery[data-view="list"] .card__q { position: static; opacity: 0; grid-column: 3; }
.gallery[data-view="list"] .card:hover .card__q,
.gallery[data-view="list"] .card:focus-within .card__q { opacity: 1; }
.gallery[data-view="list"] .card__name { white-space: normal; }
@media (min-width: 760px) {
  .gallery[data-view="list"] .card { grid-template-columns: 24px 44px 1fr auto; gap: 22px; padding: 16px 0; }
  .gallery[data-view="list"] .card__pick { grid-column: 1; }
  .gallery[data-view="list"] .card__frame { display: block; grid-column: 2; width: 44px; height: 44px; }
  .gallery[data-view="list"] .card__caption { grid-column: 3; display: flex; align-items: baseline; gap: 16px; }
  .gallery[data-view="list"] .card__text { display: flex; align-items: baseline; gap: 16px; flex: 1; min-width: 0; }
  .gallery[data-view="list"] .card__meta { margin: 0; flex: none; }
  .gallery[data-view="list"] .card__q { grid-column: 4; }
}

/* ── 空态与加载 ───────────────────────────────────────────────────────── */
.state {
  padding: 96px 0 120px;
  max-width: 34em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.state__title { font-family: var(--serif); font-size: 30px; letter-spacing: -0.02em; }
.state__sub { font-size: 14px; }
.state .btn { margin-top: 14px; }
.loadline { width: 120px; height: 1px; background: var(--fg-10); overflow: hidden; }
.loadline i { display: block; width: 40%; height: 100%; background: var(--fg); animation: bootslide 1.5s var(--ease) infinite; }
.sentinel { height: 1px; }

/* ── 页脚 ─────────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--fg-10); }
.foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 26px;
  padding-bottom: 26px;
  flex-wrap: wrap;
}

/* ── 手机底部工具条 ───────────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 65;
  display: flex;
  background: var(--bg-90);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid var(--fg-10);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 56px;
  padding: 8px 0;
  color: var(--fg-40);
  font-size: 10px;
  letter-spacing: 0.14em;
  transition: color 0.4s var(--ease);
}
.tab:hover, .tab[aria-current="true"] { color: var(--fg); }
.tabbar-spacer { height: 56px; }

@media (min-width: 900px) {
  .tabbar, .tabbar-spacer { display: none; }
}

/* 手机端顶部只保留身份与状态，导航交给底部工具条 */
@media (max-width: 899px) {
  .nav__links { display: none; }

  /* 手机上工具栏不吸顶，把纵向空间还给照片 */
  .toolbar { position: static; }
  .toolbar__inner { padding-top: 12px; padding-bottom: 8px; gap: 12px; }
  .toolbar__tools { gap: 14px; }
  .searchfield { flex: 1 1 100%; }
  .selects { gap: 24px; width: 100%; justify-content: space-between; }
  .toolbar__note { padding-top: 0; padding-bottom: 10px; gap: 10px; }
  .toolbar__view { gap: 18px; }
  .viewswitch button { width: 34px; height: 32px; }

  .hero { padding: 40px 0 32px; }
  .hero__title { font-size: clamp(2.4rem, 13vw, 3.4rem); }
  .gallery-wrap { padding: 26px 0 56px; }
  .gallery { gap: 32px 18px; }
}

/* ── 抽屉 ─────────────────────────────────────────────────────────────── */
.drawer {
  position: fixed;
  top: 0; bottom: 0;
  width: min(440px, 100vw);
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: transform 0.65s var(--ease);
  will-change: transform;
}
.drawer--left { left: 0; border-right: 1px solid var(--fg-10); transform: translateX(-101%); }
.drawer--right { right: 0; border-left: 1px solid var(--fg-10); transform: translateX(101%); }
.drawer.is-open { transform: translateX(0); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 14px 24px;
  border-bottom: 1px solid var(--fg-10);
  flex: none;
}
.drawer__body { flex: 1; overflow-y: auto; padding: 28px 24px 40px; }
.drawer__foot {
  flex: none;
  padding: 16px 24px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--fg-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.drawer__foot--split { justify-content: stretch; }
.drawer__foot--split .btn { flex: 1; }

@media (max-width: 560px) {
  .drawer { width: 100vw; border: 0; }
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(28, 28, 28, 0.32);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.scrim.is-open { opacity: 1; }

/* ── 相册目录 ─────────────────────────────────────────────────────────── */
.albumrow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 15px 0;
  border-bottom: 1px solid var(--fg-10);
  text-align: left;
  transition: border-color 0.5s var(--ease);
}
.albumrow:hover { border-bottom-color: var(--fg-40); }
.albumrow__name {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--fg-80);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: font-style 0.5s var(--ease), color 0.4s var(--ease);
}
.albumrow:hover .albumrow__name { font-style: italic; color: var(--fg); }
.albumrow[aria-selected="true"] .albumrow__name { color: var(--fg); }
.albumrow[aria-selected="true"] .albumrow__name::after { content: " ·"; }
.albumrow__num { font-variant-numeric: tabular-nums; flex: none; }

/* ── 上传面板 ─────────────────────────────────────────────────────────── */
.drop {
  margin-top: 28px;
  border: 1px solid var(--fg-20);
  padding: 44px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.45s var(--ease), background-color 0.45s var(--ease);
}
.drop:hover, .drop:focus-visible { border-color: var(--fg); background: var(--fg-02); }
.drop.is-over { border-color: var(--fg); background: var(--fg-05); }
.drop__title { font-family: var(--serif); font-size: 19px; letter-spacing: -0.01em; }
.drop__sub { font-size: 12.5px; }
.drop__alt { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }

.queuehead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--fg-10);
}
.queue { margin-top: 4px; }
.qrow { padding: 13px 0; border-bottom: 1px solid var(--fg-10); }
.qrow__top { display: flex; align-items: baseline; gap: 12px; }
.qrow__name {
  font-family: var(--serif);
  font-size: 15px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qrow__size { flex: none; font-variant-numeric: tabular-nums; }
.qrow__track { height: 1px; background: var(--fg-10); margin-top: 9px; }
.qrow__fill { height: 100%; width: 0; background: var(--fg); transition: width 0.35s var(--ease); }
.qrow.is-error .qrow__fill { background: var(--fg-40); }
.qrow__note { margin-top: 5px; }
.qrow.is-error .qrow__note { color: var(--fg-80); font-style: italic; }

/* ── 灯箱 ─────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--fg);
  color: var(--bg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "top top top"
    "prev stage next"
    "bottom bottom bottom";
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lb__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.lb__bar--top { grid-area: top; border-bottom: 1px solid rgba(249, 248, 246, 0.12); }
.lb__bar--bottom {
  grid-area: bottom;
  border-top: 1px solid rgba(249, 248, 246, 0.12);
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.lb__bar .label { color: rgba(249, 248, 246, 0.45); }
.lb__topactions, .lb__bottomactions { display: flex; align-items: center; gap: 22px; }
.lb__caption { min-width: 0; }
.lb__name {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  word-break: break-all;
}
.lb__stage {
  grid-area: stage;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  min-height: 0;
  min-width: 0;
}
.lb__stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lb__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  color: rgba(249, 248, 246, 0.45);
  transition: color 0.4s var(--ease), background-color 0.4s var(--ease);
}
.lb__arrow:hover { color: var(--bg); background: rgba(249, 248, 246, 0.05); }
.lb__arrow--prev { grid-area: prev; }
.lb__arrow--next { grid-area: next; }
.lb__arrow .ico { width: 24px; height: 24px; }

.lb__info {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(380px, 100vw);
  background: var(--fg);
  border-left: 1px solid rgba(249, 248, 246, 0.12);
  padding: 74px 26px 26px;
  overflow-y: auto;
  z-index: 2;
}
.lb__info dl { display: grid; gap: 18px; }
.lb__info dt { color: rgba(249, 248, 246, 0.4); font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; }
.lb__info dd { font-family: var(--serif); font-size: 16px; margin-top: 6px; word-break: break-all; color: rgba(249, 248, 246, 0.9); }

@media (max-width: 640px) {
  .lightbox {
    grid-template-areas:
      "top top top"
      "stage stage stage"
      "bottom bottom bottom";
  }
  .lb__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 88px; }
  .lb__arrow--prev { left: 0; }
  .lb__arrow--next { right: 0; }
  .lb__stage { padding: 10px; }
  .lb__bottomactions { gap: 16px; flex-wrap: wrap; }
  .lb__name { font-size: 17px; }
}

/* ── 多选操作条 ───────────────────────────────────────────────────────── */
.selbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 140%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 14px 22px;
  background: var(--fg);
  color: var(--bg);
  transition: transform 0.6s var(--ease);
  max-width: calc(100vw - 24px);
  flex-wrap: wrap;
}
.selbar.is-open { transform: translate(-50%, 0); }
.selbar .label { color: rgba(249, 248, 246, 0.5); }
.selbar__actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
@media (max-width: 899px) {
  .selbar {
    left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom));
    transform: translateY(140%);
    max-width: none;
    justify-content: space-between;
  }
  .selbar.is-open { transform: translateY(0); }
}

/* ── 模态框 ───────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(28, 28, 28, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.modal {
  width: 100%;
  max-width: 460px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--fg-10);
  padding: 32px 28px 24px;
}
.modal__title { font-family: var(--serif); font-size: 26px; letter-spacing: -0.02em; }
.modal__sub { margin-top: 10px; font-size: 13.5px; color: var(--fg-60); }
.modal__body { margin-top: 26px; }
.modal__actions {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--fg-10);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}
.modal__list { max-height: 220px; overflow-y: auto; margin-top: 18px; }
.modal__list li {
  font-family: var(--serif);
  font-size: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--fg-10);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-80);
}

/* ── 提示条 ───────────────────────────────────────────────────────────── */
.toasts {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  background: var(--fg);
  color: var(--bg);
  padding: 13px 17px;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast--quiet { background: var(--bg); color: var(--fg); border: 1px solid var(--fg-20); }
@media (max-width: 899px) {
  .toasts { bottom: calc(70px + env(safe-area-inset-bottom)); }
}

/* ── 桌面布局微调 ─────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  :root { --nav-h: 72px; --gutter: 48px; }
  .hero { padding: 104px 0 72px; }
  .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 64px; align-items: end; }
  .hero__aside { padding-bottom: 6px; }
  .stats { grid-template-columns: 1fr; gap: 18px; }
  .stats dd { font-size: 30px; }
  .stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--fg-10); }
  .stats dd { margin-top: 0; }
  .stats { border-top: 0; padding-top: 0; }
  .toolbar__inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
  .toolbar__albums { max-width: 40%; flex: none; }
  .toolbar__tools { gap: 26px; flex: 1; }
  .searchfield { flex: 1 1 300px; max-width: 560px; }
  .selects { margin-left: auto; }
  .gallery-wrap { padding: 64px 0 120px; }
  .lb__bar { padding: 18px 26px; }
  .lb__stage { padding: 32px; }
  .selbar { bottom: 32px; }
}

@media (min-width: 1400px) {
  .hero__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: 96px; }
}

/* ── 无障碍与动效降级 ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card__img { opacity: 1 !important; }
}

/* 滚动条 */
.drawer__body::-webkit-scrollbar, .lb__info::-webkit-scrollbar, .modal::-webkit-scrollbar { width: 6px; }
.drawer__body::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb { background: var(--fg-20); }
.lb__info::-webkit-scrollbar-thumb { background: rgba(249, 248, 246, 0.2); }
