/* ============================================================
 * 下载站前台样式 v2.1（独立版，参照 pc.qq.com 软件中心）
 * 适配：宽屏（1440 容器） / 平板 / 手机（分类横向滑动）
 * ============================================================ */
:root {
  --dl-primary: #1e86ff;
  --dl-primary-2: #37a7ff;
  --dl-primary-hover: #0f6fe0;
  --dl-bg: #f5f7fa;
  --dl-card: #ffffff;
  --dl-border: #e8ecf2;
  --dl-text: #222328;
  --dl-text-sub: #7a828e;
  --dl-radius: 10px;
  --dl-grad: linear-gradient(135deg, var(--dl-primary-2), var(--dl-primary));
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--dl-bg);
  color: var(--dl-text);
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
}
a { text-decoration: none; color: inherit; }

/* 宽屏：1440 容器（QQ 软件中心式居中定宽） */
.dl-container { max-width: 1440px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.dl-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--dl-card);
  border-bottom: 1px solid var(--dl-border);
  box-shadow: 0 1px 6px rgba(20, 40, 80, .04);
}
.dl-header-inner { display: flex; align-items: center; gap: 30px; height: 62px; }
.dl-logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 19px; font-weight: 700; color: var(--dl-primary);
  white-space: nowrap;
}
.dl-logo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--dl-grad);
  font-size: 19px; color: #fff;
  box-shadow: 0 3px 8px rgba(30, 134, 255, .3);
}
.dl-nav { display: flex; gap: 26px; }
.dl-nav a { color: var(--dl-text-sub); font-size: 15px; line-height: 62px; }
.dl-nav a:hover, .dl-nav a.active { color: var(--dl-primary); font-weight: 600; }

