:root {
  --night: #07080D; --canvas: #0E0F13; --surface: #1A1C22; --surface-hi: #23262E;
  --text: #F5F5F7; --text2: rgba(245,245,247,.72); --text3: rgba(245,245,247,.48);
  --glass: rgba(255,255,255,.07); --glass-hi: rgba(255,255,255,.12); --stroke: rgba(255,255,255,.14);
  --cyan: #64D2FF; --cyan-deep: #2EA8E0; --lake: #1F3BD1; --lake-deep: #0A1A7A; --live: #FF453A; --pine: #30D158; --amber: #FFD60A;
  --radius: 22px; --ease: cubic-bezier(.2,.8,.2,1);
  --motion-fast: 180ms; --motion-med: 260ms; --motion-slow: 420ms;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--night); color: var(--text); font: 400 16px/1.6 Outfit, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
:is(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.02em; }
h2 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 700; text-align: center; }
h3 { font-size: 19px; font-weight: 600; }
.center { text-align: center; }

/* moving light behind everything, like the TV's wallpaper */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .45; animation: drift 24s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: var(--lake); left: -15vmax; top: -20vmax; }
.aurora span:nth-child(2) { background: var(--cyan-deep); right: -20vmax; top: 10vmax; animation-duration: 30s; animation-direction: alternate-reverse; }
.aurora span:nth-child(3) { background: var(--lake-deep); left: 20vmax; bottom: -35vmax; opacity: .25; animation-duration: 36s; }
@keyframes drift { to { transform: translate(8vmax, -6vmax) scale(1.1); } }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(7,8,13,.65); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; text-decoration: none; }
.nav .links { display: flex; gap: 18px; margin-left: 12px; }
.nav .links a { text-decoration: none; color: var(--text2); font-size: 15px; transition: color .2s; }
.nav .links a:hover { color: var(--text); }
.nav-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.lang { display: flex; background: var(--glass); border: 1px solid var(--stroke); border-radius: 99px; padding: 3px; }
.lang button { background: none; border: 0; color: var(--text2); font: 600 13px Outfit, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; padding: 5px 10px; border-radius: 99px; cursor: pointer; }
.lang button.on { background: var(--text); color: var(--night); }
.gh, .nav-pill { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; background: var(--glass); border: 1px solid var(--stroke); border-radius: 99px; padding: 6px 12px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.nav-pill:hover, .gh:hover { background: var(--glass-hi); }
@media (max-width: 960px) { .nav .links { display: none; } }

/* notice bar + live telemetry ribbon */
.live-notice { background: linear-gradient(90deg, rgba(100,210,255,.16), rgba(31,59,209,.28)); border-bottom: 1px solid rgba(100,210,255,.28);
  padding: 10px clamp(16px, 4vw, 48px); display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 14px; flex-wrap: wrap; text-align: center; }
.live-notice b { color: var(--cyan); }
.live-notice button { background: rgba(255,255,255,.14); border: 1px solid var(--stroke); color: var(--text); border-radius: 99px; padding: 3px 10px; cursor: pointer; font: 600 12px inherit; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border-radius: 99px; font: 600 15px inherit; text-decoration: none; transition: transform .25s var(--ease), background .25s, box-shadow .25s; border: 1px solid transparent; cursor: pointer; color: var(--text); }
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn.primary { background: var(--text); color: var(--night); box-shadow: 0 10px 40px rgba(100,210,255,.25); }
.btn.primary small { opacity: .65; font-weight: 500; }
.btn.cyan { background: var(--cyan); color: #050811; box-shadow: 0 10px 30px rgba(100,210,255,.22); }
.btn.ghost { background: var(--glass); border-color: var(--stroke); color: var(--text); }
.btn.ghost:hover { background: var(--glass-hi); }
.btn.danger { background: rgba(255,69,58,.18); border-color: rgba(255,69,58,.45); color: #ff8e86; }
.btn.small { padding: 9px 16px; font-size: 14px; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding: clamp(40px, 7vw, 88px) clamp(16px, 4vw, 48px) 36px; max-width: 1400px; margin: 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: var(--glass); border: 1px solid var(--stroke); font-size: 14px; text-decoration: none; color: var(--text2); }
.pill b { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pine); box-shadow: 0 0 0 0 rgba(48,209,88,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(48,209,88,0); } 100% { box-shadow: 0 0 0 0 rgba(48,209,88,0); } }
.hero h1 { font-size: clamp(42px, 6.4vw, 82px); font-weight: 800; margin: 20px 0 16px; background: linear-gradient(180deg, #fff 30%, rgba(255,255,255,.62)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--text2); max-width: 34em; margin: 0 0 26px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.stats { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(100px, auto)); gap: 20px; justify-content: start; }
.stats b { display: block; font-size: 26px; font-weight: 700; }
.stats span { color: var(--text3); font-size: 13px; }
.hero-art img { width: 100%; height: auto; border-radius: 28px; box-shadow: 0 40px 120px rgba(0,0,0,.6); }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, auto); } }

/* telemetry pulse bar */
.telemetry-bar { max-width: 1200px; margin: 16px auto 0; padding: 0 clamp(16px, 4vw, 48px); }
.telemetry-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; padding: 18px 22px; border-radius: var(--radius);
  background: rgba(255,255,255,.045); border: 1px solid var(--stroke); }
