/* ==========================================================================
   Freebies 页（/freebies）— 筛选 + 卡片 + 弹窗
   --------------------------------------------------------------------------
   这一层只服务 .page-freebies，别的页面完全不引用（style.css 一个字没动）。

   结构：
     报头        直接用站点通用的 .page-head（浅橙底），不在这里重写
     .fb-panel   筛选面板：一行一个维度（搜索分类 / 细分类别 / 获取方式 / 排列顺序）
     .fb-grid    结果网格，一张卡片 = 封面 + 名字 + 一行简介 + 标签
     .fb-modal   原生 <dialog>，点卡片弹出来：简介、优缺点、下载链接

   几条约定：
     * 颜色只用站点变量（--brand / --brand-wash / --ink / --line / --bg），不新造色；
       浅底 + 白卡片 + 橙色选中态，和 /cakewalk-sonar-faq、/merch 是一套配色
       （2026-10-16：第一版做成了深色面板，用户指出"配色不统一"，已改浅）；
     * 不用渐变（style.css 开头那条"黑橙白、不用渐变"的规矩）；
     * 动效只动 transform / opacity，并有 prefers-reduced-motion 兜底。
   ========================================================================== */

/* ---------- 页头（粘性那条）----------
   本站通用页头是 `saturate(180%) blur(14px)` 的毛玻璃：滚动时合成器每帧都要
   重新模糊页头背后那一条。这一页下面是 71 张图的长列表、滚动距离最长，所以
   在这里把模糊降到 6px、去掉 saturate、底色加实到 .94 —— 白底页面上观感几乎
   一样，每帧的离屏渲染轻很多（2026-10-16 用户要求提速）。
   ⚠️ 只覆盖颜色/模糊；圆角、描边、投影那些"形状"仍在 style.css 的 .site-header 里。 */
.page-freebies .site-header {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- 报头 ----------
   报头直接用站点通用的 .page-head（浅橙底 #fff6ee + 橙 eyebrow + 黑标题），
   和 /cakewalk-sonar-faq、/merch 那几个内页是同一套；这一层只补那句小提示。
   （2026-10-16：原来写成深色报头，用户指出"配色不统一"，改回浅色。） */
.page-freebies .fb-head-hint {
  margin: 14px 0 0;
  max-width: 62ch;
  font-size: .95rem;
  color: var(--ink-3);
}

.page-freebies .fb-head-hint b { color: var(--brand-deep); font-weight: 600; }

/* 报头：左边文字、右边「本期强推」优惠位（窄屏时上下排） */
.page-freebies .fb-head-grid {
  display: grid;
  width: min(100% - 40px, 1180px);
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0 28px;
  align-items: start;
}

/* 左边一列：报头文字 + 视频卡单独纵向排。优惠卡再高也只会在右侧延伸，
   不会把文字和视频之间撑出空隙（以前 promo 跨两行时会按行分摊高度）。 */
.page-freebies .fb-head-main {
  min-width: 0;
  display: grid;
  gap: 24px;
  align-content: start;
}

.page-freebies .fb-head-text { min-width: 0; }

/* ---------- 全家桶视频合集（报头正下方） ---------- */
.page-freebies .fb-head-main > .fb-videos {
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.page-freebies .fb-head-main > .fb-videos .container {
  width: 100%;
  margin-inline: 0;
}

.page-freebies .fb-videos {
  padding: 34px 0 40px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.page-freebies .fb-videos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.page-freebies .fb-videos-head .eyebrow {
  margin-bottom: 8px;
}

.page-freebies .fb-videos-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.72rem);
  line-height: 1.2;
}

.page-freebies .fb-videos-head p {
  max-width: 650px;
  margin: 5px 0 0;
  color: var(--ink-3);
  font-size: .84rem;
}

.page-freebies .fb-videos-more {
  flex: 0 0 auto;
  padding-bottom: 3px;
  color: var(--brand-deep);
  font-size: .84rem;
  font-weight: 600;
}

.page-freebies .fb-video-module {
  position: relative;
  display: block;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}

.page-freebies .fb-video-player {
  display: grid;
  grid-template-columns: minmax(300px, 49%) minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: 12px;
}

.page-freebies .fb-video-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}

