/* =========================================================
   全站样式 —— 深色玻璃风格
   想改配色只改 :root 里的变量；想改动效强度改「视差系数」
   ========================================================= */

:root {
  /* 配色 */
  --bg: #04050a;
  --fg: #eef1f8;
  --muted: rgba(238, 241, 248, .64);
  --line: rgba(255, 255, 255, .10);
  --dot: rgba(255, 255, 255, .16);
  --accent: #8ab4ff;
  --accent-2: #a78bfa;

  /* 玻璃：底色（tint）+ 亮面（bg），两者叠加才有"有厚度的玻璃"感 */
  --glass-tint: rgba(6, 8, 14, .42);
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04));
  --glass-brd: rgba(255, 255, 255, .18);
  --glass-edge: rgba(255, 255, 255, .50);
  --glass-shadow: 0 18px 50px rgba(0, 0, 0, .55);

  /* 尺寸 */
  --maxw: 1150px;
  --radius: 26px;
  --pill: 999px;

  /* 效率曲线 */
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* 鼠标归一化坐标（-1 ~ 1），由 js/main.js 实时写入 */
  --px: 0;
  --py: 0;
}

/* 浅色模式：点右上角开关切换 */
html[data-theme="light"] {
  --bg: #eef1f8;
  --fg: #0d1017;
  --muted: rgba(13, 16, 23, .60);
  --line: rgba(13, 16, 23, .10);
  --dot: rgba(13, 16, 23, .16);
  --accent: #2f6feb;
  --accent-2: #7c4dff;
  --glass-tint: rgba(255, 255, 255, .55);
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, .70), rgba(255, 255, 255, .30));
  --glass-brd: rgba(255, 255, 255, .95);
  --glass-edge: rgba(255, 255, 255, 1);
  --glass-shadow: 0 18px 40px rgba(15, 23, 42, .14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .1em .42em;
}
html[data-theme="light"] code { background: rgba(13, 16, 23, .06); }

::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

/* 滚动条也做成玻璃感 */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(13, 16, 23, .18); background-clip: content-box; }

/* =========================================================
   背景层：点阵 + 光斑 + 月亮，全部随鼠标做视差
   ========================================================= */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* 点阵网格 */
.bg-grid {
  position: absolute;
  inset: -12%;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 30%, transparent 78%);
  will-change: transform;
  transform: translate3d(calc(var(--px) * -18px), calc(var(--py) * -18px), 0);
}

/* 两团彩色光斑 */
.bg-glow {
  position: absolute;
  width: 72vmax;
  height: 72vmax;
  border-radius: 50%;
  filter: blur(40px);
  will-change: transform;
}
.bg-glow-a {
  left: -18vmax;
  top: -28vmax;
  background: radial-gradient(circle, rgba(96, 86, 255, .34), transparent 62%);
  transform: translate3d(calc(var(--px) * 28px), calc(var(--py) * 22px), 0);
}
.bg-glow-b {
  right: -26vmax;
  bottom: -30vmax;
  background: radial-gradient(circle, rgba(0, 200, 180, .20), transparent 62%);
  transform: translate3d(calc(var(--px) * -24px), calc(var(--py) * -20px), 0);
}

/* 四周压暗，让中间更聚焦 */
.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 38%, rgba(0, 0, 0, .80) 100%);
}
html[data-theme="light"] .bg-vignette {
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 40%, rgba(160, 175, 210, .35) 100%);
}

/* =========================================================
   液态玻璃：所有玻璃块共用的底子
   --mx/--my 是鼠标在元素内的百分比，由 JS 写入 → 决定高光位置
   ========================================================= */
.glass {
  position: relative;
  background-color: var(--glass-tint);
  background-image: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-brd);
  box-shadow:
    inset 0 1px 0 var(--glass-edge),          /* 顶部棱边反光 */
    inset 0 -1px 1px rgba(0, 0, 0, .22),      /* 底部内阴影 */
    var(--glass-shadow);
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}

