/* ==========================================================================
   电影视频首屏 · 个人博客首屏
   近黑 #05060A 底色 + 暖金 #E4C063 单一强调色
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #05060A;
  --surface: #0A0C12;
  --accent: #E4C063;
  --accent-soft: rgba(228, 192, 99, 0.14);
  --accent-line: rgba(228, 192, 99, 0.45);
  --text: #F4F1EA;
  --text-soft: #D8D3C7;
  --hairline: rgba(244, 241, 234, 0.12);

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --measure: 44rem;
  /* 正文最大行宽 */
  --section-y: clamp(4rem, 11vh, 6.5rem);
  /* 区块纵向留白 */
  /* 视频真实宽高比：JS 读到元数据后会在 .hero 上覆盖为准确值，这里是兜底（常见 16:9） */
  --video-ratio: 1.7778;
  /* 首屏舞台高度上限：略低于一屏，让下一区块露出一点，形成滚动提示 */
  --hero-max: 92vh;
  /* 顶部导航高度：fixed 定位，用同值补偿首屏内边距，标题不会被挡 */
  --nav-h: 4rem;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* 固定导航会盖住锚点目标，跳转时预留出导航高度 */
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  /* 背景图统一放在 .bg-image（fixed、z-index -2）里加 filter: blur，
     保证正文文字可读。background-color 仍兜底防图片加载失败/未加载完 */
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   背景图：单张 VRChat_3.webp 静态展示
   ========================================================================== */
.bg-image {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url('assets/VRChat_3.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(5px) brightness(0.65);
}

/* 全局暗化蒙版：fixed 全屏、z-index: -1，画在 .bg-image 之上。
   罩一层 rgba(5,6,10,0.55) 给整页统一暗调，让背景图更柔、文字更清晰、避免各 section 之间色带；
   contact / footer 再叠更深一层形成"下方更黑"的层次 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.55);
  pointer-events: none;
  z-index: -1;
}

h1,
h2,
p,
blockquote,
figure {
  margin: 0;
}

::selection {
  background: rgba(228, 192, 99, 0.3);
  color: var(--text);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #05060A;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   顶部导航
   ========================================================================== */

/* 固定在最上层：首屏视频从页面顶边开始铺，导航浮在其上 */
.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  /* 磨砂玻璃：压低底色不透明度 + 大半径模糊 + 提饱和，视频的色块会在背后糊成一片流动的色雾 */
  background: rgba(5, 6, 10, 0.6);
  border-bottom: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  /* 顶部一道极淡高光 + 向下投影：让玻璃片有厚度，并从内容里浮起来 */
  box-shadow: inset 0 1px 0 rgba(244, 241, 234, 0.06), 0 14px 40px rgba(5, 6, 10, 0.3);
}

/* 不支持 backdrop-filter 时退化为不透明底，保证导航文字对比度 */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .site-nav {
    background: rgba(5, 6, 10, 0.88);
  }
}

.site-nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem clamp(1rem, 4vw, 2.5rem);
  min-height: var(--nav-h);
  padding: 0.5rem var(--gutter);
}

.site-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

/* 品牌圆形小 logo：深色描边让它与导航底色之间留一点呼吸 */
.site-nav__logo {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: block;
  border: 1px solid var(--hairline);
  transition: border-color 0.3s var(--ease);
}

.site-nav__brand:hover {
  color: var(--accent);
}

.site-nav__brand:hover .site-nav__logo {
  border-color: rgba(228, 192, 99, 0.5);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.9rem, 2.6vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 0.45rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

/* 悬停/聚焦时下方生长一条暖金细线 */
.site-nav__link::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s var(--ease);
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--accent);
}

.site-nav__link:hover::after {
  transform: scaleX(1);
}

/* ==========================================================================
   背景音乐控制按钮
   ========================================================================== */
/* 固定在右下角的玻璃感按钮，与 site-nav 同款（背板模糊 + 暗底 + 暖金高光）；
   z-index 6 高于 site-nav 的 5，确保不被半透明导航遮挡 */
