/* ===== 极简下载站 · 前台样式（全新设计） ===== */
/* 风格：深色渐变 Hero + 磨砂玻璃 + 精致卡片区 · 冷峻科技感 */

:root {
  /* 品牌主色（靛蓝→紫罗兰） */
  --mdui-color-primary: #4f46e5;
  --mdui-color-on-primary: #ffffff;
  --mdui-color-primary-container: #eef0ff;
  --mdui-color-on-primary-container: #312e81;
  --mdui-color-secondary: #6366f1;
  --mdui-color-secondary-container: #e0e7ff;
  --mdui-color-on-secondary-container: #1e1b4b;

  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-deep: #3730a3;
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #f4f5fb;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(79, 70, 229, 0.10);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ===== 顶栏（磨砂玻璃） ===== */
.site-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 14px;
  flex: 1;
}
.topbar-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.18s;
}
.topbar-nav a:hover { background: var(--mdui-color-primary-container); color: var(--mdui-color-on-primary-container); }
.topbar-nav a.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.3); }

/* ===== Hero（深色渐变，冷峻感） ===== */
.hero {
  background:
    radial-gradient(1000px 480px at 85% -10%, rgba(124, 58, 237, 0.45), transparent 60%),
    radial-gradient(760px 420px at 8% 115%, rgba(79, 70, 229, 0.40), transparent 60%),
    linear-gradient(150deg, #111827 0%, #1e1b4b 55%, #312e81 100%);
  color: #fff;
  padding: 84px 0 110px;
  position: relative;
  overflow: hidden;
}
/* 细网格 + 光晕纹理 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-inner { text-align: center; max-width: 780px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5.4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.12;
  background: linear-gradient(120deg, #fff, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  margin: 0 0 38px;
  font-size: 18px;
  opacity: 0.85;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.hero-search {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 8px;
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.hero-search mdui-text-field {
  flex: 1;
  --mdui-color-primary: #a5b4fc;
  --mdui-color-on-surface: #fff;
  --mdui-color-outline: rgba(255,255,255,0.3);
  --mdui-color-on-surface-variant: rgba(255,255,255,0.65);
  background: transparent;
  border-radius: 12px;
}
.hero-search mdui-text-field::part(container) { background: transparent; }
.hero-stats {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 60px;
}
.hero-stats .stat b {
  font-size: 28px;
  font-weight: 800;
  display: block;
  letter-spacing: -0.3px;
  background: linear-gradient(120deg, #e0e7ff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-stats .stat span { font-size: 13px; opacity: 0.7; font-weight: 500; }

/* ===== 区块 ===== */
.section { padding: 48px 0 10px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h2 mdui-icon {
  color: var(--brand);
  font-size: 24px;
  background: var(--mdui-color-primary-container);
  padding: 6px;
  border-radius: 10px;
}
.section-head .more {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: color .15s;
}
.section-head .more:hover { color: var(--brand); }

/* ===== 分类卡片 ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.cat-card {
  background: var(--card);
  border-radius: 18px;
  padding: 26px 18px 22px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1), box-shadow 0.22s;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.cat-card::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 60%; height: 3px;
  transform: translateX(-50%) scaleX(0);
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
  transition: transform .25s;
}
.cat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.cat-card:hover::after { transform: translateX(-50%) scaleX(1); }
.cat-card .cat-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--mdui-color-primary-container), #e6e9ff);
  color: var(--brand-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  transition: transform .25s;
}
.cat-card:hover .cat-icon { transform: scale(1.08) rotate(-3deg); }
.cat-card .cat-name { font-weight: 700; font-size: 15.5px; color: var(--ink); }
.cat-card .cat-count { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* ===== 资源卡片 ===== */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
  gap: 20px;
}
.res-card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1), box-shadow 0.22s;
  display: flex;
  flex-direction: column;
}
.res-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.25);
}
.res-cover {
  height: 148px;
  background:
    radial-gradient(240px 120px at 90% -10%, rgba(124,58,237,.25), transparent 70%),
    linear-gradient(135deg, #eef0ff, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 46px;
  position: relative;
}
.res-cover mdui-icon { filter: drop-shadow(0 6px 12px rgba(79,70,229,.25)); }
.res-cover img { width: 100%; height: 100%; object-fit: cover; }
.res-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.res-title {
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.45;
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 45px;
  color: var(--ink);
}
.res-summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}
.res-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.res-meta .dl { display: flex; align-items: center; gap: 4px; background: var(--mdui-color-primary-container); color: var(--brand-deep); padding: 3px 10px; border-radius: 999px; }
.res-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(124,58,237,.4);
  letter-spacing: .3px;
}

/* ===== 空状态 / 加载 ===== */
.empty {
  text-align: center;
  padding: 64px 0;
  color: var(--muted);
  font-weight: 500;
}
.empty mdui-icon { font-size: 58px; color: #cbd5e1; display: block; margin: 0 auto 16px; }
.loading-wrap { display: flex; justify-content: center; padding: 44px 0; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 32px 0 48px;
}
.page-info { font-size: 14px; color: var(--muted); margin: 0 12px; font-weight: 500; }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 48px;
  font-weight: 500;
}

/* ===== 详情页 ===== */
.detail-wrap { padding: 40px 0 64px; }
.detail-card {
  background: var(--card);
  border-radius: 24px;
  padding: 36px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.detail-head { display: flex; gap: 28px; align-items: flex-start; }
.detail-cover {
  width: 132px;
  height: 132px;
  border-radius: 22px;
  background:
    radial-gradient(160px 80px at 80% -10%, rgba(124,58,237,.3), transparent 70%),
    linear-gradient(135deg, #eef0ff, #e0e7ff);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  flex-shrink: 0;
  overflow: hidden;
}
.detail-cover mdui-icon { filter: drop-shadow(0 8px 16px rgba(79,70,229,.3)); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; }
.detail-info h1 { margin: 0 0 10px; font-size: 28px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.3; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.detail-tags mdui-chip { --mdui-color-surface-container-high: var(--mdui-color-primary-container); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 22px; color: var(--muted); font-size: 14px; margin-top: 16px; font-weight: 500; }
.detail-meta .item { display: flex; align-items: center; gap: 6px; }
.detail-meta .item mdui-icon { color: var(--brand); font-size: 18px; }
.detail-desc { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.detail-desc h3 { font-size: 17px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.detail-desc .desc-body {
  white-space: pre-wrap;
  line-height: 1.85;
  color: #334155;
  font-size: 15px;
}
.download-bar {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.download-bar mdui-button { font-weight: 700; }

/* 响应式 */
@media (max-width: 640px) {
  .topbar-nav { display: none; }
  .hero { padding: 56px 0 80px; }
  .hero-stats { gap: 34px; }
  .detail-head { flex-direction: column; align-items: center; text-align: center; }
  .detail-meta { justify-content: center; }
  .download-bar { justify-content: center; }
  .hero-search { padding: 6px; border-radius: 14px; }
}
