/* ============================================================================
   《月蚀症》官网原型 —— 样式表
   仅包含：布局 / 字体 / 配色 / 基础动效，无框架依赖
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1. 全局变量（配色 + 字体 + 尺寸）
   --------------------------------------------------------------------------- */
:root {
  /* 配色变量 */
  --bg-primary: #0D1117;
  --bg-secondary: #1e252d;
  --accent-cyan: #00FFF7;
  --accent-cyan-dim: #00FFF766;
  --accent-red: #FF2A2A;
  --text-primary: #E8F0F2;
  --text-secondary: #8A9BA8;
  --border-subtle: #2A3540;

  /* 派生色（同样用变量管理，方便统一替换） */
  --bg-nav-scrolled: rgba(13, 17, 23, 0.9);
  --bg-placeholder: #000000;
  --text-on-accent: #000000;
  --scanline-color: rgba(0, 255, 247, 0.04);
  --vignette-color: rgba(0, 0, 0, 0.35);
  --glow-cyan: rgba(0, 255, 247, 0.35);

  /* 字体族 */
  --font-display: 'Chakra Petch', 'Bebas Neue', 'Segoe UI', sans-serif;
  --font-nav: 'Bebas Neue', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --font-cn: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-mono: 'Share Tech Mono', 'Consolas', 'Courier New', monospace;

  /* 尺寸 */
  --nav-height: 64px;
  --page-max: 1280px;
  --section-gutter: 40px;
}

/* ---------------------------------------------------------------------------
   2. 基础重置（所有元素直角，不使用圆角）
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* 始终为竖向滚动条预留位置：
     打开角色档案浮层时会锁住滚动，滚动条一旦消失，居中内容会整体右移约半条滚动条的宽度，
     预留 gutter 后页面宽度保持不变，就不会再出现偏移 */
  scrollbar-gutter: stable;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-cn);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 浮层打开时锁住页面滚动 */
body.is-locked {
  overflow: hidden;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
   3. 全局叠加层：青色扫描线 + 四角暗角
   固定在页面上层，pointer-events: none 保证不响应鼠标
   --------------------------------------------------------------------------- */
.fx-scanlines {
  position: fixed;
  top: -300px;
  left: 0;
  right: 0;
  height: calc(100% + 300px); /* 顶部多出 300px，用于无缝循环滚动 */
  z-index: 9997;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--scanline-color) 0,
    var(--scanline-color) 1px,
    transparent 1px,
    transparent 3px
  );
  /* 极慢速度向下移动，300px 为 3px 间隔的整数倍，循环无跳变 */
  animation: scan-drift 60s linear infinite;
}

@keyframes scan-drift {
  from { transform: translateY(0); }
  to   { transform: translateY(300px); }
}

.fx-vignette {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background:
    radial-gradient(circle at 0% 0%,     var(--vignette-color), transparent 42%),
    radial-gradient(circle at 100% 0%,   var(--vignette-color), transparent 42%),
    radial-gradient(circle at 0% 100%,   var(--vignette-color), transparent 42%),
    radial-gradient(circle at 100% 100%, var(--vignette-color), transparent 42%);
}

/* ---------------------------------------------------------------------------
   4. Logo 图片（assets/ 下的透明底 PNG，直接叠在深色背景上）
   如果以后换成“深色底截图”而不是透明底，在这三个类里补一行
   mix-blend-mode: screen; 即可把深色背景滤掉
   --------------------------------------------------------------------------- */

/* 首屏中央的大 Logo */
.hero-logo-img {
  width: 800px;
  max-width: 90%;
  height: auto;
  display: block;
  margin: 0 auto;
  /* 轻微青色辉光，让 Logo 从夜景里“浮”出来 */
  filter: drop-shadow(0 0 20px rgba(0, 255, 247, 0.3));
}

/* 导航栏左侧小 Logo：初始隐藏，滚动后由 JS 把 opacity / translateY 推到终态 */
.nav-logo {
  display: block;
}

.nav-logo-img {
  width: 200px;
  height: auto;
  display: block;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.2s ease;
}