/* 跟随鼠标的镜面高光（液态感的来源之一）
   只给顶栏用：卡片、资源列表这些"框"里没有鼠标坐标，
   高光会固定在正中变成一个白点，所以它们不带这个效果 */
.nav-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    160px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, .38),
    rgba(255, 255, 255, .06) 42%,
    transparent 68%
  );
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.nav-shell:hover::after { opacity: 1; }

/* 玻璃的「厚度」：用一层渐变描边勾出边缘 */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .04) 42%, rgba(255, 255, 255, .26));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: .9;
}

/* =========================================================
   顶栏
   ========================================================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 18px 20px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 1180px;
}

/* 玻璃胶囊容器 */
.nav-shell {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--pill);
  /* 宽度对齐参考站：一条横跨大半个屏幕的长条 */
  width: min(980px, 100%);
  /* 比卡片更透一点，好让底下的内容透出来被"折射" */
  background-color: rgba(6, 8, 14, .34);
  /* 轻微倾斜跟随鼠标（JS 写 --tilt-x / --tilt-y） */
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  will-change: transform;
}

/* 浅色主题：白底上不能再用"深色玻璃"，否则发灰；彩虹边也会像渲染错误 */
html[data-theme="light"] .nav-shell {
  background-color: rgba(255, 255, 255, .58);
  border-color: rgba(255, 255, 255, .85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 1px rgba(15, 23, 42, .06),
    0 18px 40px rgba(15, 23, 42, .12);
}

/* =========================================================
   顶栏「真玻璃」：透镜折射 + 色散
   js/main.js 检测到浏览器支持后会在 <html> 上加 .lens-on；
   不支持的浏览器自动退回毛玻璃，不会变透明或坏掉。
   ========================================================= */
.lens-on .nav-shell {
  -webkit-backdrop-filter: blur(.6px) saturate(1.2) url(#glass-lens);
  backdrop-filter: blur(.6px) saturate(1.2) url(#glass-lens);
}

/* 边缘色散：一圈很薄的彩虹描边，模拟白光被玻璃棱边分开 */
.nav-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  background: conic-gradient(from 205deg,
    rgba(255, 120, 60, .55), rgba(255, 60, 120, .35), rgba(120, 120, 255, 0),
    rgba(80, 200, 255, .45), rgba(255, 255, 255, .62), rgba(255, 140, 80, .50),
    rgba(120, 120, 255, .35), rgba(255, 120, 60, .55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: .9;
  filter: blur(.2px);
}

/* 白底上改成极淡的冷色描边，去掉彩虹 */
html[data-theme="light"] .nav-shell::before {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 1),
    rgba(170, 186, 214, .42) 46%,
    rgba(140, 160, 195, .34) 74%,
    rgba(255, 255, 255, .95));
  opacity: 1;
  filter: none;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  color: var(--fg);
  padding: 0 8px;
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }

/* 导航项：紧凑成簇，在品牌和 FPS 之间居中（参考图就是这么排的）
   —— gap 保持小间距，auto 外边距负责把整簇推到中间 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  margin: 0 auto;
}

/* 每颗胶囊都是一个独立小玻璃块（磁吸效果靠 --tx/--ty/--s） */
.nav-link {
  position: relative;            /* ::after 的定位基准 */
  display: inline-block;
  padding: 9px 19px;
  border-radius: var(--pill);
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  background-color: rgba(10, 12, 20, .45);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  backdrop-filter: blur(8px) saturate(160%);
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) scale(var(--s, 1));
  transition: color .25s, background-color .25s, border-color .25s, box-shadow .25s;
  will-change: transform;
}
html[data-theme="light"] .nav-link {
  background-color: rgba(255, 255, 255, .45);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .25));
  border-color: rgba(255, 255, 255, .8);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), inset 0 1px 0 rgba(255, 255, 255, .9);
}
/* 胶囊也吃同一套透镜滤镜（位移量小一号）——
   这样它们不是"贴"在玻璃条上的塑料片，而是同一块玻璃上的凸起 */