.page-freebies .fb-video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.page-freebies .fb-video-now {
  display: flex;
  min-width: 0;
  padding: 14px 18px;
  flex-direction: column;
  justify-content: center;
}

.page-freebies .fb-video-now-meta {
  margin: 0;
  color: var(--brand-deep);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
}

.page-freebies .fb-video-now h3 {
  margin: 5px 0 0;
  overflow: hidden;
  display: -webkit-box;
  font-size: 1.02rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.page-freebies .fb-video-now > p:not(.fb-video-now-meta) {
  margin: 6px 0 0;
  color: var(--ink-3);
  font-size: .84rem;
}

.page-freebies .fb-video-open {
  display: inline-block;
  margin-top: 0;
  font-size: .8rem;
  font-weight: 600;
}

.page-freebies .fb-video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 9px;
}

.page-freebies .fb-video-directory-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  color: var(--ink);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.page-freebies .fb-video-directory-toggle:hover {
  color: var(--brand-deep);
  background: var(--brand-wash);
  border-color: var(--brand-soft);
}

.page-freebies .fb-video-directory-toggle[aria-expanded="true"] {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.page-freebies .fb-video-directory-toggle[aria-expanded="true"] span {
  color: rgba(255, 255, 255, .68);
}

.page-freebies .fb-video-directory-toggle span {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: .66rem;
}

.page-freebies .fb-video-drawer {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 30;
  display: flex;
  width: min(360px, calc(100% - 28px));
  max-height: 330px;
  overflow: hidden;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 22px 56px rgba(17, 17, 17, .2);
  overscroll-behavior: contain;
}

.page-freebies .fb-video-drawer[hidden] {
  display: none !important;
}

.page-freebies .fb-video-drawer-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--brand-wash);
  border-bottom: 1px solid var(--line);
}

.page-freebies .fb-video-drawer-head strong {
  font-size: .86rem;
}

.page-freebies .fb-video-drawer-head span {
  margin-left: 7px;
  color: var(--ink-3);
  font-size: .7rem;
}

.page-freebies .fb-video-drawer-close {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink-2);
  font: inherit;
  font-size: 1.15rem;
  line-height: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.page-freebies .fb-video-drawer-close:hover {
  color: var(--brand-deep);
  border-color: var(--brand-soft);
}

.page-freebies .fb-video-list {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex-direction: column;
  list-style: none;
  background: #fff;
}

.page-freebies .fb-video-list li {
  min-width: 0;
}

.page-freebies .fb-video-list li + li {
  border-top: 1px solid var(--line-2);
}

.page-freebies .fb-video-item {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: 11px 13px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  background: #fff;
  border: 0;
  cursor: pointer;
  transition: background .14s, box-shadow .14s;
}

.page-freebies .fb-video-item:hover {
  background: var(--brand-wash);
}

.page-freebies .fb-video-item.is-active {
  background: var(--brand-wash);
  box-shadow: inset 3px 0 0 var(--brand);
}

.page-freebies .fb-video-version {
  display: inline-flex;
  width: 38px;
  min-height: 24px;
  grid-row: 1 / 3;
  align-items: center;
  justify-content: center;
  color: var(--brand-deep);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  background: var(--brand-wash);
  border: 1px solid var(--brand-soft);
  border-radius: 7px;
}

.page-freebies .fb-video-item.is-active .fb-video-version {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.page-freebies .fb-video-copy {
  display: block;
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
}

.page-freebies .fb-video-copy strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  font-size: .78rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-freebies .fb-video-date {
  display: block;
  grid-column: 2 / 4;
  grid-row: 2;
  color: var(--ink-3);
  font-size: .68rem;
  line-height: 1.4;
  white-space: nowrap;
}

.page-freebies .fb-video-duration {
  grid-column: 3;
  grid-row: 1;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: .67rem;
  white-space: nowrap;
}

/* ---------- 本期强推（报头右上角，内容来自 data.json 的 promo） ---------- */
.page-freebies .fb-promo {
  grid-column: 2;
  display: flex;
  height: auto;
  align-self: start;
  flex-direction: column;
  margin: 0;
  padding: 12px 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(17, 17, 17, .06);
}

@media (max-width: 980px) {
  .page-freebies .fb-head-grid {
    width: min(100% - 40px, 1060px);
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .page-freebies .fb-head-main { gap: 22px; }
  .page-freebies .fb-promo { grid-column: 1; max-width: 460px; }
}

@media (max-width: 620px) {
  .page-freebies .fb-videos {
    padding-block: 28px 32px;
  }
  .page-freebies .fb-videos-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .page-freebies .fb-video-player {
    grid-template-columns: 1fr;
  }
  .page-freebies .fb-video-now {
    padding-inline: 18px;
  }
  .page-freebies .fb-video-item {
    column-gap: 8px;
    row-gap: 2px;
    padding-inline: 10px;
  }
  .page-freebies .fb-video-drawer {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 300;
    width: auto;
    max-height: min(55vh, 420px);
  }
}

.page-freebies .fb-promo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 2px 0 10px;
}

.page-freebies .fb-promo-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--brand-deep);
}

