/* ============================================================================
   下载中心（downloads.html）
   ----------------------------------------------------------------------------
   这一页要解决的不是「好看」，而是三件具体的事：
     1) 让人一眼看出这三份材料分别是什么、有多长、哪一版 —— 所以每个文件都带
        版本 / 篇幅 / 大小 / 更新日期，且这四个值由生成器写入，不手抄；
     2) 让「下载」这个动作没有歧义 —— 主按钮就是真文件（.pptx / .xlsx / .pdf），
        不用先留资、不用跳第三方网盘；
     3) 打印出来还能看 —— 招标与立项经常是「打印这一页附在材料后面」。
   配色与排版沿用 main.css 的变量，不另立一套视觉。
   ========================================================================== */

/* ---- hero 上的三个分类入口 ---- */
.dl-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.75rem;
  max-width: 900px;
}

.dl-quick-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  color: #fff;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.dl-quick-item:hover,
.dl-quick-item:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-1px);
}

.dl-quick-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.dl-quick-item strong {
  font-size: 1.02rem;
  font-weight: 600;
}

.dl-quick-item em {
  font-size: 0.78rem;
  font-style: normal;
  opacity: 0.8;
}

/* ---- 区块 ---- */
.dl-section {
  scroll-margin-top: 80px;
}

.dl-section .section-desc {
  max-width: 62ch;
}

/* ---- 宣传 PPT：左封面预览，右元数据 + 大纲 ---- */
.dl-deck {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  margin-top: 1.75rem;
}

/* 封面预览是纯 CSS 画的：不额外做一张截图 —— 截图会和真正的 .pptx 版本漂移，
   而这块的全部作用只是让人认出「打开之后大概长这样」。 */
.dl-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-sm);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(232, 168, 56, 0.24) 0%, transparent 55%),
    linear-gradient(150deg, #0d5c63 0%, #094248 100%);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dl-cover::after {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -42%;
  width: 62%;
  height: 90%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.dl-cover-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.dl-cover-mark {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.86rem;
  font-weight: 700;
}

.dl-cover-kicker {
  margin: 0.9rem 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  opacity: 0.75;
}

.dl-cover-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
}

.dl-cover-foot {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.6;
  opacity: 0.72;
}

.dl-deck-body {
  min-width: 0;
}

/* ---- 文件元数据（版本 / 篇幅 / 大小 / 更新）---- */
.dl-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem 1.25rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.dl-meta > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.dl-meta dt {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.dl-meta dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-word;
}

/* ---- PPT 大纲 ---- */
.dl-outline {
  margin-bottom: 1.4rem;
}

.dl-outline-title {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.dl-outline-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: dl-slide;
  display: grid;
  gap: 0.4rem;
}

.dl-outline-list li {
  counter-increment: dl-slide;
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.dl-outline-list li::before {
  content: counter(dl-slide, decimal-leading-zero);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.65;
  padding-top: 0.1rem;
}

.dl-outline-list strong {
  display: block;
  font-weight: 600;
}

.dl-outline-list span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- 通用动作区与提示 ---- */
.dl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.dl-hint {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 78ch;
}

/* ---- 功能清单：文件条 + 表格 ---- */
.dl-filebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.dl-filebar-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.dl-filebar-main strong {
  font-size: 0.98rem;
}

.dl-filebar-main span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dl-filebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dl-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

/* 窄屏上这张表要横向滚动才能看全 —— 只给滚动不给提示，
   读者会以为最后一列被裁掉了。提示只在小屏出现，桌面与打印都不需要。 */
.dl-scroll-note {
  display: none;
}

.dl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 720px;
}

.dl-table caption {
  text-align: left;
  padding: 0.75rem 1rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dl-table th,
.dl-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.dl-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  white-space: nowrap;
  z-index: 1;
}

.dl-table tbody tr:last-child td {
  border-bottom: 0;
}

.dl-table tbody tr:hover {
  background: rgba(13, 92, 99, 0.03);
}

