/* ===========================================================
   downloads.html — 下载中心（资料下载）
   参考 Microchip / NXP / Micron / 中微半导 等原厂下载页做法：
   Hero 搜索 → 热门下载 → 左侧筛选 + 右侧资料列表（版本/日期/大小/下载）
   → 找不到资料的服务入口；全部资料免登录直接下载
   类名前缀 dl-*；基础排版复用 base.css / cbu5000v210.css（.cb-*）
   =========================================================== */

/* ---------------- Hero ---------------- */
.dl-hero {
  background: var(--white);
  color: var(--ink);
  padding: 62px 0 58px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
/* 白底上的极浅蓝色氛围光（不再是整块蓝底） */
.dl-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(680px 280px at 84% -12%, rgba(46,107,255,.07), transparent 62%);
  pointer-events: none;
}
.dl-hero::after {
  content: "";
  position: absolute;
  right: -80px; bottom: -220px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,107,255,.06), rgba(46,107,255,0) 68%);
  pointer-events: none;
}
.dl-hero-inner { position: relative; z-index: 1; max-width: 900px; }
.dl-hero .eyebrow { color: var(--blue); margin-bottom: 14px; }
.dl-hero h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.06;
  letter-spacing: -.03em;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--ink);
}
.dl-hero-lead {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--muted);
  max-width: 640px;
  margin: 0;
}