.lens-on .nav-link {
  -webkit-backdrop-filter: blur(.5px) saturate(1.15) url(#glass-lens-sm);
  backdrop-filter: blur(.5px) saturate(1.15) url(#glass-lens-sm);
}

/* 胶囊边缘也带一点色散，和长条呼应；比长条那圈更收敛 */
.nav-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 220deg,
    rgba(255, 130, 70, .45), rgba(255, 255, 255, .55),
    rgba(90, 200, 255, .40), rgba(255, 255, 255, .30),
    rgba(255, 130, 70, .40));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: .7;
}
html[data-theme="light"] .nav-link::after {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 1), rgba(170, 186, 214, .35), rgba(255, 255, 255, .9));
  opacity: .7;
}
/* 鼠标悬停：整颗胶囊亮起来 */
.nav-link:hover {
  color: var(--fg);
  background-color: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 6px 20px rgba(0, 0, 0, .28);
  text-decoration: none;
}
html[data-theme="light"] .nav-link:hover {
  background-color: rgba(255, 255, 255, .8);
  border-color: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12), inset 0 1px 0 #fff;
}

/* 当前所在区块 */
.nav-link.is-active {
  color: var(--fg);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* 右上角 FPS（纯装饰，跟你参考图里那个一样） */
.nav-fps {
  font-size: .72rem;
  color: var(--muted);
  padding: 0 6px 0 14px;
  margin-left: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nav-fps b { font-weight: 600; color: var(--fg); }

/* 主题开关 */
.theme-toggle {
  pointer-events: auto;
  margin-left: auto;
  position: relative;
  width: 58px;
  height: 32px;
  padding: 0;
  border-radius: var(--pill);
  cursor: pointer;
  flex: none;
}
.theme-toggle .knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #cdd6e8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  transition: transform .45s var(--ease), background .45s var(--ease);
}
html[data-theme="light"] .theme-toggle .knob {
  transform: translateX(26px);
  background: linear-gradient(180deg, #6d8dff, #2f6feb);
}

/* =========================================================
   首屏（介绍）
   ========================================================= */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 150px 22px 90px;
}

.eyebrow {
  font-size: .78rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 26px;
  /* 中文/英文都好看的弱化小字 */
  font-weight: 500;
}
.eyebrow span { opacity: .5; margin: 0 .5em; }

/* 巨标题：斜体 + 大写 + 3D 跟随鼠标 */
.hero-title {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, "PingFang SC", sans-serif;
  font-size: clamp(2.1rem, 8.2vw, 6.4rem);
  font-weight: 900;
  font-style: italic;
  font-stretch: condensed;
  line-height: .94;
  letter-spacing: -.025em;
  text-transform: uppercase;
  color: #fff;
  /* 任何情况下都不允许标题把页面撑出横向滚动条 */
  max-width: 100%;
  overflow-wrap: break-word;
  text-shadow: 0 0 70px rgba(140, 170, 255, .30), 0 2px 0 rgba(0, 0, 0, .20);
  transform:
    perspective(1000px)
    rotateY(calc(var(--px) * 7deg))
    rotateX(calc(var(--py) * -7deg))
    translate3d(calc(var(--px) * -14px), calc(var(--py) * -10px), 0);
  will-change: transform;
  transition: text-shadow .5s;
}
html[data-theme="light"] .hero-title {
  color: #0d1017;
  text-shadow: 0 0 70px rgba(90, 120, 255, .22);
}
.hero-title .name {
  /* 你的名字单独上色，一眼能找到它们 */
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin: 30px auto 0;
  font-size: clamp(.95rem, 1.6vw, 1.1rem);
  color: var(--muted);
  max-width: 40em;
  /* 比标题弱一档的视差 */
  transform: translate3d(calc(var(--px) * -6px), calc(var(--py) * -5px), 0);
}

.hero-actions {
  margin: 40px 0 0;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  transform: translate3d(calc(var(--px) * -3px), calc(var(--py) * -3px), 0);
}

/* 玻璃按钮 */
.btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--pill);
  font-size: .92rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  border: 1px solid var(--glass-brd);
  background-color: var(--glass-tint);
  background-image: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .3s var(--ease), background .3s, border-color .3s, box-shadow .3s;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-2px) scale(1.02);
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .38);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #06080f;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 34%, transparent);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 42px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* 底部滚动提示 */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: .78rem;
  letter-spacing: .14em;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-hint::after {
  content: "";
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: hint-fall 2.2s var(--ease) infinite;
}
@keyframes hint-fall {
  0%   { opacity: 0; transform: translateY(-10px) scaleY(.4); }
  45%  { opacity: 1; transform: translateY(0) scaleY(1); }
  100% { opacity: 0; transform: translateY(10px) scaleY(.6); }
}

