/* ==========================================================
   星辰文件资源下载站 - 全站样式
   主题：深空星辰 · 玻璃拟态 · 青紫渐变
   ========================================================== */

:root {
  --bg-deep: #050816;
  --bg-mid: #0a1028;
  --bg-soft: #101a3c;
  --accent-cyan: #7dd3fc;
  --accent-violet: #a78bfa;
  --accent-pink: #f0abfc;
  --text-main: #e6edf9;
  --text-sub: #9aa8c7;
  --text-dim: #6b7a99;
  --glass-bg: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-hover: rgba(255, 255, 255, 0.09);
  /* 毛玻璃统一模糊配方：普通卡片档 / 大面板加强档（模糊 + 提饱和） */
  --glass-blur: blur(16px) saturate(150%);
  --glass-blur-strong: blur(24px) saturate(160%);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-glow: 0 0 24px rgba(125, 211, 252, 0.15);
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  --transition-base: 0.3s cubic-bezier(0.25, 0.6, 0.3, 1);
}

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

/* hidden 属性兜底：防止类样式（如 .modal-overlay 的 display:flex）覆盖隐藏语义，
   否则透明遮罩会盖住整个页面导致所有按钮无法点击 */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: radial-gradient(ellipse at 20% -10%, var(--bg-soft) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(88, 60, 180, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 110%, rgba(30, 64, 140, 0.35) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.65;
  /* clip 不会创建滚动容器，避免破坏子元素的 position: sticky；
     老浏览器回退到 hidden */
  overflow-x: hidden;
  overflow-x: clip;
}

/* ================= 星空背景 ================= */

.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--tw-dur, 3s) ease-in-out infinite;
  animation-delay: var(--tw-delay, 0s);
  opacity: 0.6;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

.shooting-star {
  position: absolute;
  width: 130px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
  border-radius: 2px;
  opacity: 0;
  transform: rotate(-32deg);
  animation: shoot 7s linear infinite;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.8));
}

@keyframes shoot {
  0% { opacity: 0; transform: rotate(-32deg) translateX(0); }
  4% { opacity: 1; }
  12% { opacity: 0; transform: rotate(-32deg) translateX(420px); }
  100% { opacity: 0; transform: rotate(-32deg) translateX(420px); }
}

/* ================= 背景图层（随机 ACG 背景媒体） =================
   固定全屏背景层：默认加载随机 mp4 动图（config 的 background.url，由 main.js
   先按视频加载、失败再按图片重试），成功后淡入；失败/超时保持隐藏，
   露出默认的深空渐变 + 星空背景。内部媒体铺满裁切；
   ::after 深色暗纱压暗背景，保证前景文字与毛玻璃卡片可读。 */

.bg-image {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.bg-image.loaded { opacity: 1; }

.bg-image video,
.bg-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 深色暗纱：压暗随机背景，保证前景文字与毛玻璃卡片的可读性 */
.bg-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(5, 8, 22, 0.14), rgba(5, 8, 22, 0.4) 74%),
    linear-gradient(180deg, rgba(5, 8, 22, 0.35) 0%, rgba(5, 8, 22, 0.55) 100%);
}

/* ================= 通用布局 ================= */

main {
  position: relative;
  z-index: 1;
}

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 46px 22px 10px;
}

.section-head {
  margin-bottom: 22px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.section-title svg {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.5));
}

/* 毛玻璃基底：半透明底 + 背景模糊提饱和 + 顶部内高光（玻璃边缘感） */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 34px rgba(1, 3, 10, 0.32);
}

/* ================= Hero ================= */

.hero {
  position: relative;
  z-index: 1;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 22px;
}

.hero-logo {
  margin-bottom: 22px;
  animation: floaty 5s ease-in-out infinite;
  filter: drop-shadow(0 0 22px rgba(125, 211, 252, 0.45));
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-title {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(100deg, #e0f2fe 10%, var(--accent-cyan) 40%, var(--accent-violet) 75%, var(--accent-pink) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shine 7s linear infinite;
}

@keyframes shine {
  to { background-position: 200% center; }
}

.hero-subtitle {
  margin-top: 14px;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  color: var(--text-sub);
  letter-spacing: 2px;
}

.hero-badges {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  font-size: 0.82rem;
  color: var(--text-sub);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: var(--transition-base);
}

.hero-badge:hover {
  color: var(--accent-cyan);
  border-color: rgba(125, 211, 252, 0.4);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  animation: bounce 2.2s ease-in-out infinite;
  transition: color 0.25s;
}

.hero-scroll:hover { color: var(--accent-cyan); }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(9px); }
}

