:root {
  --bg: #070b14;
  --surface: #0e1525;
  --surface-2: #141e33;
  --border: rgba(148, 163, 184, 0.14);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.14);
  --red: #f43f5e;
  --red-bg: rgba(244, 63, 94, 0.14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 15% 0%, rgba(56, 189, 248, 0.11), transparent 36%),
              radial-gradient(circle at 85% 10%, rgba(129, 140, 248, 0.11), transparent 34%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1220px; margin: 0 auto; padding: 0 20px; }

/* Header */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 16px; padding: 8px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; letter-spacing: 0.3px;
  white-space: nowrap; flex-shrink: 0;
}
.brand-badge {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 800; color: #050811;
}
.nav-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  white-space: nowrap; transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
  white-space: nowrap; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: all 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff; box-shadow: 0 8px 24px rgba(14, 165, 233, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.lang-btn {
  padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  white-space: nowrap; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent); cursor: pointer;
}
.lang-btn:hover { border-color: var(--accent); background: rgba(56, 189, 248, 0.12); }

/* Hero */
.hero { padding: 54px 0 36px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 0.9fr; gap: 28px; align-items: stretch; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(56, 189, 248, 0.12); color: var(--accent); border: 1px solid rgba(56, 189, 248, 0.24);
}
h1 { margin: 14px 0 12px; font-size: 38px; line-height: 1.2; letter-spacing: -0.5px; }
.hero-sub { color: var(--muted); font-size: 15.5px; margin: 0 0 24px; max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--muted); }

.status-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
}
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-val { font-size: 19px; font-weight: 700; margin-top: 2px; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* Sections */
.section { padding: 34px 0; scroll-margin-top: 76px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 24px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }

/* Controls & Table */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding: 14px 16px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border);
}
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
label.inline { font-size: 13px; color: var(--muted); font-weight: 500; }
input[type="number"], input[type="text"], select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 13.5px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.chip {
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; cursor: pointer;
}
.chip.active, .chip:hover { border-color: var(--accent); color: var(--text); background: rgba(56, 189, 248, 0.1); }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 13.5px; }
thead th {
  text-align: left; padding: 12px 14px; background: var(--surface-2);
  color: var(--muted); font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(148, 163, 184, 0.08); }
tbody tr:hover { background: rgba(56, 189, 248, 0.04); }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: rgba(56, 189, 248, 0.14); color: var(--accent); }
.tag-amber { background: var(--amber-bg); color: var(--amber); }

.alert-banner {
  margin-top: 14px; padding: 12px 16px; border-radius: 10px;
  background: var(--amber-bg); border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a; font-size: 13.5px;
}

/* Custom Calculator */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select { width: 100%; }
.result-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* Guide & Whitelist */
.steps-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.step-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.step-num {
  display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center;
  border-radius: 8px; background: rgba(56, 189, 248, 0.16); color: var(--accent); font-weight: 700; margin-right: 8px;
}
.code-box {
  margin-top: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; font-family: Consolas, monospace; font-size: 12.5px; color: #bae6fd;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; overflow-x: auto;
}

.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; margin-bottom: 4px; }
.faq-a { color: var(--muted); font-size: 13.5px; margin: 0; }

footer { padding: 28px 0 46px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; text-align: center; margin-top: 30px; }

.dl-dropdown { position: relative; display: inline-block; }
.dl-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 245px; z-index: 80;
  background: var(--surface); border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px; padding: 6px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  display: none; flex-direction: column; gap: 4px;
}
.dl-menu-left { right: auto; left: 0; }
.dl-dropdown.open .dl-menu { display: flex; }
.dl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--text); font-size: 13px; font-weight: 500; transition: background 0.15s;
}
.dl-item:hover { background: rgba(56, 189, 248, 0.14); color: var(--accent); }
.dl-item small { color: var(--muted); font-size: 11px; }
.dl-sep { height: 1px; background: var(--border); margin: 3px 4px; }
.dl-item-linux { color: var(--accent); }

.tui-preview {
  margin-top: 12px;
  padding: 14px 16px;
  background: #04070d;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  font-family: Consolas, "Cascadia Mono", "DejaVu Sans Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  overflow-x: auto;
  white-space: pre;
}

/* Promo Video Section */
.promo-section { padding: 10px 0 30px; }
.promo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}
.promo-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #04070d;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.promo-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #04070d;
}
.promo-info { display: flex; flex-direction: column; gap: 12px; }
.promo-info .pill { align-self: flex-start; }
.promo-info h2 { margin: 0; font-size: 23px; line-height: 1.3; }
.promo-desc { margin: 0; color: var(--muted); font-size: 14px; }
.promo-list {
  margin: 2px 0 4px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.promo-list strong { color: var(--text); }
.promo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

@media (max-width: 960px) {
  .nav-inner {
    flex-wrap: wrap;
    padding: 10px 0 0;
    gap: 0;
  }
  .brand {
    order: 1;
    font-size: 15.5px;
  }
  .nav-actions {
    order: 2;
    gap: 6px;
  }
  .nav-actions .btn {
    padding: 7px 11px;
    font-size: 12.5px;
  }
  .nav-actions .lang-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .nav-links {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 10px;
    padding: 8px 0 10px;
    border-top: 1px solid var(--border);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    flex-shrink: 0;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
  }
  .section { scroll-margin-top: 118px; }
  .hero-grid, .promo-grid, .calc-grid, .steps-grid { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
}

@media (max-width: 520px) {
  .container { padding: 0 14px; }
  .brand { font-size: 14.5px; gap: 8px; }
  .brand-badge { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
  .hero { padding: 28px 0 24px; }
  h1 { font-size: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .dl-menu { min-width: 185px; max-width: calc(100vw - 28px); }
}