.page-freebies .fb-promo-label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  background: var(--brand);
  border-radius: 2px;
  vertical-align: 1px;
}

.page-freebies .fb-promo-tag {
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
}

/* 倒计时：读数字要跳得稳，所以用等宽数字 */
.page-freebies .fb-promo-count {
  margin-left: auto;
  padding: 3px 9px;
  font-size: .76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-deep);
  background: var(--brand-wash);
  border: 1px solid var(--brand-soft);
  border-radius: 999px;
  white-space: nowrap;
}

/* 标价：美元原价大一点，折算的人民币小一号灰一点 */
.page-freebies .fb-promo-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 2px 10px;
}

.page-freebies .fb-promo-price b {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--ink);
}

.page-freebies .fb-promo-price-rmb {
  font-size: .88rem;
  color: var(--ink-3);
  border-bottom: 1px dotted var(--line);
}

/* 到点了：整块灰掉（链接还在，但不再抢眼） */
.page-freebies .fb-promo.is-ended .fb-promo-pic img,
.page-freebies .fb-promo.is-ended .fb-promo-body { opacity: .55; }

.page-freebies .fb-promo.is-ended .fb-promo-count {
  color: var(--ink-3);
  background: var(--line-2);
  border-color: var(--line);
}

.page-freebies .fb-promo.is-ended .fb-promo-cta { background: var(--ink-3); }

.page-freebies .fb-promo-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.page-freebies .fb-promo-link:hover { text-decoration: none; }

.page-freebies .fb-promo-pic {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  /* 图本身是深灰底，用同色兜底，contain 也不会看出留边 */
  background: #434343;
}

.page-freebies .fb-promo-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s;
}

.page-freebies .fb-promo-link:hover .fb-promo-pic img { transform: scale(1.04); }

.page-freebies .fb-promo-body { display: block; padding: 12px 2px 0; }

.page-freebies .fb-promo-title {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}

.page-freebies .fb-promo-desc {
  display: block;
  margin-top: 6px;
  font-size: .84rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.page-freebies .fb-promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: .86rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  text-decoration: none;
}

.page-freebies .fb-promo-cta:hover { background: var(--brand-bright); color: #fff; text-decoration: none; }

/* 按钮那一行：主按钮 + 复制链接 */
.page-freebies .fb-promo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 12px;
}