.dl-table .dl-line-name {
  font-weight: 600;
  white-space: nowrap;
}

/* 业务群列是 rowspan 合并的，靠底色把它和产品线分开，扫读时不会错行 */
.dl-table .dl-group-cell {
  width: 96px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(13, 92, 99, 0.035);
  white-space: nowrap;
}

.dl-table .dl-line-name a {
  color: var(--primary);
}

.dl-table .dl-line-name small {
  display: block;
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: normal;
}

.dl-table ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.15rem;
}

.dl-table ul li::before {
  content: "· ";
  color: var(--primary);
  opacity: 0.55;
}

.dl-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(13, 92, 99, 0.08);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- 白皮书分组 ---- */
.dl-packs {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.dl-pack-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.dl-pack-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.dl-pack-group-head h3 {
  margin: 0;
  font-size: 0.98rem;
}

.dl-pack-group-head span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dl-pack-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}

.dl-pack-row:last-child {
  border-bottom: 0;
}

.dl-pack-row:hover {
  background: rgba(13, 92, 99, 0.03);
}

.dl-pack-name {
  min-width: 0;
}

.dl-pack-name strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
}

.dl-pack-name em {
  display: block;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dl-pack-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.dl-pack-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dl-pack-actions .btn {
  padding: 0.32rem 0.7rem;
  font-size: 0.78rem;
}

/* ---- 授权与免责 ---- */
.dl-license {
  max-width: 900px;
}

.dl-license h2 {
  margin: 0 0 0.35rem;
}

.dl-license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem 2rem;
  margin-top: 1rem;
}

.dl-license-grid h3 {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  color: var(--primary);
}

.dl-list {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-muted);
  padding-left: 1rem;
  list-style: disc;
}

.dl-disclaimer {
  margin: 1.4rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.7;
  color: #6b5320;
}

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .dl-quick {
    grid-template-columns: minmax(0, 1fr);
  }

  .dl-deck {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .dl-cover {
    max-width: 420px;
  }
}

@media (max-width: 640px) {
  .dl-pack-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }

  .dl-pack-actions {
    justify-content: flex-start;
  }

  .dl-pack-meta {
    white-space: normal;
  }

  .dl-scroll-note {
    display: block;
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
  }
}

/* ---- 打印：招标与立项常把这一页打印后附在材料后面 ----
   导航、按钮、封面预览都不带信息量，隐藏；文件链接与版本日期必须留下，
   否则纸上就没有「去哪拿」和「哪一版」。 */
