/* ============================================================
   音视「听与看」· 样式表（media.css）
   只服务 media_index / media_detail / admin_media / admin_media_form；
   不动 style.css 与 admin.css。
   全站无阴影：层次一律 1px 细边线 + 半透明底。
   类名统一 media- 前缀，且一律挂在 .thm-media 之下，避免污染其它模块。
   类型三色：音频=青、视频=靛、混合=琥珀。
   ============================================================ */

.thm-media {
  --m-audio: #0e9488;
  --m-audio-soft: rgba(14, 148, 136, .12);
  --m-video: #6d4aff;
  --m-video-soft: rgba(109, 74, 255, .12);
  --m-mixed: #d97706;
  --m-mixed-soft: rgba(217, 119, 6, .12);
}

/* ============================================================
   一、类型徽标（前台卡片 / 详情页 / 后台列表共用）
   ============================================================ */
.thm-media .media-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 12px;
  line-height: 1.7;
  font-weight: 600;
  letter-spacing: .4px;
  white-space: nowrap;
}
.thm-media .media-kind-audio { color: var(--m-audio); background: var(--m-audio-soft); border-color: rgba(14, 148, 136, .3); }
.thm-media .media-kind-video { color: var(--m-video); background: var(--m-video-soft); border-color: rgba(109, 74, 255, .3); }
.thm-media .media-kind-mixed { color: var(--m-mixed); background: var(--m-mixed-soft); border-color: rgba(217, 119, 6, .32); }

/* ============================================================
   二、台头 hero：顶部 ON AIR 播出带 + 台标，底衬铺一条音频波形
      与一段胶片（聆听与观看两条轨道），配色青（音频）与靛（视频）
   ============================================================ */
.thm-media .media-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
  min-height: 200px;
  box-sizing: border-box;
  padding: 46px 30px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(940px 400px at 94% -14%, rgba(109, 74, 255, .15), transparent 58%),
    radial-gradient(820px 380px at 2% 122%, rgba(14, 148, 136, .13), transparent 56%),
    linear-gradient(158deg, #f2fbfa 0%, #eef1ff 54%, #f5f2ff 100%);
}

/* 播出带：顶部一条 ON AIR 横条 + 刻度盘 + 台标，像电视台的台头 */
.thm-media .media-broadcast {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 36px;
  padding: 0 30px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, .5);
  pointer-events: none;
}
.thm-media .media-onair {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 2px;
  color: var(--m-mixed);
}
.thm-media .media-onair i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--m-mixed);
  animation: mediaPulse 1.9s ease-in-out infinite;
}
.thm-media .media-dial {
  flex: 1 1 auto;
  height: 7px;
  background: repeating-linear-gradient(90deg, var(--brand-line) 0 1px, transparent 1px 16px);
  opacity: .7;
}
.thm-media .media-station { display: inline-flex; align-items: baseline; gap: 8px; }
.thm-media .media-station .sig-cn {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--brand-strong);
}
.thm-media .media-station .sig-en {
  font-size: 9.5px;
  letter-spacing: 2px;
  color: var(--muted);
}

/* 底衬场景：一条音频波形（青）+ 一段胶片（靛，带齿孔）立在底部右侧，
   中间一枚半透明的播放三角，把「听」与「看」两条轨道讲清楚 */
.thm-media .media-hero-bg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  pointer-events: none;
}
.thm-media .media-scene {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}
.thm-media .media-scene-wave rect {
  fill: rgba(14, 148, 136, .38);
  transform-box: fill-box;
  transform-origin: bottom;
  animation: mediaBar 2.4s ease-in-out infinite;
}
.thm-media .media-scene-wave rect:nth-child(2n) { animation-delay: .35s; }
.thm-media .media-scene-wave rect:nth-child(3n) { animation-delay: .7s; }
.thm-media .media-scene-film rect { fill: rgba(109, 74, 255, .22); }
.thm-media .media-scene-perf rect { fill: rgba(255, 255, 255, .72); }
.thm-media .media-scene-play path { fill: rgba(47, 111, 237, .16); }
.thm-media .media-scene-play { animation: mediaGlow 3.2s ease-in-out infinite; }
@keyframes mediaBar {
  0%, 100% { transform: scaleY(.5); }
  50% { transform: scaleY(1); }
}
@keyframes mediaGlow {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}
@keyframes mediaPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .3; transform: scale(.78); }
}

