/* ============================================================
   INDEX — 网页作品索引
   版式：居中大标题 → 一行类别胶囊 → 三列卡片网格
   纯白底 · 近黑字 · 整屏舞台 · 圆角卡片
   ============================================================ */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --faint: #a3a3a3;
  --line: #e9e9e9;
  --line-soft: #f2f2f2;
  --stamp: #c0392b;
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 32px;
  --gap: 24px;
  --inset: 32px;
  --pad: 40px;
  --maxw: 1240px;
  --sans: "Geist", "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cover-placeholder: #1c1c1e;
  --online: #22c55e;
}

[data-theme="dark"] {
  --bg: #0e0e10;
  --fg: #ededee;
  --muted: #8a8a90;
  --faint: #5a5a60;
  --line: #242428;
  --line-soft: #161619;
  --cover-placeholder: #232326;
  --online: #4ade80;
}
[data-theme="dark"] body { background: var(--bg); color: var(--fg); }
[data-theme="dark"] .sheet { background: rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .card__link {
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }

/* WebGPU 背景画布：铺满视口、置于所有内容之下 */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.bg-canvas.is-off { opacity: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  cursor: default;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--fg); color: var(--bg); }

/* 移动端：禁止横向滚动、统一字号缩放 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }

/* ---------- 页面舞台（随页面滚动） ---------- */
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--inset);
  display: flex;
}
.stage__inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏（药丸导航） ---------- */
.topbar {
  position: sticky;
  top: var(--inset);
  z-index: 30;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding:10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 6px 24px -12px rgba(0, 0, 0, 0.18);
}
.topbar__brand {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  white-space: nowrap;
}
/* 在线状态：绿色脉冲圆点 */
.status-dot {
  position: relative;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--online) 16%, transparent);
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--online);
  animation: status-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes status-ping {
  0% { transform: scale(1); opacity: 0.65; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}
.topbar__name em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
  margin-left: 5px;
}
.topbar__nav {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
}
.topbar__actions {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.25s var(--ease);
}
.nav-item:hover { color: var(--fg); }
.nav-item svg { width: 15px; height: 15px; flex: none; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.lang-toggle:hover { color: var(--fg); border-color: #d8d8d8; }
.lang-toggle svg { width: 14px; height: 14px; flex: none; }

/* 背景动效开关（关闭时图标变灰并划斜线） */
.bg-toggle {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.bg-toggle:hover { border-color: #d8d8d8; }
.bg-toggle svg { width: 15px; height: 15px; flex: none; }
.bg-toggle[aria-pressed="false"] { color: var(--faint); }
.bg-toggle[aria-pressed="false"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-45deg);
}

.welcome-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  background: transparent;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.welcome-btn:hover { border-color: #d8d8d8; }
.welcome-btn svg { width: 15px; height: 15px; flex: none; }

/* 主题切换：滑动开关（滑块 overshoot 缓动） */
.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--line-soft);
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.switch:hover { border-color: #d8d8d8; }
.switch:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }
[data-theme="dark"] .switch { background: #2a2a30; border-color: #3a3a42; }

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  view-transition-name: theme-knob;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s var(--ease);
}
[data-theme="dark"] .switch-knob { transform: translateX(22px); }

.knob-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.knob-icon--sun { opacity: 1; transform: rotate(0deg) scale(1); }
.knob-icon--moon { opacity: 0; transform: rotate(-90deg) scale(0.4); }
[data-theme="dark"] .knob-icon--sun { opacity: 0; transform: rotate(90deg) scale(0.4); }
[data-theme="dark"] .knob-icon--moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* 圆形扩散进行时，让开关滑块同步滑动（同一 overshoot 缓动） */
::view-transition-group(theme-knob) {
  animation-duration: 0.4s;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="dark"] .topbar { background: #15151a; box-shadow: 0 8px 28px -14px rgba(0, 0, 0, 0.7); }

/* ---------- 主题切换动效：圆形扩散（View Transitions API） ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
/* 过渡期间临时禁用 CSS 过渡：让新快照直接呈现最终配色，
   避免"揭示结束后颜色才渐变"造成的延迟卡顿 */
html.vt-running,
html.vt-running *,
html.vt-running *::before,
html.vt-running *::after {
  transition: none !important;
}

/* ---------- 居中大标题 ---------- */
.hero {
  text-align: center;
  padding: clamp(44px, 7vh, 84px) 0 clamp(26px, 4vh, 40px);
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 64px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.hero p {
  margin-top: 16px;
  font-size: 15px;
  color: var(--muted);
}
.hero p b { font-weight: 500; color: var(--stamp); }

/* ---------- 分类行（左：类别胶囊 · 右：视图切换） ---------- */
.cats-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: clamp(22px, 3.2vh, 34px);
}
.cats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cats::-webkit-scrollbar { display: none; }

/* 分段胶囊：视图切换（滑动高亮） */
.pills {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  flex: none;
}
.pills__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  height: 32px;
  border-radius: 999px;
  background: var(--fg);
  transition: left 0.4s cubic-bezier(0.65, 0, 0.35, 1),
              width 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}
.pill {
  position: relative;
  z-index: 1;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.pill:hover { color: var(--fg); }
.pill.is-active { color: var(--bg); }
.pill svg { width: 14px; height: 14px; flex: none; }
.cat {
  flex: none;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}
.cat:hover { color: var(--fg); border-color: #d8d8d8; }
.cat.is-active { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.cat em { font-style: normal; font-size: 10px; color: var(--faint); }
/* 选中态数字用实色、不透明：暗色主题下 tab 底为浅色、数字为深色，最清晰 */
.cat.is-active em { color: var(--bg); opacity: 1; }
/* 暗色模式下「未选中」数字提亮到接近正文，保证 10px 小字也看得清
   （必须排除 .is-active，否则会覆盖选中态规则，导致浅底浅字看不见） */
[data-theme="dark"] .cat:not(.is-active) em { color: var(--fg); opacity: 0.72; }

/* ---------- 折叠式搜索：默认只留图标，聚焦后展开（仅动画宽度） ---------- */
.search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 56px;                /* 折叠态：约等于一枚图标 */
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;           /* 折叠时裁掉输入文字 */
  cursor: text;               /* 点击任意位置聚焦输入框 */
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.search:hover { border-color: #d8d8d8; }
.search:hover,
.search:focus-within { width: 230px; }
.search > svg {
  width: 15px;
  height: 15px;
  flex: none;                 /* 图标始终钉在左侧 */
  color: var(--muted);
}
.search__input {
  flex: none;
  width: 0;                   /* 折叠时输入框宽度为 0，避免占位文字漏出 */
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.search:hover .search__input,
.search:focus-within .search__input { width: calc(100% - 23px); }
.search__input::placeholder { color: var(--faint); }
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration { -webkit-appearance: none; display: none; }

/* ---------- 内容区（随页面滚动，不单独滚动） ---------- */
.region {
  position: relative;
  padding-bottom: 44px;
}

/* ---------- 卡片网格 ---------- */
.grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  align-content: start;
}
.grid.is-index { grid-template-columns: 1fr; gap: 0; }

.card { min-width: 0; }
.card.is-hidden { display: none; }

.card__link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cover-placeholder);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.35),
    0 1px 0 0 rgba(255, 255, 255, 0.6) inset;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.card__link:hover {
  transform: translateY(-3px);
  box-shadow: 0 46px 110px -36px rgba(0, 0, 0, 0.42),
    0 1px 0 0 rgba(255, 255, 255, 0.6) inset;
}
.card__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform 0.9s var(--ease);
}
.card__link:hover .card__cover { transform: scale(1.05); }

/* 可点击（有链接）的卡片：右上角「外链」标识 */
a.card__link::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.86);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M8 7h9v9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
a.card__link:hover::after {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.26);
}

.card__scrim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 62%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.card__bar {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
  pointer-events: none;
}
.card__name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.card__name em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.62;
}
.card__tag {
  font-size: 11px;
  letter-spacing: 0;
  opacity: 0.8;
  white-space: nowrap;
}

.empty { padding: 40px 4px; font-size: 14px; color: var(--faint); text-align: center; }

/* 页面底部说明 */
.footnote {
  padding: 0 4px 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--faint);
  text-align: center;
}

