/* ============================================================
 * SubLive 译播足球 —— 样式（深色球场风 · 双语字幕质感）
 * ============================================================ */
:root {
  --bg: #0a0f0d;
  --panel: #101815;
  --panel-2: #16211c;
  --line: #223129;
  --txt: #e8f3ec;
  --txt-dim: #93a89c;
  --accent: #00e676;
  --accent-dim: #0a9d55;
  --red: #ff3b47;
  --yellow: #ffd60a;
  --radius: 14px;
  --sub-zh-size: 20px;
  --sub-en-size: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
i, em { font-style: normal; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 22px;
  background: rgba(10, 15, 13, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; }
.logo-ball { font-size: 24px; filter: drop-shadow(0 0 8px rgba(0, 230, 118, .5)); }
.logo-text i {
  display: block; font-size: 11px; font-weight: 500;
  color: var(--txt-dim); letter-spacing: 3px; line-height: 1.1;
}
.topnav { display: flex; gap: 6px; margin-left: 8px; }
.topnav a {
  padding: 6px 14px; border-radius: 999px;
  color: var(--txt-dim); font-size: 14px; font-weight: 600;
}
.topnav a.on, .topnav a:hover { color: var(--accent); background: rgba(0, 230, 118, .08); }
.back {
  margin-left: auto; font-size: 14px; color: var(--txt-dim);
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
}
.back:hover { color: var(--accent); border-color: var(--accent-dim); }

/* 直播页顶栏比赛条 */
.match-strip { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.strip-league { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 1px; }
.strip-teams { font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.strip-teams b { font-weight: 700; }
.strip-teams i { color: var(--txt-dim); font-size: 12px; }
.strip-vs { color: var(--txt-dim); font-size: 11px; }

/* ---------- 首页 Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; align-items: center;
  max-width: 1200px; margin: 0 auto; padding: 64px 24px 40px;
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 900; letter-spacing: 1px; }
.hero h1 em {
  font-style: normal; color: var(--accent);
  text-shadow: 0 0 30px rgba(0, 230, 118, .45);
}
.hero-sub { margin-top: 14px; color: var(--txt-dim); font-size: 16px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.badge {
  font-size: 13px; font-weight: 600; padding: 6px 13px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--txt);
  background: var(--panel);
}
.cta {
  display: inline-block; margin-top: 26px; padding: 12px 30px;
  background: var(--accent); color: #04140b; font-weight: 800; font-size: 16px;
  border-radius: 999px; transition: .2s;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 230, 118, .35); }

/* Hero 里的字幕演示块 */
.hero-sub-demo {
  background:
    radial-gradient(120% 90% at 50% 0%, #173524 0%, #0d1812 60%, #0a0f0d 100%);
  border: 1px solid var(--line); border-radius: 18px;
  min-height: 240px; position: relative; overflow: hidden;
}
.hero-sub-demo::before {
  content: "🟩"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 110px; opacity: .08;
}
.demo-sub {
  position: absolute; left: 0; right: 0; bottom: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0 20px; text-align: center;
  animation: subPulse 4.5s ease-in-out infinite;
}
.demo-sub .ds-zh {
  font-size: 19px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, .62); padding: 5px 16px; border-radius: 8px;
}
.demo-sub .ds-en {
  font-size: 13.5px; color: #cfe8da;
  background: rgba(0, 0, 0, .45); padding: 3px 13px; border-radius: 7px;
}
@keyframes subPulse {
  0%, 12% { opacity: 0; transform: translateY(10px); }
  18%, 78% { opacity: 1; transform: translateY(0); }
  92%, 100% { opacity: 0; transform: translateY(6px); }
}

/* ---------- 比赛区 ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 10px 24px 60px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin: 26px 0 18px;
}
.section-head h2 { font-size: 22px; font-weight: 800; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: var(--panel); color: var(--txt-dim);
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
}
.tab.on { color: #04140b; background: var(--accent); border-color: var(--accent); font-weight: 800; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.empty { grid-column: 1/-1; text-align: center; color: var(--txt-dim); padding: 40px 0; }

.card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; transition: .18s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent-dim); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; }
.card-top .league { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.card-top .league-en { font-size: 11.5px; color: var(--txt-dim); }
.card-mid {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 8px; margin: 14px 0 12px;
}
.side { display: flex; flex-direction: column; }
.side.r { text-align: right; }
.t-zh { font-size: 17px; font-weight: 800; }
.t-en { font-size: 11.5px; color: var(--txt-dim); }
.mid { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sc { font-size: 26px; font-weight: 900; letter-spacing: 2px; }
.sc.dim { color: var(--txt-dim); }
.sc.vs { font-size: 18px; color: var(--txt-dim); }
.pill { font-size: 11.5px; font-weight: 800; padding: 3px 11px; border-radius: 999px; letter-spacing: 1px; }
.pill.live { background: var(--red); color: #fff; animation: blink 1.6s infinite; }
.pill.live i { font-style: normal; opacity: .9; margin-left: 4px; }
.pill.ft { background: var(--panel-2); color: var(--txt-dim); border: 1px solid var(--line); }
.pill.soon { background: rgba(0, 230, 118, .12); color: var(--accent); }
@keyframes blink { 50% { opacity: .55; } }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.cc { font-size: 11.5px; color: var(--txt-dim); }
.watch { font-size: 13px; font-weight: 700; color: var(--accent); }

/* ---------- 特色区 ---------- */
.features { margin-top: 56px; }
.features h2 { font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.feat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.feat-icon { font-size: 28px; }
.feat h3 { font-size: 16px; margin: 10px 0 6px; }
.feat p { font-size: 13.5px; color: var(--txt-dim); }

/* ---------- 直播页 ---------- */
.watch-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px;
  max-width: 1280px; margin: 0 auto; padding: 18px 22px 40px;
}

/* 记分板 */
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 18px; margin-bottom: 12px;
}
.sb-team { display: flex; flex-direction: column; }
.sb-team.r { align-items: flex-end; text-align: right; }
.sb-short { font-size: 11px; color: var(--accent); font-weight: 800; letter-spacing: 1px; }
.sb-name { font-size: 12.5px; color: var(--txt-dim); }
.sb-mid { display: flex; align-items: center; gap: 14px; }
.sb-score { font-size: 30px; font-weight: 900; }
.sb-clock { font-size: 13px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.scoreboard.flash .sb-score { animation: scorePop .7s ease; }
@keyframes scorePop {
  30% { transform: scale(1.35); color: var(--accent); text-shadow: 0 0 18px rgba(0, 230, 118, .8); }
}

/* 播放器外壳 */
.player-shell {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #000; border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}
.player-shell video { width: 100%; height: 100%; object-fit: contain; display: block; }
.clockbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .12); }
.clockbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 3s linear; }
.demo-mark {
  position: absolute; top: 12px; left: 12px;
  font-size: 11px; font-weight: 900; letter-spacing: 2px;
  padding: 4px 10px; border-radius: 6px; background: rgba(0, 0, 0, .55);
  color: #8b9a91;
}
.demo-mark.on { color: #fff; background: var(--red); animation: blink 1.6s infinite; }
.demo-mark.ft { color: var(--txt-dim); }
.demo-mark.soon { color: var(--yellow); }

/* ---------- 双语字幕层（核心特色视觉） ---------- */
.subtitle-layer {
  --sub-zh-size: 20px; --sub-en-size: 14px;
  position: absolute; left: 0; right: 0;
  bottom: 34px; top: auto;
  z-index: 8; /* 永远在直播流覆盖层之上：字幕不因视频失败而消失 */
  display: flex; flex-direction: column; align-items: center;
  padding: 0 4%; text-align: center; pointer-events: none;
  transition: bottom .25s ease;
}
.subtitle-layer.sub-top { bottom: auto; top: 46px; }
.subtitle-layer.sub-off { display: none; }
.sub-box {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  opacity: 0; transform: translateY(12px);
  transition: opacity .28s ease, transform .28s ease;
}
.sub-box.sub-in { opacity: 1; transform: translateY(0); }
.sub-min {
  font-size: 11px; font-weight: 900; color: #04140b;
  background: var(--accent); border-radius: 5px; padding: 1px 7px;
  margin-bottom: 3px;
}
.sub-tag {
  font-size: 11.5px; font-weight: 800; letter-spacing: 1px;
  color: #fff; background: rgba(0, 0, 0, .55);
  padding: 2px 10px; border-radius: 999px; margin-bottom: 2px;
}
.sub-zh {
  font-size: var(--sub-zh-size); font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, .66);
  padding: 4px 16px; border-radius: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
  max-width: 100%;
}
.sub-en {
  font-size: var(--sub-en-size); color: #d7e8de;
  background: rgba(0, 0, 0, .48);
  padding: 2px 13px; border-radius: 7px;
  max-width: 100%;
}
/* 仅英文模式下主行加粗 */
.subtitle-layer:not(:has(.sub-zh)) .sub-en {
  font-weight: 700; color: #fff;
}
/* 事件配色 */
.sub-box.t-goal .sub-tag { background: var(--accent); color: #04140b; }
.sub-box.t-red .sub-tag { background: var(--red); }
.sub-box.t-yellow .sub-tag { background: var(--yellow); color: #1c1802; }
.sub-box.t-var .sub-tag { background: #7c4dff; }
.sub-box.t-break .sub-tag { background: rgba(255, 255, 255, .85); color: #111; }
/* 待机态字幕：低调常驻 */
.sub-box.t-idle { opacity: .45; transition: opacity .8s ease; }
.sub-box.t-idle.sub-in { opacity: .45; }
.sub-box.t-idle .sub-zh { font-size: calc(var(--sub-zh-size) * .72); background: rgba(0, 0, 0, .4); }
.sub-box.t-idle .sub-en { font-size: calc(var(--sub-en-size) * .82); background: transparent; }

/* 直播流不可用覆盖层 */
.stream-fallback {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px;
  background: repeating-linear-gradient(45deg, #0c130f 0 14px, #0e1613 14px 28px);
}
.sf-title { font-weight: 800; font-size: 16px; }
.stream-fallback p { color: var(--txt-dim); font-size: 13.5px; max-width: 420px; }
.sf-note { font-size: 12px !important; color: var(--accent) !important; }

/* ---------- 字幕控制条 ---------- */
.subbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px; margin-top: 12px;
}
.seg { display: flex; align-items: center; gap: 4px; background: var(--panel-2); border-radius: 9px; padding: 3px; }
.seg button {
  border: 0; background: transparent; color: var(--txt-dim);
  font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 7px;
}
.seg button.on { background: var(--accent); color: #04140b; }
.seg .size-val { font-size: 12px; color: var(--txt-dim); min-width: 22px; text-align: center; }
.switch { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--txt-dim); cursor: pointer; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.mini-btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--txt);
  font-size: 12.5px; font-weight: 700; padding: 6px 13px; border-radius: 9px;
}
.mini-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.mini-btn.demo { margin-left: auto; border-color: var(--accent-dim); color: var(--accent); }
.mini-btn.demo.active { background: var(--accent); color: #04140b; border-color: var(--accent); }
.demo-hint { font-size: 12.5px; color: var(--txt-dim); margin: 8px 2px 0; }
.player-note { font-size: 12px; color: #6d7f74; margin-top: 10px; }

/* ---------- 时间线 ---------- */
.timeline-col {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; max-height: 78vh;
  position: sticky; top: 74px;
}
.tl-head { font-size: 15px; font-weight: 800; padding: 2px 4px 10px; border-bottom: 1px solid var(--line); }
.tl-head i { color: var(--txt-dim); font-weight: 500; font-size: 12px; }
.timeline { list-style: none; overflow-y: auto; padding: 6px 2px; flex: 1; }
.timeline::-webkit-scrollbar { width: 6px; }
.timeline::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.evt { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px dashed var(--line); animation: evtIn .3s ease; }
@keyframes evtIn { from { opacity: 0; transform: translateX(14px); } }
.evt-min {
  flex: 0 0 40px; text-align: center; font-weight: 900; font-size: 13px;
  color: var(--txt-dim); padding-top: 2px;
}
.evt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.evt-type { font-size: 11.5px; font-weight: 800; color: var(--txt-dim); letter-spacing: .5px; }
.evt-type i { color: #6d7f74; font-size: 10.5px; }
.evt-zh { font-size: 13px; font-weight: 600; }
.evt-en { font-size: 11.5px; color: var(--txt-dim); }
.evt.t-goal .evt-type { color: var(--accent); }
.evt.t-goal { background: rgba(0, 230, 118, .06); border-radius: 8px; }
.evt.t-red .evt-type { color: var(--red); }
.evt.t-yellow .evt-type { color: var(--yellow); }
.evt.t-var .evt-type { color: #a97dff; }
.evt.t-break { opacity: .75; }

/* ---------- 页脚 ---------- */
.foot {
  text-align: center; color: #5f6f66; font-size: 12.5px;
  padding: 26px 20px 34px; border-top: 1px solid var(--line); margin-top: 20px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; }
  .watch-wrap { grid-template-columns: 1fr; }
  .timeline-col { position: static; max-height: 420px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .match-strip { order: 3; width: 100%; align-items: flex-start; }
  .mini-btn.demo { margin-left: 0; }
}