/* ================= 基础设施简介（背景融合式布局） =================
   无卡片、无边框、无玻璃衬底：标题、文案与示意图直接浮于背景星空之上，
   底部垫一层极淡的青紫环境光帮助内容与背景自然融合；
   文案由 main.js 逐字拆分（含关键词高亮），滚动进入视口（.infra-live）后
   逐字浮现并清晰化，随后青→紫→粉的色彩涟漪循环扫过；
   右侧分流示意图保留，叠加节点呼吸光晕与分流虚线动画。 */

.infra-plain {
  position: relative;
  width: min(1040px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  /* filter 由 main.js 按滚动进度逐帧写入（景深失焦），不参与过渡以免动画滞后 */
}

/* 环境光：两团大范围低透明度光晕，让文字区域与背景融为一体（非卡片衬底） */
.infra-plain::before {
  content: "";
  position: absolute;
  inset: -16% -6%;
  pointer-events: none;
  background:
    radial-gradient(44% 46% at 30% 40%, rgba(125, 211, 252, 0.075), transparent 72%),
    radial-gradient(40% 44% at 72% 62%, rgba(167, 139, 250, 0.085), transparent 72%);
}

.infra-head,
.infra-body {
  position: relative;
  z-index: 0; /* 保证内容绘制在环境光之上 */
}

.infra-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

/* 标题：图标浮动光晕 + 渐变流光大字（与 Hero 主标题同一视觉语言） */
.infra-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 4px;
}

.infra-title-icon {
  display: inline-flex;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 10px rgba(125, 211, 252, 0.55));
  animation: floaty 5s ease-in-out infinite;
}

.infra-title-text {
  background: linear-gradient(100deg, #e0f2fe 10%, var(--accent-cyan) 40%, var(--accent-violet) 72%, var(--accent-pink) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* 深色投影跟随渐变字形，保证在较亮背景媒体上依然可读 */
  filter: drop-shadow(0 2px 12px rgba(4, 8, 20, 0.55));
  animation: shine 7s linear infinite;
}

/* 标题下渐变细线：两端淡出，自然消失在背景中 */
.infra-divider {
  width: min(520px, 76vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.5), rgba(167, 139, 250, 0.5), transparent);
}

/* 主体：左侧文案 + 右侧架构图（窄屏上下堆叠，见响应式区块） */
.infra-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 44px;
  align-items: center;
  width: 100%;
}

/* 简介文案：无任何衬底直接浮于背景，可读性由字符深色投影保证 */
.infra-flow {
  font-size: clamp(0.98rem, 1.7vw, 1.1rem);
  line-height: 2.3;
  letter-spacing: 0.6px;
  text-align: center;
  color: var(--text-sub);
}

/* 单字 span：入场/涟漪两段动画的错峰延迟由 main.js 按字序号写入内联样式 */
.infra-char {
  display: inline-block;
  color: var(--text-sub);
  text-shadow: 0 1px 10px rgba(3, 6, 16, 0.5);
}

/* 关键词字符：加粗提亮，随色彩涟漪同步辉光（见 infraKeyWave） */
.infra-key {
  font-weight: 700;
  color: #e0f2fe;
  text-shadow: 0 0 12px rgba(125, 211, 252, 0.3), 0 1px 10px rgba(3, 6, 16, 0.5);
}

/* 架构图：去掉底框，SVG 直接浮于背景，整体带柔和光晕与深色投影 */
.infra-diagram {
  padding: 6px;
  filter: drop-shadow(0 0 22px rgba(125, 211, 252, 0.12)) drop-shadow(0 4px 14px rgba(3, 6, 16, 0.5));
}

/* 示意图节点：策略引擎呼吸光晕，存储节点错峰脉动（呼应数据持续分流） */
.diagram-core {
  animation: diagramCorePulse 3.2s ease-in-out infinite;
}

.diagram-node {
  animation: diagramNodePulse 2.7s ease-in-out infinite;
}

.diagram-node:nth-of-type(2) { animation-delay: 0.45s; }
.diagram-node:nth-of-type(3) { animation-delay: 0.9s; }

