:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --panel-2: #243044;
  --line: #2f3b4f;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --ok: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --input: #0b1220;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 10% -10%, #1e3a5f 0%, transparent 50%),
              radial-gradient(900px 500px at 100% 0%, #132238 0%, transparent 45%),
              var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: .5px;
}
.hero .badge {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.card {
  background: linear-gradient(180deg, rgba(36,48,68,.95), rgba(26,35,50,.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px 14px;
  align-items: center;
}
.label {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}
.field {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}
.field:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.row-btns {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn {
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform .05s, filter .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ok { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn-danger { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.btn-ghost {
  background: #334155;
}
.btn-ghost:hover:not(:disabled) { background: #475569; }

.stats {
  display: flex;
  gap: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.stats b.ok { color: var(--ok); }
.stats b.bad { color: var(--bad); }

.log-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.log-title h3 { margin: 0; font-size: 15px; }
.log {
  background: #070b12;
  border: 1px solid #1f2937;
  border-radius: 8px;
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  padding: 12px 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.log .ok { color: #4ade80; }
.log .bad { color: #f87171; }
.log .info { color: #93c5fd; }
.log .muted { color: #64748b; }

.tips {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.25);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.7;
}
.tips strong { color: #93c5fd; }

.lock-mask {
  position: relative;
}
.lock-mask.is-locked::after {
  content: "请先验证卡密";
  position: absolute;
  inset: 0;
  background: rgba(7,11,18,.72);
  backdrop-filter: blur(2px);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  font-weight: 700;
  letter-spacing: .5px;
  z-index: 2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #111827;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #64748b;
}
.status-pill.on .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-pill.on { color: #bbf7d0; }

.wait-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.4);
  color: #bbf7d0;
  font-size: 13px;
  font-weight: 700;
}

/* 分步向导 */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #111827;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.step-item .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #334155;
  color: #e2e8f0;
  font-size: 12px;
}
.step-item.active {
  border-color: rgba(59,130,246,.55);
  background: rgba(59,130,246,.12);
  color: #dbeafe;
}
.step-item.active .n { background: var(--primary); }
.step-item.done {
  border-color: rgba(34,197,94,.45);
  color: #bbf7d0;
}
.step-item.done .n { background: var(--ok); }
.step-title {
  margin: 0 0 6px;
  font-size: 16px;
}
.step-desc {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.main-action {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  min-width: 220px;
}
.btn-sm {
  padding: 10px 14px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .label { text-align: left; }
  .hero { flex-direction: column; align-items: flex-start; }
  .steps { grid-template-columns: 1fr; }
  .btn-lg { width: 100%; min-width: 0; }
}
