/* ClashLab — shared styles */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --border: #e3e8ef;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8492a6;
  --brand: #2563eb;
  --brand-2: #3b82f6;
  --brand-soft: #e8f0fe;
  --ok: #16a34a;
  --ok-soft: #e7f7ed;
  --warn: #b45309;
  --warn-soft: #fff6e5;
  --muted-soft: #eef1f5;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --hero-1: #0b1220;
  --hero-2: #111c33;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 24px rgba(15, 23, 42, .06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --header-h: 60px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #2563eb, #7c3aed); display: grid; place-items: center; color: #fff; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--text-2); font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--brand-soft); }
.nav-toggle { display: none; margin-left: auto; width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; cursor: pointer; place-items: center; color: var(--text); }

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px 14px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; }
}

/* ---------- Buttons / badges ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .3); }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: #e7ecf3; }
.btn-dark-ghost { background: rgba(255, 255, 255, .07); color: #e2e8f0; border-color: rgba(255, 255, 255, .14); }
.btn-dark-ghost:hover { background: rgba(255, 255, 255, .13); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: var(--muted-soft); color: var(--text-2); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.tag { display: inline-block; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Hero (dark) ---------- */
.hero-dark {
  position: relative; overflow: hidden;
  background: radial-gradient(1000px 420px at 85% -10%, rgba(59, 130, 246, .28), transparent 60%),
              radial-gradient(700px 360px at 0% 110%, rgba(124, 58, 237, .2), transparent 60%),
              linear-gradient(180deg, var(--hero-1), var(--hero-2));
  color: #e2e8f0;
  padding: 72px 0 56px;
}
.hero-dark::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
  pointer-events: none;
}
.hero-dark .container { position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #93c5fd; background: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .3); padding: 5px 12px; border-radius: 999px; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, .25); }
.hero-dark h1 { font-size: clamp(32px, 5vw, 50px); font-weight: 800; color: #fff; margin: 20px 0 10px; }
.hero-dark h1 .hl { background: linear-gradient(90deg, #60a5fa, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 14px; letter-spacing: .2em; color: #94a3b8; }
.hero-desc { max-width: 640px; color: #cbd5e1; margin-top: 18px; font-size: 15.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 44px; margin-top: 40px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .08); }
.hero-stats strong { display: block; font-size: 24px; color: #fff; font-weight: 800; }
.hero-stats span { font-size: 12.5px; color: #94a3b8; }

/* ---------- Hero (light, centered) ---------- */
.hero-light { padding: 80px 0 64px; text-align: center; background: radial-gradient(800px 360px at 50% -20%, rgba(37, 99, 235, .1), transparent 70%), var(--surface); border-bottom: 1px solid var(--border); }
.hero-light .pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; }
.hero-light h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 800; margin: 22px auto 0; max-width: 760px; }
.hero-light p.lead { max-width: 640px; margin: 18px auto 0; color: var(--text-2); font-size: 16px; }
.hero-light .hero-actions { justify-content: center; }
.hero-note { display: block; max-width: 640px; margin: 26px auto 0; font-size: 13px; color: var(--text-3); }
.hero-note svg { display: inline-block; vertical-align: -3px; margin-right: 6px; }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; }
section.block.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-kicker { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; color: var(--brand); margin-bottom: 10px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; }
.section-head p { color: var(--text-2); margin-top: 12px; }

/* Quick steps */
.quick-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: q; }
.quick-step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 18px; text-align: center; box-shadow: var(--shadow); }
.quick-step .num { width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%; background: var(--text); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.quick-step h3 { font-size: 15.5px; margin-bottom: 6px; }
.quick-step p { font-size: 13.5px; color: var(--text-2); }
@media (max-width: 980px) { .quick-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .quick-steps { grid-template-columns: 1fr; } }

/* Callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.callout svg { flex: none; margin-top: 3px; }
.callout-info { background: #eef4ff; border-color: #cfe0ff; color: #1e3a8a; }
.callout-warn { background: var(--warn-soft); border-color: #fbe0b0; color: #7c4a03; }
.callout-ok { background: var(--ok-soft); border-color: #c4ebd2; color: #14532d; }
.callout + .callout { margin-top: 10px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 32px; }
.tab-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; }
.tab-btn:hover { color: var(--text); border-color: #cbd5e1; }
.tab-btn[aria-selected="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.tab-panel[hidden] { display: none; }

/* Platform layout */
.platform-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 960px) { .platform-grid { grid-template-columns: minmax(0, 1fr); } }
.panel-title { font-size: 21px; font-weight: 800; margin-bottom: 20px; }

.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps > li { position: relative; padding: 0 0 26px 54px; }
.steps > li::before { content: ""; position: absolute; left: 16px; top: 36px; bottom: 0; width: 2px; background: var(--border); }
.steps > li:last-child::before { display: none; }
.steps .num { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.steps h4 { font-size: 16px; margin: 5px 0 6px; }
.steps p { color: var(--text-2); font-size: 14.5px; }
.steps ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14.5px; }
.steps .callout, .steps pre { margin-top: 12px; }

.side-card { position: sticky; top: calc(var(--header-h) + 20px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.side-card .label { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--text-3); }
.side-card h3 { font-size: 20px; margin: 8px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.side-card p { font-size: 14px; color: var(--text-2); margin-bottom: 14px; }
.side-card .tags { margin-bottom: 18px; }
.side-card .btn { width: 100%; justify-content: center; }
.side-card .btn + .btn { margin-top: 8px; }
.side-card .hint { font-size: 12.5px; color: var(--text-3); margin-top: 12px; text-align: center; }
.app-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 17px; flex: none; }

/* iOS app cards */
.app-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .app-cards { grid-template-columns: 1fr; } }
.app-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.app-card .head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.app-card h4 { font-size: 17px; }
.app-card .price { font-size: 13px; color: var(--text-3); }
.app-card p { font-size: 14px; color: var(--text-2); margin-bottom: 14px; flex: 1; }

/* Code */
pre.code { position: relative; margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.65; }
pre.code code { background: none; border: 0; padding: 0; border-radius: 0; color: inherit; font-size: inherit; }
pre.code .c { color: #64748b; }
pre.code .k { color: #93c5fd; }
pre.code .s { color: #86efac; }
.code-window { background: var(--code-bg); border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px rgba(15, 23, 42, .18); }
.code-window .bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: #0b1220; border-bottom: 1px solid #1e293b; }
.code-window .bar i { width: 11px; height: 11px; border-radius: 50%; background: #334155; }
.code-window .bar i:nth-child(1) { background: #f87171; }
.code-window .bar i:nth-child(2) { background: #fbbf24; }
.code-window .bar i:nth-child(3) { background: #34d399; }
.code-window .bar span { margin-left: 8px; font-family: var(--mono); font-size: 12.5px; color: #94a3b8; }
.code-window pre.code { border-radius: 0; padding: 20px 22px; font-size: 13.2px; }
.copy-btn { position: absolute; top: 8px; right: 8px; font: 600 12px var(--font); color: #cbd5e1; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; padding: 4px 10px; cursor: pointer; opacity: 0; transition: opacity .15s; }
pre.code:hover .copy-btn, .copy-btn:focus { opacity: 1; }
@media (hover: none) { .copy-btn { opacity: 1; } }
.code-label { font-size: 13.5px; font-weight: 600; color: var(--text); margin-top: 12px; }

/* Config */
.config-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: start; }
@media (max-width: 960px) { .config-grid { grid-template-columns: minmax(0, 1fr); } }
.field-list { display: grid; gap: 12px; }
.field { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.field code { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 600; }
.field h4 { display: inline; font-size: 15px; margin-left: 8px; }
.field p { font-size: 14px; color: var(--text-2); margin-top: 6px; }

/* Tips grid */
.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 760px) { .tips { grid-template-columns: 1fr; } }
.tips .callout { margin: 0; }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 980px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.feature .ico { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 16px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature > p { font-size: 14px; color: var(--text-2); }
.feature ul { margin: 12px 0 16px; padding-left: 18px; font-size: 13.8px; color: var(--text-2); flex: 1; }
.feature li + li { margin-top: 4px; }

/* FAQ */
.faq { max-width: 860px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 17px 52px 17px 20px; font-weight: 600; font-size: 15.5px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details[open] summary { color: var(--brand); }
.faq .answer { padding: 0 20px 18px; color: var(--text-2); font-size: 14.5px; }
.faq .answer p + p, .faq .answer p + ul, .faq .answer ul + p { margin-top: 8px; }
.faq .answer ul { margin: 8px 0 0; padding-left: 20px; }
.faq .answer li + li { margin-top: 4px; }

/* CTA */
.cta { background: linear-gradient(135deg, #1e3a8a, #4c1d95); border-radius: 20px; padding: 48px 32px; text-align: center; color: #e0e7ff; }
.cta h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); }
.cta p { margin: 12px auto 24px; max-width: 560px; }
.cta .btn-primary { background: #fff; color: #1e3a8a; box-shadow: none; }

/* ---------- Comparison table ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.table-hint { display: none; text-align: center; font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
@media (max-width: 860px) { .table-hint { display: block; } }
table.compare { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
table.compare caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
table.compare thead th { background: var(--hero-1); color: #cbd5e1; font-size: 12.5px; font-weight: 600; text-align: left; padding: 14px 16px; white-space: nowrap; }
table.compare td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
table.compare tbody tr:hover td { background: #fafbfd; }
table.compare tr.group td { background: var(--surface-2); font-size: 12.5px; font-weight: 700; letter-spacing: .05em; color: var(--text-3); padding: 9px 16px; }
table.compare .name { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
table.compare .name .app-icon { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
table.compare a.repo { font-size: 12.5px; font-weight: 500; }
.plats { display: flex; gap: 5px; }
.plat { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); }
.plat svg { width: 14px; height: 14px; }

/* ---------- Chooser ---------- */
.chooser { display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--hero-1); border-radius: 20px; overflow: hidden; color: #e2e8f0; box-shadow: 0 24px 60px rgba(15, 23, 42, .2); }
@media (max-width: 860px) { .chooser { grid-template-columns: 1fr; } }
.chooser-nav { padding: 22px 14px; border-right: 1px solid #1e293b; background: #0d1628; }
.chooser-nav .label { font-size: 12px; font-weight: 700; color: #64748b; padding: 0 10px 10px; letter-spacing: .06em; }
.chooser-nav [role=tablist] { display: flex; flex-direction: column; gap: 4px; }
.chooser-nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: #94a3b8; font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.chooser-nav button svg { width: 16px; height: 16px; }
.chooser-nav button:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.chooser-nav button[aria-selected="true"] { background: rgba(59, 130, 246, .16); color: #fff; }
@media (max-width: 860px) {
  .chooser-nav { border-right: 0; border-bottom: 1px solid #1e293b; }
  .chooser-nav [role=tablist] { flex-direction: row; overflow-x: auto; }
  .chooser-nav button { width: auto; white-space: nowrap; }
}
.chooser-body { padding: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .chooser-body { grid-template-columns: 1fr; padding: 20px; } }
.chooser-col h3 { font-size: 15px; color: #fff; margin-bottom: 4px; }
.chooser-col .sub { font-size: 12.5px; color: #64748b; font-weight: 600; letter-spacing: .05em; margin-bottom: 14px; }
.pick { background: rgba(255, 255, 255, .04); border: 1px solid #1e293b; border-radius: 14px; padding: 18px; }
.pick + .pick { margin-top: 12px; }
.pick.primary { background: linear-gradient(160deg, rgba(37, 99, 235, .22), rgba(124, 58, 237, .12)); border-color: rgba(96, 165, 250, .35); }
.pick .top { display: flex; align-items: center; gap: 12px; }
.pick .top .app-icon { width: 40px; height: 40px; }
.pick h4 { color: #fff; font-size: 16px; }
.pick .feat { font-size: 12.5px; color: #93c5fd; }
.pick p { font-size: 13.8px; color: #cbd5e1; margin-top: 10px; }
.pick .btn { margin-top: 14px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--hero-1); color: #94a3b8; padding: 56px 0 28px; margin-top: 0; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer .logo { color: #fff; margin-bottom: 14px; }
.site-footer h4 { color: #e2e8f0; font-size: 14px; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #fff; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid #1e293b; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; color: #64748b; }

/* Back to top */
.to-top { position: fixed; right: 20px; bottom: 20px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.to-top.show { opacity: 1; pointer-events: auto; }

@media (max-width: 640px) {
  section.block { padding: 52px 0; }
  .hero-dark { padding: 52px 0 40px; }
  .hero-light { padding: 56px 0 48px; }
  .hero-stats { gap: 24px 32px; }
  .container { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Home ---------- */
.hero-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
@media (max-width: 960px) { .hero-split { grid-template-columns: minmax(0, 1fr); } .hero-split .code-window { display: none; } }
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: 13px; color: #94a3b8; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { color: #34d399; }

.platform-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 980px) { .platform-picker { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .platform-picker { grid-template-columns: repeat(2, 1fr); } }
.pp-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); color: var(--text); transition: transform .15s, border-color .15s; }
.pp-card:hover { text-decoration: none; transform: translateY(-2px); border-color: #bfd3fb; }
.pp-card .pp-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; color: var(--text); margin-bottom: 6px; }
.pp-card .pp-ico svg { width: 20px; height: 20px; }
.pp-card strong { font-size: 16px; }
.pp-card span { font-size: 13px; color: var(--text-2); }
.pp-card em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--brand); margin-top: 4px; }

.proto-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 980px) { .proto-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .proto-grid { grid-template-columns: 1fr; } }
.proto { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.proto h4 { font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.proto p { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }
.checklist { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 28px; color: var(--text-2); }
.checklist li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.split h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; }
.split > div > p { color: var(--text-2); margin-top: 12px; }

/* ---------- Download center ---------- */
.dl-section + .dl-section { margin-top: 56px; }
.dl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.dl-head h2 { font-size: 22px; font-weight: 800; }
.dl-head span { font-size: 13px; color: var(--text-3); }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .dl-grid { grid-template-columns: minmax(0, 1fr); } }
.dl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.dl-card.featured { border-color: #bfd3fb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08), var(--shadow); }
.dl-card.legacy { background: #fbfcfd; box-shadow: none; }
.dl-card .head { display: flex; align-items: center; gap: 12px; }
.dl-card .head h3 { font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dl-card > p { font-size: 14px; color: var(--text-2); margin: 12px 0 14px; }
.dl-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 13.5px; }
.dl-meta dt { color: var(--text-3); white-space: nowrap; }
.dl-meta dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.dl-meta dd a { color: var(--text-2); }
.dl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.dl-actions .btn { padding: 9px 16px; font-size: 13.5px; }
.ver { font-family: var(--mono); font-size: 13px; }
.ver.loading { color: var(--text-3); }
.dl-note { font-size: 12.5px; color: var(--text-3); margin-top: 10px; }
.legacy-list { display: grid; gap: 8px; }
.legacy-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; font-size: 14px; color: var(--text-2); }
.legacy-item strong { color: var(--text); }
.legacy-item .grow { flex: 1; min-width: 200px; }

/* ---------- Language switcher ---------- */
.lang-switch { position: relative; margin-left: 8px; }
.lang-switch summary { list-style: none; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { color: var(--text); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; z-index: 60; }
.lang-menu a { padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.lang-menu a:hover { background: var(--surface-2); text-decoration: none; }
.lang-menu a[aria-current] { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
@media (max-width: 860px) {
  .lang-switch { margin-left: auto; }
  .lang-switch summary span { display: none; }
  .nav-toggle { margin-left: 8px; }
}

/* Korean wraps at spaces, not mid-word */
html:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }

/* ---------- Provider recommendations ---------- */
.disclosure { max-width: 860px; margin: 0 auto; }
.ap-list { display: grid; gap: 16px; }
.ap-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 22px 74px; box-shadow: var(--shadow); }
.ap-card:first-child { border-color: #bfd3fb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08), var(--shadow); }
.ap-rank { position: absolute; left: 22px; top: 22px; width: 36px; height: 36px; border-radius: 10px; background: var(--text); color: #fff; font-weight: 800; display: grid; place-items: center; }
.ap-card:first-child .ap-rank { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.ap-card .head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ap-card h3 { font-size: 19px; }
.ap-reason { color: var(--text); font-size: 15px; margin: 10px 0 14px; }
.ap-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; }
.ap-body .dl-meta { margin: 0; }
.ap-body .btn { white-space: nowrap; }
@media (max-width: 700px) {
  .ap-card { padding: 20px; }
  .ap-rank { position: static; margin-bottom: 12px; }
  .ap-body { grid-template-columns: minmax(0, 1fr); }
}
.ap-empty { text-align: center; background: var(--surface); border: 1px dashed #cbd5e1; border-radius: var(--radius); padding: 40px 24px; color: var(--text-2); }
.ap-empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.updated { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 14px; }
table.compare.narrow { min-width: 720px; }
.redflags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .redflags { grid-template-columns: minmax(0, 1fr); } }
.redflags .callout { margin: 0; }
.ap-tests { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.ap-tests-title { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--text-3); margin-bottom: 10px; }
.ap-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 600px) { .ap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ap-stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.ap-stats span { display: block; font-size: 12px; color: var(--text-3); }
.ap-stats strong { font-size: 16px; }
.ap-tests .dl-meta { margin-bottom: 8px; }
.ap-src { font-size: 12.5px; color: var(--text-3); }
.ap-score { margin-left: auto; display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 12px; border-radius: 999px; background: #fff7e6; border: 1px solid #fde1a8; color: #92400e; white-space: nowrap; }
.ap-score strong { font-size: 18px; color: #b45309; }
.ap-score small { font-size: 12px; }
@media (max-width: 700px) { .ap-score { margin-left: 0; } }

/* ---------- Homepage provider picks ---------- */
.hp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .hp-grid { grid-template-columns: minmax(0, 1fr); } }
.hp-card { position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.hp-card:first-child { border-color: #bfd3fb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08), var(--shadow); }
.hp-top { display: flex; align-items: center; gap: 10px; }
.hp-top h3 { font-size: 17px; min-width: 0; }
.hp-top .app-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 15px; }
.hp-rank { position: absolute; top: -10px; left: -10px; width: 26px; height: 26px; border-radius: 50%; background: var(--text); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; box-shadow: var(--shadow); }
.hp-card:first-child .hp-rank { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.hp-score { margin-left: auto; white-space: nowrap; font-size: 12px; color: #92400e; background: #fff7e6; border: 1px solid #fde1a8; border-radius: 999px; padding: 2px 10px; }
.hp-score strong { font-size: 16px; color: #b45309; }
.hp-price { font-size: 15px; font-weight: 700; }
.hp-price span { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.hp-facts { font-size: 13px; color: var(--text-2); }
.hp-coupon { font-size: 13px; color: var(--text-2); background: var(--ok-soft); border-radius: 8px; padding: 6px 10px; }
.hp-coupon strong { color: var(--ok); }
.hp-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.hp-actions .btn { flex: 1; justify-content: center; }
.hp-more { text-align: center; margin-top: 24px; font-weight: 600; }

/* Clash cat logo */
img.logo-mark { width: 30px; height: 30px; background: none; border-radius: 0; object-fit: contain; }
.site-footer img.logo-mark { background: #fff; border-radius: 8px; padding: 3px; box-sizing: border-box; }

/* ---------- Provider card v2 ---------- */
.ap-card { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; padding: 24px; }
.ap-card .head { gap: 8px 12px; }
.ap-card .head .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-icon { position: relative; flex: none; }
.ap-icon .app-icon { width: 44px; height: 44px; border-radius: 12px; }
.ap-icon .rank { position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.ap-card:first-child .ap-icon .rank, .hp-card:first-child .ap-icon .rank { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.ap-reason { margin: 12px 0 16px; }
.ap-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0; font-size: 14px; }
.ap-specs div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
.ap-specs div.wide { grid-column: 1 / -1; }
.ap-specs dt { color: var(--text-3); }
.ap-specs dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.ap-tests .dl-meta { grid-template-columns: 84px minmax(0, 1fr); gap: 6px 10px; }
.ap-side { display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; align-self: start; position: sticky; top: calc(var(--header-h) + 16px); }
.ap-side > div span { display: block; font-size: 12.5px; color: var(--text-3); }
.ap-side-score strong { font-size: 32px; font-weight: 800; color: #b45309; line-height: 1.1; }
.ap-side-score small { font-size: 13px; color: var(--text-3); margin-left: 4px; }
.ap-side-price strong { font-size: 16px; }
.ap-side-coupon { background: var(--ok-soft); border: 1px dashed #86d6a4; border-radius: 8px; padding: 8px 10px; }
.ap-side-coupon strong { color: var(--ok); font-size: 14px; }
.ap-side .btn { justify-content: center; }
.ap-side-review { text-align: center; font-size: 13.5px; font-weight: 600; }
@media (max-width: 900px) {
  .ap-card { grid-template-columns: minmax(0, 1fr); }
  .ap-side { position: static; }
}
@media (max-width: 600px) {
  .ap-specs { grid-template-columns: minmax(0, 1fr); }
  .ap-specs div, .ap-tests .dl-meta { grid-template-columns: 76px minmax(0, 1fr); }
}
.ap-rank, .hp-rank { display: none; }
.hp-top .ap-icon .app-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 15px; }

/* ---------- Hero stats: even columns ---------- */
.hero-stats { display: grid; grid-template-columns: repeat(4, max-content); gap: 18px 48px; }
@media (max-width: 640px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; } }
.ap-icon .rank { width: 18px; height: 18px; top: -6px; left: -6px; font-size: 11px; }
.hp-coupon.none { background: var(--surface-2); color: var(--text-3); }
.ap-side-coupon strong { display: block; font-size: 17px; letter-spacing: .03em; font-family: var(--mono); }
.ap-side-coupon em { display: block; font-style: normal; font-size: 12.5px; color: var(--text-2); }
.hp-coupon strong { font-family: var(--mono); letter-spacing: .03em; }
.hp-coupon span { display: block; font-size: 12px; color: var(--text-3); }
@media (max-width: 640px) {
  .hero-dark .hero-actions .btn { flex: 1 1 0; justify-content: center; padding-left: 12px; padding-right: 12px; }
  .hero-dark .hero-actions .btn-primary { flex-basis: 100%; }
}