.metric-item small { display: block; color: var(--text3); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.metric-item strong { display: block; font-size: 24px; font-weight: 700; margin-top: 2px; color: var(--text); }
.metric-item span { font-size: 13px; color: var(--cyan); }

/* international / release banner */
.intl { padding: 0 clamp(16px, 4vw, 48px); max-width: 1100px; margin: 24px auto 0; }
.intl-card { display: flex; gap: 18px; align-items: center; padding: 20px 24px; border-radius: var(--radius); background: linear-gradient(120deg, rgba(31,59,209,.35), rgba(122,50,220,.25)); border: 1px solid var(--stroke); }
.intl-card p { margin: 4px 0 0; color: var(--text2); font-size: 15px; }
.intl-card .btn { margin-left: auto; flex-shrink: 0; background: var(--glass-hi); }
.globe { font-size: 34px; animation: spin 12s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .intl-card { flex-direction: column; align-items: flex-start; } .intl-card .btn { margin-left: 0; } }

/* sections */
.section { padding: clamp(56px, 8vw, 110px) clamp(16px, 4vw, 48px) 0; max-width: 1200px; margin: 0 auto; }
.section.narrow { max-width: 820px; }
.sub { text-align: center; color: var(--text2); font-size: 18px; max-width: 42em; margin: 14px auto 34px; }
.grid { display: grid; gap: 18px; }
.features { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { position: relative; padding: 26px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1px solid var(--stroke); transition: transform .35s var(--ease), border-color .35s, background .35s; overflow: hidden; }
.card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.10), transparent 40%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.26); }
.card:hover::after { opacity: 1; }
.card i { font-style: normal; font-size: 28px; display: block; margin-bottom: 14px; }
.card p { color: var(--text2); margin: 8px 0 0; font-size: 15px; }
.tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.tabs button { background: var(--glass); border: 1px solid var(--stroke); color: var(--text2); padding: 10px 20px; border-radius: 99px; font: 600 15px Outfit, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; cursor: pointer; transition: all .25s; }
.tabs button.on { background: var(--text); color: var(--night); }