.dl-search-mini { margin-left: auto; display: flex; }
.dl-search-mini input {
  width: 220px; height: 36px; padding: 0 14px;
  border: 1px solid var(--dl-border); border-right: 0;
  border-radius: 18px 0 0 18px; outline: none; font-size: 13px;
  color: var(--dl-text); background: var(--dl-bg);
}
.dl-search-mini input:focus { background: #fff; border-color: var(--dl-primary); }
.dl-search-mini button {
  height: 36px; padding: 0 18px; border: 0; cursor: pointer;
  border-radius: 0 18px 18px 0;
  background: var(--dl-primary); color: #fff; font-size: 13px;
}
.dl-search-mini button:hover { background: var(--dl-primary-hover); }

/* ---------- 首页 hero（QQ 式大宣传区） ---------- */
.dl-hero {
  padding: 58px 20px 50px; text-align: center;
  background: linear-gradient(180deg, #e3f1ff 0%, var(--dl-bg) 100%);
}
.dl-hero h1 {
  margin: 0 0 12px; font-size: 34px; letter-spacing: 2px;
  color: #1d2b45;
}
.dl-hero .dl-slogan { margin: 0 0 28px; color: var(--dl-text-sub); font-size: 15px; letter-spacing: 1px; }
.dl-search { display: flex; justify-content: center; margin-bottom: 16px; }
.dl-search input {
  width: min(580px, 70vw); height: 48px; padding: 0 20px;
  border: 2px solid var(--dl-primary); border-right: 0;
  border-radius: 24px 0 0 24px; outline: none; font-size: 15px;
  box-shadow: 0 4px 16px rgba(30, 134, 255, .14);
}
.dl-search button {
  height: 48px; padding: 0 38px; border: 0; cursor: pointer;
  border-radius: 0 24px 24px 0;
  background: var(--dl-grad); color: #fff; font-size: 16px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(30, 134, 255, .3);
}
.dl-search button:hover { background: var(--dl-primary-hover); }
.dl-hot-words { color: var(--dl-text-sub); font-size: 13px; }
.dl-hot-words a { margin: 0 7px; color: var(--dl-primary); }
.dl-hot-words a:hover { text-decoration: underline; }

/* ---------- 区块 ---------- */
.dl-section { margin-top: 36px; }
.dl-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.dl-section-head h2 { margin: 0; font-size: 21px; }
.dl-section-head .more { color: var(--dl-text-sub); font-size: 13px; }
.dl-section-head .more:hover { color: var(--dl-primary); }

/* ---------- 分类网格（宽屏 6 列，QQ 圆角图标卡） ---------- */
.dl-cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.dl-cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 28px 10px 24px; background: var(--dl-card);
  border-radius: var(--dl-radius); border: 1px solid var(--dl-border);
  transition: all .15s ease;
}
.dl-cat-card:hover {
  transform: translateY(-3px); border-color: var(--dl-primary);
  box-shadow: 0 8px 20px rgba(30, 134, 255, .14);
}
.dl-cat-icon {
  display: flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; border-radius: 18px;
  font-size: 36px; line-height: 1;
  background: linear-gradient(180deg, #eaf4ff, #dcf0ff);
}
.dl-cat-card:hover .dl-cat-icon { background: linear-gradient(180deg, #dceeff, #c8e6ff); }
.dl-cat-name { font-size: 15px; font-weight: 600; }

/* ---------- 排行榜 ---------- */
.dl-rank-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; }
.dl-rank {
  background: var(--dl-card); border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius); padding: 18px 20px 8px;
}
.dl-rank h2 { margin: 0 0 8px; font-size: 17px; }
.dl-rank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; border-top: 1px dashed var(--dl-border);
}
.dl-rank-item:hover .dl-rank-title { color: var(--dl-primary); }
.dl-rank-no {
  flex: 0 0 22px; height: 22px; border-radius: 5px; text-align: center;
  line-height: 22px; font-size: 12px; font-weight: 700;
  background: #eef1f6; color: var(--dl-text-sub);
}
.dl-rank-no.dl-top1 { background: #ff4d4f; color: #fff; }
.dl-rank-no.dl-top2 { background: #ff7a45; color: #fff; }
.dl-rank-no.dl-top3 { background: #ffa940; color: #fff; }
.dl-rank-title {
  flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 14px;
}
.dl-rank-meta { color: var(--dl-text-sub); font-size: 12px; white-space: nowrap; }

/* ---------- 精选推荐卡片 ---------- */
.dl-rec-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.dl-rec-card {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 22px 14px 18px; text-align: center;
  background: var(--dl-card); border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius); transition: all .15s ease;
}
.dl-rec-card:hover {
  transform: translateY(-3px); border-color: var(--dl-primary);
  box-shadow: 0 8px 20px rgba(30, 134, 255, .14);
}
.dl-rec-icon { font-size: 36px; line-height: 1; }
.dl-rec-info h3 { margin: 2px 0 5px; font-size: 14px; }
.dl-rec-info p {
  margin: 0; font-size: 12px; color: var(--dl-text-sub);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 列表页（侧栏 + 行列表） ---------- */
.dl-page { margin-top: 24px; margin-bottom: 40px; }
.dl-crumb { color: var(--dl-text-sub); font-size: 13px; margin-bottom: 14px; }
.dl-crumb a:hover { color: var(--dl-primary); }
.dl-crumb strong { color: var(--dl-text); }

.dl-list-layout { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.dl-side {
  background: var(--dl-card); border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius); padding: 14px 0; position: sticky; top: 78px;
}
.dl-side-title { padding: 0 18px 10px; font-weight: 700; font-size: 15px; }
.dl-side-item {
  display: block; padding: 10px 18px; color: var(--dl-text-sub); font-size: 14px;
  border-left: 3px solid transparent;
}
.dl-side-item:hover { color: var(--dl-primary); background: #f6f9ff; }
.dl-side-item.active {
  color: var(--dl-primary); font-weight: 600;
  background: #f0f6ff; border-left-color: var(--dl-primary);
}

.dl-main { min-width: 0; }
.dl-item {
  display: flex; align-items: center; gap: 18px;
  background: var(--dl-card); border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius); padding: 16px 22px; margin-bottom: 12px;
  transition: box-shadow .15s ease;
}
.dl-item:hover { box-shadow: 0 6px 18px rgba(20, 40, 80, .08); }
.dl-item-icon {
  flex: 0 0 68px; height: 68px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; background: linear-gradient(180deg, #f2f8ff, #e6f3ff);
  border-radius: 14px; border: 1px solid var(--dl-border);
}
.dl-item-info { flex: 1; min-width: 0; }
.dl-item-title { display: block; font-size: 16px; font-weight: 600; margin-bottom: 5px; }
.dl-item-title:hover { color: var(--dl-primary); }
.dl-item-intro {
  margin: 0 0 7px; font-size: 13px; color: var(--dl-text-sub);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.dl-item-meta { display: flex; gap: 18px; color: var(--dl-text-sub); font-size: 12px; }

.dl-btn-down {
  flex: 0 0 auto; display: inline-block; padding: 10px 28px;
  background: var(--dl-grad); color: #fff !important;
  border-radius: 20px; font-size: 14px; font-weight: 600;
  box-shadow: 0 3px 10px rgba(30, 134, 255, .25);
}
.dl-btn-down:hover { background: var(--dl-primary-hover); }

.dl-empty {
  text-align: center; padding: 70px 0; color: var(--dl-text-sub);
  background: var(--dl-card); border: 1px dashed var(--dl-border);
  border-radius: var(--dl-radius);
}
.dl-pager { margin-top: 18px; text-align: center; }
.dl-pager .layui-laypage a, .dl-pager .layui-laypage span { border-radius: 6px; }

/* ---------- 详情页 ---------- */
.dl-detail-card {
  display: flex; gap: 28px; align-items: flex-start;
  background: var(--dl-card); border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius); padding: 32px;
}
.dl-detail-icon {
  flex: 0 0 116px; height: 116px; display: flex; align-items: center; justify-content: center;
  font-size: 58px; background: linear-gradient(180deg, #f2f8ff, #e6f3ff);
  border: 1px solid var(--dl-border); border-radius: 22px;
}
.dl-detail-main { flex: 1; min-width: 0; }
.dl-detail-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dl-detail-title-row h1 { margin: 0; font-size: 23px; }
.dl-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
}
.dl-badge-safe { background: #e8f8ef; color: #18a058; border: 1px solid #bfe9d2; }
.dl-badge-clean { background: #eaf4ff; color: var(--dl-primary); border: 1px solid #c8e2ff; }
.dl-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 26px; color: var(--dl-text-sub); font-size: 13px; }
.dl-detail-meta label { color: #a3abba; margin-right: 6px; }
.dl-detail-meta a { color: var(--dl-primary); }
.dl-detail-intro { margin: 16px 0 0; color: #4a5160; line-height: 1.8; font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 安全提示条（QQ 式绿色安心条） */
.dl-safe-bar {
  margin-top: 14px; padding: 12px 20px;
  background: #e8f8ef; border: 1px solid #bfe9d2; border-radius: var(--dl-radius);
  color: #18a058; font-size: 13px;
}
.dl-safe-bar b { margin-left: 4px; }

/* 简介卡片 */
.dl-intro-card {
  margin-top: 14px; background: var(--dl-card);
  border: 1px solid var(--dl-border); border-radius: var(--dl-radius);
  padding: 22px 24px;
}
.dl-intro-card h2 { margin: 0 0 10px; font-size: 18px; }
.dl-intro-card p { margin: 0; color: #4a5160; line-height: 1.9; font-size: 14px; white-space: pre-wrap; }

/* 相关推荐列表 */
.dl-rel-list { display: flex; flex-direction: column; }

.dl-detail-action {
  flex: 0 0 180px; text-align: center; align-self: center;
  border-left: 1px dashed var(--dl-border); padding-left: 28px;
}
.dl-btn-down-big {
  display: block; padding: 14px 0; text-align: center;
  background: var(--dl-grad); color: #fff !important;
  border-radius: 26px; font-size: 17px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(30, 134, 255, .3);
}
.dl-btn-down-big:hover { background: var(--dl-primary-hover); }
.dl-price { display: block; margin-top: 12px; color: var(--dl-text-sub); font-size: 15px; }
.dl-price .free { color: #16baaa; font-weight: 700; }
.dl-price .pay { color: #ff7a45; font-weight: 700; }

/* ---------- 搜索结果页 ---------- */
.dl-search-head { margin-bottom: 16px; font-size: 15px; color: var(--dl-text-sub); }
.dl-search-head strong { color: var(--dl-primary); font-size: 17px; }

/* ---------- 底栏 ---------- */
.dl-footer {
  margin-top: 50px; padding: 26px 0; text-align: center;
  background: var(--dl-card); border-top: 1px solid var(--dl-border);
  color: var(--dl-text-sub); font-size: 13px;
}
.dl-footer p { margin: 4px 0; }
.dl-footer a { color: var(--dl-text-sub); }
.dl-footer a:hover { color: var(--dl-primary); }

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

/* 平板（≤1200）：分类 4 列、推荐 4 列 */
@media (max-width: 1200px) {
  .dl-cat-grid { grid-template-columns: repeat(4, 1fr); }
  .dl-rec-grid { grid-template-columns: repeat(4, 1fr); }
  .dl-hero h1 { font-size: 30px; }
}

/* 中屏（≤900）：双榜单列、隐藏导航 */
@media (max-width: 900px) {
  .dl-rank-row { grid-template-columns: 1fr; }
  .dl-list-layout { grid-template-columns: 1fr; }
  .dl-side { position: static; }
  .dl-nav { display: none; }
  .dl-header-inner { gap: 14px; }
  .dl-search-mini { flex: 1; margin-left: 0; }
  .dl-search-mini input { flex: 1; width: auto; min-width: 0; }
  .dl-detail-card { flex-direction: column; }
  .dl-detail-action { border-left: 0; padding-left: 0; border-top: 1px dashed var(--dl-border); padding-top: 20px; width: 100%; }
}

/* 手机（≤640）：分类改横向滑动（QQ 手机版风格）、卡片紧凑化 */
@media (max-width: 640px) {
  body { font-size: 13px; }

  /* hero 紧凑 */
  .dl-hero { padding: 34px 16px 30px; }
  .dl-hero h1 { font-size: 22px; letter-spacing: 0; }
  .dl-hero .dl-slogan { font-size: 13px; margin-bottom: 18px; }
  .dl-search input { width: 60vw; height: 42px; padding: 0 14px; }
  .dl-search button { height: 42px; padding: 0 22px; font-size: 14px; }
  .dl-hot-words { padding: 0 10px; line-height: 1.9; display: block; }

  /* 分类：横向滑动条，替代多行网格 */
  .dl-cat-grid {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 4px 2px 12px;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    scrollbar-width: none;
  }
  .dl-cat-grid::-webkit-scrollbar { display: none; }
  .dl-cat-card {
    flex: 0 0 auto;
    width: 84px;
    padding: 14px 6px 12px;
    gap: 7px;
    border-radius: 12px;
  }
  .dl-cat-icon { width: 48px; height: 48px; border-radius: 13px; font-size: 26px; }
  .dl-cat-name { font-size: 12.5px; font-weight: 500; }

  /* 推荐卡片 2 列 */
  .dl-rec-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dl-rec-card { padding: 16px 10px 14px; }
  .dl-rec-icon { font-size: 30px; }

  /* 列表行紧凑 */
  .dl-item { gap: 12px; padding: 12px 14px; }
  .dl-item-icon { flex: 0 0 50px; height: 50px; font-size: 27px; border-radius: 11px; }
  .dl-item-title { font-size: 14.5px; margin-bottom: 3px; }
  .dl-item-intro { font-size: 12px; margin-bottom: 5px; }
  .dl-item-meta { flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; }
  .dl-btn-down { width: 100%; text-align: center; padding: 8px 0; border-radius: 17px; }
  .dl-item { flex-wrap: wrap; }

  /* 详情紧凑 */
  .dl-detail-card { padding: 20px 16px; gap: 16px; }
  .dl-detail-icon { flex: 0 0 80px; height: 80px; font-size: 40px; border-radius: 16px; }
  .dl-detail-main h1 { font-size: 18px; }
  .dl-btn-down-big { padding: 11px 0; font-size: 15px; }

  /* 侧栏改横向滑动（列表页手机端） */
  .dl-side { padding: 10px 12px; display: flex; overflow-x: auto; gap: 8px; scrollbar-width: none; }
  .dl-side::-webkit-scrollbar { display: none; }
  .dl-side-title { display: none; }
  .dl-side-item { flex: 0 0 auto; padding: 7px 14px; border-left: 0; border: 1px solid var(--dl-border); border-radius: 15px; font-size: 13px; }
  .dl-side-item.active { background: var(--dl-primary); color: #fff; border-color: var(--dl-primary); }

  .dl-page { margin-top: 14px; }
  .dl-rank { padding: 14px 14px 6px; }
  .dl-container { padding: 0 16px; }
}