/* 页脚 Logo：复用导航栏 Logo，宽度收到 160px */
.footer-logo-img {
  width: 160px;
  height: auto;
  display: block;
}

/* ---------------------------------------------------------------------------
   5. 通用占位图组件：黑底青边 + 两行文字说明（+ 可选 REC 红点）
   --------------------------------------------------------------------------- */
.ph {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--bg-placeholder);
  border: 2px solid var(--accent-cyan);
  overflow: hidden;
}

.ph__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px;
}

.ph__title {
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.4;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  text-align: center;
}

.ph__desc {
  max-width: 720px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: center;
}

/* 占位图右上角的闪烁 REC 红点 */
.ph__rec {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: var(--accent-red);
  animation: rec-blink 1.1s steps(1, end) infinite;
}

@keyframes rec-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

/* CG 占位图：400 x 250 */
.ph--cg {
  max-width: 400px;
  aspect-ratio: 400 / 250;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ph--cg .ph__title { font-size: 19px; }
.ph--cg .ph__desc  { font-size: 12px; margin-top: 8px; padding: 0 12px; }

.ph--cg:hover {
  transform: scale(1.02);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px var(--accent-cyan), 0 0 26px var(--glow-cyan);
}

/* ---------------------------------------------------------------------------
   6. 导航栏（固定顶部 64px，初始透明）
   --------------------------------------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 9990;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 滚动后：背景变为半透明深色 */
.site-nav.is-scrolled {
  background: var(--bg-nav-scrolled);
  border-bottom-color: var(--border-subtle);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--section-gutter);
}

.nav-menu__list {
  display: flex;
  align-items: center;
  gap: 34px;
}

/* 导航项：Bebas Neue、大写、字间距 2px */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-family: var(--font-nav);
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--accent-cyan);
}

/* 悬停时右侧出现 6px 的 REC 红点 */
.nav-link__dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-link:hover .nav-link__dot,
.nav-link:focus-visible .nav-link__dot {
  opacity: 1;
}

/* 当前项：青色的下划线 */
.nav-link.is-active {
  color: var(--text-primary);
}

.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 14px; /* 减去 gap 8px + 红点 6px，使下划线只对齐文字 */
  bottom: -10px;
  height: 2px;
  background: var(--accent-cyan);
}

/* 汉堡菜单按钮（桌面端隐藏） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--accent-cyan);
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--accent-cyan);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* 菜单展开时，汉堡图标变为关闭图标 */
.nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------------------------
   7. Section 通用布局
   --------------------------------------------------------------------------- */
.section {
  position: relative;
  padding: 140px var(--section-gutter) 110px;
}

.section__inner {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
}

/* 板块分隔线：细线 + 左端短青色刻度，让板块之间有个过渡 */
.section-rule {
  position: relative;
  width: calc(100% - var(--section-gutter) * 2);
  max-width: var(--page-max);
  height: 1px;
  margin: 0 auto;
  border: 0;
  background: var(--border-subtle);
}

.section-rule::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 64px;
  height: 5px;
  background: var(--accent-cyan);
  opacity: 0.45;
}

.section--characters,
.section--world,
.section--gallery,
.section--news,
.section--download {
  display: flex;
  align-items: center;
}

/* 各板块设定高度（用 min-height 实现，保证小屏内容不被裁切） */
.section--characters { min-height: 120vh; }
.section--world      { min-height: 120vh; }
.section--gallery    { min-height: 100vh; }
.section--news       { min-height: 80vh; }
.section--download   { min-height: 60vh; }

/* 板块标题：青色小字 + 白色大字，左对齐 */
.section-head {
  margin-bottom: 48px;
}

.section-head__kicker {
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--accent-cyan);
}

