:root {
  --bg: #0f1117;
  --bg-elev: #12151e;
  --card: #1a1d27;
  --border: #2a2d3a;
  --text: #e4e4e7;
  --text-dim: #8b8d97;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --success: #22c55e;
  --warn: #f59e0b;
  --radius: 12px;
  --mono: "SF Mono", "Cascadia Code", Consolas, "JetBrains Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --product-a: #6366f1;
  --product-b: #8b5cf6;
  --product-c: #06b6d4;
  --product-d: #22c55e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(15, 17, 23, 0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--product-b));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
}
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }

.nav-ext {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--text) !important;
}
.nav-ext:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Hero */
.hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(700px 360px at 88% 0%, rgba(139, 92, 246, 0.10), transparent 50%),
    var(--bg);
}

.eyebrow {
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.tagline {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 40em;
}

/* Sections */
.section { padding: 48px 0; }
.section.muted {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 48px;
}

.section-head { margin-bottom: 24px; }
.section-head h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.section-head p { color: var(--text-dim); font-size: 15px; }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
}

.product-card:hover {
  text-decoration: none;
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

.product-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}

.product-icon.controlcommand { background: linear-gradient(135deg, var(--product-a), var(--product-b)); }
.product-icon.e-player { background: linear-gradient(135deg, var(--product-a), var(--product-c)); }
.product-icon.winpilot { background: linear-gradient(135deg, var(--product-c), var(--product-d)); }
.product-icon.netcontrol { background: linear-gradient(135deg, var(--product-d), var(--product-a)); }

.product-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.product-cat {
  font-size: 12px;
  color: var(--text-dim);
}

.product-tagline {
  font-size: 15px;
  font-weight: 600;
}

.product-desc {
  color: var(--text-dim);
  font-size: 13.5px;
  flex: 1;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pill {
  font-size: 11px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--text-dim);
}

.pill.ok {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.product-cta {
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn .chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 6px;
}
.btn-ghost .chip {
  background: var(--bg-elev);
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* Product detail */
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.hero-inner .detail-hero {
  width: 100%;
}

.hero-copy { min-width: 0; }

.side-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}

.release-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.release-card.latest {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12), 0 18px 50px rgba(99, 102, 241, 0.12);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), transparent 42%), var(--card);
}

.release-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.release-version {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
}
.badge-latest { background: var(--accent); color: #fff; }
.badge-stable {
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.release-date {
  margin-left: auto;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 13px;
}

.notes {
  margin: 12px 0 18px;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 14px;
}
.notes li { margin-bottom: 6px; }

.feature-list {
  list-style: none;
  display: grid;
  gap: 8px;
}
.feature-list li {
  color: var(--text-dim);
  font-size: 14px;
  padding-left: 18px;
  position: relative;
}
.feature-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent-hover);
}

.file-list { display: grid; gap: 10px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.file-info { min-width: 0; flex: 1; }

.file-name {
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 2px;
}

.file-dl { flex-shrink: 0; }

.history-list { display: grid; gap: 12px; }

.history-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.history-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}
.history-item summary::-webkit-details-marker { display: none; }
.history-item .release-version { font-size: 17px; }

.chev {
  margin-left: auto;
  color: var(--text-dim);
  transition: transform 0.15s;
}
.history-item[open] .chev { transform: rotate(180deg); }

.history-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.empty {
  color: var(--text-dim);
  text-align: center;
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.side-card h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.side-card p, .side-card li {
  color: var(--text-dim);
  font-size: 13.5px;
}
.side-card ul {
  padding-left: 16px;
}
.side-card a { word-break: break-all; }

.kv {
  display: grid;
  gap: 8px;
}
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-k { color: var(--text-dim); }
.kv-v { font-family: var(--mono); text-align: right; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 13px;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--text); }

.dim { color: var(--text-dim); font-weight: 400; }

/* QR Download */
.qr-download {
  margin-top: 20px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qr-canvas {
  border-radius: 8px;
  image-rendering: pixelated;
}
.qr-label {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 860px) {
  .product-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .nav { gap: 10px; font-size: 13px; }
  .file-row { flex-wrap: wrap; }
  .file-dl { width: 100%; }
  .file-dl .btn { width: 100%; justify-content: center; }
  .hero-inner, .section-inner { padding-left: 16px; padding-right: 16px; }
  .header-inner { padding-left: 16px; padding-right: 16px; }
}
