/* horizon.css — Horizon 首页框架 (赛事栏) + 新闻 / 文章 / 音频 (news.js 的样式写在本文件下半部分)。 */
:root { --hz-bar-h: 70px; }
/* 赛事栏: 吸顶; 联赛视图里的二级胶囊用 top: var(--hz-bar-h) 接着吸 */
.hz-bar {
  position: sticky; top: var(--safe-top); z-index: 100;   /* 吸在状态栏垫片下方 (app.css .status-fill) */
  display: flex; align-items: stretch; height: var(--hz-bar-h); padding: 0 6px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hz-tab {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 0; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 600;
}
.hz-tab img { width: 34px; height: 34px; object-fit: contain; }
.hz-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hz-tab.active { color: var(--text); }
.hz-tab.active::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 2.5px; border-radius: 2px; background: var(--accent); }
.hz-tab:active img { transform: scale(.94); }

/* ── news module ── */
/* 头条列表 / 文章详情 / 音频 (horizon/news.js · article.js · audio.js)。只用 app.css token。 */

/* 共用: 图片容器加载失败 (.no-img) 收起; 分类标签; 播放胶囊 */
[data-nimg] { overflow: hidden; background: var(--surface); }
[data-nimg] img { display: block; width: 100%; height: 100%; object-fit: cover; }
[data-nimg] picture { display: contents; }

.news-cat {
  --c: var(--text-2);
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.news-cat[data-cat="cluster"] { --c: var(--accent); }
.news-cat[data-cat="transfer"] { --c: var(--warn); }
.news-cat[data-cat="interview"] { --c: var(--info); }
.news-cat[data-cat="preview"] { --c: var(--danger); }

/* 播放 / 暂停 / 加载 三态图标 (audio.js PLAY_GLYPH) */
.audio-glyph { position: relative; display: inline-grid; place-items: center; flex: none; width: 14px; height: 14px; }
.audio-glyph svg { grid-area: 1 / 1; width: 100%; height: 100%; }
.audio-glyph svg .f { fill: currentColor; stroke: none; }
.audio-glyph .g-pause, .audio-glyph .g-load { display: none; }
.is-playing > .audio-glyph .g-play, .is-playing .audio-glyph .g-play { display: none; }
.is-playing > .audio-glyph .g-pause, .is-playing .audio-glyph .g-pause { display: block; }
.is-loading .audio-glyph .g-play, .is-loading .audio-glyph .g-pause { display: none; }
.is-loading .audio-glyph .g-load { display: block; grid-area: 1 / 1; width: 100%; height: 100%; border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }

.news-play {
  --p: 0;
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 28px; padding: 0 11px 0 9px; border: 0; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700;
}
.news-play .audio-glyph { width: 12px; height: 12px; }
.news-play.is-current {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 38%, transparent) calc(var(--p) * 100%), var(--accent-soft) 0);
}
.news-play:active { transform: scale(.95); }

/* ── 头条列表 ── */
.news-view { position: relative; }
.news-body { position: relative; z-index: 1; background: var(--bg); will-change: auto; }
.news-ptr {
  position: absolute; top: 0; left: 0; right: 0; z-index: 0; height: 44px;
  display: grid; place-items: center; opacity: 0; transform: translateY(-44px); pointer-events: none;
}
.news-ptr-spin { width: 24px; height: 24px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; }
.news-ptr.ready .news-ptr-spin { border-color: var(--accent-soft); border-top-color: var(--accent); }
.news-ptr.spinning .news-ptr-spin { animation: spin .8s linear infinite; }

.news-hero { display: block; cursor: pointer; border-bottom: 1px solid var(--line); }
.news-hero-img { aspect-ratio: 16 / 9; }
.news-hero-img.no-img { display: none; }
.news-hero-body { padding: 14px 16px 16px; }
.news-hero-title { margin: 0 0 12px; font-size: 22px; line-height: 1.28; font-weight: 800; letter-spacing: -.01em; }
.news-hero:active .news-hero-title, .news-card:active .news-card-title { color: var(--text-2); }

.news-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.news-time { color: var(--muted); font-size: 12.5px; }

.news-card {
  position: relative; display: flex; gap: 14px; padding: 14px 16px; cursor: pointer;
}
.news-card + .news-card::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: 1px; background: var(--line); }
.news-thumb { flex: none; width: 116px; height: 84px; border-radius: var(--radius-sm); }
.news-thumb.no-img { display: none; }
.news-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.news-card-title {
  margin: 0; font-size: 16px; line-height: 1.35; font-weight: 650;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}