@media print {
  /* 页头页脚与行动区在纸上没有意义：导航点不了，二维码扫不了（二维码在联系页有）。
     不隐藏的话，最后一页会多出「产品线 / 全部 15 条 / 机器可读索引」这一堆链接。 */
  #site-header,
  #site-footer,
  .site-header,
  .site-footer,
  .breadcrumb,
  .cta-band,
  .dl-quick,
  .dl-cover,
  .dl-actions,
  .dl-filebar-actions,
  .dl-pack-actions {
    display: none !important;
  }

  .dl-scroll-note {
    display: none !important;
  }

  /* 打印用系统字体。
     这一页正文用了 Google Fonts 的 Noto Sans SC；打印时 Chrome 会把它按子集
     逐段嵌进 PDF（一份 10 页的页面能因此到 2 MB），且部分子集在阅读器里
     落成 Type3 位图。纸面只要清楚，用系统黑体就够。 */
  body,
  .dl-hero,
  .dl-table,
  .dl-pack-group,
  .dl-meta,
  .dl-outline-list {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
      "Source Han Sans SC", "Noto Sans CJK SC", system-ui, sans-serif !important;
  }

  /* 纸上不要任何底色。
     起因很具体：这块页面的 section 底色与卡片底色会被 Chrome 印成一整页的矩形，
     并且排在文字之后 —— PDF 里文字明明在，看起来却是一张白纸。
     边框与文字本身保留，信息一点不少，还省墨。 */
  *,
  *::before,
  *::after {
    background: transparent !important;
    box-shadow: none !important;
  }

  .dl-hero {
    background: none !important;
    color: #000 !important;
    min-height: auto !important;
    padding: 0 0 0.75rem !important;
  }

  .dl-hero .page-hero-bg,
  .dl-hero .page-hero-overlay {
    display: none !important;
  }

  .dl-hero h1,
  .dl-hero .page-hero-lead,
  .dl-hero .page-hero-tag {
    color: #000 !important;
  }

  /* 表格容器不要 break-inside: avoid：15 行产品线的表本来就跨页，
     给了 avoid 之后 Chrome 会把整块往下推，标题与文件条之间空出两厘米多。
     卡片与文件条不跨页，才留 avoid。 */
  .dl-pack-group,
  .dl-meta,
  .dl-filebar {
    break-inside: avoid;
    page-break-inside: avoid;
    border-color: #999 !important;
  }

  /* 章节标题不许落在页脚：上一页末尾只剩一行「02 · 系统功能清单」这种断法，
     打印出来像残页。Chrome 对 break-after: avoid 支持不稳，改用最确定的办法：
     第 2、3 块内容各自另起一页，标题自然落在页首。 */
  .dl-section + .dl-section {
    break-before: page;
    page-break-before: always;
  }

  /* 屏幕上的 section 上下留白（3.5rem）和标题下留白（2.5rem）到纸上就是三处
     叠加的空白：标题与文件条之间能空出 2.5 厘米。纸上按行距留白就够。 */
  .dl-section {
    padding: 0 0 0.75rem !important;
  }

  .section-head,
  .page-section > .container > p.section-desc {
    margin-bottom: 0.7rem !important;
  }

  .dl-filebar {
    margin: 0.7rem 0 0.6rem !important;
  }

  .section-head {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 段落的最后一行不许单独掉到下一页：表格后面那段脚注只落了一行在纸上，
     多出一个几乎空白的页面。 */
  p,
  li,
  dd {
    orphans: 3;
    widows: 3;
  }

  .dl-hint {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 表格在纸上用 7.6 点：8.5 点时这张表正好 2.2 页，最后一页只剩一行，
     而且那一行会和同组的另两行拆开。缩到 7.6 点、行内留白收一半后，
     分页落在业务群边界上 —— 最后一页是完整的「售后与服务」三行。 */
  .dl-table {
    min-width: 0;
    font-size: 7.6pt;
  }

  .dl-table td,
  .dl-table th {
    padding: 0.32rem 0.5rem;
  }

  .dl-table thead th {
    position: static;
  }

  .dl-pack-row,
  .dl-table tbody tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 链接在纸上点不了，把地址显示出来 */
  .dl-pack-name a::after {
    content: " (" attr(href) ")";
    font-size: 7.5pt;
    color: #555;
  }

  /* 屏幕上是浅灰正文色（--ink-soft / --muted），印到纸上会淡成一片灰影，
     看不清字号也分不出层级。纸上统一压到近黑，层级改由字重和边框承担。 */
  .dl-section,
  .dl-section p,
  .dl-section li,
  .dl-section dt,
  .dl-section dd,
  .dl-section small,
  .dl-section span,
  .dl-section a,
  .dl-section strong,
  .section-head h2,
  .section-desc,
  .section-label,
  .dl-table th,
  .dl-table td,
  .dl-table caption,
  .dl-meta dt,
  .dl-meta dd,
  .dl-hint,
  .dl-outline-list li strong,
  .dl-outline-list li span,
  .dl-filebar-main,
  .dl-pack-group-head,
  .dl-pack-name,
  .dl-pack-meta {
    color: #111 !important;
  }

  /* 徽章原本靠浅底色区分，纸上没有底色，改成描边 */
  .dl-badge {
    color: #000 !important;
    border: 0.5pt solid #555 !important;
    font-weight: 700;
  }

  /* 表头去掉底纹后会和表体混在一起，加一条下边框压住 */
  .dl-table thead th {
    border-bottom: 1pt solid #333 !important;
  }
}

