:root {
  --bg: #f6f8fb;
  --bg-soft: #eef2f8;
  --card: #ffffff;
  --text: #101828;
  --muted: #5b6478;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-soft: #d7f2ee;
  --accent: #2563eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
}

[data-theme="dark"] {
  --bg: #0b1017;
  --bg-soft: #0f1620;
  --card: #131b25;
  --text: #e6edf6;
  --muted: #93a1b5;
  --line: #22303f;
  --brand: #2dd4bf;
  --brand-soft: #123b39;
  --accent: #60a5fa;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .88em;
  word-break: break-all;
}
b { color: var(--text); }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand .ic { color: var(--brand); width: 22px; height: 22px; }
.brand em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 6px; }
.nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); }

/* hero */
.hero { padding: 54px 0 40px; background: radial-gradient(120% 120% at 10% 0%, var(--brand-soft) 0%, transparent 55%); }
.hero-inner { display: grid; grid-template-columns: 1.4fr .8fr; gap: 40px; align-items: center; }
.badge {
  display: inline-block; font-size: 12px; color: var(--brand);
  background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 14px;
}
h1 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.2; margin: 0 0 14px; letter-spacing: -.5px; }
.hero-text p { color: var(--muted); margin: 0 0 22px; max-width: 60ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, filter .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--brand); color: #041b19; }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--text); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.hero-art { display: grid; gap: 12px; }
.hero-art img { width: 100%; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stats { display: flex; gap: 28px; margin: 28px 0 0; padding: 0; }
.stats dt { font-size: 24px; font-weight: 700; }
.stats dd { margin: 0; font-size: 12px; color: var(--muted); }

/* sections */
.section { padding: 46px 0; }
.section.alt { background: var(--bg-soft); border-block: 1px solid var(--line); }
h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin: 0 0 8px; }
h2 .ic { color: var(--brand); width: 22px; height: 22px; }
h3.sub { font-size: 16px; margin: 30px 0 10px; }
.lead { color: var(--muted); margin: 0 0 20px; max-width: 78ch; }

.grid { display: grid; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; box-shadow: var(--shadow);
}
.grid.steps { grid-template-columns: repeat(3, 1fr); }
.step {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; margin-bottom: 8px;
}
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

/* callout */
.callout {
  margin-top: 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 12px; padding: 14px 16px;
}
.callout-body { display: grid; gap: 2px; font-size: 14px; }
.callout-body span { color: var(--muted); }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--bg-soft); color: var(--text);
}
.pill:hover { text-decoration: none; border-color: var(--brand); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 220px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.search .ic { color: var(--muted); }
.search input, .search.wide input {
  flex: 1; border: 0; outline: 0; background: transparent; color: var(--text);
  height: 40px; font-size: 14px; font-family: inherit;
}
.search.wide { max-width: 420px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #041b19; font-weight: 600; }

/* list items */
.grid.list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.item { display: flex; flex-direction: column; gap: 10px; }
.item .name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.tag { font-size: 11px; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 2px 7px; font-weight: 600; }
.item .url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--muted); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all;
}
.item .row { display: flex; gap: 8px; margin-top: auto; }
.copy-btn, .open-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-family: inherit;
  border-radius: 8px; padding: 7px 12px; cursor: pointer; border: 1px solid var(--line);
  background: var(--card); color: var(--text);
}
.copy-btn:hover, .open-btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.copy-btn.done { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* tabs + table */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.tab.active { background: var(--brand); border-color: var(--brand); color: #041b19; font-weight: 600; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--bg-soft); font-size: 12px; color: var(--muted); font-weight: 600; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
td.url-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--muted); }
td .copy-btn { padding: 4px 10px; font-size: 12px; }

/* players / kodi / resources */
.grid.players { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.kodi { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.resources { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card h4 { margin: 0 0 8px; font-size: 14px; }
.plat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plat-list li { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.plat-list a { color: var(--text); }
.kodi-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.kodi-list li { border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.kodi-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.kodi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kodi-count { font-size: 12px; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 2px 8px; }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.res-list li { font-size: 13px; }
.res-list .desc { display: block; color: var(--muted); font-size: 12px; }
.res-list .row { display: flex; gap: 6px; margin-top: 6px; }
.mini-copy {
  font-size: 12px; font-family: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--muted); border-radius: 6px; padding: 3px 9px;
}
.mini-copy:hover { color: var(--brand); border-color: var(--brand); }
.mini-copy.done { color: var(--brand); background: var(--brand-soft); }

.steps-ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 8px; }
.steps-ol b { color: var(--text); }

/* docs */
.grid.docs { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card.doc { display: block; color: var(--text); transition: transform .12s ease, border-color .12s ease; }
.card.doc:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--brand); }
.card.doc h3 { font-size: 15px; }
.more { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--brand); }
.note { margin-top: 22px; font-size: 13px; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 24px; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 26px 0 40px; }
.footer p { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.footer .muted { color: var(--muted); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { grid-template-columns: 1fr 1fr; }
  .grid.steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .nav { display: none; }
  .hero-art { display: none; }
  .stats { gap: 18px; }
}
