/* ============================================================
   下载中心 - 前台设计系统（浅色极简 · 统一品牌蓝）
   与设计令牌：--brand / --bg / --card / --line / --text / --muted
   ============================================================ */
:root {
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-50: #eff4ff;
  --bg: #f6f7f9;
  --card: #ffffff;
  --line: #e6e8ec;
  --text: #18181b;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-hover: 0 10px 28px rgba(16, 24, 40, .10);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===================== 顶部栏 =====================
   2026-10-26：本页顶部栏已并入 C 端公共样式 c-end-header.css
   （深蓝渐变，与视频 / 百科 / 智能教练 / 赛事 / 课堂 / 手册完全一致）。
   原先这里自建的 .site-header（白色毛玻璃）已删除 —— 它是全站唯一
   一个不跟公共样式走的内页，导致导航栏颜色和别人不一样。
   ⚠ 不要再在页面私有 CSS 里定义 .header / .btn-back / .header-right，
      否则会覆盖公共样式；要改顶部栏请只改 c-end-header.css。
   ==================================================== */

/* ===================== 页面容器 ===================== */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 600; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ===================== 工具栏 ===================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-tab {
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: .15s;
  user-select: none;
}
.cat-tab:hover { border-color: var(--brand); color: var(--brand); }
.cat-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.search-box { position: relative; min-width: 240px; flex: 0 1 280px; }
.search-box i {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 14px;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-size: 14px;
  color: var(--text);
  transition: .15s;
}
.search-box input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.file-count { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* ===================== 卡片网格 ===================== */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.file-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.file-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #cdd5e0; }

.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--brand-50);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ext {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  padding: 8px 14px;
  border-radius: 10px;
  letter-spacing: 1px;
}

.info { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-50);
  padding: 3px 10px;
  border-radius: 6px;
}
.name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted-2);
  flex-wrap: wrap;
  margin-top: 2px;
}
.meta .plat { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.dl-btn {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
}
.dl-btn:hover { background: var(--brand-600); }
.dl-btn:disabled { opacity: .6; cursor: default; }

/* ===================== 空状态 ===================== */
.empty { text-align: center; padding: 70px 20px; color: var(--muted-2); }
.empty i { font-size: 54px; display: block; margin-bottom: 12px; color: #c7ccd4; }
.empty h3 { font-size: 18px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.empty p { font-size: 14px; }

/* ===================== 加载 ===================== */
.loading { text-align: center; padding: 50px; color: var(--muted); }

/* ===================== 详情弹窗 ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .25);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 18px; font-weight: 600; word-break: break-all; }
.modal-close {
  width: 34px; height: 34px;
  border: none;
  background: #f1f3f5;
  border-radius: 50%;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 22px; overflow: auto; }
.modal-cover {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
  background: var(--brand-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-cover img { max-width: 100%; max-height: 240px; border-radius: 10px; object-fit: cover; }
.modal-cover .ext {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  padding: 12px 18px;
  border-radius: 10px;
}
.modal-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-50);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.params {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 20px;
  margin: 8px 0 18px;
}
.params .p { display: flex; gap: 6px; font-size: 14px; }
.params .p b { color: var(--muted); font-weight: 500; }
.params .p span { color: var(--text); font-weight: 500; }
.desc-block { font-size: 14px; line-height: 1.8; color: #374151; }
.desc-block p { margin-bottom: 10px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
}
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ===================== 响应式 ===================== */
@media (max-width: 640px) {
  .page { padding: 20px 14px 50px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; flex: 1 1 auto; }
  /* 2026-10-26：手机竖屏一行一个卡片。
     原为 repeat(auto-fill, minmax(150px, 1fr))，375px 宽下 150×2+12=312 能塞进两列
     → 两张卡挤在一起、标题被压成两行半。改 1fr 固定单列，卡片宽度撑满。 */
  .file-grid { grid-template-columns: 1fr; gap: 12px; }
  /* 2026-10-26 二次：封面压扁 + 内边距收紧，卡片高 417px -> 约 320px，一屏能看 2 张多。
     封面 16:9 -> 5:2（横幅比例），object-fit:cover 居中裁切，不放大小图。
     414 宽下卡片宽 386，若用 21:9 封面仍 165 高、整卡 341 偏高，故取 5:2。 */
  .cover { aspect-ratio: 5 / 2; }
  .info { padding: 12px 14px 14px; gap: 6px; }
  .name { font-size: 14px; }
  .desc { -webkit-line-clamp: 2; min-height: 0; }
  .dl-btn { margin-top: 2px; padding: 8px; }
}