@keyframes diagramCorePulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(125, 211, 252, 0.35)); }
  50% { filter: drop-shadow(0 0 9px rgba(167, 139, 250, 0.7)); }
}

@keyframes diagramNodePulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.55)); }
}

/* 分流虚线：持续流动 */
.flow-line {
  stroke-dasharray: 6 6;
  animation: flowdash 1.4s linear infinite;
}

@keyframes flowdash {
  to { stroke-dashoffset: -24; }
}

/* ---- 入场与色彩涟漪动画（有 JS 且滚动进入视口 .infra-live 后播放） ----
   无 JS 时以下预隐藏规则不生效，内容保持静态可见；
   "减弱动效"时由该媒体查询区块内的可见性覆盖规则直接显示。 */

.js .infra-head,
.js .infra-diagram {
  opacity: 0;
}

.js .infra-divider {
  opacity: 0;
  transform: scaleX(0);
}

.js .infra-char {
  opacity: 0;
}

.js .infra-live .infra-head {
  animation: infraHeadIn 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.js .infra-live .infra-divider {
  animation: infraDividerIn 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s both;
}

/* 每字两段动画：入场浮现清晰化（一次性）+ 色彩涟漪（循环）；
   各自的延迟由 main.js 写入内联 animation-delay（入场, 涟漪） */
.js .infra-live .infra-char {
  animation: infraCharIn 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both,
    infraCharWave 12s linear infinite;
}

/* 关键词字符复用入场动画，涟漪换用带辉光的版本 */
.js .infra-live .infra-char.infra-key {
  animation-name: infraCharIn, infraKeyWave;
}

.js .infra-live .infra-diagram {
  animation: infraDiagramIn 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.3s both,
    infraFloat 7s ease-in-out 1.5s infinite;
}

@keyframes infraHeadIn {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes infraDividerIn {
  from { opacity: 0; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}

@keyframes infraCharIn {
  from { opacity: 0; transform: translateY(16px) scale(0.86); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes infraDiagramIn {
  from { opacity: 0; transform: translateX(42px); }
  to { opacity: 1; transform: none; }
}

@keyframes infraFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* 色彩涟漪：大部分时间保持正文色，一段青→紫→粉的高光带
   随逐字错峰延迟缓慢扫过全文（涟漪周期与错峰步长见 main.js 的 INFRA_ANIM） */
@keyframes infraCharWave {
  0%, 14%, 100% { color: var(--text-sub); }
  2.5% { color: #bae6fd; }
  5% { color: var(--accent-cyan); }
  7.5% { color: var(--accent-violet); }
  10% { color: var(--accent-pink); }
  12.5% { color: #93c5fd; }
}

/* 关键词涟漪：与正文同相位，颜色更亮并带同步辉光
   （text-shadow 仅参与关键词动画，控制整体重绘成本） */
@keyframes infraKeyWave {
  0%, 14%, 100% {
    color: #e0f2fe;
    text-shadow: 0 0 12px rgba(125, 211, 252, 0.3), 0 1px 10px rgba(3, 6, 16, 0.5);
  }
  2.5% {
    color: #f0f9ff;
    text-shadow: 0 0 16px rgba(186, 230, 253, 0.55), 0 1px 10px rgba(3, 6, 16, 0.5);
  }
  5% {
    color: var(--accent-cyan);
    text-shadow: 0 0 18px rgba(125, 211, 252, 0.8), 0 1px 10px rgba(3, 6, 16, 0.5);
  }
  7.5% {
    color: var(--accent-violet);
    text-shadow: 0 0 18px rgba(167, 139, 250, 0.8), 0 1px 10px rgba(3, 6, 16, 0.5);
  }
  10% {
    color: var(--accent-pink);
    text-shadow: 0 0 18px rgba(240, 171, 252, 0.8), 0 1px 10px rgba(3, 6, 16, 0.5);
  }
  12.5% {
    color: #bfdbfe;
    text-shadow: 0 0 14px rgba(147, 197, 253, 0.6), 0 1px 10px rgba(3, 6, 16, 0.5);
  }
}

/* ================= 服务商列表（基础设施简介下方） =================
   各家官方 logo 主色不一（雨云/浪浪云等为深色文字，深色星空背景下不可读），
   故统一用浅色圆角衬底（chip）承载 logo，保证可读性与视觉统一；
   悬停上浮 + 青紫辉光。入场跟随基础设施简介（.infra-live 后整块错峰浮现），
   并随滚动景深与简介整块同步失焦（位于 .rack-bg 子元素内）。 */

.infra-providers {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* 小标题：与主标题同一套渐变流光，字号收窄以区分层级 */
.providers-title {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(100deg, #e0f2fe 10%, var(--accent-cyan) 40%, var(--accent-violet) 72%, var(--accent-pink) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(4, 8, 20, 0.5));
}

.providers-subtitle {
  font-size: clamp(0.78rem, 1.5vw, 0.9rem);
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-shadow: 0 1px 8px rgba(3, 6, 16, 0.5);
}

.providers-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 18px;
  margin-top: 8px;
  list-style: none;
}

/* 浅色衬底：近白微透底 + 圆角 + 投影，统一承载不同主色的 logo */
.provider-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 20px;
  background: rgba(248, 250, 252, 0.96);
  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(2, 4, 12, 0.35);
  transition: transform var(--transition-base), box-shadow var(--transition-base),
    background var(--transition-base);
}

.provider-item:hover {
  transform: translateY(-3px);
  background: #fff;
  box-shadow: 0 10px 30px rgba(2, 4, 12, 0.45), 0 0 22px rgba(125, 211, 252, 0.35);
}

/* logo：固定高度宽度自适应（原图缩小显示保证清晰），限宽防超宽 logo 撑开衬底 */
.provider-logo {
  display: block;
  height: 26px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

/* logo 加载失败时的降级文字：浅色衬底上的深色品牌名 */
.provider-fallback {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #253554;
  white-space: nowrap;
}

/* 入场：跟随基础设施简介，简介入场基本完成后整块浮现 */
.js .infra-providers {
  opacity: 0;
}

.js .infra-live .infra-providers {
  animation: infraProvidersIn 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.55s both;
}

@keyframes infraProvidersIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* ================= 文件工具栏（分组 Tab + 搜索） ================= */

.files-toolbar {
  display: flex;
  align-items: center;
  /* 行间距 10px（分组 Tab 独占一行，与第二行控件间），列间距 16px */
  gap: 10px 16px;
  padding: 14px 18px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.group-tabs {
  display: flex;
  gap: 6px;
  /* 分组 Tab 独占工具栏第一行（flex-basis 100% 强制换行），
     分组再多也不折行堆叠，放不下的分组在整行内横向滚动 */
  flex: 1 1 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  /* 左右渐隐提示可滚动：渐隐宽度由 main.js 按滚动位置写入 --fade-l/--fade-r
     （无溢出/已到头一侧为 0px，即无渐隐）；不支持 mask 的浏览器自然降级 */
  -webkit-mask-image: linear-gradient(to right,
    transparent 0, #000 var(--fade-l, 0px),
    #000 calc(100% - var(--fade-r, 0px)), transparent 100%);
  mask-image: linear-gradient(to right,
    transparent 0, #000 var(--fade-l, 0px),
    #000 calc(100% - var(--fade-r, 0px)), transparent 100%);
}

/* 细滚动条（与文件列表容器风格一致） */
.group-tabs::-webkit-scrollbar { height: 6px; }

.group-tabs::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, 0.25);
  border-radius: 999px;
}

.group-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 0.88rem;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap; /* 单个 Tab 内不折行 */
  flex: none;          /* 不被压缩变形，放不下交给容器滚动 */
  transition: var(--transition-base);
}

.group-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.group-tab.active {
  color: #0b1226;
  background: linear-gradient(100deg, var(--accent-cyan), var(--accent-violet));
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(125, 211, 252, 0.35);
}

.group-tab .tab-count {
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.group-tab.active .tab-count {
  background: rgba(11, 18, 38, 0.22);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-dim);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: var(--transition-base);
}

.search-box:focus-within {
  border-color: rgba(125, 211, 252, 0.5);
  box-shadow: var(--shadow-glow);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  min-width: 0;
}

.search-box input::placeholder { color: var(--text-dim); }
.search-box input::-webkit-search-cancel-button { filter: invert(0.7); }

/* ---- 工具栏第二行：搜索框 + 展示方式切换 + 一键展开/折叠 ---- */

.files-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: none; /* 第二行整体不被压缩 */
  width: 100%;
}

.files-toolbar-right .search-box {
  flex: 1;
  min-width: 180px;
}

/* 展示方式切换（行式列表 / 文件夹层级）：胶囊分段控件 */
.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text-sub);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-base);
}

.view-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.view-btn.active {
  color: #0b1226;
  background: linear-gradient(100deg, var(--accent-cyan), var(--accent-violet));
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(125, 211, 252, 0.35);
}

/* 一键展开/折叠按钮：独立胶囊（仅层级视图显示，显隐与文案由 main.js 控制） */
.view-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}

.view-action:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(125, 211, 252, 0.35);
  box-shadow: var(--shadow-glow);
}

/* 图标方向随动作切换：展开=双下箭头 / 折叠=双上箭头 */
.view-action[data-action="expand"] .toggle-icon-collapse { display: none; }
.view-action[data-action="collapse"] .toggle-icon-expand { display: none; }

/* ================= 文件列表（行式布局） ================= */

.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 2px 2px 6px;
  list-style: none;
  min-height: 0;
}

.file-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "icon info meta actions";
  align-items: center;
  gap: 6px 18px;
  padding: 13px 18px;
  /* 毛玻璃行卡片：半透明底 + 背景模糊（透过背景媒体呈现磨砂质感） */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
  transition: transform var(--transition-base), border-color var(--transition-base),
    box-shadow var(--transition-base), background var(--transition-base);
}