.section-head__title {
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   8. Section 01 首屏
   --------------------------------------------------------------------------- */
.section--hero {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  min-height: 640px;
  padding: 0 var(--section-gutter);
  overflow: hidden;
}

/* 首屏背景图层：盆地市夜景航拍图铺满整屏（最底层） */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 优先加载 WebP（同分辨率、暗部更干净）；老浏览器走下面这行 JPG 回退 */
  background-image: url('assets/city-night.jpg');
  background-image: image-set(
    url('assets/city-night.webp') type('image/webp'),
    url('assets/city-night.jpg') type('image/jpeg')
  );
  background-size: cover;      /* 按比例铺满，窄屏自动裁切，不留黑边、不拉伸 */
  background-position: center;
  background-repeat: no-repeat;
  /* 压暗整体亮度 + 略提对比 + 降饱和，去掉航拍图的暖调，让夜景更冷更沉
     （还是太亮就把 brightness 改 0.5，太暗改 0.7） */
  filter: brightness(0.6) contrast(1.1) saturate(0.8);
  z-index: 0;
}

/* 背景之上的渐变遮罩：中心稍微透出城市灯光，四周压暗，把视线收到中央的 Logo 上
   （中心仍偏亮就把第一个 alpha 从 0.3 提到 0.5） */
.hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    rgba(13, 17, 23, 0.3) 0%,
    rgba(13, 17, 23, 0.7) 60%,
    rgba(13, 17, 23, 0.9) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

/* 首屏的文字与标签提升到背景之上
   （对应需求里的 hero-logo-img / hero-subtitle / hero-description / hero-tags；
   右下角 .hero__actions 本身是 fixed + 高 z-index，已在背景之上，无需处理） */
.hero-logo-img,
.hero__subtitle,
.hero__lead,
.hero__note,
.hero__tags {
  position: relative;
  z-index: 1;
}

/* 首屏文字加一层暗色投影，边缘和背景分开
   （如果还觉得糊，把 alpha 提到 0.9、模糊半径加到 12px） */
.hero__subtitle,
.hero__lead,
.hero__note,
.hero__tags {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero__subtitle {
  margin-top: 26px;
  font-size: 15px;
  font-style: italic;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

.hero__lead {
  margin-top: 26px;
  font-size: 18px;
  color: var(--text-primary);
}

.hero__note {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-secondary);
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

/* 类型标签：小方块，青色边框 */
.tag {
  padding: 6px 14px;
  font-family: var(--font-cn);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  background: rgba(13, 17, 23, 0.7); /* 半透明底，标签不再直接压在高亮像素上 */
  border: 1px solid var(--accent-cyan);
}

/* 首屏右下角的两个固定按钮 */
.hero__actions {
  position: fixed;
  right: var(--section-gutter);
  bottom: 36px;
  z-index: 9991;
  display: flex;
  gap: 12px;
}

/* ---------------------------------------------------------------------------
   9. 按钮通用样式（黑底青边 → 悬停时背景变青、文字变黑）
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  background: transparent;
  border: 2px solid var(--accent-cyan);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent-cyan);
  color: var(--text-on-accent);
}

/* 下载板块的平台按钮：整行宽度 */
.btn--block {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  padding: 20px 24px;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 1px;
  background: var(--bg-placeholder);
}

/* ---------------------------------------------------------------------------
   10. Section 04 画廊
   --------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  gap: 24px;
}

/* ---------------------------------------------------------------------------
   11. Section 05 新闻
   --------------------------------------------------------------------------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.news-card {
  padding: 24px;
  background: var(--bg-placeholder);
  border: 2px solid var(--accent-cyan);
  transition: background-color 0.2s ease;
}

.news-card:hover {
  background: var(--bg-secondary);
}

.news-card__date {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

.news-card__title {
  margin-top: 10px;
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: 18px;
  color: var(--text-primary);
}

.news-card__text {
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   12. Section 06 下载
   --------------------------------------------------------------------------- */
.download-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  align-items: start;
  gap: 48px;
}

.platform-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 系统需求表格：表头青色、等宽字体 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}

.spec-table th {
  padding: 14px 18px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: left;
  color: var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
}

