/* ============================================================
   站点样式 · 用户端
   沿用原 netlify-upload 的视觉语言：浅色渐变背景 + 玻璃卡片 + 蓝色主色
   布局按定稿线框图重做：搜索置顶 / 类型 tab / 产业折叠 / 分区块
   ============================================================ */

:root {
  --bg-top: #f8fafc;
  --bg-mid: #eef4ff;
  --bg-bottom: #fef3e6;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-soft: rgba(248, 250, 252, 0.88);
  --text: #0f172a;
  --muted: #64748b;
  --dim: #94a3b8;
  --line: rgba(148, 163, 184, 0.2);
  --line-strong: rgba(148, 163, 184, 0.32);
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --warm: #f59e0b;
  --success: #10b981;
  --shadow-lg: 0 22px 60px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --page: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body { padding: 0 0 56px; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 78%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.is-hidden { display: none !important; }

/* ---------------- 顶栏 ---------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

/*
 * 头部 logo 图标区。默认不显示（2026-09-24 需求），
 * 只有 branding.showUserLogo 为真时才由 applyBranding 把节点挂上来 ——
 * 开关在管理端「系统设置 → 站点品牌」。
 * 所以这几条规则不是死样式：它们在"开"的时候就是这个块的完整外观。
 */
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.26);
}

/* 有真实 logo 时改用白底 + 细边，让 logo 自己说话 */
.brand-mark.has-logo {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 2px;
}

/* 图与字二选一：由 .has-logo 决定，不靠 JS 改内联样式 */
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 9px;
  display: none;
}

.brand-mark.has-logo .brand-logo { display: block; }
.brand-mark.has-logo .brand-mark-text { display: none; }

.brand-mark-text { line-height: 1; }

