/* ============================================================
   网络视听（/radio）样式
   ============================================================ */
:root {
  --rd-primary: #2f6fed;
  --rd-primary-dark: #2257c4;
  --rd-ink: #1f2d3d;
  --rd-ink-2: #34455c;
  --rd-muted: #636d7e;   /* 原 #8a93a3 在白底仅 2.9:1；改后白底 5.1:1、浅灰底 4.8:1，稳过 AA */
  --rd-line: #e6eaf1;
  --rd-bg: #f4f6fb;
  --rd-card: #ffffff;
  --rd-radius: 14px;
}

* { box-sizing: border-box; }

/* iOS 横竖屏切换时禁止 Safari 自行放大字号 */
html {
  background: var(--rd-bg);
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body { background: var(--rd-bg); }

.rd-body {
  margin: 0 auto;
  max-width: 1000px;
  color: var(--rd-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.rd-body a { color: inherit; text-decoration: none; }
.rd-body button { font-family: inherit; }
.rd-body svg { display: block; }

/* ============================== 顶栏 ============================== */
.rd-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--rd-line);
  box-shadow: 0 2px 10px rgba(31, 45, 61, .04);
}

.rd-head-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
  max-width: 1000px;
  margin: 0 auto;
}

.rd-back {
  width: 34px; height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #55607a;
  background: #f4f6fb;
}
.rd-back:hover { background: #e8eefc; color: var(--rd-primary); }

.rd-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rd-brand-mark {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 9px;
  background: linear-gradient(135deg, #2f6fed, #6aa0ff);
  color: #fff; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.rd-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.rd-brand-text b { font-size: 16px; letter-spacing: .3px; }
.rd-brand-text i {
  font-style: normal; font-size: 10px; color: var(--rd-muted);
  letter-spacing: 1.4px; text-transform: uppercase;
}

.rd-head-actions { margin-left: auto; display: flex; gap: 8px; }

.rd-chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 11px;
  border: 1px solid var(--rd-line);
  background: #fff; color: var(--rd-ink-2);
  border-radius: 999px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.rd-chip-btn:hover { border-color: #c7d8fb; color: var(--rd-primary); background: #f7faff; }
.rd-chip-btn em {
  font-style: normal; font-size: 11px; font-weight: 600;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: #eef3fe; color: var(--rd-primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.rd-chip-btn.is-on { border-color: #c7d8fb; background: #eef3fe; color: var(--rd-primary); }

/* Tabs */
.rd-tabs {
  display: flex;
  gap: 6px;
  padding: 0 10px 8px;
  max-width: 1000px;
  margin: 0 auto;
}
.rd-tab {
  flex: 1 1 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px;
  border: 1px solid transparent;
  background: #f4f6fb;
  color: #55607a;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.rd-tab em { font-style: normal; font-size: 11px; color: var(--rd-muted); }
.rd-tab.on {
  background: var(--rd-primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(47, 111, 237, .24);
}
.rd-tab.on em { color: rgba(255, 255, 255, .82); }

/* ============================== 主体 ============================== */
.rd-main { padding: 14px 14px 40px; }

/* ---------- 播放舞台 ---------- */
.rd-stage {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--rd-card);
  border: 1px solid var(--rd-line);
  border-radius: var(--rd-radius);
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(31, 45, 61, .06);
}
.rd-stage[hidden] { display: none !important; }

.rd-stage-media {
  position: relative;
  width: 96px;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f0ff, #d3e2ff);
  flex: 0 0 auto;
}

.rd-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #0b1220;
  display: block;
}
.rd-video[hidden] { display: none !important; }
.rd-body audio { display: none; }

.rd-audio-cover {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  color: var(--rd-primary);
}
.rd-audio-cover[hidden] { display: none !important; }
.rd-audio-cover span { font-size: 26px; line-height: 1; opacity: .9; }

.rd-wave { display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.rd-wave i {
  width: 3px; height: 5px; border-radius: 2px;
  background: var(--rd-primary); opacity: .55;
}
.rd-stage.is-playing .rd-wave i { animation: rdWave .9s ease-in-out infinite; }
.rd-stage.is-playing .rd-wave i:nth-child(2) { animation-delay: .12s; }
.rd-stage.is-playing .rd-wave i:nth-child(3) { animation-delay: .24s; }
.rd-stage.is-playing .rd-wave i:nth-child(4) { animation-delay: .36s; }
.rd-stage.is-playing .rd-wave i:nth-child(5) { animation-delay: .48s; }
@keyframes rdWave {
  0%, 100% { height: 5px; opacity: .45; }
  50% { height: 14px; opacity: 1; }
}

.rd-stage-info { min-width: 0; }
.rd-stage-title {
  font-size: 15px; font-weight: 600; color: var(--rd-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rd-stage-sub {
  font-size: 12px; color: var(--rd-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rd-stage-msg {
  margin-top: 4px; font-size: 12px; color: #b45309;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 7px; padding: 4px 8px; line-height: 1.5;
}
.rd-stage-msg[hidden] { display: none !important; }
.rd-stage-msg a { color: var(--rd-primary); text-decoration: underline; cursor: pointer; }

.rd-stage-ops { display: flex; align-items: center; gap: 6px; }

.rd-icon-btn {
  width: 36px; height: 36px; flex: 0 0 auto;
  border: 1px solid var(--rd-line);
  background: #fff; color: #55607a;
  border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.rd-icon-btn:hover { border-color: #c7d8fb; color: var(--rd-primary); }
.rd-icon-btn.is-primary { background: var(--rd-primary); border-color: var(--rd-primary); color: #fff; }
.rd-icon-btn.is-primary:hover { background: var(--rd-primary-dark); }
.rd-icon-btn.is-fav { color: #f0a020; border-color: #ffe3b0; background: #fffaef; }
.rd-icon-btn svg[hidden] { display: none !important; }

.rd-vol { display: flex; align-items: center; gap: 4px; color: var(--rd-muted); }
.rd-vol input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 66px; height: 4px; border-radius: 2px;
  background: #dfe4ec; outline: none;
}
.rd-vol input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--rd-primary); cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.rd-vol input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border: 0; border-radius: 50%;
  background: var(--rd-primary); cursor: pointer;
}

/* 电视模式：画面占满宽度 */
.rd-stage.is-tv { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.rd-stage.is-tv .rd-stage-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #0b1220;
}
.rd-stage.is-tv .rd-stage-ops { justify-content: flex-end; }

/* ---------- 筛选区 ---------- */
.rd-filter { margin-bottom: 12px; }

.rd-search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--rd-line);
  border-radius: 11px; padding: 0 12px; height: 42px;
  color: var(--rd-muted);
}
.rd-search:focus-within { border-color: #b9cffa; box-shadow: 0 0 0 3px rgba(47, 111, 237, .1); }
.rd-search input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: none; background: transparent;
  font-size: 14px; color: var(--rd-ink); height: 100%;
}
.rd-search input::-webkit-search-cancel-button { cursor: pointer; }

.rd-cats {
  display: flex; gap: 7px; flex-wrap: nowrap;
  overflow-x: auto; padding: 10px 1px 2px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.rd-cats::-webkit-scrollbar { display: none; }
.rd-cat {
  flex: 0 0 auto;
  height: 31px; padding: 0 13px;
  border: 1px solid var(--rd-line);
  background: #fff; color: #55607a;
  border-radius: 999px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.rd-cat:hover { border-color: #c7d8fb; color: var(--rd-primary); }
.rd-cat.on { background: #eef3fe; border-color: #c7d8fb; color: var(--rd-primary); font-weight: 600; }

/* ---------- 节目网格 ---------- */
.rd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
}

.rd-card {
  position: relative;
  display: block;              /* 卡片内只剩图标块，不再有下方文字行 */
  padding: 8px;
  background: var(--rd-card);
  border: 1px solid var(--rd-line);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.rd-card:hover { border-color: #c7d8fb; box-shadow: 0 6px 18px rgba(47, 111, 237, .1); transform: translateY(-1px); }
.rd-card.is-on { border-color: var(--rd-primary); box-shadow: 0 0 0 3px rgba(47, 111, 237, .13); }
.rd-card[hidden] { display: none !important; }

.rd-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  background: linear-gradient(135deg, #eef3fe, #dbe7ff);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  /* 顶部留白避让 EN 角标（左上）与收藏星标（右上），左右留白防止文字贴边 */
  padding: 24px 12px 10px;
}

/* 首字母水印：纯装饰，用来区分同色块卡片，不承载任何信息 */
.rd-thumb::before {
  content: attr(data-ini);
  position: absolute;
  right: 2px; bottom: -12px;
  font-size: 62px; font-weight: 800; line-height: 1;
  color: rgba(47, 111, 237, .06);
  pointer-events: none; user-select: none;
}

/* 节目名称直接压在图标上，是卡片唯一的信息层 */
.rd-thumb-name {
  position: relative; z-index: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: clamp(12.5px, 3.4vw, 14px);
  font-weight: 700; line-height: 1.3;
  color: #2257c4;
  text-align: center;
  letter-spacing: .1px;
  overflow-wrap: anywhere;
  text-wrap: balance;          /* 两行以上自动均衡断行，避免末行只剩一两个字 */
}

/* 图标高光压在文字之下，避免把文字洗淡 */
.rd-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0));
  pointer-events: none;
}
.rd-card[data-kind="tv"] .rd-thumb { background: linear-gradient(135deg, #12203a, #27406b); }
.rd-card[data-kind="tv"] .rd-thumb-name { color: #dbe8ff; }
.rd-card[data-kind="tv"] .rd-thumb::before { color: rgba(185, 207, 250, .10); }

.rd-lang {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 10px; line-height: 1; padding: 3px 5px;
  border-radius: 5px; background: rgba(255, 255, 255, .88);
  color: #2f6fed; font-weight: 600; letter-spacing: .4px;
}

.rd-star {
  /* 现在是 .rd-card 的直接子元素：卡片 padding 8px + 原缩略图内 inset 4px = 12px */
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  color: #b9c2d0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.rd-star:hover { background: #fff; color: #f0a020; }
.rd-star.is-on { color: #f0a020; }

.rd-empty { text-align: center; color: var(--rd-muted); font-size: 13px; padding: 34px 0; }
.rd-empty[hidden] { display: none !important; }
.rd-panel[hidden] { display: none !important; }

.rd-foot-tip {
  margin: 22px 0 0;
  font-size: 11px; line-height: 1.8; color: #636d7e;   /* 原 #a3abb9 对比度仅约 2:1 */
  text-align: center;
}

/* ============================== 抽屉 ============================== */
.rd-drawer { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.rd-drawer[hidden] { display: none !important; }
.rd-drawer-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .44); }
.rd-drawer-box {
  position: relative;
  width: min(400px, 100%);
  height: 100%;
  background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(15, 23, 42, .16);
  animation: rdSlide .22s ease;
}
@keyframes rdSlide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.rd-drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--rd-line);
}
.rd-drawer-head b { font-size: 15px; }
.rd-drawer-head .rd-icon-btn { margin-left: auto; }

.rd-drawer-tools { padding: 10px 14px 0; }
.rd-drawer-tools[hidden] { display: none !important; }
.rd-mini-btn {
  height: 30px; padding: 0 12px;
  border: 1px solid var(--rd-line); background: #fff;
  border-radius: 8px; font-size: 12px; color: #55607a; cursor: pointer;
}
.rd-mini-btn:hover { border-color: #fecaca; color: #b91c1c; background: #fffafa; }

.rd-drawer-list { list-style: none; margin: 0; padding: 8px 10px 24px; overflow-y: auto; flex: 1 1 auto; }
.rd-drawer-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 6px; border-radius: 10px; cursor: pointer;
}
.rd-drawer-item:hover { background: #f7faff; }
.rd-drawer-item .rd-di-ico {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 9px; background: #eef3fe; color: var(--rd-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.rd-drawer-item[data-kind="tv"] .rd-di-ico { background: #e8eef8; color: #27406b; }
.rd-di-body { min-width: 0; flex: 1 1 auto; }
.rd-di-name {
  /* JS 里生成的是 <span>，行内元素会让名称与副标题挤在同一行，必须显式块级化 */
  display: block;
  font-size: 13px; font-weight: 600; color: var(--rd-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rd-di-sub {
  display: block;
  font-size: 11px; color: var(--rd-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rd-di-del {
  width: 28px; height: 28px; flex: 0 0 auto;
  border: 0; background: transparent; color: #b9c2d0;
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rd-di-del:hover { background: #fef2f2; color: #dc2626; }

.rd-drawer-empty {
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--rd-muted); font-size: 13px;
  padding: 24px 24px calc(48px + env(safe-area-inset-bottom, 0px));
}
/* 列表无内容时不再抢占空间，让空状态占据剩余高度并居中 */
.rd-drawer-list:empty { flex: 0 0 auto; padding: 0; }
.rd-drawer-empty[hidden] { display: none !important; }

/* ============================== 响应式 ============================== */
@media (max-width: 719px) {
  .rd-stage { grid-template-columns: 72px minmax(0, 1fr); }
  .rd-stage-media { width: 72px; }
  .rd-stage-ops { grid-column: 1 / -1; justify-content: flex-start; }
  .rd-stage.is-tv { grid-template-columns: minmax(0, 1fr); }
  .rd-stage.is-tv .rd-stage-ops { justify-content: space-between; }
  .rd-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
  /* 手机上 16:9 只有 80~106px 高，横向排不下名称；改 4:3 让名称有 2~3 行空间 */
  .rd-thumb { aspect-ratio: 4 / 3; padding: 24px 10px 10px; }
  .rd-head-actions .rd-chip-btn span { display: none; }
  .rd-chip-btn { padding: 0 9px; gap: 4px; }
  .rd-vol input[type=range] { width: 54px; }
}

@media (max-width: 400px) {
  .rd-brand-text i { display: none; }
  .rd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-tab { font-size: 13px; }
}

@media (min-width: 720px) {
  .rd-main { padding: 18px 16px 48px; }
  .rd-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
  .rd-stage { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .rd-wave i, .rd-drawer-box { animation: none !important; }
  .rd-card { transition: none; }
}

/* ============================================================
   移动端 / 平板适配层（2026-10-22）
   目标：320px 起全尺寸无横向溢出、触控目标≥44px、
         iOS 聚焦不缩放、刘海安全区、低版本 aspect-ratio 兜底
   ============================================================ */

/* ---------- 1. 全局：消除触屏闪烁、禁用双击缩放延迟、图片自适应 ---------- */
.rd-body {
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
  word-break: break-word;
}
.rd-body img { max-width: 100%; height: auto; display: block; }
.rd-card, .rd-tab, .rd-chip-btn, .rd-cat, .rd-icon-btn,
.rd-star, .rd-di-del, .rd-mini-btn, .rd-back { touch-action: manipulation; }

/* 输入框字号 ≥16px：iOS Safari 聚焦输入框时字号小于 16px 会强制放大整页 */
.rd-search input { font-size: 16px; }
@media (min-width: 720px) {
  .rd-search input { font-size: 14px; }
}

/* ---------- 2. 刘海屏安全区（配合 viewport-fit=cover） ---------- */
.rd-head { padding-top: env(safe-area-inset-top, 0px); }
.rd-head-inner {
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
.rd-tabs {
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  padding-right: max(10px, env(safe-area-inset-right, 0px));
}
.rd-main {
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}
.rd-drawer-box { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---------- 3. 弹性字号：小屏不挤、大屏不飘 ---------- */
/* 中文正文在手机上低于 12px 会明显吃力，clamp 下限据此设定 */
.rd-stage-title { font-size: clamp(14px, 3.7vw, 16px); }
.rd-brand-text b { font-size: clamp(15px, 4.1vw, 16.5px); }
.rd-foot-tip    { font-size: clamp(11.5px, 3vw, 12px); }
.rd-tab         { font-size: clamp(13px, 3.5vw, 14px); }

/* ---------- 4. 触屏设备：放大所有可点区域到 ≥44px ---------- */
@media (pointer: coarse) {
  .rd-back { width: 44px; height: 44px; }
  .rd-chip-btn { height: 44px; padding: 0 13px; }
  .rd-tab { height: 44px; }
  .rd-cat { height: 44px; padding: 0 16px; font-size: 13.5px; }
  .rd-search { height: 46px; }
  .rd-icon-btn { width: 44px; height: 44px; }
  .rd-mini-btn { height: 40px; padding: 0 16px; font-size: 13px; }
  /* 星标视觉 32px 贴角，避免压住图标内的名称；命中区仍由伪元素撑到 44×44 */
  .rd-star { width: 32px; height: 32px; top: 8px; right: 8px; }
  .rd-star::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
  .rd-drawer-item { padding: 11px 8px; min-height: 56px; }
  .rd-di-del { width: 44px; height: 44px; }
  .rd-stage-ops { gap: 8px; }

  /* 音量条：轨道视觉 6px，但把 input 命中区加高到 30px，滑块 20px，手指好拖 */
  .rd-vol input[type=range] {
    width: 88px; height: 30px;
    background: transparent;
    margin: -12px 0;              /* 抵消加高带来的布局膨胀 */
  }
  .rd-vol input[type=range]::-webkit-slider-runnable-track {
    height: 6px; border-radius: 3px; background: #dfe4ec;
  }
  .rd-vol input[type=range]::-webkit-slider-thumb {
    width: 20px; height: 20px; margin-top: -7px;
  }
  .rd-vol input[type=range]::-moz-range-track {
    height: 6px; border-radius: 3px; background: #dfe4ec;
  }
  .rd-vol input[type=range]::-moz-range-thumb { width: 20px; height: 20px; }
}

/* ---------- 5. 触屏无 hover：改成按下的即时反馈，避免:hover 粘住 ---------- */
@media (hover: none) {
  .rd-card:hover,
  .rd-chip-btn:hover,
  .rd-icon-btn:hover,
  .rd-cat:hover,
  .rd-tab:hover,
  .rd-back:hover,
  .rd-mini-btn:hover,
  .rd-di-del:hover,
  .rd-star:hover {
    transform: none;
    box-shadow: none;
  }
  .rd-chip-btn:hover, .rd-icon-btn:hover, .rd-back:hover { background: #fff; color: #55607a; border-color: var(--rd-line); }
  .rd-cat:hover { background: #fff; color: #55607a; border-color: var(--rd-line); }
  .rd-card:hover { border-color: var(--rd-line); }
  .rd-card:active { transform: scale(.985); border-color: #c7d8fb; }
  .rd-tab:active { opacity: .85; }
  .rd-icon-btn:active, .rd-chip-btn:active, .rd-cat:active, .rd-back:active { background: #eef3fe; }
  .rd-star:active { background: #fff; }
}

/* ---------- 6. 抽屉：移动端全屏 + 惯性滚动 + 高度跟随动态视口 ---------- */
.rd-drawer-list {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
@supports (height: 100dvh) {
  .rd-drawer { height: 100dvh; }
}
@media (max-width: 719px) {
  .rd-drawer { align-items: stretch; }
  .rd-drawer-box {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    animation: rdSlideUp .2s ease;
  }
  @keyframes rdSlideUp { from { transform: translateY(18px); opacity: .5; } to { transform: none; opacity: 1; } }
  .rd-drawer-head b { font-size: 16px; }
  .rd-cat { scroll-snap-align: start; }
  .rd-cats { scroll-snap-type: x proximity; }
}

/* ---------- 7. 平板：封面与网格适度放大，避免大留白 ---------- */
@media (min-width: 720px) and (max-width: 1024px) {
  .rd-stage { grid-template-columns: 108px minmax(0, 1fr) auto; }
  .rd-stage-media { width: 108px; }
  .rd-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---------- 8. 手机横屏：压缩吸顶高度，限制画面高度 ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .rd-head-inner { padding-top: 6px; padding-bottom: 4px; }
  .rd-tabs { padding-bottom: 6px; }
  .rd-brand-text i { display: none; }
  .rd-main { padding-top: 10px; }
  .rd-stage.is-tv .rd-stage-media { max-height: 54vh; width: auto; margin: 0 auto; }
  .rd-stage.is-tv { justify-items: center; }
}

/* ---------- 9. 超窄屏（≤340px）兜底 ---------- */
@media (max-width: 340px) {
  .rd-main { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  .rd-head-inner { gap: 8px; }
  .rd-brand-mark { width: 26px; height: 26px; font-size: 15px; }
  .rd-tab { font-size: 12.5px; gap: 4px; }
  .rd-tab em { font-size: 10px; }
  .rd-grid { gap: 7px; }
  .rd-chip-btn em { min-width: 15px; height: 15px; font-size: 10px; }
}

/* ---------- 10. 低版本内核兜底：不支持 aspect-ratio 时用 padding 占位 ---------- */
@supports not (aspect-ratio: 1 / 1) {
  .rd-stage-media { height: 96px; }
  .rd-stage.is-tv .rd-stage-media { height: 0; padding-bottom: 56.25%; }
  .rd-thumb { min-height: 96px; }
}


/* ---------- 11. 手机端顶栏瘦身 ----------
   说明：尝试过「只让品牌行吸顶」，但 position:sticky 的粘滞范围受父容器
   （.rd-head）高度约束，父容器滚出视口后子元素随之离开，实测 brandTop=-340 失效。
   因此保留两行共同吸顶（切换 Tab 需要随时可达），改为压缩内边距把总高降到 ~108px。 */
@media (max-width: 719px) {
  /* 安全区只由 head-inner 承担，避免 .rd-head 与 .rd-head-inner 双重叠加 */
  .rd-head { padding-top: 0; }
  .rd-head-inner { padding-top: max(8px, env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
  .rd-tabs { padding-top: 6px; padding-bottom: 6px; }
  .rd-main { padding-top: 10px; }
}