/* 鼠标跟随光晕（--mx/--my 由 main.js 写入） */
.file-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%),
      rgba(125, 211, 252, 0.09), transparent 45%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.file-row:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 26px rgba(3, 6, 18, 0.5), var(--shadow-glow);
}

.file-row:hover::before { opacity: 1; }

.file-row .file-icon {
  grid-area: icon;
  width: 42px;
  height: 42px;
}

.file-row .file-info { grid-area: info; }

.file-row .file-meta {
  grid-area: meta;
  justify-content: flex-end;
}

.file-row .file-actions {
  grid-area: actions;
  margin-top: 0;
  padding-top: 0;
}

.file-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.14), rgba(167, 139, 250, 0.14));
  border: 1px solid rgba(125, 211, 252, 0.22);
  color: var(--accent-cyan);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.file-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

/* 行式布局下描述单行省略 */
.file-desc {
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.file-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.file-meta svg { opacity: 0.75; }

.file-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

/* ================= 文件列表（文件夹层级视图） =================
   由工具栏"层级"按钮切换（main.js 给 .file-list 加 tree 类）：
   文件夹头部行（折叠箭头 + 图标 + 名称 + 计数）+ 缩进层级线 + 子层级列表，
   文件行复用行式布局的 .file-row 卡片与全部操作。 */

/* 文件夹头部行：轻量玻璃行，点击折叠/展开（main.js 委托处理） */
.tree-folder-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background var(--transition-base), border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.tree-folder-head:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(125, 211, 252, 0.35);
}

