:root {
  --bg: #0e0f11;
  --panel: #17181b;
  --panel-2: #1f2024;
  --panel-3: #26282d;
  --line: #2a2c31;
  --text: #f2f3f5;
  --muted: #8b8f98;
  --dim: #5d616a;
  --accent: #58e2a0;
  --accent-ink: #062316;
  --accent-soft: rgba(88, 226, 160, 0.14);
  --up: #3ddc84;
  --down: #ff5a5f;
  --live: #ff4d4f;
  --radius: 10px;
  --maxw: 1080px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { padding-bottom: 24px; -webkit-font-smoothing: antialiased; font-size: 14px; }
body.has-slip { padding-bottom: 72px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(14, 15, 17, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.06em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 17px; }
.brand-text { font-size: 18px; }
.brand-text b { color: var(--accent); margin-left: 4px; }
.feed { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.feed .pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); font-size: 12px; color: var(--muted); white-space: nowrap; }
.feed .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.feed .pill.ok .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.feed .pill.err .dot { background: var(--down); }
.feed .pill.demo { background: #3b2f12; color: #ffcb6b; font-weight: 600; }

/* ---------- tabs ---------- */
.tabs { max-width: var(--maxw); margin: 12px auto 0; padding: 0 16px; display: flex; gap: 8px; }
.tabs button { flex: 1; height: 40px; border-radius: var(--radius); background: var(--panel); color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--accent); color: var(--accent-ink); }
.tabs button i { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.08); }
.tabs button.active i { background: rgba(0,0,0,.15); }
.tabs .icon-btn { flex: 0 0 40px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
.tabs button.active .pulse { background: var(--accent-ink); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,77,79,.6); } 70% { box-shadow: 0 0 0 6px rgba(255,77,79,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,79,0); } }