.brand-text { display: grid; gap: 1px; min-width: 0; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

.head-spacer { flex: 1; }

.head-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 7px 15px;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.head-link:hover { color: var(--accent); border-color: rgba(37, 99, 235, 0.36); box-shadow: var(--shadow-sm); }

/*
 * 用户端**不再提供任何通往管理端的入口**（2026-09-22 用户要求）。
 * 原先这里是 .head-key 钥匙图标（一条"暗门"），现在整个移除：
 * 用户端就是纯展示页，管理端地址由维护者自己记住 / 收藏。
 * 若将来想加回，记得连 index.html、detail.html 的结构一起加。
 */

/* ---------------- 页面容器 ---------------- */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 20px 20px 0;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

/*
 * 搜索栏已移除（用户要求）。
 * 样式一并删掉，避免留下无人引用的死代码 ——
 * 将来要加回搜索框，按需重写即可（逻辑层的关键词过滤仍然保留）。
 */

/* ---------------- 内容类型 tab（第二层） ---------------- */

/*
 * 用 flex 自动换行，而不是固定列数 —— 这样管理端把类型加到 6～8 个时，
 * 手机上会自动排成两行，不需要改任何 CSS。
 *
 * 关键：最后一行必须左对齐。
 * 如果每个 tab 都是 flex:1，换行后最后一行剩下的那个会被撑满整行并跑到中间，
 * 看起来像"应用"这个 tab 居中了。用 ::after 占位撑住剩余空间，保证左对齐。
 */
.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.type-tabs::after {
  content: "";
  flex: 1 1 0;
  min-width: 92px;
}

.type-tab {
  flex: 0 1 auto;
  min-width: 92px;
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.type-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.62); }
.type-tab.is-active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}
.type-tab .tcount {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* 类型很多时（管理端新增过），收紧一点，避免撑成三行 */
.type-tabs.is-dense .type-tab,
.type-tabs.is-dense::after { min-width: 76px; }
.type-tabs.is-dense .type-tab { min-height: 38px; font-size: 12.5px; }

/* ---------------- 产业筛选（默认折叠，第三层） ---------------- */

.filter-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.filter-toggle:hover { border-color: var(--line-strong); }

.filter-label { color: var(--muted); font-weight: 500; }
.filter-value { color: var(--accent); font-weight: 700; }
.filter-spacer { flex: 1; }

.filter-count {
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.caret {
  width: 0;
  height: 0;
  flex: none;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5.5px solid var(--muted);
  transition: transform 0.2s ease;
}
.caret.is-open { transform: rotate(180deg); }

.filter-body { margin-top: 12px; display: grid; gap: 12px; }
.filter-body.is-collapsed { display: none; }

/*
 * 两级筛选的层级表达：
 *   一级产业 = 大块九宫格（重、显眼）
 *   二级分类 = 缩进 + 左侧竖线的胶囊条（轻、从属）
 * 靠缩进和竖线把"父子关系"讲清楚，不用额外文字解释。
 */
.filter-level {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}
.filter-level:empty { display: none; }

.industry-rows { display: grid; gap: 8px; }
.industry-row { display: grid; gap: 8px; }

.industry-tab {
  min-height: 50px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  padding: 0 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.industry-tab:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.industry-tab.is-active {
  border-color: rgba(37, 99, 235, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.category-panel {
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.78));
  border: 1px solid var(--line);
}
/* 作为二级时再往右缩一点、加一道左竖线，视觉上"挂在"产业下面 */
.category-panel.is-sub {
  margin-left: 10px;
  border-left: 3px solid rgba(37, 99, 235, 0.28);
}
.category-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
/* 未选产业时的一句说明，比胶囊轻，不抢视线 */
.category-tip {
  font-size: 11.5px;
  color: var(--dim);
  margin-right: 2px;
}
.category-empty {
  font-size: 12px;
  color: var(--dim);
}

.category-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.category-tab:hover { transform: translateY(-1px); }
.category-tab.is-active {
  border-color: rgba(37, 99, 235, 0.36);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
}

/* ---------------- 结果摘要 ---------------- */

.result-summary {
  font-size: 12.5px;
  color: var(--muted);
  padding: 0 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.summary-chip {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 11px;
}

/* ---------------- 分区块 ---------------- */

/*
 * 区块之间要明显松于区块内部。
 * 之前区块间距 12px、内部卡片间距也是 12px，两个区块糊在一起，
 * 上一区的卡片标题和下一区的标题看着像连着的，读不出这是两块内容。
 * 现在：区块间距 30px，区块内卡片间距 12px，比例 2.5:1，层次一眼能分出来。
 */
.sections { display: grid; gap: 30px; }

.section { display: grid; gap: 12px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  /* 标题和它自己的卡片贴紧，和上一区块拉开 */
  margin-bottom: 2px;
}
.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 4px;
  height: 17px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
}
.section-rule { flex: 1; height: 1px; background: var(--line); }
.section-count {
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.section-grid { display: grid; gap: 12px; }
.grid-video { grid-template-columns: 1fr; }
.grid-image { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-app { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-file { grid-template-columns: 1fr; }

/* ---------------- 卡片：共用 ---------------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
    var(--surface-strong);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(37, 99, 235, 0.2); box-shadow: var(--shadow-md); }
/* 整卡缩放的反馈只给「整张卡都是链接」的卡片；应用卡内部有多个可点区域，缩了会误导 */
.card:active { transform: scale(0.985); }
.app-card:active { transform: none; }

/* 视频卡 */
.video-card { display: grid; gap: 0; overflow: hidden; }

/*
 * 视频直接播放：
 * 帧容器统一给 16/10 的宽高比，避免加载前高度为 0 导致卡片"跳一下"。
 */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #e8eef8, #f1f5f9);
  overflow: hidden;
}
.video-cover {
  position: relative;
  width: 100%;
  height: 100%;
}
.video-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.video-player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;   /* 竖屏视频也不裁切 */
  background: #0f172a;
  /* 卡片本身不是链接，播放器要能接收自己的点击（播放/暂停/进度） */
  position: relative;
  z-index: 1;
}
.video-missing {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 4px 12px;
}
.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-badge::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #fff;
}

.duration-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.68);
  border-radius: 6px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

.type-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(37, 99, 235, 0.86);
  border-radius: 6px;
  padding: 2px 8px;
}

.card-body { padding: 11px 13px 13px; display: grid; gap: 7px; }
.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.card-meta {
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-variant-numeric: tabular-nums;
}

/* 文件卡：上面一行「格式图标 + 名称/产业」，下面一行「打开文件 / 查看详情」 */
.file-card {
  display: grid;
  gap: 12px;
  padding: 13px 15px;
}
.file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.file-ext {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #64748b, #475569);
}
.file-ext[data-ext="PDF"] { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.file-ext[data-ext="DOC"], .file-ext[data-ext="DOCX"] { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.file-ext[data-ext="XLS"], .file-ext[data-ext="XLSX"], .file-ext[data-ext="CSV"] { background: linear-gradient(135deg, #16a34a, #15803d); }
.file-ext[data-ext="PPT"], .file-ext[data-ext="PPTX"] { background: linear-gradient(135deg, #ea580c, #c2410c); }
.file-ext[data-ext="ZIP"], .file-ext[data-ext="RAR"], .file-ext[data-ext="7Z"] { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.file-ext[data-ext="APK"] { background: linear-gradient(135deg, #10b981, #047857); }

.file-info { min-width: 0; display: grid; gap: 5px; }
.file-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-sub { font-size: 11.5px; color: var(--dim); display: flex; gap: 10px; flex-wrap: wrap; }
.file-sub:empty { display: none; }

/* 老的独立「查看」胶囊已并入按钮行，保留类名以防别处引用，但不再单独排版 */
.file-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* 图片卡 */
.image-card { overflow: hidden; }
.image-thumb {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #e8eef8, #f1f5f9);
  overflow: hidden;
}
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------- 应用卡（图标 + 名称 + 二维码与下载按钮并排） ---------------- */

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 12px 13px;
  text-align: center;
  gap: 10px;
  /* 整卡不再是链接，鼠标默认样式交给内部按钮 */
  cursor: default;
}
.app-logo-wrap {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  padding: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.92)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.app-logo { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; display: block; }
.app-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.42;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* 两个等宽按钮：立即下载 + 扫码下载，底色/描边/字色完全一致 */
.app-actions {
  width: 100%;
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 8px;
}

.app-qr,
.app-download {
  min-height: 36px;
  min-width: 0;
  border: 1px solid rgba(37, 99, 235, 0.38);
  border-radius: 11px;
  background: #fff;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.app-qr:hover,
.app-download:hover {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.55);
}
.app-qr:active,
.app-download:active { transform: scale(0.985); }

.app-qr { cursor: pointer; }

/* 没有二维码时明确说出来，但不响应点击 */
.app-qr.is-empty {
  border-style: dashed;
  border-color: var(--line);
  color: var(--dim);
  background: rgba(248, 250, 252, 0.9);
  cursor: default;
}

.app-download { cursor: pointer; }
.app-download.is-disabled {
  border-color: var(--line);
  background: rgba(248, 250, 252, 0.9);
  color: var(--dim);
  cursor: default;
}

/* ---------------- 平台 / 环境提示（T26） ----------------
   应用区块顶部说一遍、详情页按钮下方说一遍。
   只是提示，不遮挡也不禁用任何按钮 —— 判断依据是 UA，判错也不该拦住用户。 */

.platform-note { display: grid; gap: 7px; }
.platform-note-item {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.7;
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--muted);
}
.platform-note-item.is-warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.32);
  color: #92400e;
}

/* ---------------- 图片加载失败兜底（T26） ----------------
   占位图不要被 object-fit: cover 裁掉；那圈底色也换成虚线，明确"这里本来是图标"。 */

.is-broken-image { object-fit: contain; }
.app-card.has-broken-logo .app-logo-wrap {
  border-style: dashed;
  background: repeating-linear-gradient(
    135deg, rgba(148, 163, 184, 0.14) 0 6px, rgba(148, 163, 184, 0.06) 6px 12px
  );
}
.detail-icon-note {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.12);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* 二维码大图查看器：flex 容器把面板真正垂直+水平居中 */
.qr-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qr-viewer.is-hidden { display: none; }
.qr-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.qr-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(88vw, 380px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 22px 20px 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.96));
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qr-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  font-size: 23px;
  line-height: 1;
}
.qr-viewer-img {
  display: block;
  width: min(70vw, 300px);
  height: min(70vw, 300px);
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  object-fit: contain;
}
.qr-viewer-name {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}
.qr-viewer-tip {
  margin: 8px 0 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------------- 滚动加载哨兵 / 空状态 ---------------- */

/*
 * 哨兵只是给 IntersectionObserver 盯的一个小点，本身不该有存在感。
 * 里面的提示文字是给"滑到底但内容已全部加载完"时用的兜底说明，
 * 正常情况下用户滑得快会看到它闪一下就被新内容顶走。
 */
.section-sentinel {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 6px 0;
}
.section-sentinel-hint {
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.02em;
}
.section-sentinel.is-end .section-sentinel-hint {
  color: var(--dim);
  opacity: 0.75;
}

.empty-state {
  padding: 34px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88));
  border: 1px dashed var(--line);
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
  text-align: center;
}

.notice {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
  font-size: 13px;
  line-height: 1.7;
}

.site-foot {
  max-width: var(--page);
  margin: 34px auto 0;
  padding: 0 20px;
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

/* ============================================================
   详情页
   ============================================================ */

.detail-page { max-width: 880px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 7px 15px;
}
.back-link:hover { color: var(--accent); border-color: rgba(37, 99, 235, 0.36); }
.back-link::before { content: "←"; font-size: 13px; }

.detail-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.detail-hero video,
.detail-hero img { width: 100%; display: block; }
.detail-hero img { max-height: 72vh; object-fit: contain; background: #eef2f7; }

.hero-empty {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #cbd5e1;
  font-size: 13px;
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
.hero-empty .play-badge { position: static; transform: none; }

.detail-head { display: flex; align-items: center; gap: 14px; }

.detail-icon {
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 18px;
  object-fit: cover;
  padding: 5px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.94));
  box-shadow: var(--shadow-sm);
}

.detail-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
}
.tag.primary {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--accent-soft);
}
.tag.demo {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.34);
  background: rgba(245, 158, 11, 0.12);
}

.detail-summary { margin: 0; font-size: 14px; line-height: 1.85; color: var(--muted); }

.kv-table {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px 18px;
  font-size: 12.5px;
  padding: 16px;
}
.kv-table dt { color: var(--dim); margin: 0; }
.kv-table dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }

.action-row { display: grid; gap: 10px; }

.btn {
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(0.99); }
.btn-primary {
  border-color: transparent;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}
.btn-primary:disabled {
  background: #cbd5e1;
  color: #f8fafc;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-sub { font-size: 11.5px; font-weight: 500; opacity: 0.82; }

.related-list { display: grid; gap: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(12px);
  z-index: 90;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 响应式 ---------------- */

@media (min-width: 640px) {
  .page { padding: 24px 24px 0; gap: 18px; }
  .head-inner { padding: 14px 24px; }
  .panel { padding: 18px; }
  .grid-video { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-app { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-image { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-file { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-title { font-size: 25px; }
  .action-row { grid-template-columns: 2fr 1fr; }
}

@media (min-width: 1000px) {
  .grid-video { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-app { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-image { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-file { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .kv-table { grid-template-columns: auto minmax(0, 1fr); }
  .type-tab, .type-tabs::after { min-width: 80px; }

  /*
   * 手机两列网格下卡片只有 ~169px 宽。
   * 两个等宽按钮各占约 78px，「立即下载」「扫码下载」4 个字都放得下；
   * 二维码不再出现在卡片里，想扫点「扫码下载」看大图。
   */
  .app-actions { gap: 7px; }
  .app-qr { font-size: 12px; padding: 0 4px; }
  .app-download { font-size: 12px; padding: 0 6px; }
}