.spec-table td {
  padding: 14px 18px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.spec-table tbody tr:hover td {
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   13. 页脚
   --------------------------------------------------------------------------- */
.site-footer {
  /* 底部留出空间，避免右下角的固定按钮压住页脚状态行 */
  padding: 28px var(--section-gutter) 100px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: var(--page-max);
  margin: 0 auto;
}

.site-footer__copy {
  grid-column: 2;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   14. 首屏进场时间轴
   - 启动层开始淡出时，JS 给 <body> 加 .is-entering，下面的动画才启动
   - Logo 荧光灯闪烁 0.6s，其余元素在闪烁结束后依次淡入
   --------------------------------------------------------------------------- */
/* 荧光灯亮起：不规则的闪烁节奏 */
@keyframes fluorescent-flicker {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  12%  { opacity: 0.2; }
  20%  { opacity: 1; }
  28%  { opacity: 0.4; }
  40%  { opacity: 1; }
  55%  { opacity: 0.7; }
  70%  { opacity: 1; }
  85%  { opacity: 0.9; }
  100% { opacity: 1; }
}

/* 文字与按钮的淡入：opacity 0 + translateY(10px) → 1 + 0 */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Logo：0.6s 荧光灯闪烁，结束后保持 opacity 1 */
.is-entering .hero__logo {
  animation: fluorescent-flicker 0.6s linear both;
}

/* 副标题：闪烁结束后 0.6s 开始 */
.is-entering .hero__subtitle {
  animation: hero-rise 0.3s ease-out 0.6s both;
}

/* 简介两行：0.75s 开始 */
.is-entering .hero__lead,
.is-entering .hero__note {
  animation: hero-rise 0.3s ease-out 0.75s both;
}

/* 类型标签：0.9s 开始 */
.is-entering .hero__tags {
  animation: hero-rise 0.3s ease-out 0.9s both;
}

/* 右下角按钮：1.0s 开始 */
.is-entering .hero__actions {
  animation: hero-rise 0.3s ease-out 1.0s both;
}

/* 首屏 Logo 的淡入包裹层（本身的 opacity / transform 由滚动脚本控制） */
.hero__logo {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* ---------------------------------------------------------------------------
   15. 动效：Section 进入视口时淡入（由 IntersectionObserver 添加 is-visible）
   --------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================================================================
   16. 情报白板（Section 02）
   - 容器 1200x700，软木底 + 细噪点 + 木质内框，整体旋转 -1deg
   - 七张 160x200 证件照按百分比绝对定位，顶部红色图钉，底部手写标签
   - 红绳用 SVG 二次贝塞尔曲线，端点小圆点模拟图钉
   =========================================================================== */
.intel-board {
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 1200 / 700;   /* 容器按 12:7 等比缩放，移动端也不会变形 */
  margin: 0 auto;
}

/* 白板外层：桌面端不滚动，窄屏时承载横向滑动 */
.intel-board-wrap {
  width: 100%;
}

/* 白板本体：软木色底 + 噪点纹理 + 木质内框（rotate 单独放在这层，避免影响浮层定位） */
.intel-board__bg {
  position: absolute;
  inset: 0;
  background-color: #3A3028;
  /* 用 SVG feTurbulence 生成细噪点，模拟软木板颗粒 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  border: 14px solid #574434;                 /* 木质外框 */
  box-shadow: inset 0 0 0 2px #2A2118,        /* 内圈压线，模拟木框厚度 */
              inset 0 0 90px rgba(0, 0, 0, 0.55);
  transform: rotate(-1deg);
}

/* 红线层：压在照片之上（z-index 10 > 照片层 5），pointer-events 关掉不影响点击 */
.intel-board__strings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-1deg);
  pointer-events: none;
  z-index: 10;
}

.intel-board__strings path {
  stroke: #C0392B;      /* 更亮的暗红，压在照片上也看得清 */
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
}

.intel-board__strings circle {
  fill: #C0392B;        /* 端点圆点，模拟图钉钉住线 */
}

/* 照片层：层级低于红线，所以线会覆盖在照片上 */
.intel-board__photos {
  position: absolute;
  inset: 0;
  transform: rotate(-1deg);
  z-index: 5;
}

/* 单张证件照：宽高按白板百分比取（160/1200 = 13.33%），随白板等比缩放 */
.intel-photo {
  position: absolute;
  width: 13.33%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.25s ease, transform 0.2s ease;
}

.intel-photo__img {
  display: block;
  width: 100%;
  aspect-ratio: 160 / 200;
  border: 4px solid #E8F0F2;     /* 白色相纸边 */
  background: #C9D3D9;
  filter: contrast(1.03);
}

.intel-photo:hover,
.intel-photo:focus-visible {
  transform: translateY(-4px);
}

/* 顶部红色图钉 */
.intel-photo__pin {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--accent-red);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  border-radius: 50%;      /* 图钉是实体物件，按需求做圆形 */
  z-index: 2;
}

/* 底部手写风标签：编号 + 角色名 */
.intel-photo__label {
  display: block;
  margin-top: 6px;
  padding: 2px 4px;
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  color: #F2E7D8;
  background: rgba(13, 17, 23, 0.55);
}

.intel-photo__label b {
  margin-right: 6px;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--accent-cyan);
}