.bg-music {
  position: fixed;
  bottom: clamp(1rem, 2.5vh, 1.5rem);
  right: clamp(1rem, 2.5vw, 1.5rem);
  z-index: 6;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(5, 6, 10, 0.6);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(244, 241, 234, 0.06), 0 14px 40px rgba(5, 6, 10, 0.3);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

.bg-music:hover {
  border-color: rgba(228, 192, 99, 0.5);
  color: var(--accent);
}

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

.bg-music:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bg-music__icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* 默认显示播放图标；aria-pressed=true（正在播放）切换到暂停图标 */
.bg-music__icon--pause {
  display: none;
}

.bg-music[aria-pressed="true"] .bg-music__icon--play {
  display: none;
}

.bg-music[aria-pressed="true"] .bg-music__icon--pause {
  display: inline;
}

/* ==========================================================================
   加载页：首次进入预加载资源，全屏遮罩 + 进度条
   ========================================================================== */
/* 整页 fixed 遮罩，z-index 9999 高于一切（.bg-music=6、.contact__qr=5、.site-nav=5）。
   加载完加 .is-loaded 类后 0.5s 淡出 + visibility:hidden 不再拦截点击 */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.5s var(--ease), visibility 0s 0.5s;
}

.loader.is-loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  width: min(22rem, 80%);
}

.loader__brand {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  color: var(--accent);
  opacity: 0.85;
}

.loader__logo {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: block;
  border: 1px solid var(--hairline);
}

.loader__bar {
  width: 100%;
  height: 2px;
  background: rgba(244, 241, 234, 0.08);
  overflow: hidden;
}

.loader__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), rgba(228, 192, 99, 0.6));
  transition: width 0.25s var(--ease);
}

.loader__pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--text-soft);
  opacity: 0.7;
}

/* 减少动效偏好：跳过淡出过渡，立即消失 */
@media (prefers-reduced-motion: reduce) {
  .loader {
    transition: none;
  }
}

@media (max-width: 640px) {
  .bg-music {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

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

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  /* 内容锚在左下角：字幕式构图 */
  align-content: end;
  justify-items: start;
  overflow: hidden;
  /* 舞台高度跟随视频比例：容器比例 == 视频比例时，铺满画面既不裁切也不留黑边 */
  --hero-height: clamp(30rem, calc(100vw / var(--video-ratio)), var(--hero-max));
  min-height: var(--hero-height);
  /* 顶部让出固定导航的高度，矮屏上标题也不会被挡 */
  padding: calc(var(--nav-h) + clamp(3.5rem, 9vh, 6rem)) var(--gutter) clamp(3.5rem, 9vh, 6rem);
  /* 首屏画面全部来自 .hero__video（未播放时显示其 poster 帧），这里只留电影感底色 */
  background: radial-gradient(125% 95% at 50% 18%, #0C0E16, var(--bg) 68%);
}

@supports (height: 100svh) {

  /* 移动端用 svh，避免地址栏收起时首屏高度跳变 */
  .hero {
    --hero-max: 92svh;
  }
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.hero__video {
  display: block;
  width: 100%;
  height: 100%;
  /* 铺满舞台：容器高度已按视频比例生成，因此通常等于等比铺满（零裁切零黑边）；
     只有视频比视口更高时，才从上下对称裁掉最少的部分，绝不留黑边 */
  object-fit: cover;
  object-position: center;
  filter: saturate(0.86) contrast(1.06) brightness(0.86);
  /* 常驻可见：poster 立即绘制（首屏 LCP），视频就绪后原位无缝接管，不会白屏 */
  /* 容器高度由 .hero 的 --hero-height 固定，因此不存在 CLS；此处不再做任何推近缩放 */
}

/* 文字压视频的可读性遮罩（渐变 + 暗角），保证 4.5:1 对比 */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(115% 85% at 50% 18%, rgba(228, 192, 99, 0.10), rgba(5, 6, 10, 0) 62%),
    radial-gradient(140% 120% at 50% 55%, rgba(5, 6, 10, 0) 38%, rgba(5, 6, 10, 0.9) 100%),
    linear-gradient(180deg,
      rgba(5, 6, 10, 0.84) 0%,
      rgba(5, 6, 10, 0.55) 38%,
      rgba(5, 6, 10, 0.88) 78%,
      var(--bg) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1rem, 2.6vh, 1.75rem);
  width: 100%;
  /* 比正文行宽更宽，避免放大后的标题过早换行（--measure 仍留给名言区） */
  max-width: min(56rem, 100%);
  text-align: left;
}

/* 文字块背后的柔和聚焦区：只在文字正后方补足对比度，四周仍看得清视频 */
.hero__content::before {
  content: "";
  position: absolute;
  inset: -14% -20%;
  z-index: -1;
  background: radial-gradient(62% 58% at 16% 56%, rgba(5, 6, 10, 0.72), rgba(5, 6, 10, 0) 74%);
  pointer-events: none;
}

.hero__title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(2.6rem, 8.5vw, 7rem);
  line-height: 1.14;
  letter-spacing: 0.02em;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(5, 6, 10, 0.75), 0 0 90px rgba(5, 6, 10, 0.5);
}

.hero__subtitle {
  max-width: 34ch;
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2.1vw, 1.5rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--text-soft);
  text-wrap: pretty;
}