.tree-folder-head:focus-visible {
  outline: none;
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: var(--shadow-glow);
}

/* 折叠箭头：展开朝下，折叠转回朝右 */
.tree-caret {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform var(--transition-base);
}

.tree-folder.collapsed .tree-caret {
  transform: rotate(-90deg);
}

/* 文件夹图标：紫色系小方块（与文件行的青色图标区分） */
.tree-folder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.16), rgba(125, 211, 252, 0.16));
  border: 1px solid rgba(167, 139, 250, 0.28);
  color: var(--accent-violet);
}

.tree-folder-name {
  flex: 1;
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

.tree-folder-count {
  flex-shrink: 0;
  margin-left: auto;
  padding: 1px 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

/* 子层级列表：缩进 + 青色层级线；先子文件夹后本层文件（main.js 生成） */
.tree-children {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 2px 16px;
  padding: 0 0 0 14px;
  list-style: none;
  border-left: 1px solid rgba(125, 211, 252, 0.18);
}

/* 折叠时隐藏子层级（配合箭头旋转过渡） */
.tree-folder.collapsed > .tree-children {
  display: none;
}

/* ================= 滚动景深遮罩（Scroll Rack Focus） =================
   滚动驱动的景深遮罩动画：
   - 外层 .rack-focus 提供滚动行程（100vh stage + 动画行程 + 完成停留）；
   - .rack-stage sticky 固定 100vh，并用 perspective 建立 3D 空间；
   - 背景层随进度 translateZ 后退 + scale 补偿 + blur/brightness/saturate 渐变换；
   - scrim 暗角遮罩 opacity 渐显；前景面板 translateY 升起、始终清晰；
   - 所有数值由 main.js 按滚动进度 + rAF 插值实时写入，可回滚。 */

.rack-focus {
  position: relative;
  height: calc(100vh + var(--rack-travel, 65vh) + var(--rack-hold, 15vh));
}

.rack-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  perspective: var(--rack-perspective, 1100px);
  perspective-origin: 50% 42%;
}

/* 背景层：略大于视口，避免后退/模糊时露出边缘 */
.rack-bg {
  position: absolute;
  inset: -8% -6%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 4vh 26px;
  /* 静态时 transform/filter 均保持 none：filter 会创建合成隔离层（backdrop root），
     影响后代对背景图层的采样；滚动时 JS 只对本层写 transform，
     失焦改为逐帧写入子元素（基础设施简介整块）的 filter，见 main.js 的 rackApply。
     transform 不会创建隔离层，不影响 backdrop-filter 采样。 */
  transform: none;
  filter: none;
  will-change: transform;
}

/* 背景层内的基础设施简介整块限宽居中 */
.rack-bg .infra-plain { width: min(1040px, 92vw); }

/* 暗角遮罩层：径向 + 线性渐变叠加，opacity 由 JS 驱动 */
.rack-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 85% at 50% 42%,
      rgba(3, 6, 16, 0) 30%, rgba(3, 6, 16, 0.55) 72%, rgba(2, 4, 12, 0.92) 100%),
    linear-gradient(180deg,
      rgba(2, 4, 12, 0.55) 0%, rgba(2, 4, 12, 0) 30%,
      rgba(2, 4, 12, 0) 62%, rgba(2, 4, 12, 0.7) 100%);
  opacity: 0;
  will-change: opacity;
}