/* 聚焦态：其他照片变暗 */
.intel-board.is-dimmed .intel-photo {
  opacity: 0.3;
}

.intel-board.is-dimmed .intel-photo.is-active {
  opacity: 1;
}

/* 板块内的小提示行 */
.section-note {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   17. 角色档案浮层（点击证件照后展开）
   --------------------------------------------------------------------------- */
.intel-focus {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(13, 17, 23, 0.88);
}

.intel-focus[hidden] {
  display: none;
}

/* 关闭时：放大照片与档案面板一起淡出（配合 JS 的 200ms 延时隐藏） */
.intel-focus.is-closing {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.intel-focus__inner {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  max-width: 900px;
  animation: focus-in 0.25s ease-out both;
}

@keyframes focus-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 放大的证件照：160x200 的 2.2 倍 */
.intel-focus__img {
  display: block;
  width: 352px;
  height: 440px;
  border: 4px solid #E8F0F2;
  background: #C9D3D9;
}

/* 档案面板 */
.intel-focus__panel {
  width: 340px;
  padding: 20px;
  background: var(--bg-primary);
  border: 2px solid var(--accent-cyan);
}

.intel-focus__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.intel-focus__code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

.intel-focus__close {
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
  background: transparent;
  border: 1px solid var(--accent-cyan);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.intel-focus__close:hover,
.intel-focus__close:focus-visible {
  background: var(--accent-cyan);
  color: var(--text-on-accent);
}

.intel-focus__name {
  margin-top: 14px;
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: 22px;
  color: var(--text-primary);
}

.intel-focus__job {
  margin-top: 6px;
  font-family: var(--font-cn);
  font-size: 14px;
  color: var(--text-secondary);
}

.intel-focus__quote {
  margin-top: 16px;
  padding-left: 12px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  border-left: 2px solid var(--accent-cyan);
}

.intel-focus__foot {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   18. 盆地市交互地图（Section 03）
   --------------------------------------------------------------------------- */
.city-map {
  position: relative;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 1000 / 600;   /* 容器 1000x600，等比缩放 */
  margin: 0 auto;
  border: 1px solid var(--accent-cyan);
  overflow: hidden;
}

/* 底图：复用首屏那张鸟瞰图 */
.city-map__bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/city-night.jpg');
  background-image: image-set(
    url('assets/city-night.webp') type('image/webp'),
    url('assets/city-night.jpg') type('image/jpeg')
  );
  background-size: cover;
  background-position: center;
  filter: brightness(0.45) contrast(1.05) saturate(0.7);
}

/* 区域标记点：12px 青色圆点 + 脉冲圆环 */
.map-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.map-marker__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--accent-cyan);
  border-radius: 50%;      /* 青色圆点 */
  transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease;
}

/* 脉冲圆环：从 0 放大到 1.5 倍并淡出 */
.map-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 1px solid var(--accent-cyan);
  border-radius: 50%;      /* 脉冲圆环 */
  animation: marker-pulse 2s ease-out infinite;
}