/* 台标徽标：像播出带左上角的「频道号」，等宽字 + 紫底小方块 + 一道渐隐细线 */
.thm-media .media-hero-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--muted);
}
.thm-media .media-hero-label span {
  padding: 2px 9px;
  border-radius: 4px;
  background: #6d4aff;
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
}
.thm-media .media-hero-label::after {
  content: "";
  flex: 0 0 72px;
  height: 1px;
  background: linear-gradient(90deg, rgba(109, 74, 255, .4), transparent);
}
.thm-media .media-hero-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: .5px;
  color: var(--ink);
}
/* 播出单：一条横向排开的轨道带，左时间码 / 中轨道键 / 右一句话说明 */
.thm-media .media-rundown { display: flex; flex-wrap: wrap; gap: 10px 20px; max-width: 760px; margin: 0; }
.thm-media .rd-track {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
}
.thm-media .rd-track:first-child { border-top: 0; }
.thm-media .rd-tc { flex: 0 0 auto; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.thm-media .rd-key { flex: 0 0 auto; padding: 2px 10px; border-radius: 3px; font-size: 11.5px; font-weight: 600; color: #fff; }
.thm-media .rd-audio .rd-key { background: var(--m-audio); }
.thm-media .rd-video .rd-key { background: var(--m-video); }
.thm-media .rd-mixed .rd-key { background: var(--m-mixed); }
.thm-media .rd-desc { font-size: 12.5px; color: var(--ink-soft); }
/* 页脚注：一行小字，用竖细线分隔，不再是圆胶囊 */
.thm-media .media-hero-feet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.thm-media .media-hero-feet span { display: inline-flex; align-items: center; gap: 6px; }
.thm-media .media-hero-feet span + span { margin-left: 16px; padding-left: 16px; border-left: 1px solid rgba(28, 37, 54, .12); }
/* hero 文案一律浮在底衬场景之上 */
.thm-media .media-hero-label,
.thm-media .media-hero-title,
.thm-media .media-rundown,
.thm-media .media-hero-feet { position: relative; z-index: 1; }

/* ============================================================
   三、频道切换：一枚分段控件（全部 / 音频 / 视频 / 混合）
   ============================================================ */
.thm-media .media-seg-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 20px 0 18px;
}
.thm-media .media-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .72);
}
.thm-media .media-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.7;
  transition: background .18s, color .18s;
}
.thm-media .media-seg-btn em {
  font-style: normal;
  font-size: 11.5px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: rgba(47, 111, 237, .08);
  color: var(--muted);
}
.thm-media .media-seg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-line);
  transition: background .18s;
}
.thm-media .media-seg-btn:hover { color: var(--brand-strong); background: rgba(47, 111, 237, .06); }
.thm-media .media-seg-btn.on { background: var(--brand); color: #fff; }
.thm-media .media-seg-btn.on em { background: rgba(255, 255, 255, .22); color: #fff; }
.thm-media .media-seg-btn.on .media-seg-dot { background: #fff; }
.thm-media .media-seg-hint { font-size: 12px; letter-spacing: 2px; color: var(--muted); }

/* ============================================================
   四、节目单：首条头牌 + 卡片流
   ============================================================ */
.thm-media .media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 18px;
}
.thm-media .media-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .62);
  transition: transform .18s, border-color .18s;
}
.thm-media .media-card:hover { transform: translateY(-2px); border-color: var(--brand-line); }

/* 头牌：首条节目横排，占满整行，像一张节目海报 */
.thm-media .media-card.is-lead { grid-column: 1 / -1; flex-direction: row; }
.thm-media .media-card.is-lead .media-cover {
  width: 44%;
  aspect-ratio: auto;
  min-height: 236px;
  border-bottom: none;
  border-right: 1px solid var(--hairline);
}
.thm-media .media-card.is-lead .media-body { justify-content: center; padding: 22px 26px; }
.thm-media .media-card.is-lead .media-title { font-size: 24px; }
.thm-media .media-card.is-lead .media-summary { font-size: 14px; }

.thm-media .media-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(150deg, var(--bg-soft), rgba(233, 241, 254, .5));
}
.thm-media .media-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thm-media .media-cover-char {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(44px, 10vw, 84px);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--brand);
  opacity: .26;
  user-select: none;
}
.thm-media .media-cover .media-kind { position: absolute; left: 10px; bottom: 10px; }

/* 播放钮：封面中央一枚圆盘，悬停时点亮 */
.thm-media .media-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  background: rgba(255, 255, 255, .66);
  color: var(--brand-strong);
  font-size: 18px;
  transform: translate(-50%, -50%);
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.thm-media .media-card:hover .media-play {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.06);
}

.thm-media .media-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 15px; }
.thm-media .media-lead-tag {
  align-self: flex-start;
  margin-bottom: 9px;
  padding: 2px 11px;
  border: 1px solid var(--brand-line);
  border-radius: var(--r-pill);
  background: rgba(47, 111, 237, .08);
  color: var(--brand-strong);
  font-size: 11.5px;
  letter-spacing: 1px;
}
.thm-media .media-title {
  margin: 0 0 7px;
  font-family: var(--font-serif);
  font-size: 17.5px;
  line-height: 1.5;
  color: var(--ink);
}
.thm-media .media-title a { color: inherit; }
.thm-media .media-title a:hover { color: var(--brand-strong); }
.thm-media .media-summary {
  margin: 0 0 11px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.thm-media .media-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.thm-media .media-tag {
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .7);
  font-size: 11.5px;
  color: var(--muted);
}

.thm-media .media-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--muted);
}
.thm-media .media-foot .media-views { color: var(--brand-strong); }
.thm-media .media-more { margin-left: auto; color: var(--brand-strong); font-weight: 600; }
.thm-media .media-more:hover { text-decoration: underline; }