.page-freebies .fb-promo-copy {
  padding: 8px 12px;
  font: inherit;
  font-size: .84rem;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.page-freebies .fb-promo-copy:hover {
  color: var(--brand-deep);
  border-color: var(--brand-soft);
  background: var(--brand-wash);
}

.page-freebies .fb-promo-copy:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 复制成功：按钮短暂变成"已复制 ✓" */
.page-freebies .fb-promo-copy.is-done {
  color: #fff;
  background: #1f6f4a;
  border-color: #1f6f4a;
}

/* FL Studio 三版：横幅图 + 三条价格 /「去购买」。
   购买链接原样用 data.json 里的 /ref/ 地址，不加 noreferrer、不做跳转页。 */
.page-freebies .fb-promo--offers { height: 100%; }
.page-freebies .fb-promo--offers .fb-promo-pic {
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  background: #1a1a1a;
}
.page-freebies .fb-promo--offers .fb-promo-title { font-size: 1.16rem; }
.page-freebies .fb-promo--offers .fb-promo-desc { margin-top: 4px; }
.page-freebies .fb-promo-coupon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 10px 0 0;
  padding: 7px 10px;
  background: var(--brand-wash);
  border: 1px dashed var(--brand-soft);
  border-radius: 10px;
}
.page-freebies .fb-promo-coupon-label { font-size: .76rem; color: var(--ink-2); }
.page-freebies .fb-promo-coupon-code { color: var(--brand-deep); font-size: .9rem; font-weight: 700; letter-spacing: .06em; }
.page-freebies .fb-promo-coupon-copy {
  padding: 3px 8px;
  border: 1px solid var(--brand-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-deep);
  font: inherit;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
}
.page-freebies .fb-promo-coupon-copy:hover { border-color: var(--brand); color: var(--brand); }
.page-freebies .fb-promo-coupon-copy.is-done { background: #1f6f4a; border-color: #1f6f4a; color: #fff; }
.page-freebies .fb-promo-coupon-note { flex-basis: 100%; color: var(--ink-3); font-size: .74rem; }
.page-freebies .fb-promo-offers {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-2);
}
.page-freebies .fb-promo-offers li {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line-2);
}
.page-freebies .fb-promo-offers li:last-child { border-bottom: 0; }
.page-freebies .fb-promo-offer-body { min-width: 0; }
.page-freebies .fb-promo-offer-name { display: block; font-size: .9rem; font-weight: 700; color: var(--ink); }
.page-freebies .fb-promo-offer-desc { display: block; margin-top: 2px; font-size: .75rem; color: var(--ink-3); }
.page-freebies .fb-promo-offer-buy { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.page-freebies .fb-promo-offer-price { color: var(--brand-deep); font-size: .86rem; font-weight: 700; white-space: nowrap; }
.page-freebies .fb-promo-offer-cta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.page-freebies .fb-promo-offer-cta:hover { background: var(--brand-bright); color: #fff; text-decoration: none; }

/* ---------- 热度榜（免费下载区顶部，前 5 名） ----------
   build_freebies.py 先按 data.json 的 hot.seed 画出 5 条（没 JS 也在），
   freebies.js 拉到足够的真实点击后原地重画（结构完全一样，见 build_hot）。
   ⚠️ 别给这一块加滤镜或大阴影：它在页面最上面，滚动时会被反复重绘。 */
.page-freebies .fb-hot {
  margin: 0 0 20px;
  padding: 18px 20px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* [hidden] 得自己写一条：作者样式里的 display 会盖掉浏览器默认的 */
.page-freebies .fb-hot[hidden] { display: none; }

.page-freebies .fb-hot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-freebies .fb-hot-title { min-width: 0; }

.page-freebies .fb-hot-title h2 {
  margin: 2px 0 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}

.page-freebies .fb-hot-sub {
  margin: 5px 0 0;
  font-size: .82rem;
  color: var(--ink-3);
}

.page-freebies .fb-hot-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin: 0;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--brand-deep);
  background: var(--brand-wash);
  border: 1px solid var(--brand-soft);
  border-radius: 999px;
}

.page-freebies .fb-hot-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: fbHotPulse 2.4s ease-in-out infinite;
}

@keyframes fbHotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.page-freebies .fb-hot-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-freebies .fb-hot-item { margin: 0; min-width: 0; }

.page-freebies .fb-hot-hit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  padding: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}

.page-freebies .fb-hot-hit:hover {
  background: var(--brand-wash);
  border-color: var(--brand-soft);
  transform: translateY(-1px);
}

.page-freebies .fb-hot-hit:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.page-freebies .fb-hot-thumb {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
  border-bottom: 1px solid var(--line);
}

.page-freebies .fb-hot-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-freebies .fb-hot-rank {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
  background: rgba(17, 17, 17, .72);
  border-radius: 7px;
}

.page-freebies .fb-hot-item:first-child .fb-hot-rank { background: var(--brand); }

.page-freebies .fb-hot-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 3px;
  padding: 10px 12px 11px;
}

.page-freebies .fb-hot-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.32;
  color: var(--ink);
}