.quotes__note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* ==========================================================================
   名言警句
   ========================================================================== */

.quotes {
  position: relative;
  padding: var(--section-y) var(--gutter) clamp(3.5rem, 11vh, 6rem);
  /* 顶部从原 var(--bg) 不透明衔接改为 rgba(5,6,10,0.55) 半透明、过渡更短（2-4rem）：
     仍有一点顶部暗色平滑接 hero 视频底部，但向下淡到透明让 body 模糊背景图透出，
     不再出现纯黑横条 */
  background:
    linear-gradient(180deg, rgba(5, 6, 10, 0.55) 0%, rgba(5, 6, 10, 0) clamp(2rem, 6vh, 4rem)),
    radial-gradient(120% 130% at 50% 0%, rgba(228, 192, 99, 0.07), rgba(5, 6, 10, 0) 58%),
    transparent;
}

/* 区块分隔细线：中段偏暖金，替代生硬的整条边框 */
.quotes::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg,
      rgba(244, 241, 234, 0) 0%,
      var(--hairline) 20%,
      rgba(228, 192, 99, 0.38) 50%,
      var(--hairline) 80%,
      rgba(244, 241, 234, 0) 100%);
}

.quotes__inner {
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
}



/* 区块标题共用一套字（等宽 + 宽字距 + 暖金）：改这里两个区块的标题一起生效 */
.quotes__title,
.blog-entry__title,
.contact__title {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--accent);
}

/* 标题下的英文小副标题：mono 小字 + 宽字距但不大写，颜色比标题降一档 */
.section-subtitle {
  margin: 0.45rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: none;
  color: var(--text-soft);
  opacity: 0.72;
}

/* 固定最小高度：切换名言时行数变化不会带动整页跳动；下限要盖住 .quote__text 最大字号下的两行 */
.quotes__panel {
  display: grid;
  align-content: center;
  min-height: clamp(7.5rem, 20vh, 10rem);
  margin-top: clamp(1rem, 3vh, 1.75rem);
}

.quote__text {
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.85vw, 1.95rem);
  line-height: 1.85;
  letter-spacing: 0.03em;
  text-wrap: balance;
  /* 数据里的 \n 是刻意断行（对联式短句）：pre-line 保留换行，同时仍按容器宽度正常折行 */
  white-space: pre-line;
}

.quotes__panel[data-state="swapping"] .quote__text {
  opacity: 0;
  transform: translateY(0.35rem);
}

/* 引号由样式生成，/ "" 让辅助技术跳过（不支持该语法时浏览器直接不渲染） */
.quote__text::before {
  content: "「" / "";
}

.quote__text::after {
  content: "」" / "";
}

.quote__text::before,
.quote__text::after {
  color: var(--accent);
}

/* ==========================================================================
   博客入口
   ========================================================================== */

.blog-entry {
  position: relative;
  padding: var(--section-y) var(--gutter) clamp(3.5rem, 11vh, 6rem);
}