/* 卡片流为空时的留白更高一点，别显得挤 */
.thm-media .media-list > .mod-empty { grid-column: 1 / -1; }

/* ============================================================
   五、详情页
   ============================================================ */
.thm-media .media-article {
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .62);
}
.thm-media .media-article-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.thm-media .media-badge {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .7);
  font-size: 11.5px;
  color: var(--muted);
}
.thm-media .media-badge-live { color: var(--ok); border-color: rgba(22, 163, 74, .3); background: rgba(22, 163, 74, .1); }
.thm-media .media-article-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 29px;
  line-height: 1.4;
  letter-spacing: .5px;
  color: var(--ink);
}
.thm-media .media-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.thm-media .media-article-summary {
  margin: 0 0 12px;
  padding-left: 13px;
  border-left: 2px solid var(--brand-line);
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.thm-media .media-article-cover { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.thm-media .media-article-cover img { display: block; width: 100%; max-height: 460px; object-fit: cover; }

.thm-media .media-player-sec { margin-top: 22px; }
.thm-media .media-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15.5px;
  color: var(--ink);
}
.thm-media .media-player-list { display: flex; flex-direction: column; gap: 12px; }
.thm-media .media-player {
  padding: 12px 15px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .62);
}
.thm-media .media-player-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.thm-media .media-player-name { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.thm-media .media-player-dur {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* 播放器：音频一行高，视频按内容自适应 */
.thm-media .media-audio { display: block; width: 100%; height: 40px; }
.thm-media .media-video {
  display: block;
  width: 100%;
  max-height: 460px;
  border-radius: var(--r-sm);
  background: #000;
}

/* ============================================================
   六、页尾 Pro 入口（前台两个页面共用）
   ============================================================ */
.thm-media .media-pro { margin-top: 26px; text-align: center; }
.thm-media .media-pro a {
  display: inline-block;
  padding: 9px 22px;
  border: 1px solid var(--brand-line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .62);
  color: var(--brand-strong);
  font-size: 13.5px;
  transition: background .18s, border-color .18s, color .18s;
}
.thm-media .media-pro a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ============================================================
   七、后台表单：类型选择器与播放轨编辑行
   ============================================================ */
.thm-media .media-kinds { display: flex; flex-wrap: wrap; gap: 9px; }
.thm-media .media-kind-pick { position: relative; display: inline-flex; cursor: pointer; }
.thm-media .media-kind-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
/* 未选中：柔化收敛；选中：品牌色实底 */
.thm-media .media-kind-pick .media-kind {
  padding: 5px 16px;
  opacity: .55;
  border-color: var(--line);
  background: rgba(255, 255, 255, .7);
  color: var(--ink-soft);
  transition: opacity .18s, border-color .18s, background .18s, color .18s;
}
.thm-media .media-kind-pick:hover .media-kind { opacity: .85; }
.thm-media .media-kind-pick input:checked + .media-kind {
  opacity: 1;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.thm-media .media-kind-pick input:focus-visible + .media-kind { outline: 2px solid var(--brand-line); outline-offset: 2px; }

/* 播放轨：一行四列（类型 / 标题 / 地址 / 时长）+ 删除 */
.thm-media .media-tracks { display: flex; flex-direction: column; gap: 9px; }
.thm-media .media-track-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1.1fr) minmax(0, 2fr) 108px auto;
  gap: 8px;
  align-items: center;
}
.thm-media .media-track-row input,
.thm-media .media-track-row select { width: 100%; }
.thm-media .media-track-del { white-space: nowrap; }

/* ============================================================
   八、窄屏：一切收成一列，不横向溢出
   ============================================================ */
@media (max-width: 760px) {
  .thm-media .media-hero { min-height: 0; padding: 42px 18px 20px; }
  .thm-media .media-broadcast { padding: 0 18px; gap: 10px; }
  .thm-media .media-broadcast .sig-en { display: none; }
  .thm-media .media-hero-bg { height: 116px; }
  .thm-media .media-hero-title { font-size: 25px; }
  .thm-media .media-seg { width: 100%; }
  .thm-media .media-seg-btn { flex: 1 1 auto; justify-content: center; }
  .thm-media .media-seg-hint { display: none; }
  .thm-media .media-list { grid-template-columns: 1fr; }
  .thm-media .media-card.is-lead { flex-direction: column; }
  .thm-media .media-card.is-lead .media-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
  }
  .thm-media .media-card.is-lead .media-body { padding: 14px 16px 15px; }
  .thm-media .media-card.is-lead .media-title { font-size: 18px; }
  .thm-media .media-article { padding: 18px 16px; }
  .thm-media .media-article-title { font-size: 23px; }
  .thm-media .media-track-row { grid-template-columns: 1fr; }
  .thm-media .media-track-del { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .thm-media .media-scene-wave rect,
  .thm-media .media-scene-play { animation: none; }
  .thm-media .media-scene-wave rect { transform: none; }
  .thm-media .media-onair i { animation: none; }
  .thm-media .media-card:hover { transform: none; }
  .thm-media .media-card:hover .media-play { transform: translate(-50%, -50%); }
}