/* screenshots */
.tv-frame { max-width: 980px; margin: 0 auto; }
.tv-screen { position: relative; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: #000; border: 10px solid #17181d; box-shadow: 0 0 0 1px #2c2f37, 0 50px 120px rgba(0,0,0,.7); }
.tv-screen .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity .9s var(--ease), transform 6s linear; }
.tv-screen .slide.on { opacity: 1; transform: scale(1); }
.tv-screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 35%); pointer-events: none; }
.tv-stand { width: 200px; height: 26px; margin: 0 auto; background: linear-gradient(#1c1e24, #101116); clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%); }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; background: var(--text3); cursor: pointer; transition: width .3s, background .3s; padding: 0; }
.dots button.on { width: 26px; background: var(--text); }
.caption { text-align: center; color: var(--text2); min-height: 1.6em; margin: 12px 0 0; }
.phones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 64px; }
.phone { margin: 0; text-align: center; }
.phone img { border-radius: 34px; border: 8px solid #17181d; box-shadow: 0 0 0 1px #2c2f37, 0 30px 70px rgba(0,0,0,.6); transition: transform .5s var(--ease); }
.phone:nth-child(even) { transform: translateY(28px); }
.phone:hover img { transform: translateY(-8px) rotate(-1deg); }
.phone figcaption { color: var(--text2); margin-top: 14px; font-weight: 500; }
@media (max-width: 760px) { .phones { grid-template-columns: repeat(2, 1fr); } }

/* device picker + downloads */
.downloads { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.dl ol { padding-left: 20px; color: var(--text2); font-size: 15px; margin: 14px 0 18px; }
.dl ol li { margin-bottom: 6px; }
.dl.mine { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 20px 60px rgba(100,210,255,.18); }
.dl .row { display: flex; gap: 8px; flex-wrap: wrap; }
.role-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; background: rgba(100,210,255,.15); color: var(--cyan); border: 1px solid rgba(100,210,255,.32); }
.role-tag.green { background: rgba(48,209,88,.14); color: var(--pine); border-color: rgba(48,209,88,.32); }
.role-tag.amber { background: rgba(255,214,10,.14); color: var(--amber); border-color: rgba(255,214,10,.3); }
.dl-sub { font-size: 13px; color: var(--text3); margin-top: 10px; line-height: 1.45; }
.dl-sub code { color: var(--text2); background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }
.compare-box { margin-top: 24px; padding: 20px 24px; border-radius: var(--radius); background: rgba(255,255,255,.05); border: 1px solid var(--stroke); }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 12px; }
.compare-item { background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 16px; }
.compare-item strong { color: var(--cyan); display: block; margin-bottom: 4px; }
.note { text-align: center; color: var(--text2); margin-top: 26px; }
.note a { color: var(--cyan); }

/* release inspector, channel explorer, m3u inspector */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.input, select.input, textarea.input { background: rgba(255,255,255,.07); border: 1px solid var(--stroke); color: var(--text); border-radius: 12px; padding: 10px 14px; font: 400 14px inherit; }
.input::placeholder { color: var(--text3); }
.input.grow { flex: 1; min-width: 220px; }
textarea.input { width: 100%; min-height: 110px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.pills-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.chip-btn { background: var(--glass); border: 1px solid var(--stroke); color: var(--text2); border-radius: 99px; padding: 6px 14px; font: 500 13px inherit; cursor: pointer; white-space: nowrap; }
.chip-btn.on { background: var(--cyan); color: #050811; border-color: var(--cyan); font-weight: 700; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ch-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.ch-logo { width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-weight: 700; color: var(--cyan); }
.ch-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.ch-meta { min-width: 0; flex: 1; }
.ch-meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-meta small { color: var(--text3); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; margin-left: 4px; background: rgba(100,210,255,.16); color: var(--cyan); }
.tag.drm { background: rgba(255,214,10,.16); color: var(--amber); }

/* checksum table & admin tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--stroke); border-radius: 16px; background: rgba(255,255,255,.035); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
table.data th, table.data td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
table.data th { color: var(--text3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
table.data code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--cyan); word-break: break-all; }

/* modal dialog (update & push modal) */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(5,6,12,.76); backdrop-filter: blur(10px); display: grid; place-items: center; padding: 20px; }
.modal-box { width: min(560px, 100%); background: #141720; border: 1px solid rgba(255,255,255,.22); border-radius: 26px; padding: 28px; box-shadow: 0 30px 90px rgba(0,0,0,.75); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.modal-body { color: var(--text2); font-size: 15px; max-height: 55vh; overflow-y: auto; white-space: pre-wrap; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 22px; }
.progress-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--lake), var(--cyan)); }

/* how it works */
.flow { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 36px 0 10px; }
.node { padding: 18px 24px; border-radius: 18px; background: var(--glass); border: 1px solid var(--stroke); text-align: center; min-width: 180px; }
.node small { display: block; color: var(--text3); font-size: 13px; margin-top: 4px; }
.node.core { background: linear-gradient(135deg, rgba(100,210,255,.22), rgba(31,59,209,.25)); border-color: rgba(100,210,255,.4); }
.arrow { color: var(--text3); font-size: 26px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(5px); } }

/* community */
.ways { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 56px; }
.way { text-decoration: none; }
.contributors { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 22px 0; }
.contributors .person { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; color: var(--text2); width: 84px; }
.contributors .person img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--stroke); transition: transform .3s var(--ease); }
.contributors .person:hover img { transform: scale(1.08); border-color: var(--cyan); }

/* faq */
details { border-bottom: 1px solid var(--stroke); padding: 18px 4px; }
details:first-of-type { margin-top: 30px; }
summary { cursor: pointer; font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--text3); font-size: 24px; line-height: 1; transition: transform .3s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--text2); margin: 10px 0 0; }

/* footer */
.footer { text-align: center; padding: 90px 16px 50px; color: var(--text3); font-size: 14px; }
.footer .brand { justify-content: center; color: var(--text); margin-bottom: 10px; }
.footer a { color: var(--text2); }
.footer .fine { font-size: 12px; max-width: 40em; margin: 16px auto 0; }

/* admin layout */
.admin-wrap { max-width: 1260px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 48px) 80px; }
.admin-login { max-width: 430px; margin: 80px auto; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 20px 0; }
.kpi-card { padding: 20px; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid var(--stroke); }
.kpi-card small { color: var(--text3); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.kpi-card b { display: block; font-size: 32px; margin-top: 6px; }
.split-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-top: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.field .input { width: 100%; }
.bar-row { margin-bottom: 10px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); }

/* scroll reveal */
.js .reveal { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal:not(.in) { opacity: 0; transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal:not(.in) { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