/* 与 .quotes / .contact 同一套分区细线：中段偏暖金，保持区块呼吸一致 */
.blog-entry::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg,
      rgba(244, 241, 234, 0) 0%,
      var(--hairline) 20%,
      rgba(228, 192, 99, 0.38) 50%,
      var(--hairline) 80%,
      rgba(244, 241, 234, 0) 100%);
}

.blog-entry__inner {
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
}

.blog-entry__desc {
  margin: clamp(1rem, 3vh, 1.75rem) 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: var(--text);
}

.blog-entry__link {
  display: inline-block;
  margin-top: clamp(1.25rem, 3.5vh, 2rem);
  padding: 0.72rem 2.1rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.blog-entry__link:hover,
.blog-entry__link:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ==========================================================================
   联系方式
   ========================================================================== */

.contact {
  position: relative;
  /* 底部渐暗到 0.5，正好等于页脚顶部的起始暗度：让 contact → footer 的
     变暗过渡无缝衔接，不再有"交界处亮度突变"的硬边 */
  background: linear-gradient(180deg,
      rgba(5, 6, 10, 0) 0%,
      rgba(5, 6, 10, 0) 55%,
      rgba(5, 6, 10, 0.5) 100%);
  /* 底部留白加大：容纳悬停时展开的大二维码，避免它压住页脚 */
  padding: var(--section-y) var(--gutter) clamp(18rem, 34vh, 26rem);
}

/* 与 .quotes 同一套分区细线：中段偏暖金，保持两个区块的呼吸一致 */
.contact::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg,
      rgba(244, 241, 234, 0) 0%,
      var(--hairline) 20%,
      rgba(228, 192, 99, 0.38) 50%,
      var(--hairline) 80%,
      rgba(244, 241, 234, 0) 100%);
}

.contact__inner {
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
}

.contact__list {
  /* 联系方式收窄一些：每行字少，铺满 --measure 会显得松散 */
  max-width: 30rem;
  margin: clamp(1.25rem, 3.5vh, 2rem) auto 0;
  padding: 0;
  list-style: none;
}

/* 细线分行的表单式排布：标签居左、值居右。
   垂直用 center 而非 baseline：图片的 baseline 是底边，
   baseline 对齐会让图标行的标签沉底、文本行却正常，三行标签忽高忽低 */
.contact__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 4vw, 2rem);
  padding-block: clamp(0.7rem, 2vh, 0.95rem);
  border-bottom: 1px solid var(--hairline);
}

.contact__label {
  flex: none;
  font-family: var(--font-mono);
  font-size: 2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.contact__value {
  /* 值可能是任意长度的邮箱/ID：允许收缩换行，避免撑破行 */
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--text);
  /* 单击即整体选中，邮箱/ID 可以直接复制 */
  -webkit-user-select: all;
  user-select: all;
}

.contact__value--link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.28em;
  transition: text-decoration-color 0.3s var(--ease);
}

.contact__value--link:hover {
  text-decoration-color: currentColor;
}

/* ==========================================================================
   联系方式 · 图标卡片
   ========================================================================== */
/* 联系方式为图标式：QQ 悬停弹 QR 加好友码，VRChat 点图标直接跳主页 */

.contact__iconwrap {
  /* wrap 是 QR 浮层的定位锚点；QR 会超出 wrap 范围显示 */
  position: relative;
  display: inline-flex;
  align-items: center;
}

.contact__iconlink {
  /* 链接容器不再画边框/圆环：图标按原生像素显示，链接只是个 hover 锚点 */
  display: inline-flex;
  align-items: center;
  color: var(--text);
  transition: opacity 240ms var(--ease), filter 240ms var(--ease);
}

.contact__iconlink:hover,
.contact__iconlink:focus-visible {
  opacity: 0.85;
  filter: brightness(1.15);
}

.contact__icon {
  display: block;
}

/* 图标统一到 4rem 视觉高度：行与行节奏一致，标签高度不再参差。
   QQ / Bilibili 为 1:1 方图；VRChat 保持原图比例（1031:433 ≈ 2.38:1）只缩高度 */