/* 前景面板容器：flex + margin:auto 居中，溢出时仍可完整滚动 */
.rack-panel-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}

.rack-panel {
  pointer-events: auto;
  margin: auto;
  display: flex;
  flex-direction: column;
  width: min(980px, 94vw);
  /* 固定高度：约占视口 80%（上下各留约 10% 余量），大屏不超过 880px；
     内容超出由内部列表容器滚动（见下方 .file-list 规则） */
  height: min(80vh, 880px);
  padding: 20px 24px;
  /* 毛玻璃面板：半透明深色底 + 背景加强模糊（透过背景媒体呈现磨砂质感） */
  background: linear-gradient(165deg, rgba(18, 24, 48, 0.55), rgba(8, 12, 30, 0.66));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  backdrop-filter: var(--glass-blur-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 34px 90px rgba(1, 3, 10, 0.6), 0 0 46px rgba(125, 211, 252, 0.1);
  overflow: hidden;
  will-change: transform, opacity;
}

/* 有 JS 时才预设"未升起"状态；无 JS 时面板直接就位可见 */
.js .rack-panel {
  opacity: 0;
  transform: translateY(90vh) scale(0.92);
}

.rack-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex: none;
}

.rack-panel-head h3 {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.rack-panel-count {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.rack-panel .files-toolbar {
  flex: none;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(5, 8, 22, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

/* 列表容器：吃掉面板固定高度的剩余空间（flex:1 + min-height:0）；
   动画期间不接管滚动（滚动交给页面驱动进度），对焦完成（is-settled）
   后放开列表内部滚动，超出部分在容器内滚动 */
.rack-panel .file-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.rack-panel.is-settled .file-list {
  overflow-y: auto;
  scrollbar-width: thin;
}

.rack-panel.is-settled .file-list::-webkit-scrollbar { width: 8px; }

.rack-panel.is-settled .file-list::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, 0.25);
  border-radius: 999px;
}

/* 空态：在固定高度面板内垂直水平居中 */
.rack-panel .empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 12px;
}

/* 降级：减弱动效偏好 / 运行时关闭动画时的静态布局 */
.rack-focus.rack-off {
  height: auto;
  max-width: 1080px;
  margin: 0 auto;
  padding: 46px 22px 10px;
}

.rack-off .rack-stage {
  position: static;
  height: auto;
  overflow: visible;
  perspective: none;
}

.rack-off .rack-bg {
  position: static;
  inset: auto;
  padding: 0 0 26px;
  transform: none;
  filter: none;
}

.rack-off .rack-scrim { display: none; }

.rack-off .rack-panel-wrap {
  position: static;
  display: block;
}

.rack-off .rack-panel {
  width: 100%;
  opacity: 1;
  transform: none;
  overflow: visible;
}

/* 静态布局下面板同样固定高度，列表容器内滚动 */
.rack-off .rack-panel .file-list { overflow-y: auto; }

/* ================= 高速徽标 ================= */

.badge-turbo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #10162e;
  background: linear-gradient(100deg, #67e8f9, #a78bfa);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 0 12px rgba(103, 232, 249, 0.45);
  animation: turbo-pulse 2.4s ease-in-out infinite;
  transition: transform 0.2s;
}

.badge-turbo:hover { transform: scale(1.08); }

@keyframes turbo-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(103, 232, 249, 0.35); }
  50% { box-shadow: 0 0 18px rgba(167, 139, 250, 0.65); }
}