/* 统计 */
.dl-stats {
  display: flex;
  gap: 46px;
  flex-wrap: wrap;
  margin-top: 36px;
}
.dl-stat b {
  display: block;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--ink);
}
.dl-stat span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.dl-stat--free b { color: #1E8E5A; font-size: 24px; line-height: 1.25; }
.dl-stat--free span { color: var(--ink-soft); font-weight: 600; }

/* ---------------- 热门下载 ---------------- */
.dl-hot { padding: 52px 0 6px; }
.dl-hot-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.dl-hot-head h2 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.02em; margin: 0; }
.dl-hot-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.dl-hot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.dl-hot-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  transition: .25s;
}
.dl-hot-card:hover {
  border-color: var(--blue-300);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.dl-hot-ico {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dl-hot-ico svg { width: 20px; height: 20px; }
.dl-hot-card h3 { font-size: 15px; margin: 1px 0 4px; color: var(--ink); line-height: 1.35; }
.dl-hot-card p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }

/* ---------------- 主体布局 ---------------- */
.dl-section { padding: 40px 0 84px; }
.dl-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

/* 左侧筛选 */
.dl-side {
  position: sticky;
  top: 96px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 20px;
}
.dl-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.dl-side-head h2 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.dl-reset {
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.dl-reset:hover { color: var(--blue-600); text-decoration: underline; }

.dl-f-group { padding: 20px 0 4px; border-top: 1px solid var(--line); margin-top: 16px; }
.dl-f-group:first-of-type { border-top: 0; margin-top: 12px; padding-top: 8px; }
.dl-f-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.dl-f-list { list-style: none; padding: 0; margin: 0; }
.dl-f-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .18s;
}
.dl-f-item:hover { color: var(--blue); }
.dl-f-item input { accent-color: var(--blue); width: 15px; height: 15px; flex: 0 0 auto; margin: 0; }
.dl-f-item .dl-f-name { flex: 1 1 auto; min-width: 0; }
.dl-f-item .dl-f-num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-f-item.is-on { color: var(--blue); font-weight: 600; }
.dl-f-item.is-on .dl-f-num { color: var(--blue-400); }

/* 右侧：工具条 */
.dl-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.dl-count { font-size: 14px; color: var(--muted); }
.dl-count b { color: var(--ink); font-weight: 700; }
.dl-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-chip-x {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.dl-chip-x:hover { background: var(--blue-100); }
.dl-sort {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.dl-sort select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.dl-sort select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }

/* 资料列表 */
.dl-list { display: flex; flex-direction: column; }
.dl-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 16px;
  border-bottom: 1px solid var(--line);
  border-radius: 12px;
  transition: background .2s ease, box-shadow .2s ease;
}
.dl-row:hover {
  background: var(--blue-50);
  box-shadow: inset 3px 0 0 var(--blue);
}
/* 「加载更多」新增行的入场：错峰淡入 + 轻微上浮（延迟由 JS 按序号写成 inline animation-delay）。
   只挂在新行上 —— 整列表重绘时已存在的行不动画，否则会整页闪一下。
   both 保证延迟期间也是隐藏态。 */
.dl-row--in { animation: dlRowIn .32s cubic-bezier(.22, .61, .36, 1) both; }
/* 首条新增行：淡入 + 描边流光（常亮，一道高光沿边框跑），鼠标移动才停 */
.dl-row--newfirst, .dl-row--hi-dismiss { position: relative; }
.dl-row--newfirst { animation: dlRowIn .32s cubic-bezier(.22, .61, .36, 1) both; box-shadow: 0 0 0 2px rgba(37, 95, 244, .4); }
/* 流光：conic 渐变随 --angle 旋转，mask 只留边框一圈；常亮时跑动，dismiss 时淡出 */
.dl-row--newfirst::after, .dl-row--hi-dismiss::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 3px;
  background: conic-gradient(from var(--angle), transparent 0%, rgba(37, 95, 244, .95) 16%, transparent 36%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.dl-row--newfirst::after { animation: dlRowFlow 3s linear infinite; }
/* 鼠标移动后：流光 + 常亮环一起平滑淡出，不突变 */
.dl-row--hi-dismiss { box-shadow: 0 0 0 0 rgba(37, 95, 244, 0); transition: box-shadow .45s ease; }
.dl-row--hi-dismiss::after { opacity: 0; transition: opacity .45s ease; }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes dlRowFlow { to { --angle: 360deg; } }
@keyframes dlRowIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.dl-ext {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  flex: 0 0 auto;
}
.dl-ext--pdf { background: #E4453A; }
.dl-ext--zip { background: #6B4FBB; }
.dl-ext--doc { background: #2E6BFF; }
.dl-ext--xls { background: #1E8E5A; }
.dl-ext--apk { background: #2FA36B; }
.dl-ext--other { background: #6B7A8C; }

.dl-row-main { min-width: 0; }
.dl-row-title {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -.01em;
  margin: 0 0 5px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dl-badge-new {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: #FF7F00;
  border-radius: 999px;
  padding: 2px 7px;
}
.dl-row-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 9px;
}
.dl-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dl-row-meta .dl-tag {
  background: var(--blue-50);
  color: var(--blue-600);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 600;
}
.dl-row-meta .dl-sep { color: var(--line); }
.dl-row-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; width: 92px; }
.dl-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: .2s;
  cursor: pointer;
}
.dl-dl svg { width: 15px; height: 15px; }
.dl-dl--go { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.dl-dl--go:hover { background: rgba(46,107,255,.08); color: var(--blue-600); border-color: var(--blue-600); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(46,107,255,.12); }

/* 空状态 / 加载更多 */
.dl-empty { padding: 64px 20px; text-align: center; }
.dl-empty[hidden] { display: none !important; }
.dl-empty h3 { font-size: 18px; margin: 0 0 8px; }
.dl-empty p { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.dl-more-wrap { padding: 28px 0 0; text-align: center; }
.dl-more {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .12s, box-shadow .2s;
}
.dl-more:hover { border-color: var(--blue); background: var(--blue-50); }
/* 按下反馈：数据在内存里，点击是瞬时完成的 —— 这 1px 下压让「我点了」有即时回应，
   不引入任何假等待。 */
.dl-more:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08); }
.dl-more[hidden] { display: none !important; }
/* 减少动态偏好：去掉入场动画与按压位移，滚动也由 JS 切到即时 */
@media (prefers-reduced-motion: reduce) {
  .dl-row--in, .dl-row--newfirst { animation: none; }
  .dl-row--newfirst::after { animation: none; }
  .dl-more:active { transform: none; box-shadow: none; }
}
.dl-endnote { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
/* 加载更多：点击后的加载动画（数据在内存，同步渲染会秒出，给最短可见时长让 spinner 转起来） */
.dl-spinner { padding: 28px 0 0; text-align: center; }
.dl-spinner[hidden] { display: none !important; }
.dl-spinner .pl { display: inline-block; }

/* From Uiverse.io by Nawsome — 四色旋转环加载动画 */
.pl { width: 6em; height: 6em; }
.pl__ring { fill: none; }
.pl__ring--a { stroke: #f42f25; animation: ringA 2s linear infinite; }
.pl__ring--b { stroke: #f49725; animation: ringB 2s linear infinite; }
.pl__ring--c { stroke: #255ff4; animation: ringC 2s linear infinite; }
.pl__ring--d { stroke: #f42582; animation: ringD 2s linear infinite; }
@keyframes ringA {
  from, 4% { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -330; }
  12% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -335; }
  32% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -595; }
  40%, 54% { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -660; }
  62% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -665; }
  82% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -925; }
  90%, to { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -990; }
}
@keyframes ringB {
  from, 12% { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -110; }
  20% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -115; }
  40% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -195; }
  48%, 62% { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -220; }
  70% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -225; }
  90% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -305; }
  98%, to { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -330; }
}
@keyframes ringC {
  from { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: 0; }
  8% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -5; }
  28% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -175; }
  36%, 58% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -220; }
  66% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -225; }
  86% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -395; }
  94%, to { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -440; }
}
@keyframes ringD {
  from, 8% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: 0; }
  16% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -5; }
  36% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -175; }
  44%, 50% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -220; }
  58% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -225; }
  78% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -395; }
  86%, to { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -440; }
}

/* ---------------- 帮助 / CTA ---------------- */
.dl-help { background: var(--zone-soft); border-top: 1px solid var(--line); padding: 62px 0 70px; }
.dl-help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dl-help-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dl-help-card h3 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.dl-help-card p { font-size: 13.5px; line-height: 1.7; color: var(--muted); margin: 0; flex: 1 1 auto; }
.dl-help-card .btn { align-self: flex-start; margin-top: 6px; padding: 10px 20px; font-size: 14px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .dl-hot-grid { grid-template-columns: repeat(2, 1fr); }
  .dl-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 900px) {
  .dl-hero { padding: 52px 0 58px; }
  .dl-stats { gap: 30px; }
  .dl-stat b { font-size: 24px; }
  .dl-layout { grid-template-columns: 1fr; }
  .dl-side { position: static; }
  .dl-help-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dl-hot-grid { grid-template-columns: 1fr; }
  .dl-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 12px;
  }
  .dl-ext { width: 48px; height: 48px; font-size: 10.5px; }
  .dl-row-actions { grid-column: 2 / -1; width: auto; justify-self: flex-end; margin-top: 6px; }
  .dl-dl { width: auto; padding: 9px 16px; justify-content: center; }
  .dl-sort { margin-left: 0; width: 100%; }
}