.contact__icon--qq {
  width: 4rem;
  height: 4rem;
}

.contact__icon--bilibili {
  width: 4rem;
  height: 4rem;
}

.contact__icon--github {
  width: 4rem;
  height: 4rem;
}

.contact__icon--vrchat {
  width: 9.5rem;
  height: 4rem;
}

/* QR 浮层：默认折叠；hover 图标或 QR 自身时显示，留出扫码时间 */
.contact__qr {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 100%;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 0.7rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  /* 淡出态与显示态位置完全一致（translateX(-50%)），纯渐隐、不位移不缩放。
     之前淡出时 translate(50%) 会让浮层向右移动约半个自身宽度：
     鼠标向右移出时，移动中的浮层会"追上"指针 → :hover 重新成立 → 又弹回 →
     又淡出 → 无限抽搐。位置不变后浮层不再扫过指针，才能平滑消失 */
  transform: translate(-50%, 0);
  transition: opacity 120ms var(--ease),
    transform 120ms var(--ease),
    visibility 0s linear 120ms;
  z-index: 5;
}

/* 用兄弟选择器同时覆盖 QR：鼠标停在 QR 自身时也保持显示，给扫码留时间 */
.contact__iconlink:hover~.contact__qr,
.contact__iconlink:focus-visible~.contact__qr,
.contact__qr:hover {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 220ms var(--ease),
    transform 220ms var(--ease),
    visibility 0s;
}

.contact__qr-img {
  width: 18rem;
  aspect-ratio: 1058 / 1920;
  display: block;
  border-radius: 0.35rem;
}

.contact__qr-tip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-soft);
  white-space: nowrap;
}

/* ==========================================================================
   页脚
   ========================================================================== */

.site-footer {
  /* 顶部 0.5 直接承接 .contact 底部的 0.5，随后用多段色标平滑加深到全黑：
     多档"先缓后快"的过渡比一段线性更自然，不会在中段就几乎全黑 */
  background: linear-gradient(180deg,
      rgba(5, 6, 10, 0.5) 0%,
      rgba(5, 6, 10, 0.8) 40%,
      rgba(5, 6, 10, 0.95) 72%,
      rgba(5, 6, 10, 1) 100%);
  padding: clamp(2rem, 6vh, 3.25rem) var(--gutter) clamp(2.25rem, 7vh, 3.5rem);
}

.site-footer__inner {
  max-width: var(--measure);
  margin-inline: auto;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: clamp(0.5rem, 1.5vh, 0.8rem);
}

/* 页脚第一行：站点主张（中文短句），居中、字大但色淡，深藏不露 */
.site-footer__slogan {
  font-family: var(--font-sans);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: rgba(244, 241, 234, 0.2);
  line-height: 1.3;
  text-align: center;
}

/* slogan 与信息区之间的细分隔线：暖金渐隐，呼应各区块的分隔线 */
.site-footer__slogan::after {
  content: "";
  display: block;
  width: clamp(3rem, 8vw, 5rem);
  height: 1px;
  margin: clamp(1rem, 2.5vh, 1.6rem) auto 0;
  background: linear-gradient(90deg,
      rgba(244, 241, 234, 0) 0%,
      rgba(228, 192, 99, 0.45) 50%,
      rgba(244, 241, 234, 0) 100%);
}

/* 信息区：版权 / 署名 / 备案逐行居中堆叠 */
.site-footer__colophon {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.site-footer__copy,
.site-footer__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--text-soft);
}

/* 署名比版权再弱一档：不争注意力 */
.site-footer__meta {
  opacity: 0.7;
}

/* 备案行：回正文字体，与上面的等宽元信息区分开；全居中下不再限宽 */
.site-footer__note {
  font-size: 0.78rem;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: var(--text-soft);
  opacity: 0.78;
  text-wrap: pretty;
}

/* ICP 备案链接：颜色继承正文、默认下划线极淡，悬停时变明显——避免默认蓝色在深色主题里突兀 */
.site-footer__note--icp a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(216, 211, 199, 0.25);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.3s var(--ease);
}