@keyframes marker-pulse {
  0%   { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}

.map-marker:hover .map-marker__dot,
.map-marker:focus-visible .map-marker__dot {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
}

/* 区域信息面板：宽 320px，从标记点位置弹出 */
.map-panel {
  position: absolute;
  width: 320px;
  max-width: calc(100% - 24px);
  padding: 16px;
  background: var(--bg-primary);
  border: 2px solid var(--accent-cyan);
  z-index: 5;
}

.map-panel[hidden] {
  display: none;
}

.map-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.map-panel__title {
  font-family: var(--font-cn);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

.map-panel__close {
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
  background: transparent;
  border: 1px solid var(--accent-cyan);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.map-panel__close:hover,
.map-panel__close:focus-visible {
  background: var(--accent-cyan);
  color: var(--text-on-accent);
}

.map-panel__desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   19. 下载按钮图标 / Q 版小人装饰 / 页脚扩展
   --------------------------------------------------------------------------- */
.btn__icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  flex: 0 0 auto;
  /* SVG 自带白色填充；悬停时按钮变青底黑字，图标同步压成黑色 */
  transition: filter 0.2s ease;
}

.btn--block:hover .btn__icon,
.btn--block:focus-visible .btn__icon {
  filter: brightness(0);
}

/* Q 版小人：透明底、无边框无阴影，等比缩放到指定尺寸 */
.q-deco {
  display: block;
  width: 56px;
  height: auto;
  pointer-events: none;
}

.q-deco--footer {
  width: 60px;
}

/* 板块标题行：左侧标题 + 右侧装饰/信息 */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-head__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* 页脚：品牌 + Logo + 社交图标 */
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.social-link {
  display: block;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.social-link svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--accent-cyan);
}

/* 页脚第二行：站内条目 + 系统状态 */
.site-footer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: var(--page-max);
  margin: 20px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-family: var(--font-cn);
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-links a {
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent-cyan);
}

.site-footer__status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   20. DOS 启动动画 + 首屏进场时间轴 + 返回顶部
   --------------------------------------------------------------------------- */
/* 启动层：铺满屏幕，文字从左上角开始 */
.boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);   /* #0D1117 */
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 40px;
  box-sizing: border-box;
  transition: opacity 0.2s ease;
}

/* 淡出状态：JS 在打字结束后加上这个类 */
.boot-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* 同一标签页内重复进入时直接不显示启动层，避免闪一下 */
.boot-skip .boot-screen {
  display: none;
}

.boot-screen__text {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.8;
  color: var(--accent-cyan);
  margin: 0;
  white-space: pre-wrap;
}

/* 返回顶部按钮：滚过一屏后出现 */
.to-top {
  position: fixed;
  left: var(--section-gutter);
  bottom: 36px;
  z-index: 9991;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--accent-cyan);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.to-top:hover,
.to-top:focus-visible {
  background: var(--accent-cyan);
  color: var(--text-on-accent);
}

