:root {
  --bg: #06140d;
  --panel: rgba(7, 24, 15, 0.78);
  --panel-strong: rgba(13, 45, 28, 0.88);
  --line: rgba(223, 255, 238, 0.14);
  --text: #f5fff8;
  --muted: #a9bcb1;
  --green: #1ee66b;
  --green-dark: #16824e;
  --orange: #ff6b16;
  --red: #ff6b6b;
  --amber: #ffcc66;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(30, 230, 107, .18), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(223, 255, 238, .09), transparent 24%),
    radial-gradient(circle at 92% 62%, rgba(255, 107, 22, .12), transparent 26%),
    linear-gradient(150deg, #06140d, #0a1e13 50%, #111c18);
  font-family: "Space Grotesk", "DM Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 75%);
}

.page { position: relative; max-width: 650px; margin: 0 auto; padding: 18px 14px 42px; }
.hero {
  padding: 28px 22px 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(223,255,238,.11), rgba(6,20,13,.42));
  box-shadow: 0 24px 70px rgba(0,0,0,.34), inset 0 1px rgba(223,255,238,.08);
  overflow: hidden;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-chip { display: inline-flex; align-items: center; gap: 12px; color: #dfffee; font-size: 11px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.brand-chip img { display: block; width: 116px; height: auto; object-fit: contain; filter: drop-shadow(0 0 18px rgba(223,255,238,.22)); }
.brand-chip span { padding-top: 2px; opacity: .86; }
.hero h1 { margin: 26px 0 10px; font-size: clamp(34px, 9vw, 54px); line-height: .98; letter-spacing: -.04em; }
.hero p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.hero-metrics div { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.18); }
.hero-metrics b { display: block; font-size: 18px; color: #fff; }
.hero-metrics span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.status-pill { flex: 0 0 auto; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 900; }
.status-idle { color: #d6ded9; background: rgba(255,255,255,.12); }
.status-connecting { color: #301a00; background: var(--amber); }
.status-connected, .status-success { color: #062d19; background: #9ff0bf; }
.status-upgrading { color: #051f11; background: #6fe49d; }
.status-error { color: #fff; background: #d92d20; }

.compat-card, .step-card, .log-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 38px rgba(0,0,0,.18);
}
.compat-card { display: grid; gap: 6px; padding: 14px 16px; color: var(--muted); font-size: 13px; }
.compat-card strong { color: #fff; }
.step-card { padding: 17px; }
.step-head { display: flex; gap: 12px; margin-bottom: 14px; }
.step-head span { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid rgba(51,186,113,.45); border-radius: 13px; color: #0b2b18; background: #9ff0bf; font-weight: 900; }
.step-head h2 { margin: 0; font-size: 17px; }
.step-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.info-box { padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: #dfece5; background: rgba(0,0,0,.18); font-size: 13px; word-break: break-all; }
.info-box.compact { margin-top: 10px; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.top-gap { margin-top: 10px; }
.btn { border: 0; border-radius: 14px; padding: 13px 14px; font-weight: 900; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { flex: 1; color: #062d19; background: #9ff0bf; }
.btn.ghost { color: #dbe8e0; background: rgba(255,255,255,.12); }
.btn.outline { width: 100%; color: #bdf4d0; border: 1px solid rgba(51,186,113,.5); background: rgba(51,186,113,.08); }
.btn.upgrade { width: 100%; min-height: 56px; color: #062d19; background: linear-gradient(135deg, #9ff0bf, #1ee66b); font-size: 17px; box-shadow: 0 15px 38px rgba(51,186,113,.24); }
.btn.mini { padding: 4px 8px; border-radius: 8px; color: #fff; background: rgba(255,255,255,.12); font-size: 11px; }
.input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 14px; padding: 0 13px; color: #fff; background: rgba(0,0,0,.22); outline: none; }
.input:focus { border-color: rgba(51,186,113,.75); box-shadow: 0 0 0 3px rgba(51,186,113,.14); }
.input::placeholder { color: #7f9188; }
select.input option { color: #111; }
.field-grid { display: grid; gap: 12px; }
.field-grid label { display: grid; gap: 7px; color: #d9e6df; font-size: 13px; font-weight: 800; }
.privacy { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.progress-wrap { margin-top: 16px; }
.progress-bar { height: 14px; border-radius: 999px; background: rgba(255,255,255,.13); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #1ee66b, #c9ffd8); transition: width .18s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 13px; }
.msg { margin-top: 14px; border-radius: 17px; padding: 14px 16px; font-weight: 800; line-height: 1.5; }
.msg.success { color: #062d19; background: #9ff0bf; }
.msg.error { color: #fff; background: rgba(217,45,32,.92); }
.msg.info { color: #061d12; background: #bdf4d0; }
.msg.warn { color: #301a00; background: #ffcc66; }
.hidden { display: none; }
.log-card { padding: 0; overflow: hidden; }
.log-card summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; font-weight: 900; }
.log { margin: 0; padding: 14px; max-height: 260px; overflow: auto; border-top: 1px solid var(--line); color: #a5f3a5; background: rgba(0,0,0,.42); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }

@media (min-width: 560px) { .field-grid { grid-template-columns: 1fr 1fr; } }
