:root {
  --bg: #1e2235;
  --bg-alt: #262a40;
  --card: #2b2f49;
  --text: #e7e9f3;
  --muted: #a7afc6;
  --primary: #ff9b71;
  --primary-600: #db6d00;
  --border: rgba(255,255,255,0.08);

  --fast: #24c17c;
  --medium: #ffb547;
  --slow: #ff6b6b;
  --timeout: #8c8fa8;

  --radius: 12px;
  --shadow: 0 6px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  background: radial-gradient(1200px 600px at 30% -10%, #1e2235 0%, var(--bg) 60%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  line-height: 1.55;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  padding: 28px 0 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title {
  margin: 0;
  font-size: 28px;
  color: var(--primary);
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 14px;
}

.noscript {
  margin-top: 8px;
  color: #ffd0d0;
}

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  appearance: none;
  border: none;
  background: var(--primary);
  color: #1b1f2f;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--primary-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.notice {
  margin: 18px 0 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.notice ul {
  margin: 0;
  padding-left: 18px;
}
.notice li { margin: 6px 0; }

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 14px;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-fast { background: var(--fast); box-shadow: 0 0 0 3px rgba(36,193,124,0.16); }
.dot-medium { background: var(--medium); box-shadow: 0 0 0 3px rgba(255,181,71,0.16); }
.dot-slow { background: var(--slow); box-shadow: 0 0 0 3px rgba(255,107,107,0.16); }
.dot-timeout { background: var(--timeout); box-shadow: 0 0 0 3px rgba(140,143,168,0.16); }

.table-wrap {
  margin-top: 12px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.links-table {
  width: 100%;
  border-collapse: collapse;
}
.links-table thead th {
  text-align: left;
  background: #23273d;
  color: #fff;
  padding: 14px 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.links-table td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: #dcdff0;
}
.links-table a {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}
.links-table a:hover { color: var(--primary-600); text-decoration: underline; }

.speed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #0e1327;
  margin-right: 8px;
}
.speed-badge.testing { background: #cdd1e6; color: #0e1327; }
.speed-badge.fast { background: rgba(36,193,124,0.18); color: #aaf0cf; border: 1px solid rgba(36,193,124,0.35); }
.speed-badge.medium { background: rgba(255,181,71,0.18); color: #ffe1b3; border: 1px solid rgba(255,181,71,0.35); }
.speed-badge.slow { background: rgba(255,107,107,0.18); color: #ffd0d0; border: 1px solid rgba(255,107,107,0.35); }
.speed-badge.timeout { background: rgba(140,143,168,0.15); color: #cfd2e6; border: 1px solid rgba(140,143,168,0.35); }

.spinner {
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.muted {
  color: var(--muted);
}
.foot-note {
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.site-footer {
  margin-top: 40px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式卡片布局（移动端优化） */
@media (max-width: 768px) {
  .links-table thead {
    display: none;
  }
  .links-table, .table-wrap {
    border: none;
    box-shadow: none;
  }
  .links-table tr {
    display: block;
    background: var(--card);
    margin-bottom: 12px;
    border-radius: var(--radius);
    padding: 10px 12px;
  }
  .links-table td {
    display: block;
    padding: 6px 0;
    border: none;
  }
  .links-table td:first-child {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 4px;
  }
  .speed-cell {
    margin-top: 6px;
  }
}
