:root {
  --bg: #0b0f17;
  --bg2: #0f1520;
  --card: #141c2b;
  --card2: #192336;
  --border: #1e2d42;
  --text: #dde6f0;
  --text2: #8899b2;
  --muted: #5a6e82;
  --accent: #4a9eff;
  --accent-dim: rgba(74, 158, 255, 0.1);
  --accent-hover: #6db0ff;
  --danger: #f06060;
  --danger-dim: rgba(240, 96, 96, 0.1);
  --ok: #2ecc8a;
  --ok-dim: rgba(46, 204, 138, 0.1);
  --warn: #f0b429;
  --warn-dim: rgba(240, 180, 41, 0.1);
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #6c63ff);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--card); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-dim); }
.nav .btn-nav {
  color: var(--accent);
  border: 1px solid rgba(74, 158, 255, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  transition: all 0.15s;
}
.nav .btn-nav:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  text-decoration: none;
}
.nav .btn-danger-nav {
  color: var(--danger);
  border: 1px solid rgba(240, 96, 96, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  transition: all 0.15s;
}
.nav .btn-danger-nav:hover {
  background: var(--danger-dim);
  border-color: var(--danger);
  text-decoration: none;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
}
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── Main ── */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ── Page heading ── */
.page-head {
  margin-bottom: 28px;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.page-sub {
  color: var(--text2);
  font-size: 0.92rem;
  margin-top: 6px;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 0; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ── Badges / Status ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-ok { background: var(--ok-dim); color: var(--ok); }
.badge-err { background: var(--danger-dim); color: var(--danger); }
.badge-warn { background: var(--warn-dim); color: var(--warn); }
.badge-info { background: var(--accent-dim); color: var(--accent); }
.badge-neutral { background: rgba(90,110,130,0.15); color: var(--text2); }
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-ok::before { animation: pulse-ok 2s infinite; }
@keyframes pulse-ok {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 0.8rem; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2);
}
input[type=text],
input[type=email],
input[type=password],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.12);
}
input::placeholder,
textarea::placeholder { color: var(--muted); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace; font-size: 13px; line-height: 1.6; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6e82' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 5px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--accent);
  color: #061018;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); color: #061018; text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--border); color: var(--text); box-shadow: none; transform: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #e05050; color: #fff; box-shadow: 0 4px 12px rgba(240,96,96,0.3); transform: translateY(-1px); }
.btn.sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Flash messages ── */
.flash {
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
}
.flash-ok { background: var(--ok-dim); border-color: rgba(46, 204, 138, 0.25); color: var(--ok); }
.flash-err { background: var(--danger-dim); border-color: rgba(240, 96, 96, 0.25); color: var(--danger); }
.flash-warn { background: var(--warn-dim); border-color: rgba(240, 180, 41, 0.25); color: var(--warn); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  text-align: left;
  padding: 11px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(30, 45, 66, 0.6);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }
.table-link {
  color: var(--accent);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid rgba(74, 158, 255, 0.2);
  transition: all 0.15s;
  font-size: 0.85rem;
  white-space: nowrap;
}
.table-link:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  text-decoration: none;
}
.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 0.9rem;
}

/* ── Code / pre ── */
code {
  background: var(--bg2);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88em;
  color: #a8c8f0;
  border: 1px solid var(--border);
}
pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 13px;
  line-height: 1.65;
  color: #a8c8f0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Action panels ── */
.action-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.panel-body { padding: 20px 22px; }
.panel-body + .panel-body { border-top: 1px solid var(--border); padding-top: 20px; }

/* ── Validation steps ── */
.step-list { list-style: none; }
.step-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(30,45,66,0.5);
}
.step-item:last-child { border-bottom: none; padding-bottom: 0; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.step-content { flex: 1; }
.step-label { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.step-desc { font-size: 0.83rem; color: var(--text2); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Auth page ── */
.auth-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 34px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), #6c63ff);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin-bottom: 14px;
}
.auth-title { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-sub { font-size: 0.85rem; color: var(--text2); }

/* ── Home hero ── */
.hero {
  text-align: center;
  padding: 60px 0 48px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid rgba(74, 158, 255, 0.25);
  color: var(--accent);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.hero-title span { color: var(--accent); }
.hero-sub {
  font-size: 1rem;
  color: var(--text2);
  max-width: 540px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Feature grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: rgba(74,158,255,0.35); transform: translateY(-2px); }
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.feature-title { font-size: 0.98rem; font-weight: 600; margin-bottom: 7px; }
.feature-desc { font-size: 0.85rem; color: var(--text2); line-height: 1.6; }

/* ── Cert domain chips ── */
.domain-list { display: flex; flex-wrap: wrap; gap: 6px; }
.domain-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: ui-monospace, monospace;
  color: var(--text2);
}
.domain-chip.primary { border-color: rgba(74,158,255,0.4); color: var(--accent); background: var(--accent-dim); }

/* ── Section heading ── */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Points display ── */
.points-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px 5px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.points-icon { font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(11, 15, 23, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 20px 16px;
    gap: 4px;
    z-index: 99;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 14px; border-radius: 8px; }
  .nav .btn-nav, .nav .btn-danger-nav { border: none; background: none; padding: 11px 14px; }
  .card { padding: 18px 16px; }
  .main { padding: 20px 14px 40px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 28px 20px; }
  .hero { padding: 36px 0 32px; }
  .hero-title { font-size: 1.8rem; }
  .panel-body { padding: 16px; }
  .panel-header { padding: 14px 16px; }
  table { font-size: 0.83rem; }
  thead th, tbody td { padding: 10px 10px; }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; }
  .table-link { display: block; text-align: center; padding: 6px 12px; }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.3rem; }
  .page-title { font-size: 1.4rem; }
}