.page-freebies .fb-hot-meta {
  overflow: hidden;
  font-size: .73rem;
  color: var(--ink-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 读数贴底：名字一行的和两行的卡片，数字也在同一条水平线上 */
.page-freebies .fb-hot-count {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: auto;
  padding-top: 4px;
  font-size: .7rem;
  color: var(--ink-3);
}

.page-freebies .fb-hot-count b {
  font-size: .92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-deep);
}

/* 窄屏：一行 5 个太挤，改成横向滑动（一屏能看到两个半，暗示还能滑） */
@media (max-width: 1000px) {
  .page-freebies .fb-hot-list {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(178px, 224px);
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .page-freebies .fb-hot-item { scroll-snap-align: start; }
}

@media (max-width: 560px) {
  .page-freebies .fb-hot { padding: 16px 16px 14px; }
  .page-freebies .fb-hot-sub { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .page-freebies .fb-hot-live i { animation: none; }
  .page-freebies .fb-hot-hit { transition: none; }
}

/* ---------- 筛选面板 ---------- */
.page-freebies .fb-browse {
  background: var(--bg);
  padding: clamp(30px, 4vw, 44px) 0 clamp(44px, 6vw, 72px);
}

.page-freebies .fb-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 8px;
}

.page-freebies .fb-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-freebies .fb-panel-title h2 {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}

.page-freebies .fb-panel-title p {
  margin: 6px 0 0;
  font-size: .86rem;
  color: var(--ink-3);
}

.page-freebies .fb-updated { margin-left: 8px; color: var(--ink-3); }

.page-freebies .fb-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.page-freebies .fb-search-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.page-freebies .fb-search input {
  width: min(300px, 62vw);
  padding: 9px 12px;
  font: inherit;
  font-size: .92rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.page-freebies .fb-search input::placeholder { color: var(--ink-3); }

.page-freebies .fb-search input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: transparent;
}

/* 一行一个维度：左边标签，右边胶囊 */
.page-freebies .fb-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 8px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}

.page-freebies .fb-row:last-child { border-bottom: 0; }

.page-freebies .fb-row-label {
  margin: 0;
  padding-top: 7px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink);
}

.page-freebies .fb-row-label span {
  display: block;
  margin-top: 3px;
  font-size: .74rem;
  font-weight: 400;
  color: var(--ink-3);
}

.page-freebies .fb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-freebies .fb-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  font: inherit;
  font-size: .86rem;
  color: var(--ink-2);
  background: var(--line-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.page-freebies .fb-chip:hover {
  background: var(--brand-wash);
  border-color: var(--brand-soft);
  color: var(--brand-deep);
  transform: translateY(-1px);
}

.page-freebies .fb-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 选中的那种：橙底白字（和站点主色一致），前面加个钩 */
.page-freebies .fb-chip.is-on {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}

.page-freebies .fb-chip.is-on::before {
  content: "✓";
  font-size: .74rem;
  line-height: 1;
  opacity: .9;
}

.page-freebies .fb-chip-n {
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.page-freebies .fb-chip.is-on .fb-chip-n { color: rgba(255, 255, 255, .82); }

/* ⚠️ 必须显式写：作者样式里的 display:inline-flex 会盖过浏览器默认的
   [hidden]{display:none}，细分类别那一排就藏不住别的大类的胶囊了。
   （2026-10-16 实测：选了「音源」之后，效果器的细分类别还留在那儿。） */
.page-freebies .fb-chip[hidden],
.page-freebies .fb-pack[hidden] { display: none; }

/* ---------- 整合包（每个大类一份总包） ---------- */
.page-freebies .fb-packs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* 一个整合包都没有时（比如只筛"宿主"），整条连容器一起藏起来 */
.page-freebies .fb-packs[hidden] { display: none; }

.page-freebies .fb-pack {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--brand-deep);
  background: var(--brand-wash);
  border: 1px solid var(--brand-soft);
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .15s;
}

.page-freebies .fb-pack:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-1px);
  text-decoration: none;
}

.page-freebies .fb-pack-cat {
  padding: 2px 8px;
  font-size: .74rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
}

.page-freebies .fb-pack-arrow { color: var(--brand); font-size: .9rem; }
.page-freebies .fb-pack:hover .fb-pack-arrow { color: #fff; }

/* ---------- 结果 ---------- */
.page-freebies .fb-result {
  margin: 30px 0 16px;
  font-size: .92rem;
  color: var(--ink-3);
}

.page-freebies .fb-result b { color: var(--ink); }

.page-freebies .fb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
}

