/* ==========================================================
   中转站前端样式 —— 深色主题 + 渐变强调色
   ========================================================== */

:root {
  --bg: #070b16;
  --bg-soft: #0d1424;
  --card: #111a2e;
  --card-2: #16203a;
  --border: #24304e;
  --border-soft: #1b2540;

  --text: #e8edfb;
  --text-dim: #97a3c0;
  --text-mute: #6b7699;

  --brand: #5b8cff;
  --brand-2: #8b5cf6;
  --brand-3: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(91, 140, 255, .16), transparent 62%),
    radial-gradient(900px 520px at 92% 4%, rgba(139, 92, 246, .14), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 700; letter-spacing: -.2px; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

code, pre { font-family: var(--mono); }

/* ---------- 布局 ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 460px; margin: 0 auto; padding: 0 20px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 22, .78);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-size: 15px; font-weight: 900;
  box-shadow: 0 6px 18px rgba(91, 140, 255, .35);
}
.topnav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card-2); color: var(--text);
  font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: .16s ease; font-family: inherit; white-space: nowrap;
}
.btn:hover { background: #1c2745; border-color: #33436e; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 22px rgba(91, 140, 255, .28);
}
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, .2); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-block { width: 100%; }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-tight { padding: 18px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-title h3 { margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 7px;
  font-size: .85rem; font-weight: 600; color: var(--text-dim);
}
.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  background: #0b1220; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .93rem; font-family: inherit; transition: .16s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .16);
}
.input::placeholder { color: var(--text-mute); }
.textarea { resize: vertical; min-height: 84px; font-family: var(--mono); font-size: .85rem; }
.hint { font-size: .8rem; color: var(--text-mute); margin-top: 6px; }
.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; }

.code-input {
  font-family: var(--mono); font-size: 1.4rem; letter-spacing: 10px;
  text-align: center; padding: 14px; font-weight: 700;
}

/* ---------- 提示 ---------- */
.alert {
  padding: 12px 15px; border-radius: var(--radius-sm);
  font-size: .88rem; margin-bottom: 16px; border: 1px solid;
  display: none; line-height: 1.6;
}
.alert.show { display: block; }
.alert-err { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); color: #fca5a5; }
.alert-ok { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); color: #6ee7b7; }
.alert-info { background: rgba(91, 140, 255, .1); border-color: rgba(91, 140, 255, .35); color: #a8c2ff; }
.alert-warn { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .35); color: #fcd34d; }

/* ---------- 统计 ---------- */
.stat {
  background: linear-gradient(180deg, var(--card-2), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label { font-size: .78rem; color: var(--text-mute); margin-bottom: 6px; letter-spacing: .3px; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.stat-hint { font-size: .78rem; color: var(--text-dim); margin-top: 4px; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .3px;
  border: 1px solid;
}
.badge-ok { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .35); color: #6ee7b7; }
.badge-cool { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .35); color: #fcd34d; }
.badge-off { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); color: #fca5a5; }
.badge-info { background: rgba(91, 140, 255, .12); border-color: rgba(91, 140, 255, .35); color: #a8c2ff; }
.badge-mute { background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .28); color: #94a3b8; }
.badge-violet { background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .35); color: #c4b5fd; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
thead th {
  background: var(--card-2); color: var(--text-dim);
  text-align: left; padding: 11px 14px;
  font-weight: 600; font-size: .78rem; letter-spacing: .4px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(91, 140, 255, .045); }
.mono { font-family: var(--mono); font-size: .84rem; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.break { word-break: break-all; }

/* ---------- 代码块 ---------- */
pre.code {
  background: #060a14; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px;
  overflow-x: auto; font-size: .83rem; line-height: 1.7;
  color: #cfe0ff; margin: 0 0 12px;
}
pre.code .k { color: #7aa2ff; }
pre.code .s { color: #86efac; }
pre.code .c { color: #5d6784; font-style: italic; }
pre.code .n { color: #fcd34d; }

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row pre.code { flex: 1; margin-bottom: 0; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px; border: none; background: transparent;
  color: var(--text-dim); font-size: .9rem; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit;
  transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 特性卡 ---------- */
.feature {
  background: linear-gradient(180deg, var(--card-2), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: .18s;
}
.feature:hover { border-color: #33436e; transform: translateY(-2px); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 14px;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(135deg, rgba(91, 140, 255, .22), rgba(139, 92, 246, .22));
  border: 1px solid rgba(91, 140, 255, .3);
}
.feature h3 { font-size: 1rem; margin-bottom: 6px; }
.feature p { font-size: .87rem; color: var(--text-dim); margin: 0; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 52px; text-align: center; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: 18px; letter-spacing: -.8px;
  background: linear-gradient(120deg, #fff 10%, #9db9ff 55%, #c4b5fd 95%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.05rem; color: var(--text-dim); max-width: 660px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.hero-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.section { padding: 52px 0; }
.section-title { text-align: center; margin-bottom: 34px; }
.section-title p { color: var(--text-dim); max-width: 620px; margin: 0 auto; }

/* ---------- 认证页 ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; padding: 40px 0; }
.auth-box { width: 100%; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-size: 1.55rem; margin-bottom: 8px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: .88rem; color: var(--text-dim); }
.pw-meter { height: 4px; background: var(--border); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.pw-meter-fill { height: 100%; width: 0; transition: width .25s, background .25s; }

/* ---------- 工具类 ---------- */
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.wrap-flex { display: flex; gap: 10px; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.center { text-align: center; }
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.spinner-page {
  width: 30px; height: 30px; border: 3px solid var(--border);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 60px auto;
}

.toast-host {
  position: fixed; top: 18px; right: 18px; z-index: 999;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 12px 16px;
  box-shadow: var(--shadow); font-size: .88rem;
  animation: fadeIn .2s ease;
}
.toast-ok { border-left-color: var(--ok); }
.toast-err { border-left-color: var(--err); }
.toast-warn { border-left-color: var(--warn); }

footer.site-footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 60px; padding: 26px 0;
  text-align: center; color: var(--text-mute); font-size: .84rem;
}

.pool-bar { display: flex; gap: 4px; margin: 12px 0 4px; }
.pool-seg { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.pool-seg.ok { background: linear-gradient(90deg, var(--brand), var(--ok)); }
.pool-seg.cool { background: linear-gradient(90deg, var(--warn), #fb923c); }
.pool-seg.off { background: var(--err); }

@media (max-width: 560px) {
  .hero { padding: 44px 0 32px; }
  .card { padding: 18px; }
  h1 { font-size: 1.6rem; }
}