/* ================= 悬停 Tooltip ================= */

.tooltip {
  position: fixed;
  z-index: 60;
  max-width: 320px;
  padding: 12px 15px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-main);
  background: rgba(13, 19, 43, 0.75);
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(2, 5, 15, 0.7), var(--shadow-glow);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.tooltip a {
  color: var(--accent-cyan);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed rgba(125, 211, 252, 0.55);
  cursor: pointer;
}

.tooltip a:hover { color: #bae6fd; }

/* ================= 按钮 ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  color: #0b1226;
  background: linear-gradient(100deg, var(--accent-cyan), var(--accent-violet));
  box-shadow: 0 4px 16px rgba(125, 211, 252, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(167, 139, 250, 0.45);
}

.btn-ghost {
  color: var(--text-sub);
  background: transparent;
  border-color: var(--glass-border);
}

.btn-ghost:hover {
  color: var(--accent-cyan);
  border-color: rgba(125, 211, 252, 0.45);
  background: rgba(125, 211, 252, 0.06);
}

.btn-sponsor {
  color: #2b0f22;
  background: linear-gradient(100deg, #f9a8d4, #f0abfc 55%, #c4b5fd);
  box-shadow: 0 4px 16px rgba(240, 171, 252, 0.35);
}

.btn-sponsor:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(240, 171, 252, 0.5);
}

/* ================= 空态 ================= */

.empty-state {
  padding: 56px 22px;
  text-align: center;
  color: var(--text-dim);
}

.empty-state svg { margin-bottom: 14px; opacity: 0.6; }
.empty-state p { font-size: 0.92rem; }

/* ================= 模态弹层 ================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(3, 6, 16, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.modal-overlay.show { opacity: 1; }

.modal {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  /* 毛玻璃弹层：半透明深色底 + 背景加强模糊 */
  background: linear-gradient(160deg, rgba(18, 26, 55, 0.55), rgba(9, 14, 35, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: var(--glass-blur-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 24px 70px rgba(2, 5, 15, 0.7), var(--shadow-glow);
  transform: translateY(22px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.modal-overlay.show .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-base);
}

.modal-close:hover {
  color: #fecaca;
  border-color: rgba(252, 165, 165, 0.45);
  transform: rotate(90deg);
}

.modal-head h3 {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(100deg, var(--accent-cyan), var(--accent-violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.modal-file {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--accent-pink);
  word-break: break-all;
}

.modal-hint {
  margin-top: 10px;
  font-size: 0.83rem;
  color: var(--text-sub);
}

.os-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 14px;
  flex-wrap: wrap;
}

.os-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-family: inherit;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition-base);
}

.os-tab:hover { color: var(--text-main); }

.os-tab.active {
  color: var(--accent-cyan);
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(125, 211, 252, 0.09);
  font-weight: 600;
}

.code-panel {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: rgba(3, 6, 16, 0.6);
  overflow: hidden;
}

.code-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(125, 211, 252, 0.09);
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition-base);
}

.copy-btn:hover {
  background: rgba(125, 211, 252, 0.18);
  box-shadow: var(--shadow-glow);
}

.copy-btn.copied {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.5);
  background: rgba(134, 239, 172, 0.1);
}