.search { max-width: var(--maxw); margin: 10px auto 0; padding: 0 16px; }
.search input { width: 100%; height: 40px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 14px; font-size: 14px; outline: none; }
.search input:focus { border-color: var(--accent); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- game strip ---------- */
.games { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: none; }
.games::-webkit-scrollbar { display: none; }
.game { flex: 0 0 auto; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; border-radius: var(--radius); color: var(--muted); font-size: 12px; position: relative; }
.game .gi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 11px; letter-spacing: .02em; background: var(--panel-2); color: var(--text); border: 2px solid transparent; transition: border-color .15s; }
.game .badge { position: absolute; top: 0; right: 10px; min-width: 20px; padding: 1px 5px; border-radius: 999px; background: var(--panel-3); font-size: 10px; color: var(--text); }
.game.active { color: var(--text); }
.game.active .gi { border-color: var(--accent); }
.game span.lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- league groups & rows ---------- */
.group { background: var(--panel); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.group-head { display: grid; grid-template-columns: 1fr 240px; align-items: center; padding: 9px 14px; background: var(--panel-2); font-size: 12px; color: var(--muted); gap: 10px; }
.group-head .lg { display: flex; align-items: center; gap: 8px; min-width: 0; }
.group-head .lg b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-head .cols { display: grid; grid-template-columns: 1fr 1fr 44px; text-align: center; }
.tag { flex: 0 0 auto; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; color: #111; }

.row { display: grid; grid-template-columns: 1fr 240px; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); align-items: center; cursor: pointer; transition: background .15s; }
.row:hover { background: rgba(255,255,255,.02); }
.row .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; min-width: 0; }
.row .meta .stg { overflow: hidden; text-overflow: ellipsis; }
.row .meta .live { color: var(--live); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.row .meta .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
.row .meta .bo { padding: 1px 6px; border-radius: 4px; background: var(--panel-3); color: var(--muted); font-size: 11px; }
.row .meta .star { margin-left: auto; color: var(--dim); font-size: 15px; line-height: 1; padding: 0 2px; }
.row .meta .star.on { color: #ffc940; }
.team { display: flex; align-items: center; gap: 8px; min-width: 0; height: 24px; }
.team .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .sc { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 18px; text-align: right; }
.team.win .nm { font-weight: 700; }
.team.lose { color: var(--muted); }
.av { position: relative; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 5px; overflow: hidden; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #0e0f11; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--panel-3); }
.av.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 18px; }

.mk { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 6px; }
.odd { position: relative; height: 52px; border-radius: 8px; background: var(--panel-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-variant-numeric: tabular-nums; transition: background .15s, transform .05s; min-width: 0; }
.odd:hover:not([disabled]) { background: #30333a; }
.odd:active:not([disabled]) { transform: scale(.98); }
.odd .on { font-size: 11px; color: var(--muted); max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.odd .ov { font-weight: 700; color: var(--accent); font-size: 15px; }
.odd.sel { background: var(--accent); }
.odd.sel .ov, .odd.sel .on { color: var(--accent-ink); }
.odd[disabled] { cursor: default; opacity: .55; }
.odd .lock { width: 14px; height: 14px; color: var(--muted); }
.odd.up::after, .odd.down::after { position: absolute; top: 4px; right: 6px; font-size: 9px; }
.odd.up { animation: flashUp 2.4s; }
.odd.up::after { content: "▲"; color: var(--up); }
.odd.down { animation: flashDown 2.4s; }
.odd.down::after { content: "▼"; color: var(--down); }
@keyframes flashUp { 0%, 30% { box-shadow: inset 0 0 0 1px var(--up); } 100% { box-shadow: inset 0 0 0 1px transparent; } }
@keyframes flashDown { 0%, 30% { box-shadow: inset 0 0 0 1px var(--down); } 100% { box-shadow: inset 0 0 0 1px transparent; } }
.odd.won { background: rgba(61,220,132,.16); }
.odd.won .ov { color: var(--up); }
.odd.lost .ov { color: var(--dim); text-decoration: line-through; }
.more { height: 52px; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.more:hover { color: var(--text); }
.no-odds { grid-column: 1 / 3; height: 52px; border-radius: 8px; border: 1px dashed var(--line); color: var(--dim); font-size: 12px; display: grid; place-items: center; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; }
.skeleton { height: 86px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; margin-bottom: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

.banner { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius); background: #2a2210; color: #ffd27a; font-size: 13px; line-height: 1.6; border: 1px solid #4a3a14; }
.banner code { background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.banner b { color: #ffe3a6; }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); padding: 14px 0 10px; font-size: 13px; }
.back:hover { color: var(--text); }
.hero { background: radial-gradient(120% 140% at 50% 0%, #1f3a2e 0%, var(--panel) 55%); border-radius: 14px; padding: 16px; }
.hero .lg { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; justify-content: center; text-align: center; }
.hero .vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 18px 0 10px; }
.hero .side { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.hero .side .nm { font-weight: 700; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero .mid { text-align: center; }
.hero .score { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.hero .when { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hero .when.live { color: var(--live); font-weight: 700; }
.races { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.races span { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); }
.races span.cur { background: var(--accent-soft); color: var(--accent); }
.src { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.src span { font-size: 11px; color: var(--dim); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }

.stages { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0 10px; scrollbar-width: none; }
.stages::-webkit-scrollbar { display: none; }
.market { background: var(--panel); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.market-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; text-align: left; }
.market-head .st { font-size: 11px; color: var(--muted); font-weight: 500; padding: 1px 7px; border-radius: 4px; background: var(--panel-3); }
.market-head .st.settled { color: var(--accent); background: var(--accent-soft); }
.market-head .chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.market.closed .chev { transform: rotate(-90deg); }
.market.closed .sels { display: none; }
.sels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 0 14px 14px; }
.sels.n3 { grid-template-columns: repeat(3, 1fr); }
.sels.n4 { grid-template-columns: repeat(4, 1fr); }
.sels .odd { height: 50px; flex-direction: row; justify-content: space-between; padding: 0 12px; }
.sels .odd .on { max-width: 70%; font-size: 13px; color: var(--text); }
.sels .odd.sel .on { color: var(--accent-ink); }

/* ---------- bet slip ---------- */
.slip { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: var(--maxw); margin: 0 auto; }
.slip-bar { width: 100%; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 14px 14px 0 0; }
.slip-icon { display: grid; place-items: center; }
.slip-count { min-width: 22px; height: 22px; border-radius: 999px; background: var(--accent-ink); color: var(--accent); font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.slip .chev { transition: transform .2s; }
.slip[data-open="true"] .chev { transform: rotate(180deg); }
.slip-total { margin-left: auto; font-variant-numeric: tabular-nums; }
.slip-body { display: none; background: var(--panel); border-top: 1px solid var(--line); max-height: min(70vh, 640px); overflow-y: auto; padding: 12px 16px 16px; box-shadow: 0 -20px 40px rgba(0,0,0,.5); }
.slip[data-open="true"] .slip-body { display: block; }
.slip-modes { display: flex; gap: 6px; margin-bottom: 12px; }
.slip-modes button { height: 30px; padding: 0 14px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 13px; }
.slip-modes button.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.slip-modes button[disabled] { opacity: .4; cursor: not-allowed; }
.slip-modes .clear { margin-left: auto; background: none; color: var(--muted); }
.pick { background: var(--panel-2); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; position: relative; }
.pick .l1 { display: flex; align-items: center; gap: 8px; font-weight: 700; padding-right: 22px; }
.pick .l1 .po { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--accent); }
.pick .l1 .po s { color: var(--dim); font-weight: 400; margin-right: 6px; }
.pick .l2 { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pick .x { position: absolute; top: 6px; right: 6px; color: var(--muted); width: 22px; height: 22px; }
.pick.bad { box-shadow: inset 0 0 0 1px var(--down); }
.pick .warn { font-size: 12px; color: var(--down); margin-top: 4px; }
.pick input { margin-top: 8px; }
.stake { width: 100%; height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 12px; font-size: 15px; outline: none; }
.stake:focus { border-color: var(--accent); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 12px; }
.quick button { height: 34px; border-radius: 8px; background: var(--panel-2); font-size: 13px; }
.sum { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: var(--muted); }
.sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.place { width: 100%; height: 48px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; margin-top: 10px; }
.place[disabled] { opacity: .45; cursor: not-allowed; }
.slip-empty { color: var(--muted); text-align: center; padding: 24px 0; font-size: 13px; }
.note { font-size: 11px; color: var(--dim); text-align: center; margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: #2d2f35; color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 40; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .brand-text { font-size: 15px; }
  .feed .pill .t { display: none; }
  .group-head, .row { grid-template-columns: 1fr 176px; }
  .group-head .cols, .mk { grid-template-columns: 1fr 1fr 36px; }
  .odd { height: 48px; }
  .more { height: 48px; }
  .odd .on { display: none; }
  .row .meta .stg { display: none; }
  .sels.n4 { grid-template-columns: repeat(2, 1fr); }
  .sels.n3 { grid-template-columns: repeat(2, 1fr); }
  .hero .score { font-size: 28px; }
}

/* ---------- kind nav (电竞 / 体育 / 数据中心) ---------- */
.kinds { max-width: var(--maxw); margin: 12px auto 0; padding: 0 16px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.kinds button { position: relative; padding: 10px 14px 12px; color: var(--muted); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.kinds button:hover { color: var(--text); }
.kinds button.active { color: var(--text); }
.kinds button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent); }
.kinds button i { font-style: normal; font-size: 10px; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: var(--live); color: #fff; }
.kinds button i:empty { display: none; }
.game .gi.emoji { font-size: 22px; }

/* ---------- 3-way rows ---------- */
.group-head.three, .row.three { grid-template-columns: 1fr 330px; }
.group-head.three .cols, .row.three .mk { grid-template-columns: 1fr 1fr 1fr 44px; }
.row.three .no-odds { grid-column: 1 / 4; }
.odd.ghost { background: transparent; border: 1px dashed var(--line); cursor: default; }
.odd.push { background: rgba(255,255,255,.06); }
.banner { position: relative; padding-right: 36px; }
.banner-x { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; color: #ffd27a; }

/* ---------- detail tabs / periods / panels ---------- */
.dtabs { display: flex; gap: 8px; margin-top: 14px; }
.dtabs button { flex: 1; height: 40px; border-radius: var(--radius); background: var(--panel); color: var(--muted); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.dtabs button.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.dtabs button[disabled] { opacity: .4; cursor: not-allowed; }
.dtabs button i { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.08); }
.periods { margin: 12px auto 0; overflow-x: auto; max-width: 100%; }
.periods table { margin: 0 auto; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.periods th { color: var(--muted); font-weight: 500; padding: 3px 8px; white-space: nowrap; }
.periods td { padding: 3px 8px; text-align: center; }
.periods td:first-child { text-align: left; color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-chips { padding-top: 0; }
.panel-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12px; color: var(--dim); margin-bottom: 8px; flex-wrap: wrap; }
.panel-meta a { color: var(--accent); }
.panel-body { background: var(--panel); border-radius: var(--radius); padding: 12px; min-height: 120px; }
.muted { color: var(--muted); font-size: 12px; }
.small { margin-bottom: 8px; }

/* ---------- generic JSON renderer ---------- */
.j-status { font-size: 12px; padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; background: var(--panel-2); color: var(--muted); }
.j-status.ok b { color: var(--accent); }
.j-status.err { background: rgba(255,90,95,.1); color: #ffb3b5; }
.j-status.err b { color: var(--down); }
.j-note { margin-left: 8px; color: var(--accent); }
.j-hint { font-size: 13px; color: #ffd27a; background: #2a2210; border: 1px solid #4a3a14; padding: 10px 12px; border-radius: 8px; }
.j-table-wrap { overflow-x: auto; max-width: 100%; }
.j-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.j-table th { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font-weight: 600; text-align: left; padding: 6px 8px; white-space: nowrap; }
.j-table td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; max-width: 280px; }
.j-kv { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.j-kv dt { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.j-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.j-img { display: inline-block; width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin-right: 4px; background: var(--panel-3); border-radius: 4px; }
.j-null { color: var(--dim); }
.j-sep { color: var(--dim); }
.j-link { color: var(--accent); word-break: break-all; }
.j-nest summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.j-nest[open] { padding: 6px 0 6px 8px; border-left: 2px solid var(--line); }
.j-nest.inline { display: inline-block; }
.j-raw { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12px; overflow: auto; max-height: 60vh; margin: 0; }
.j-empty, .j-more { color: var(--muted); font-size: 12px; padding: 6px 0; }

/* ---------- data center ---------- */
.dc { display: grid; grid-template-columns: 340px 1fr; gap: 14px; padding-top: 14px; align-items: start; }
.dc-side { position: sticky; top: 64px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; gap: 8px; }
.dc-tabs { display: flex; gap: 6px; }
.dc-tabs button { flex: 1; height: 34px; white-space: nowrap; border-radius: 8px; background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 600; }
.dc-tabs button.active { background: var(--accent); color: var(--accent-ink); }
.dc-tabs i { font-style: normal; font-size: 10px; margin-left: 4px; opacity: .7; }
.dc-search { height: 36px; font-size: 13px; }
.dc-list { overflow-y: auto; flex: 1; padding-right: 4px; }
.dc-group { background: var(--panel); border-radius: 8px; margin-bottom: 6px; }
.dc-group summary { padding: 9px 12px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.dc-group summary i { font-style: normal; color: var(--dim); }
.dc-item { display: grid; grid-template-columns: 38px 1fr; gap: 2px 8px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.dc-item:hover { background: rgba(255,255,255,.03); }
.dc-item.active { background: var(--accent-soft); }
.dc-item .m { grid-row: span 2; align-self: center; }
.dc-item .p { font-size: 11px; color: var(--dim); font-family: ui-monospace, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m { font-size: 10px; font-weight: 800; padding: 2px 5px; border-radius: 4px; background: rgba(88,226,160,.15); color: var(--accent); text-align: center; }
.m.ws { background: rgba(63,167,255,.15); color: #7cc2ff; }
.dc-main { min-width: 0; }
.dc-intro, .dc-head, .dc-form, .dc-note { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.dc-intro h2, .dc-head h2 { margin: 0 0 8px; font-size: 18px; }
.dc-intro p { color: var(--muted); line-height: 1.7; margin: 6px 0; }
.dc-path { display: flex; gap: 8px; align-items: center; }
.dc-path code, .dc-url code { font-size: 13px; overflow-wrap: anywhere; }
.dc-sum { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.dc-desc { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 6px 0 0; }
.dc-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.dc-back { display: none; padding: 0 0 8px; }
.dc-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dc-param span { display: flex; gap: 6px; align-items: center; font-size: 12px; font-family: ui-monospace, Menlo, monospace; margin-bottom: 4px; }
.dc-param b { color: var(--down); }
.dc-param em { font-style: normal; color: var(--dim); font-size: 10px; }
.dc-param input { width: 100%; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 10px; font-size: 13px; outline: none; }
.dc-param input:focus { border-color: var(--accent); }
.dc-noparam { color: var(--muted); font-size: 13px; }
.dc-form .place { margin-top: 12px; height: 42px; }
.dc-url { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--dim); }
.dc-result { background: var(--panel); border-radius: var(--radius); padding: 12px; }
.dc-result:empty { display: none; }

@media (max-width: 860px) {
  .dc { grid-template-columns: 1fr; }
  .dc-side { position: static; max-height: none; }
  .dc.has-sel .dc-side { display: none; }
  .dc-back { display: inline-flex; }
}
@media (max-width: 640px) {
  .kinds button { padding: 10px 8px 12px; font-size: 14px; }
  .group-head.three, .row.three { grid-template-columns: 1fr 210px; }
  .group-head.three .cols, .row.three .mk { grid-template-columns: 1fr 1fr 1fr 34px; gap: 4px; }
}
.kinds button, .tabs button { white-space: nowrap; }
@media (max-width: 480px) {
  .kinds { gap: 0; overflow-x: auto; scrollbar-width: none; }
  .kinds button { font-size: 13px; padding: 10px 8px 12px; }
  .tabs { gap: 6px; }
  .tabs button { font-size: 13px; gap: 4px; }
  .group-head, .group-head.three, .row, .row.three { grid-template-columns: 1fr; }
  .group-head .cols { display: none; }
  .row .mk { grid-template-columns: 1fr 1fr 40px; }
  .row.three .mk { grid-template-columns: 1fr 1fr 1fr 40px; }
  .odd, .more { height: 44px; }
  .feed .pill.demo { font-size: 11px; padding: 3px 8px; }
  .brand-text { font-size: 14px; }
}
@media (max-width: 640px) {
  .sels .odd .on { display: block; font-size: 12px; }
  .sels.n3 { grid-template-columns: repeat(3, 1fr); }
  .sels.n3 .odd { flex-direction: column; justify-content: center; padding: 0 6px; height: 54px; }
  .sels.n3 .odd .on { max-width: 100%; }
}

.load-more { width: 100%; height: 44px; border-radius: var(--radius); background: var(--panel); color: var(--accent); font-weight: 600; margin: 4px 0 14px; }
.load-more:hover { background: var(--panel-2); }

/* ---------- data-source badges ---------- */
.srcs { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.row .meta .srcs { margin-left: auto; }
.row .meta .srcs + .star { margin-left: 6px; }
.srcb { font-size: 10px; font-weight: 800; line-height: 1; padding: 3px 5px; border-radius: 4px; letter-spacing: .02em; }
.srcb.gg { background: rgba(63,167,255,.16); color: #7cc2ff; }
.srcb.as { background: rgba(255,170,60,.16); color: #ffb74d; }
.srcs.merged { padding: 1px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(88,226,160,.45); }
.srcs i { font-style: normal; font-size: 10px; color: var(--accent); padding: 0 1px; }
.src-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 11px; color: var(--muted); margin: -2px 0 10px; }
.hero .src { align-items: center; }
.hero .src .srcb { font-size: 11px; padding: 4px 8px; }
.src-note { font-size: 11px; color: var(--dim); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }
.hero .src .srcs { border: 0; padding: 0; border-radius: 7px; }
.hero .src .srcs.merged { padding: 2px; }
.hero .src .srcb { border: 0; border-radius: 5px; }
.hero .src .srcs i { border: 0; padding: 0 2px; }

/* ---------- streams / live / news ---------- */
.sicon { font-size: 12px; line-height: 1; }
.chip i { font-style: normal; font-size: 10px; margin-left: 4px; opacity: .7; }
.stream-stage { background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.stream-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.stream-anim { display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; background: #fff; }
.stream-note { color: #ffb3b5; font-size: 12px; padding: 0 12px; }
.stream-note:not(:empty) { padding: 8px 12px; }
.stream-missing { background: var(--panel); color: var(--muted); font-size: 13px; line-height: 1.7; padding: 22px 18px; }
.stream-missing code { display: block; margin-top: 8px; font-size: 11px; color: var(--dim); overflow-wrap: anywhere; }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 0 10px; }
.live-head h2 { margin: 0; font-size: 18px; }
.live-kinds { display: flex; gap: 6px; }
.group-head.plain { grid-template-columns: 1fr auto; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding-bottom: 20px; }
.news-card { background: var(--panel); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.news-card img, .news-card video, .news-cover-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--panel-3); display: grid; place-items: center; font-size: 34px; }
.news-body { padding: 10px 12px 12px; }
.news-body h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.4; }
.news-body p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { color: var(--dim); font-size: 12px; }
.news-meta a { color: var(--accent); }
.article { max-width: 760px; margin: 0 auto; padding-bottom: 30px; }
.article h1 { font-size: 22px; line-height: 1.4; margin: 6px 0 8px; }
.article-cover { width: 100%; border-radius: var(--radius); margin: 14px 0; }
.article-body { line-height: 1.85; font-size: 15px; color: #dfe1e5; }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; }

.live-entry { flex: 0 0 auto; font-size: 13px; line-height: 1; padding: 3px 6px; border-radius: 6px; background: rgba(255,77,79,.14); box-shadow: inset 0 0 0 1px rgba(255,77,79,.35); }
.live-entry:hover { background: rgba(255,77,79,.26); }
.live-entry.big { font-size: 12px; padding: 4px 10px; color: #ffb3b5; font-weight: 700; border-radius: 999px; }
.hero .src .live-entry { border: 0; }