/* ---------- 索引（列表）视图：同一份 DOM 改写为行 ---------- */
.grid.is-index .card__link {
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 20px;
  padding: 20px 4px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  box-shadow: none;
  transform: none;
  overflow: visible;
}
.grid.is-index .card__link:hover { transform: none; box-shadow: none; }
.grid.is-index .card__scrim,
.grid.is-index .card__cover,
.grid.is-index a.card__link::after { display: none; }
.grid.is-index .card__bar {
  position: static;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  color: var(--fg);
}
.grid.is-index .card__name {
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: -0.03em;
  transition: transform 0.5s var(--ease);
}
.grid.is-index .card__link:hover .card__name { transform: translateX(10px); }
.grid.is-index .card__name em { font-size: 12px; opacity: 1; color: var(--faint); }
.grid.is-index .card__tag { color: var(--muted); opacity: 1; font-size: 13px; }
.grid.is-index .card:first-child .card__link { border-top: 1px solid var(--line); }

/* 列表视图：跟随鼠标的封面预览浮层 */
.card-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  width: 280px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--cover-placeholder);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  scale: 0.92;
  transform-origin: top left;
  transition: opacity 0.24s var(--ease), scale 0.32s var(--ease);
  will-change: transform, scale, opacity;
}
.card-preview.is-on { opacity: 1; scale: 1; }