.page-freebies .fb-card {
  margin: 0;
  /* 屏幕外的卡片不参与布局和绘制 —— 这一页有 71 张卡、每张一张大图，
     不这么做的话滚动时浏览器要一直为"看不见的东西"算布局（2026-10-16 用户
     反馈"浏览起来帧率很低"，这是最值钱的一处优化）。
     contain-intrinsic-size 的 auto 会记住上次渲染出来的真实高度，
     所以滚动条长度不会跳。 */
  content-visibility: auto;
  contain-intrinsic-size: auto 340px;
}
.page-freebies .fb-card[hidden] { display: none; }

.page-freebies .fb-hit {
  /* ⚠️ 必须是 flex + 顶对齐：<button> 默认会把内容**垂直居中**，
     卡片被网格撑成整行高度后，文字少的卡片内容会被往下推 ——
     表现就是同一行里"封面下缘不齐、标题高低不一"（2026-10-16 用户截图反馈）。
     改成 flex 顶对齐之后，多出来的高度统一落在卡片底部。 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.page-freebies .fb-hit:hover {
  transform: translateY(-3px);
  border-color: var(--brand-soft);
  /* 悬停阴影收小一点：30px 模糊在大卡片上每帧都要重绘一大片，
     视觉上几乎看不出差别，滚动/移鼠标时却明显更轻。 */
  box-shadow: 0 8px 18px rgba(17, 17, 17, .08);
}

.page-freebies .fb-hit:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.page-freebies .fb-thumb {
  display: block;
  flex: none;
  aspect-ratio: 16 / 10;
  background: #111;
  border-bottom: 1px solid var(--line);
}

.page-freebies .fb-thumb {
  /* 封面左上角「全家桶2.8」、右上角倒计时都绝对定位在这上面 */
  position: relative;
}

.page-freebies .fb-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 封面左上角：这批资源属于哪个合集（2026-10-29 加） */
.page-freebies .fb-ribbon {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 3px 9px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  background: var(--brand);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(17, 17, 17, .28);
  pointer-events: none;
}

/* 封面右上角：单张卡片的限时倒计时（到点由 freebies.js 换成「已结束」） */
.page-freebies .fb-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 9px;
  font-size: .68rem;
  font-weight: 600;
  color: #fff;
  background: rgba(17, 17, 17, .82);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* 到期的卡片整张变灰：图、字、角标一起灰，并锁掉悬停抬起 */
.page-freebies .fb-card.is-ended .fb-hit {
  filter: grayscale(1);
  opacity: .62;
}
.page-freebies .fb-card.is-ended .fb-hit:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.page-freebies .fb-body {
  display: block;
  flex: 1 1 auto;
  padding: 14px 15px 16px;
}

.page-freebies .fb-name-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.page-freebies .fb-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.page-freebies .fb-badge {
  flex: none;
  padding: 2px 7px;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
}

.page-freebies .fb-meta {
  display: block;
  margin-top: 5px;
  font-size: .78rem;
  color: var(--ink-3);
}

.page-freebies .fb-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 9px;
  font-size: .86rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.page-freebies .fb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.page-freebies .fb-tag {
  padding: 3px 8px;
  font-size: .72rem;
  color: var(--brand-deep);
  background: var(--brand-wash);
  border-radius: 6px;
}

.page-freebies .fb-tag-soft {
  color: var(--ink-3);
  background: var(--line-2);
}

.page-freebies .fb-empty {
  margin: 34px 0 0;
  padding: 26px 0;
  font-size: .96rem;
  color: var(--ink-3);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.page-freebies .fb-reset {
  padding: 0;
  font: inherit;
  color: var(--brand-deep);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

.page-freebies .fb-noscript {
  margin: 24px 0 0;
  padding: 14px 16px;
  font-size: .88rem;
  color: var(--ink-2);
  background: var(--brand-wash);
  border-radius: 10px;
}

/* ---------- 页尾那句谢谢 ---------- */
.page-freebies .fb-foot {
  padding: clamp(40px, 6vw, 64px) 0 0;
  background: var(--bg);
}

.page-freebies .fb-foot .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.page-freebies .fb-foot-note {
  margin: 0;
  max-width: 46ch;
  font-size: .96rem;
  color: var(--ink-2);
}

/* ==========================================================================
   弹窗（原生 dialog）
   ========================================================================== */
.page-freebies .fb-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  overflow: hidden;
}

.page-freebies .fb-modal::backdrop {
  background: rgba(9, 9, 9, .62);
}

.page-freebies .fb-modal-box {
  max-height: inherit;
  overflow: auto;
}

.page-freebies .fb-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  cursor: pointer;
}