.news-foot:empty { display: none; }
.news-more, .news-end { padding: 20px 16px 28px; text-align: center; color: var(--muted); font-size: 13px; }
.news-end::before, .news-end::after { content: ""; display: inline-block; width: 28px; height: 1px; margin: 0 10px; vertical-align: middle; background: var(--line-2); }
.news-retry { margin-top: 14px; }
.news-sentinel { height: 1px; }

/* 骨架 */
.news-skel-hero { aspect-ratio: 16 / 9; border-radius: 0; }
.news-skel-pad { padding: 16px; }
.news-skel-line { height: 16px; margin-bottom: 10px; }
.news-skel-line.short { width: 62%; }
.news-skel-pill { width: 76px; height: 26px; border-radius: 999px; margin-top: 4px; }
.news-skel-card { display: flex; gap: 14px; padding: 14px 16px; }
.news-skel-thumb { flex: none; width: 116px; height: 84px; }
.news-skel-lines { flex: 1; }

/* ── 文章详情 ── */
.art-bar-title { opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; font-size: 15px; }
.art-bar.show-title .art-bar-title { opacity: 1; transform: none; }
.art { padding-bottom: 28px; }
.art-hero { aspect-ratio: 16 / 9; }
.art-hero.no-img { display: none; }
.art-hero.skeleton { border-radius: 0; }
.art-head { padding: 16px 16px 4px; }
.art-kicker { display: flex; align-items: center; gap: 10px; min-height: 22px; margin-bottom: 10px; }
.art-time { color: var(--muted); font-size: 13px; }
.art-title { margin: 0; font-size: 25px; line-height: 1.25; font-weight: 800; letter-spacing: -.015em; }
.art-title-sub { margin: 8px 0 0; color: var(--text-2); font-size: 17px; line-height: 1.4; font-weight: 600; }
.art-byline { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.art-brand { color: var(--text-2); font-weight: 700; }
.art-brand + span::before { content: "·"; margin-right: 8px; }

.art-audio {
  --p: 0;
  display: flex; align-items: center; gap: 12px; margin: 14px 16px 6px; padding: 10px 14px 10px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.art-audio-btn {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
}
.art-audio-btn .audio-glyph { width: 16px; height: 16px; }
.art-audio:active .art-audio-btn { transform: scale(.94); }
.art-audio-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.art-audio-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.art-audio-lang { color: var(--muted); font-size: 12px; font-weight: 600; }
.art-audio-track { position: relative; display: block; height: 16px; cursor: pointer; }
.art-audio-track::before, .art-audio-track i { content: ""; position: absolute; left: 0; top: 6px; height: 4px; border-radius: 2px; }
.art-audio-track::before { right: 0; background: var(--line-2); }
.art-audio-track i { width: calc(var(--p) * 100%); background: var(--accent); }
.art-audio-time { flex: none; color: var(--text-2); font-size: 13px; }

.art-body { padding: 8px 16px 0; font-size: 17px; line-height: 1.65; }
.art-p { margin: 0 0 1.05em; overflow-wrap: anywhere; }
.art-p[lang="zh"] { line-height: 1.8; letter-spacing: .01em; }
.art-pair { margin-bottom: 1.4em; }
.art-pair .art-p { margin-bottom: .45em; }
.art-pair .art-p + .art-p { color: var(--text-2); font-size: .92em; }
.art-q { position: relative; padding: 10px 12px 10px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); font-weight: 600; }
.art-q::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.art-speaker { color: var(--accent); }
.art-note { color: var(--muted); font-size: 14px; }
.art-skel { padding-top: 8px; }
.art-skel-line { height: 15px; margin-bottom: 12px; }
.art-skel-line.short { width: 70%; margin-bottom: 22px; }

.art-h { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.art-tags, .art-sources { margin: 18px 16px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.art-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.art-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 600; }
.art-sources ul { margin: 0; padding: 0; list-style: none; }
.art-sources li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; font-size: 14px; line-height: 1.4; }
.art-sources a { color: var(--text-2); text-decoration: none; }
.art-sources a:active { color: var(--accent); }
.art-src-name { color: var(--muted); font-size: 12.5px; }

/* ── 迷你播放器: fixed 在 tab 栏上方, 列内居中; 显示时 body 加底部留白 ── */
body.audio-on:not([data-tab="cipher"]) { padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 76px); }
.audio-mini {
  --p: 0;
  position: fixed; left: 50%; z-index: 290;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 8px);
  width: calc(min(100%, var(--col)) - 16px); height: 60px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 0 6px 0 8px; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--shadow); animation: audioMiniIn .28s var(--ease);
}
body[data-tab="cipher"] .audio-mini, html.kb-open .audio-mini, html.audio-full-open .audio-mini { display: none; }
@keyframes audioMiniIn { from { opacity: 0; transform: translate(-50%, 16px); } }
.audio-mini-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.audio-mini-bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--accent); }
.audio-mini-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; padding: 0; border: 0; background: none; text-align: left; }
.audio-mini-cover { flex: none; width: 44px; height: 44px; border-radius: 8px; }
.audio-mini-cover.no-img { background: var(--accent-soft); }
.audio-mini-cover.no-img img { visibility: hidden; }
.audio-mini-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.audio-mini-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.audio-mini-time { color: var(--muted); font-size: 12px; }
.audio-mini-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); }
.audio-mini-btn:active { background: var(--surface-3); }
.audio-mini-toggle .audio-glyph { width: 20px; height: 20px; }
.audio-mini-close svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }

/* ── 全屏播放器: fixed inset:0 浮层, 自己处理安全区 ── */
html.audio-full-open, html.audio-full-open body { overflow: hidden; }
.audio-full { position: fixed; inset: 0; z-index: 800; background: var(--bg); overscroll-behavior: contain; animation: audioFullIn .3s var(--ease); }
@keyframes audioFullIn { from { transform: translateY(6%); opacity: 0; } }
.audio-full-bg {
  position: absolute; inset: 0; background: center / cover no-repeat;
  filter: blur(48px) saturate(1.3); opacity: .35; transform: scale(1.2); pointer-events: none;
}
.audio-full-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, var(--bg) 85%); }
.audio-full-inner {
  position: relative; height: 100%; width: min(100%, var(--col)); margin: 0 auto;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 6px) 20px calc(var(--safe-bottom) + 18px);
}
.audio-full-head { flex: none; display: flex; align-items: center; justify-content: space-between; height: 48px; margin: 0 -8px; }
.audio-full-label { color: var(--text-2); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.audio-full-info { flex: none; display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.audio-full-cover { width: 100%; aspect-ratio: 16 / 9; max-height: 38vh; border-radius: 16px; box-shadow: var(--shadow); }
.audio-full-cover.no-img { display: none; }
.audio-full-title { font-size: 20px; line-height: 1.3; font-weight: 800; }
/* 有字幕: 封面缩成小方图, 和标题并排, 把空间让给字幕 */
.audio-full.has-caps .audio-full-info { flex-direction: row; align-items: center; gap: 12px; }
.audio-full.has-caps .audio-full-cover { flex: none; width: 64px; height: 64px; aspect-ratio: auto; border-radius: 10px; box-shadow: none; }
.audio-full.has-caps .audio-full-title { font-size: 16px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.audio-full-caps {
  flex: 1 1 auto; min-height: 0; margin: 14px -4px 8px; padding: 30% 4px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
.audio-full-caps::-webkit-scrollbar { display: none; }
.audio-full:not(.has-caps) .audio-full-caps { padding: 0; -webkit-mask-image: none; mask-image: none; display: flex; align-items: center; justify-content: center; }
.audio-caps-empty { color: var(--muted); font-size: 14px; }
.audio-cap { margin: 0 0 16px; color: var(--muted); font-size: 19px; line-height: 1.45; font-weight: 700; cursor: pointer; transition: color .25s, opacity .25s; }
.audio-cap.is-past { opacity: .55; }
.audio-cap.is-active { color: var(--text); opacity: 1; }
.audio-cap-sub { display: block; margin-top: 4px; font-size: 14.5px; font-weight: 500; line-height: 1.45; }
.audio-cap.is-active .audio-cap-sub { color: var(--text-2); }

.audio-full-seek { flex: none; }
.audio-range {
  --p: 0;
  display: block; width: 100%; height: 22px; margin: 0; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.audio-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) calc(var(--p) * 100%), var(--line-2) 0); }
.audio-range::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) calc(var(--p) * 100%), var(--line-2) 0); }
.audio-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.audio-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--text); }
.audio-full-times { display: flex; justify-content: space-between; margin-top: 2px; color: var(--muted); font-size: 12px; }

.audio-full-ctrl { flex: none; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.audio-full-ctrl button { display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--text); }
.audio-full-ctrl button:active { transform: scale(.92); }
.audio-skip { width: 52px; height: 52px; }
.audio-skip svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.audio-skip svg .t { fill: currentColor; stroke: none; font: 700 7px/1 var(--font); }
.audio-big { width: 72px; height: 72px; border-radius: 50%; background: var(--accent) !important; color: var(--accent-ink) !important; box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.audio-big .audio-glyph { width: 28px; height: 28px; }
.audio-rate { width: 52px; height: 36px; border-radius: 999px; border: 1px solid var(--line-2) !important; font-size: 13px; font-weight: 700; }
.audio-stop { width: 52px; height: 36px; color: var(--muted) !important; }
.audio-stop svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (min-width: 700px) {
  .news-hero-title { font-size: 26px; }
  .art-title { font-size: 30px; }
}
