:root {
  --bg: #0B0B0F;
  --card: #141414;
  --line: #2B2B2B;
  --txt: #FFFFFF;
  --dim: #8C8C8C;
  --red: #E50914;
  --red-deep: #7A0C12;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 16px/1.75 system-ui, 'Segoe UI', Tahoma, sans-serif;
  min-height: 100vh;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
.en { color: var(--dim); font-size: 14px; }
img { max-width: 100%; }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px;
  padding: 12px 28px;
  background: rgba(11,11,15,.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
nav .brand { display: flex; align-items: center; gap: 9px; color: var(--txt); font-weight: 900; font-size: 22px; letter-spacing: .5px; }
nav .brand svg { width: 30px; height: 30px; }
nav .links { display: flex; gap: 20px; margin-inline-start: auto; }
nav .links a { color: var(--dim); font-size: 15px; font-weight: 600; }
nav .links a:hover { color: var(--txt); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 72px 24px 56px;
  background:
    radial-gradient(700px 340px at 50% -80px, rgba(229,9,20,.22), transparent 70%),
    var(--bg);
}
.hero .mark { width: 150px; height: 150px; filter: drop-shadow(0 0 34px rgba(229,9,20,.45)); }
.hero h1 { font-size: 46px; font-weight: 900; letter-spacing: 1px; margin: 14px 0 4px; }
.hero .tag { font-size: 20px; max-width: 640px; margin: 8px auto 0; color: #E8E8E8; }
.hero .tag-en { margin-top: 6px; }
.cta { display: flex; gap: 14px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-block; border: none; border-radius: 8px; cursor: pointer;
  padding: 14px 38px; font-size: 17px; font-weight: 800; font-family: inherit;
  background: var(--red); color: #fff;
}
.btn:hover { background: #FF1F2A; text-decoration: none; }
.btn.ghost { background: rgba(109,109,110,.5); color: #fff; }
.btn.ghost:hover { background: rgba(109,109,110,.75); }

/* ---------- sections ---------- */
section { padding: 44px 28px; max-width: 1080px; margin: 0 auto; }
section h2 { font-size: 27px; font-weight: 800; margin-bottom: 8px; }
section .sub-en { margin-bottom: 26px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.fcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 18px;
}
.fcard svg { width: 30px; height: 30px; stroke: var(--red); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fcard h3 { font-size: 17px; margin: 12px 0 4px; }
.fcard p { color: var(--dim); font-size: 14px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--red-deep);
  color: #fff; font-weight: 800; font-size: 15px;
}
.step h3 { font-size: 16px; margin: 10px 0 4px; }
.step p { color: var(--dim); font-size: 14px; }

.prose { max-width: 780px; }
.prose p { color: #C9C9C9; font-size: 15px; margin-bottom: 14px; }
.prose .en { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- ad slots (filled from the ADS object in app.js) ---------- */
.ad-slot { min-height: 0; text-align: center; }
.ad-slot:not(:empty) { min-height: 90px; padding: 10px 0; }
#gateUnit { display: flex; align-items: center; justify-content: center; min-height: 250px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 30px 28px 40px; color: var(--dim); font-size: 14px;
}
footer .inner { max-width: 1080px; margin: 0 auto; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
footer .links { display: flex; gap: 16px; margin-inline-start: auto; }

/* ---------- download cards ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.dl-card {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 20px; display: flex; flex-direction: column; gap: 10px;
}
.dl-card.recommended { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 26px rgba(229,9,20,.15); }
.dl-card .badge {
  position: absolute; top: -11px; inset-inline-start: 18px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 800;
  padding: 2px 12px; border-radius: 20px;
}
.dl-card .os { display: flex; align-items: center; gap: 10px; }
.dl-card .os svg { width: 26px; height: 26px; stroke: var(--red); fill: none; stroke-width: 1.8; }
.dl-card h3 { font-size: 18px; }
.dl-card .meta { color: var(--dim); font-size: 13.5px; }
.dl-card .sha {
  font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: #6E6E6E;
  word-break: break-all; line-height: 1.5;
}
.dl-card .btn { text-align: center; margin-top: auto; }
.dl-card .btn[href="#"], .dl-card .btn:not([href]) {
  background: rgba(109,109,110,.4); color: #CFCFCF; cursor: pointer;
}
.dl-card .btn.ready { background: var(--red); color: #fff; }
.dl-note { color: var(--dim); font-size: 14px; margin-top: 22px; }
.dl-note code { background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; }

/* ---------- download gate overlay ---------- */
#gate {
  position: fixed; inset: 0; z-index: 80; background: rgba(3,3,5,.96);
  display: flex; align-items: center; justify-content: center;
}
#gate.hidden { display: none; }
.gate-inner {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  max-width: 82vw; max-height: 86vh; text-align: center;
}
#gateCount {
  position: fixed; top: 26px; inset-inline-start: 26px; width: 72px; height: 72px;
  border: 2px solid #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 29px; font-weight: 800; color: #fff; background: rgba(0,0,0,.35);
}
#gateHouse { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#gateHouse svg { width: 130px; height: 130px; filter: drop-shadow(0 0 22px rgba(229,9,20,.4)); }
#gateCaption { color: #EDEDED; font-size: 19px; font-weight: 700; }
#gateSub { color: var(--dim); font-size: 14px; }
#gateCancel {
  position: fixed; top: 26px; inset-inline-end: 26px;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(0,0,0,.4); color: #CFCFCF; font-size: 22px; line-height: 1;
  cursor: pointer;
}
#gateCancel:hover { color: #fff; border-color: #fff; }
#gateDone { color: #7EE787; font-weight: 800; font-size: 18px; }
#gateDone.hidden { display: none; }

@media (max-width: 640px) {
  .hero h1 { font-size: 34px; }
  .hero .mark { width: 110px; height: 110px; }
  nav { padding: 10px 16px; gap: 12px; }
  nav .links { gap: 12px; }
}