.page-freebies .fb-modal-close:hover { background: var(--brand); border-color: var(--brand); }

.page-freebies .fb-modal-cover {
  aspect-ratio: 16 / 10;
  background: #111;
}

.page-freebies .fb-modal-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-freebies .fb-modal-head {
  padding: 20px 24px 0;
}

.page-freebies .fb-modal-cat {
  margin: 0;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand);
}

.page-freebies .fb-modal-title {
  margin: 8px 0 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.page-freebies .fb-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}

.page-freebies .fb-modal-tags .fb-tag { font-size: .74rem; }

.page-freebies .fb-modal-body {
  padding: 4px 24px 26px;
}

.page-freebies .fb-modal-desc {
  margin: 16px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.page-freebies .fb-modal-p {
  margin: 12px 0 0;
  font-size: .94rem;
  color: var(--ink-2);
}

.page-freebies .fb-modal-h {
  margin: 22px 0 0;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--ink-3);
}

.page-freebies .fb-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.page-freebies .fb-list li {
  position: relative;
  margin-top: 8px;
  padding-left: 20px;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.page-freebies .fb-list-pro li::before {
  content: "+";
  position: absolute;
  left: 2px;
  font-weight: 700;
  color: var(--brand);
}

.page-freebies .fb-list-con li::before {
  content: "−";
  position: absolute;
  left: 2px;
  font-weight: 700;
  color: var(--ink-3);
}

.page-freebies .fb-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  font-size: .9rem;
  line-height: 1.6;
  color: #6b4400;
  background: #fff6e6;
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
}

.page-freebies .fb-links {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.page-freebies .fb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: .94rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}

.page-freebies .fb-link:hover {
  border-color: var(--brand);
  background: var(--brand-wash);
  transform: translateX(2px);
  text-decoration: none;
}

.page-freebies .fb-link-kind {
  flex: none;
  min-width: 44px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: var(--ink-3);
  border-radius: 6px;
}

.page-freebies .fb-link-dl .fb-link-kind { background: var(--brand); }
.page-freebies .fb-link-official .fb-link-kind { background: #1f6f4a; }
.page-freebies .fb-link-builtin .fb-link-kind { background: #4a4a4a; }

.page-freebies .fb-link-label { flex: 1; }
.page-freebies .fb-link-go { color: var(--ink-3); font-size: .9rem; }

/* ---------- 窄屏 ---------- */
@media (max-width: 760px) {
  .page-freebies .fb-head-grid { grid-template-columns: 1fr; gap: 22px; }
  .page-freebies .fb-head-main { gap: 22px; }
  .page-freebies .fb-promo { grid-column: 1; grid-row: auto; max-width: 420px; }
  .page-freebies .fb-panel { padding: 18px 16px 6px; }
  .page-freebies .fb-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }
  .page-freebies .fb-row-label { padding-top: 0; }
  .page-freebies .fb-row-label span { display: inline; margin-left: 6px; }
  .page-freebies .fb-search { width: 100%; }
  .page-freebies .fb-search input { flex: 1; width: auto; }
  .page-freebies .fb-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .page-freebies .fb-body { padding: 12px 12px 14px; }
  .page-freebies .fb-desc { display: none; }
  .page-freebies .fb-tag-soft { display: none; }
  .page-freebies .fb-modal { width: 100vw; max-width: none; max-height: 100vh; border-radius: 0; }
  .page-freebies .fb-modal-head { padding: 18px 18px 0; }
  .page-freebies .fb-modal-body { padding: 4px 18px 22px; }
}

@media (max-width: 420px) {
  .page-freebies .fb-grid { grid-template-columns: 1fr; }
}

/* 系统开了"减少动态效果"就别动 */
@media (prefers-reduced-motion: reduce) {
  .page-freebies .fb-chip,
  .page-freebies .fb-pack,
  .page-freebies .fb-hit,
  .page-freebies .fb-link { transition: none; }
  .page-freebies .fb-chip:hover,
  .page-freebies .fb-pack:hover,
  .page-freebies .fb-hit:hover,
  .page-freebies .fb-link:hover { transform: none; }
}