/* ---------------------------------------------------------------------------
   21. 响应式：900px 以下改为单列布局 + 汉堡菜单
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --section-gutter: 20px;
  }

  /* --- 导航栏 --- */
  .nav-toggle {
    display: inline-flex;
  }

  /* 移动端不做 Logo 迁移，直接显示导航栏 Logo（图片按宽度等比缩放，不会变形） */
  .nav-logo-img {
    opacity: 1 !important;
    transform: none !important;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    display: none;
    padding: 8px 0 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-menu.is-open {
    display: block;
  }

  .nav-menu__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    justify-content: space-between;
    padding: 14px var(--section-gutter);
    font-size: 18px;
  }

  /* 移动端当前项用青色文字标识，不再使用下划线 */
  .nav-link.is-active {
    color: var(--accent-cyan);
  }

  .nav-link.is-active::after {
    display: none;
  }

  /* --- 各 Section：单列布局 --- */
  .section {
    padding: 100px var(--section-gutter) 72px;
  }

  .section--hero {
    padding: 0 var(--section-gutter);
    min-height: 560px;
  }

  .section--characters,
  .section--world,
  .section--gallery,
  .section--news,
  .section--download {
    min-height: auto;
    padding-bottom: 88px;
  }

  /* --- 首屏大 Logo：靠 max-width 等比缩小，宽高比保持不变 --- */
  .hero-logo-img {
    max-width: 92%;
  }

  /* 竖屏时航拍图裁切更狠、亮部更集中，渐变遮罩整体加深保证 Logo 可读 */
  .hero-bg::after {
    background: radial-gradient(
      ellipse at center,
      rgba(13, 17, 23, 0.45) 0%,
      rgba(13, 17, 23, 0.8) 60%,
      rgba(13, 17, 23, 0.95) 100%
    );
  }

  /* --- 首屏右下角按钮 --- */
  .hero__actions {
    right: var(--section-gutter);
    bottom: 20px;
    gap: 8px;
  }

  .hero__actions .btn {
    padding: 10px 14px;
    font-size: 12px;
  }

  /* --- 板块标题：左对齐纵向排列，隐藏 Q 版小人装饰 --- */
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .q-deco {
    display: none;
  }

  /* --- 情报白板：保持 12:7 比例放进可横向滑动的容器，
         照片仍是百分比定位，红线依然连在图钉上，不会被挤成一团 --- */
  .intel-board-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;   /* 给横向滚动条留位置 */
  }

  .intel-board {
    min-width: 760px;       /* 低于这个宽度改为横向滑动，保证照片看得清 */
    margin: 0;
  }

  .intel-board__bg {
    border-width: 10px;
  }

  /* --- DOS 启动动画：移动端字号与内边距收小 --- */
  .boot-screen {
    padding: 20px;
  }

  .boot-screen__text {
    font-size: 12px;
  }

  /* --- 角色档案浮层：改为纵向排列 --- */
  .intel-focus {
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
  }

  .intel-focus__inner {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .intel-focus__img {
    width: 200px;
    height: 250px;
  }

  .intel-focus__panel {
    width: 100%;
  }

  /* --- 地图标记点：放大点按区域，方便手指点击 --- */
  .map-marker {
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
  }

  .map-panel {
    width: 100%;
  }

  /* --- 占位图与内容改为单列 --- */

  .ph__title {
    font-size: 20px;
  }

  .gallery-grid,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .ph--cg {
    max-width: 100%;
    aspect-ratio: 400 / 250;
  }

  .download-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* --- 页脚 --- */
  .site-footer__inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 16px;
  }

  .site-footer__copy {
    grid-column: 1;
  }

  .site-footer__brand {
    flex-direction: column;
    gap: 10px;
  }

  .social-list {
    justify-content: center;
  }

  .site-footer__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-footer__status {
    white-space: normal;
  }

  /* --- 返回顶部按钮：挪到左下角，避开右下角固定按钮 --- */
  .to-top {
    left: var(--section-gutter);
    bottom: 20px;
    padding: 8px 10px;
    font-size: 11px;
  }

  /* 移动端两个固定按钮是上下排列的，页脚底部再留多一点 */
  .site-footer {
    padding-bottom: 130px;
  }
}

/* 超小屏：标题进一步缩小，避免溢出 */
@media (max-width: 480px) {
  .section-head__title {
    font-size: 34px;
    letter-spacing: 2px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-end;
  }
}

/* 尊重系统的“减少动态效果”设置 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fx-scanlines,
  .ph__rec {
    animation: none;
  }

  /* 新组件里的循环/进场动效一并关闭，加载动画直接不显示 */
  .map-marker::after,
  .intel-focus__inner,
  .intel-focus.is-closing {
    animation: none;
    transition: none;
  }

  .boot-screen {
    display: none;
  }

  /* 首屏进场时间轴整体关闭，内容直接显示 */
  .is-entering .hero__logo,
  .is-entering .hero__subtitle,
  .is-entering .hero__lead,
  .is-entering .hero__note,
  .is-entering .hero__tags,
  .is-entering .hero__actions {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}