/* =========================================================
   内容区块
   ========================================================= */
.section {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 110px 22px;
}
.section-head { margin-bottom: 42px; }
.section-kicker {
  font-size: .72rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 14px;
}
.section-title {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.section-desc { margin: 0; color: var(--muted); max-width: 46em; font-size: .95rem; }

/* 作品卡片 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  border-radius: var(--radius);
  padding: 26px 26px 28px;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .035) 52%, rgba(255, 255, 255, .10));
  border-color: rgba(255, 255, 255, .14);
}
html[data-theme="light"] .card {
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .45));
}
.card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 22px 50px rgba(0, 0, 0, .55);
}
.card:hover .card-arrow { transform: translate(3px, -3px); opacity: 1; }

/* 卡片封面图：内嵌成一张小照片（不做出血，避免 flex 拉伸算错宽度） */
.card-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 6px;
  background: #595959;
}
.card-tag {
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.card h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.01em; }
.card p { margin: 0; font-size: .9rem; color: var(--muted); }
.card-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--muted);
}
.card-arrow {
  opacity: .5;
  transition: transform .35s var(--ease), opacity .35s;
}

/* 资源列表 */
.res-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.res-list li + li { border-top: 1px solid var(--line); }
.res-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  color: var(--fg);
  transition: background .25s;
}
.res-list a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
html[data-theme="light"] .res-list a:hover { background: rgba(13, 16, 23, .04); }
.res-name { font-size: .95rem; }
.res-meta { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* 还没上传文件的位置：不可点，视觉上弱一档 */
.res-list li.is-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  opacity: .5;
}
.res-list li.is-empty .res-name { color: var(--muted); }

/* 兜底：如果哪行的 <li> 里忘了写 <a>（比如把文件路径误写进 class），
   仍然按正常行排版，不会挤成一团贴到边框上 —— 只是点不动 */
.res-list li:not(.is-empty):not(:has(a)) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  color: var(--muted);
}

