:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text2: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --ubuntu: #e95420;
  --debian: #d70a53;
  --fedora: #294172;
  --arch: #1793d1;
  --centos: #932279;
  --opensuse: #73ba25;
  --alpine: #0d597f;
  --gentoo: #54487a;
  --mint: #87cf3e;
  --kali: #557c94;
  --rocky: #10b981;
  --nixos: #5277c3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

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

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

/* Header */
header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  color: var(--accent);
}

.logo h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.logo .tagline {
  font-size: 12px;
  color: var(--text2);
}

nav {
  display: flex;
  gap: 24px;
}

nav a {
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 40px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Main */
main { padding: 40px 0; }

section { margin-bottom: 56px; }

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-desc {
  color: var(--text2);
  margin-bottom: 20px;
}

/* Protocol tabs */
.protocol-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  width: fit-content;
}

.tab {
  background: none;
  border: none;
  color: var(--text2);
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.tab.active, .tab:hover {
  background: var(--bg2);
  color: var(--text);
}

/* Mirror table */
.mirror-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.mirror-table thead {
  background: var(--bg3);
}

.mirror-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}

.mirror-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.mirror-table tbody tr:last-child td { border-bottom: none; }

.mirror-table tbody tr:hover { background: var(--bg2); }

.dist-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.dist-badge.ubuntu  { background: var(--ubuntu); }
.dist-badge.debian  { background: var(--debian); }
.dist-badge.fedora  { background: var(--fedora); }
.dist-badge.arch    { background: var(--arch); }
.dist-badge.centos  { background: var(--centos); }
.dist-badge.opensuse { background: var(--opensuse); color: #111; }
.dist-badge.alpine  { background: var(--alpine); }
.dist-badge.gentoo  { background: var(--gentoo); }
.dist-badge.mint    { background: var(--mint); color: #111; }
.dist-badge.kali    { background: var(--kali); }
.dist-badge.rocky   { background: var(--rocky); color: #111; }
.dist-badge.nixos   { background: var(--nixos); }

.sync-ok   { color: var(--green); font-size: 12px; }
.sync-warn { color: var(--yellow); font-size: 12px; }

.link-btn {
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--accent);
  white-space: nowrap;
}

.link-btn:hover {
  background: var(--bg2);
  text-decoration: none;
  border-color: var(--accent);
}

/* Status */
.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.status-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.red    { background: var(--red); }

.status-card p { color: var(--text2); font-size: 13px; margin-bottom: 6px; }
.status-card code {
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text2);
}

/* Bandwidth */
.bandwidth-info {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.bandwidth-info h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text2);
}

.bw-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.bar-wrap {
  background: var(--bg3);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #388bfd);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.bw-bar-row span:last-child {
  color: var(--text2);
  text-align: right;
  font-size: 12px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.about-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.about-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent);
}

.about-card ul {
  list-style: none;
  padding: 0;
}

.about-card li {
  color: var(--text2);
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.about-card li:last-child { border-bottom: none; }
.about-card li::before { content: '› '; color: var(--accent); }

/* Config */
.config-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  width: fit-content;
}

.cfg-tab {
  background: none;
  border: none;
  color: var(--text2);
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.cfg-tab.active, .cfg-tab:hover {
  background: var(--bg2);
  color: var(--text);
}

.config-block { display: none; }
.config-block.active { display: block; }

.config-block p {
  color: var(--text2);
  margin-bottom: 10px;
  font-size: 13px;
}

.config-block code {
  font-family: 'Consolas', 'Fira Code', monospace;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
  color: var(--text);
}

pre .comment { color: var(--text2); }

/* Contact */
.contact-info {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.contact-info p {
  margin-bottom: 8px;
  color: var(--text2);
  font-size: 14px;
}

.contact-info p:first-child { color: var(--text); }

/* Footer */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
}

footer p {
  color: var(--text2);
  font-size: 13px;
}

.footer-small {
  font-size: 11px;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .stat-divider { display: none; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  nav { display: none; }
  .mirror-table th:nth-child(3),
  .mirror-table td:nth-child(3),
  .mirror-table th:nth-child(4),
  .mirror-table td:nth-child(4) { display: none; }
}