/* ---------- 关于面板 ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17, 17, 17, 0.24);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.sheet.is-open { opacity: 1; visibility: visible; }
.sheet__panel {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: clamp(32px, 4.4vw, 52px);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.5);
  transform: translateY(18px);
  transition: transform 0.5s var(--ease);
}
.sheet.is-open .sheet__panel { transform: translateY(0); }
.sheet__close {
  position: absolute;
  right: 18px;
  top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--faint);
}
.sheet__close svg { width: 14px; height: 14px; }
.sheet__close:hover { color: var(--fg); }
.sheet__kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}
.sheet h2 {
  margin-top: 14px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.25;
}
.sheet p {
  margin-top: 18px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 44ch;
}
.sheet dl {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
}
.sheet dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.sheet dd { margin-top: 5px; font-size: 14px; }
@media (max-width: 560px) { .sheet dl { grid-template-columns: 1fr; } }

/* ---------- 进入动画 ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(14px);
  animation: fade-up 0.85s var(--ease) forwards;
}
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }
.card.fade-up:nth-child(1) { animation-delay: 0.02s; }
.card.fade-up:nth-child(2) { animation-delay: 0.06s; }
.card.fade-up:nth-child(3) { animation-delay: 0.1s; }
.card.fade-up:nth-child(4) { animation-delay: 0.14s; }
.card.fade-up:nth-child(5) { animation-delay: 0.18s; }
.card.fade-up:nth-child(6) { animation-delay: 0.22s; }

/* ---------- 转场遮罩 ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.55s var(--ease);
  pointer-events: none;
}
.veil.is-leaving { transform: scaleY(1); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  :root { --maxw: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  :root { --inset: 20px; --gap: 16px; --radius: 16px; --radius-lg: 22px; }
  .stage { padding: 20px; }
  .topbar { width: 100%; margin: 0; padding: 6px 6px 6px 14px; gap: 10px; }
  .topbar__name em { display: none; }
  .topbar__nav { gap: 2px; }
  .nav-item { padding: 6px 8px; font-size: 12.5px; }
  .lang-toggle { padding: 0 8px; height: 28px; }
  .bg-toggle { width: 28px; height: 28px; }
  .welcome-btn { width: 28px; height: 28px; }
  .hero { padding: 32px 0 22px; }
  .hero h1 { font-size: clamp(28px, 8vw, 40px); }
  .cats-row { flex-wrap: wrap; }
  .cats-row .cats { flex: 1 1 100%; }
  .cats-row .pills { margin-left: auto; }
  .search:hover,
  .search:focus-within { width: 150px; }
  .grid { grid-template-columns: 1fr; }
  .grid.is-index .card__link { grid-template-columns: 1fr; }
  .grid.is-index .card__tag { display: none; }
  .card__link { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .fade-up { opacity: 1; transform: none; }
  .status-dot::after { display: none; }
}

/* ---------- 寄语卡片（访客问候） ---------- */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.welcome.is-open { opacity: 1; pointer-events: auto; }
.welcome__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 13, 11, 0.55);
  backdrop-filter: blur(12px);
}
.welcome__card {
  position: relative;
  margin: 0;
  width: min(420px, 90vw);
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  background: #f6f2e9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 50px 140px -30px rgba(0, 0, 0, 0.7);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.welcome.is-open .welcome__card { transform: none; }

.welcome__art {
  width: 100%;
  height: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 22px;
}
.welcome__art svg {
  width: 100%;
  height: 100%;
  display: block;
}
.welcome__visitor {
  margin: 12px 0 0;
  text-align: center;
  font-family: "Geist Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #1544BA;
  opacity: 0.85;
}
.welcome__paper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 34px 34px;
  text-align: center;
  color: #1e2b24;
}
.welcome__kicker {
  margin: 0;
  font-family: "Geist Mono", "Inter", ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #1544BA;
}
.welcome__quote {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", Georgia, serif;
  font-size: clamp(19px, 4.4vw, 26px);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: #1e2b24;
}
.welcome__rule {
  display: block;
  width: 46px;
  height: 1px;
  background: #1544BA;
  opacity: 0.5;
}
.welcome__meta {
  margin: 0;
  font-family: "Geist Mono", "Inter", ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b756f;
}
.welcome__brand {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  left: 28px;
  bottom: 22px;
  font-family: "Noto Serif SC", serif;
  color: #1e2b24;
}
.welcome__brand-mark { width: 9px; height: 9px; border-radius: 50%; background: #1544BA; }
.welcome__brand-text { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; }

.welcome__actions { position: relative; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.welcome__actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid rgba(244, 240, 229, 0.3);
  border-radius: 999px;
  color: #f2efe6;
  font-size: 13px;
  background: rgba(244, 240, 229, 0.06);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.welcome__actions button:hover { background: rgba(244, 240, 229, 0.14); border-color: rgba(244, 240, 229, 0.5); }
.welcome__actions svg { width: 14px; height: 14px; flex: none; }

@media (max-width: 700px) {
  .welcome {
    gap: 14px;
    padding: 14px;
    overflow-y: auto;
    justify-content: safe center;
  }
  .welcome__card { width: 100%; max-height: 86dvh; }
  .welcome__paper { padding: 6px 24px 28px; }
  .welcome__actions button { height: 38px; }
}

/* ---------- 移动端（≤600px） ---------- */
@media (max-width: 600px) {
  :root { --inset: 14px; --gap: 14px; }

  /* 顶栏：图标化，避免窄屏溢出 */
  .topbar {
    top: 12px;
    padding: 6px 8px 6px 12px;
    gap: 6px;
    border-radius: 16px;
  }
  .topbar__brand { gap: 7px; }
  .topbar__nav { gap: 0; }
  .nav-item span { display: none; }
  .nav-item { padding: 7px; }
  .lang-toggle span { display: none; }
  .topbar__actions { gap: 4px; }
  .switch { width: 46px; }
  .switch-knob { width: 20px; height: 20px; }
  [data-theme="dark"] .switch-knob { transform: translateX(20px); }

  /* 分类行：类别横向滚动，搜索整行 */
  .cats-row { gap: 12px; }
  .cats-row .pills { margin-left: 0; }
  .search { width: 100%; }
  .search:hover,
  .search:focus-within { width: 100%; }

  /* 卡片信息：长英文名省略，避免溢出 */
  .card__name { min-width: 0; max-width: 64%; overflow: hidden; text-overflow: ellipsis; }
  .card__tag { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

  /* 关于面板：近全屏 */
  .sheet__panel {
    left: 12px; right: 12px; top: 12px; bottom: 12px;
    width: auto; max-height: none;
    padding: 28px 22px;
  }
}

@media (max-width: 380px) {
  .hero h1 { font-size: clamp(26px, 9vw, 34px); }
  .welcome__actions button { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
}