.code-block {
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #c9d7f2;
  white-space: pre;
  tab-size: 4;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.modal-foot-note {
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* ================= Toast 提示条 ================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 100;
  transform: translateX(-50%) translateY(16px);
  padding: 10px 22px;
  font-size: 0.85rem;
  color: var(--text-main);
  background: rgba(13, 19, 43, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 30px rgba(2, 5, 15, 0.6), var(--shadow-glow);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error { border-color: rgba(252, 165, 165, 0.55); }

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

.footer {
  position: relative;
  z-index: 1;
  margin-top: 56px;
  padding: 30px 22px 38px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 0.82rem;
}

.footer-sponsor {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--accent-pink);
  text-decoration: none;
  transition: var(--transition-base);
}

.footer-sponsor:hover {
  filter: drop-shadow(0 0 8px rgba(240, 171, 252, 0.6));
  transform: translateY(-1px);
}

/* ================= 入场动画（IntersectionObserver 驱动） ================= */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

/* ================= 响应式 ================= */

@media (max-width: 820px) {
  /* 基础设施简介：窄屏下文与图上下堆叠，示意图限宽居中 */
  .infra-body {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .infra-diagram {
    width: min(400px, 88vw);
    margin: 0 auto;
  }
  /* 窄屏收紧简介各块间距，控制舞台整体高度避免裁切 */
  .infra-plain { gap: 24px; }
  /* 服务商列表：窄屏缩小衬底与 logo，尽量单行放下 */
  .providers-list { gap: 10px 12px; }
  .provider-item { height: 42px; padding: 0 14px; border-radius: 10px; }
  .provider-logo { height: 22px; max-width: 120px; }
  .files-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  /* column 布局下重置 flex-basis（此方向的 100% 指高度）；
     两行结构不变：分组 Tab 一行横滚，搜索+切换控件一行 */
  .group-tabs { flex: 1 1 auto; }
  .files-toolbar-right .search-box { min-width: 0; }
  .modal { padding: 22px 18px; }
}

@media (max-width: 720px) {
  /* 列表行折行：图标+信息一行，元信息+操作一行 */
  .file-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "icon info"
      "meta actions";
    gap: 8px 14px;
  }
  .file-row .file-meta { justify-content: flex-start; }
  .file-row .file-actions { justify-content: flex-end; }
  .rack-panel { padding: 16px 14px; }
}

@media (max-width: 480px) {
  /* 超窄屏：进一步压缩服务商衬底与间距，控制舞台整体高度避免裁切 */
  .infra-providers { gap: 6px; }
  .providers-list { gap: 8px 10px; margin-top: 4px; }
  .provider-item { height: 36px; padding: 0 12px; border-radius: 9px; }
  .provider-logo { height: 18px; max-width: 96px; }
  .provider-fallback { font-size: 0.82rem; letter-spacing: 1px; }
}

/* ================= 减弱动效偏好 ================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  /* 基础设施简介：关闭动画时内容直接可见
     （覆盖 .js 预隐藏与 main.js 写入的逐字错峰延迟） */
  .js .infra-head,
  .js .infra-diagram,
  .js .infra-char {
    opacity: 1 !important;
    animation-delay: 0s !important;
  }
  .js .infra-divider {
    opacity: 1 !important;
    transform: none !important;
    animation-delay: 0s !important;
  }
  /* 服务商列表：关闭动画时直接可见 */
  .js .infra-providers {
    opacity: 1 !important;
    animation-delay: 0s !important;
  }
  /* 景深动画降级为静态布局：背景不失焦、面板直接就位 */
  .rack-focus { height: auto !important; }
  .rack-stage {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    perspective: none !important;
  }
  .rack-bg {
    position: static !important;
    inset: auto !important;
    padding: 0 22px 26px !important;
    transform: none !important;
    filter: none !important;
  }
  .rack-scrim { display: none !important; }
  .rack-panel-wrap { position: static !important; display: block !important; }
  .rack-panel {
    width: min(980px, 94vw) !important;
    margin: 0 auto !important;
    height: min(80vh, 880px) !important;
    max-height: none !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible !important;
  }
  /* 静态布局下面板同样固定高度，列表容器内滚动 */
  .rack-panel .file-list { overflow-y: auto !important; }
}

/* ================= 毛玻璃降级 =================
   不支持 backdrop-filter 的老浏览器：改用更实的深色底，
   保证卡片内容在随机背景媒体上依然可读 */

@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .file-row,
  .rack-panel,
  .modal,
  .search-box,
  .tooltip,
  .toast {
    background: rgba(10, 15, 32, 0.82);
  }
}