.site-footer__note--icp a:hover,
.site-footer__note--icp a:focus-visible {
  text-decoration-color: currentColor;
}

/* 公安网备：与 ICP 备案同一行，图标 + 文字作为整体一起点击。
   图标用 em 定尺（h=1em, w=0.9em 对应原图 36×40），字号变化时自动跟随，
   不会比旁边中文大一圈；vertical-align 微调让图标视觉居中于汉字。 */
.site-footer__police {
  margin-left: 0.75em;
  white-space: nowrap;
}

/* ICP 与公安网备之间的细竖线：伪元素生成，不进 DOM、不被读屏软件念出来，
   也永远黏在公安那条前面（不会孤零零掉在上一行行尾）。
   height 0.9em 比汉字略短、vertical-align 微调使其与汉字视觉居中；
   颜色随文字（currentColor）再压到 45%，只起"分界"作用，不抢视线 */
.site-footer__police::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.9em;
  margin-right: 0.75em;
  vertical-align: -0.1em;
  background-color: currentColor;
  opacity: 0.45;
}

.site-footer__police-icon {
  width: 0.9em;
  height: 1em;
  margin-right: 0.35em;
  vertical-align: -0.16em;
  object-fit: contain;
}

/* 手机：两条备案号一行放不下时竖排成两行，去掉竖线和左间距。
   全居中排版下 justify-items 用 center，与上方信息区保持一致 */
@media (max-width: 560px) {
  .site-footer__note--icp {
    display: grid;
    justify-items: center;
    gap: 0.3rem;
  }

  .site-footer__police {
    margin-left: 0;
  }

  .site-footer__police::before {
    display: none;
  }
}

/* ==========================================================================
   降级与动效偏好
   ========================================================================== */

@media (max-width: 640px) {

  /* 窄屏容器比例与视频比例差太多会"两难"：contain 黑边巨丑、cover 裁切严重。
     现状是 min-height 30rem (480px) 强制容器高度 → 393 宽视口下比例 0.82:1，
     视频 16:9 (1.78:1) 上下大片黑边。
     改为：min-height 降到 20rem (320px) → 容器比例 1.23:1，
     配合 cover（裁切 ~15% 边缘）比 contain 的 50%+ 黑边效果好得多。
     长远解法：导出 9:16 竖屏视频给手机，HTML 已加 source 占位 */
  .hero__video {
    object-fit: cover;
  }

  .hero {
    min-height: clamp(20rem, calc(100vw / var(--video-ratio)), 70vh);
    padding-block: calc(var(--nav-h) + clamp(3rem, 8vh, 5rem)) clamp(3rem, 8vh, 5rem);
  }

  .hero__title {
    letter-spacing: 0.01em;
  }

  /* 联系方式：图标与二维码在窄屏等比缩小，避免横向溢出 */
  .contact__icon--qq {
    width: 3.25rem;
    height: 3.25rem;
  }

  .contact__icon--bilibili {
    width: 3.25rem;
    height: 3.25rem;
  }

  .contact__icon--github {
    width: 3.25rem;
    height: 3.25rem;
  }

  .contact__icon--vrchat {
    width: 7.7rem;
    height: 3.25rem;
  }

  .contact__qr-img {
    width: 16rem;
  }
}

/* 手机：进一步收窄；二维码浮层改全屏居中，避免侧边定位溢出屏幕 */
@media (max-width: 480px) {

  .hero__title {
    font-size: clamp(2.4rem, 13vw, 3.2rem);
  }

  .contact__label {
    font-size: 1.5rem;
  }

  /* 移动端二维码改 fixed 居中，不再需要大留白容纳 */
  .contact {
    padding-bottom: clamp(3.5rem, 11vh, 6rem);
  }

  .contact__qr {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .contact__iconlink:hover~.contact__qr,
  .contact__iconlink:focus-visible~.contact__qr,
  .contact__qr:hover {
    transform: translate(-50%, -50%);
  }

  .contact__qr-img {
    width: 13rem;
  }

  .site-footer__slogan {
    font-size: clamp(2.2rem, 11vw, 3rem);
    letter-spacing: 0.14em;
  }
}

@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;
  }
}