/* 关于 */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}
.about-text p { margin: 0 0 14px; color: var(--muted); font-size: .96rem; }
.about-text strong { color: var(--fg); font-weight: 600; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-list li { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.contact-list span { color: var(--muted); }
.panel { border-radius: var(--radius); padding: 26px; }

/* =========================================================
   滚动渐入（没有 JS 时内容也照常显示，不会白屏）
   ========================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 34px 22px 46px;
  font-size: .84rem;
  color: var(--muted);
}
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* =========================================================
   文章页（作品详情）
   ========================================================= */
.article {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 140px 22px 100px;
}

/* 文章页是纯文字，不需要额外的背景元素（保留点阵和光斑） */
.article h1 {
  font-size: clamp(1.7rem, 4.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 10px 0 14px;
}
.article h2 { font-size: 1.15rem; margin: 38px 0 10px; letter-spacing: -.01em; }
.article p, .article li { color: var(--muted); }
.article strong { color: var(--fg); }
.article .back { font-size: .85rem; color: var(--muted); }
.article .back:hover { color: var(--accent); }
.meta-line { font-size: .82rem; color: var(--muted); letter-spacing: .05em; margin: 0 0 28px; }
.article pre {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.65;
}
html[data-theme="light"] .article pre { background: rgba(13, 16, 23, .04); }
.article pre code { background: none; border: 0; padding: 0; }

/* 制作流程的步骤列表 */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: flow;
}
.flow li {
  position: relative;
  padding: 14px 18px 14px 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}
html[data-theme="light"] .flow li { background: rgba(255, 255, 255, .55); }
.flow li::before {
  counter-increment: flow;
  content: counter(flow, decimal-leading-zero);
  position: absolute;
  left: 18px;
  top: 15px;
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--accent);
}
.flow li strong { display: block; font-size: .95rem; color: var(--fg); font-weight: 600; }
.flow li span { font-size: .86rem; color: var(--muted); }

/* =========================================================
   图集（作品大图）
   用 CSS 多列做瀑布流：每张图保持自己的比例，不会互相挤压，
   也不会被裁掉（原图已经被裁成内容紧贴边缘了）
   ========================================================= */
.gallery {
  columns: 2;
  column-gap: 14px;
  margin: 0 0 8px;
}
.gallery-item {
  position: relative;
  display: block;
  margin: 0 0 14px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #595959;      /* 和图里 Marmoset 的灰底一致，避免边缘露色差 */
  cursor: zoom-in;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .6s var(--ease), filter .3s;
}
.gallery-item:hover img { transform: scale(1.035); }
.gallery-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 16px 12px;
  font-size: .8rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.gallery-item:hover .gallery-cap { opacity: 1; }

/* =========================================================
   图片灯箱
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(4, 5, 10, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.lightbox.is-open { display: grid; }
.lightbox img {
  max-width: min(1400px, 94vw);
  max-height: 86vh;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .75);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .25s, transform .25s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .22); transform: rotate(90deg); }
.lightbox-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  font-size: .84rem;
  color: rgba(255, 255, 255, .72);
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 860px) {
  .nav-fps { display: none; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { padding: 12px 10px; }
  .topbar-inner { gap: 8px; }

  /* 关键：flex-basis 设 0 + min-width 0，玻璃胶囊只占「剩下的宽度」并在内部横向滚动，
     否则它按内容撑开会把右边的主题开关挤出屏幕 */
  .nav-shell {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    width: auto;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 7px 8px;
  }
  .nav-shell::-webkit-scrollbar { display: none; }
  /* 窄屏不参与"均匀铺开"，否则胶囊会被拉散、还会把开关挤出去 */
  .nav-links { flex: 0 1 auto; justify-content: flex-start; margin: 0; gap: 6px; }
  .nav-brand { padding-left: 4px; padding-right: 8px; font-size: .92rem; }
  .nav-link { padding: 7px 12px; font-size: .82rem; }

  .theme-toggle { width: 50px; height: 28px; }
  .theme-toggle .knob { width: 20px; height: 20px; }
  html[data-theme="light"] .theme-toggle .knob { transform: translateX(22px); }

  .hero { padding-top: 118px; }
  /* 标题必须能在 390px 宽的屏幕上放得下 */
  .hero-title { font-size: clamp(1.5rem, 7.6vw, 2.4rem); letter-spacing: -.02em; }
  .hero-sub { font-size: .93rem; }
  .section { padding: 70px 18px; }
  .gallery { columns: 1; }
  .scroll-hint { display: none; }
}

/* 手机（≤560px）再收一档：五个导航项 + 主题开关必须刚好放得下，
   否则最后一个（GitHub）会被挤到边线上，看起来像被裁掉 */
@media (max-width: 560px) {
  .nav-shell { gap: 4px; padding: 6px; }
  .nav-links { gap: 3px; }
  /* 窄屏上站名让位给导航项（首屏大标题里已经有名字了） */
  .nav-brand { display: none; }
  .nav-link { padding: 6px 10px; font-size: .78rem; }

  .theme-toggle { width: 44px; height: 26px; }
  .theme-toggle .knob { width: 18px; height: 18px; top: 4px; left: 4px; }
  html[data-theme="light"] .theme-toggle .knob { transform: translateX(18px); }

  .hero-title { font-size: clamp(1.35rem, 7vw, 1.9rem); letter-spacing: -.03em; }
  .hero-sub { font-size: .88rem; }
}

/* 用户开了「减少动态效果」就关掉所有动画 —— 无障碍要求 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .bg-grid, .bg-glow, .hero-title, .hero-sub, .nav-shell { transform: none !important; }
}
