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

:root {
  --bg: #05070d;
  --bg-2: #0a0e1a;
  --panel: rgba(255, 255, 255, 0.03);
  --panel-2: #141b30;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e6ebff;
  --muted: #8b94b8;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --cyan: #22d3ee;
  --green: #34d399;
  --danger: #ff5c7a;
  --warn: #fbbf24;
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6 50%, #22d3ee);
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ 导航栏 ============ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(5, 7, 13, 0.7);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: 0.3px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.brand-logo { display: block; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--muted); font-size: 14px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-login {
  padding: 9px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-login:hover { background: var(--accent); border-color: var(--accent); }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 70%);
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.glow-a { width: 500px; height: 500px; background: #6366f1; top: -100px; left: -100px; }
.glow-b { width: 420px; height: 420px; background: #22d3ee; bottom: -80px; right: -60px; opacity: 0.3; }
.hero-content { position: relative; max-width: 900px; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 30px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.hero-title {
  font-size: clamp(44px, 8vw, 76px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 24px;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-sub {
  font-size: 18px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-bottom: 60px; }
.cta-primary, .cta-ghost {
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
}
.cta-primary { background: var(--grad); color: #fff; border: none; box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35); }
.cta-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5); }
.cta-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text); border: 1px solid var(--border-strong); }
.cta-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 34px; font-weight: 800; }
.hero-stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ============ 通用 section ============ */
.section { padding: 100px 24px; position: relative; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; }
.section-desc { color: var(--muted); font-size: 16px; }

/* ============ 优势 ============ */
.adv-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.adv-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.adv-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.3s;
}
.adv-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.adv-card:hover::before { opacity: 0.06; }
.adv-icon {
  font-size: 30px;
  margin-bottom: 18px;
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  width: 56px; height: 56px;
  line-height: 56px;
  text-align: center;
  border-radius: 14px;
}
.adv-card h3 { font-size: 18px; margin-bottom: 10px; font-weight: 700; }
.adv-card p { color: var(--muted); font-size: 14px; }

/* ============ 理念 ============ */
.vision-wrap { max-width: 760px; margin: 0 auto; text-align: center; }
.vision-quote {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 28px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.vision-body { color: var(--muted); font-size: 16px; max-width: 600px; margin: 0 auto 40px; }
.vision-pillars { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.pillar {
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 14px;
  color: var(--muted);
}
.pillar span { color: var(--text); font-weight: 700; margin-right: 6px; }

/* ============ 架构 ============ */
.arch { max-width: 700px; margin: 0 auto; }
.arch-row { display: flex; justify-content: center; gap: 16px; }
.arch-row-multi { flex-wrap: wrap; }
.arch-node {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-align: center;
  min-width: 220px;
  flex: 1;
  transition: all 0.3s;
}
.arch-node:hover { border-color: var(--accent); transform: translateY(-3px); }
.arch-consumer { border-color: rgba(34, 211, 238, 0.3); }
.arch-core {
  border-color: rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
}
.arch-provider { border-color: rgba(52, 211, 153, 0.3); }
.arch-node-title { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.arch-node-sub { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.arch-node-desc { font-size: 13px; color: var(--muted); }
.arch-connector { text-align: center; color: var(--muted); padding: 8px 0; font-size: 18px; }

/* ============ 价值 ============ */
.value-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.value-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: all 0.3s;
}
.value-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.value-role {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  margin-bottom: 14px;
}
.value-card h3 { font-size: 20px; margin-bottom: 14px; font-weight: 700; }
.value-card ul { list-style: none; }
.value-card li { color: var(--muted); font-size: 14px; padding: 7px 0; position: relative; padding-left: 22px; }
.value-card li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* ============ 登录入口 ============ */
.login-entry {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.login-role {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 26px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}
.login-role:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.login-role-primary {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.04));
}
.login-role-icon { font-size: 32px; margin-bottom: 14px; }
.login-role h3 { font-size: 20px; margin-bottom: 8px; font-weight: 700; }
.login-role p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.login-role-btn {
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.login-role-primary .login-role-btn { background: var(--grad); border: none; }
.login-role-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ============ 页脚 ============ */
.footer { border-top: 1px solid var(--border); padding: 48px 24px; }
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand { font-weight: 700; font-size: 16px; }
.footer-brand p { font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 4px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted); font-size: 13px; }

/* ============ 模态框 ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 36px 32px;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 16px;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.modal-head { text-align: center; margin-bottom: 24px; }
.modal-role-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  margin-bottom: 12px;
}
.modal-head h2 { font-size: 24px; font-weight: 800; }
.modal-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus { border-color: var(--accent); }

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.error-msg { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 18px; text-align: center; }
.switch-hint { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.switch-hint a { color: var(--accent); }

/* ============ 调度面板 ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.topbar .brand { font-weight: 700; }
.topbar .user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.user-role {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}
.btn-secondary {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.stat-card .label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-card .value { font-size: 28px; font-weight: 800; }

.panel {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.panel h2 { font-size: 15px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.online { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.badge.offline { background: rgba(139, 148, 184, 0.15); color: var(--muted); }
.badge.gpu { background: rgba(99, 102, 241, 0.15); color: var(--accent); }
.empty { padding: 30px; text-align: center; color: var(--muted); font-size: 14px; }

/* ============ 管理员配置面板 ============ */
.settings-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.setting-group-title { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.setting-row { display: flex; flex-direction: column; gap: 6px; }
.setting-row label { font-size: 13px; color: var(--muted); }
.setting-row input {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  width: 100%;
}
.setting-row input:focus { outline: none; border-color: var(--accent); }
.settings-msg { font-size: 13px; color: var(--muted); min-height: 18px; }
.settings-msg.ok { color: var(--green); }
.settings-msg.error { color: #f87171; }

/* ============ API Token 面板 ============ */
.token-box { padding: 18px; display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.token-hint { font-size: 13px; color: var(--muted); margin: 0; }
.token-display { display: flex; align-items: center; gap: 10px; }
.token-display code {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  word-break: break-all;
  color: var(--text);
}

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .hero-stats { gap: 28px; }
  .arch-row-multi { flex-direction: column; }
  .arch-node { min-width: auto; }
  .footer-inner { flex-direction: column; text-align: center; }
}
