:root {
  --bg: #080b12;
  --panel: #111621;
  --panel-2: #161c29;
  --line: #293142;
  --text: #f4f6fb;
  --muted: #9aa6bb;
  --accent: #ff3d8d;
  --accent-2: #8d63ff;
  --success: #45d6a4;
  --warning: #ffcc66;
  --danger: #ff6b76;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(141, 99, 255, .18), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(255, 61, 141, .12), transparent 26rem),
    var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 32px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  font-weight: 800;
  letter-spacing: -.04em;
}

.eyebrow, .section-kicker, .step {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.topbar h1 { margin: 0; font-size: 18px; }
.environment-badge {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid rgba(255, 204, 102, .35);
  border-radius: 999px;
  color: var(--warning);
  background: rgba(255, 204, 102, .08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.page-shell { max-width: 1440px; margin: 0 auto; padding: 34px 32px 56px; }

.intro-card {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  padding: 28px 30px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(255,61,141,.07), rgba(141,99,255,.07));
}

.intro-card h2 { margin: 0 0 9px; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.04em; }
.intro-card p:last-child { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.7; }
.security-note {
  min-width: 250px;
  padding: 14px 16px;
  border-left: 3px solid var(--warning);
  background: rgba(255,204,102,.06);
}
.security-note strong, .security-note span { display: block; }
.security-note strong { margin-bottom: 5px; color: var(--warning); }
.security-note span { color: var(--muted); font-size: 13px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 20px; }
.panel, .result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 22, 33, .94);
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}
.panel { padding: 24px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-heading h2 { margin: 0; font-size: 20px; }

label { display: block; margin-bottom: 16px; }
label > span:first-child { display: block; margin-bottom: 7px; color: #cbd3e1; font-size: 12px; font-weight: 650; }
input, select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  color: var(--text);
  border: 1px solid #343e51;
  border-radius: 11px;
  outline: none;
  background: #0c1019;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(141,99,255,.13); }
input::placeholder { color: #667287; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row .short-field { max-width: 140px; }

.secret-field { display: flex; }
.secret-field input { border-radius: 11px 0 0 11px; }
.secret-field button {
  min-width: 64px;
  color: #cfd6e4;
  border: 1px solid #343e51;
  border-left: 0;
  border-radius: 0 11px 11px 0;
  background: #171d29;
}
.privacy-line { margin: -3px 0 0; color: var(--muted); font-size: 12px; }
.privacy-line span { color: var(--success); }

.text-button, .code-card-heading button {
  color: var(--muted);
  border: 0;
  background: transparent;
}
.text-button:hover, .code-card-heading button:hover { color: var(--text); }

.action-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.action-tab {
  padding: 9px 13px;
  color: var(--muted);
  border: 1px solid #343e51;
  border-radius: 999px;
  background: transparent;
}
.action-tab.active { color: white; border-color: var(--accent); background: rgba(255,61,141,.12); }
.action-description {
  margin-bottom: 18px;
  padding: 12px 14px;
  color: var(--muted);
  border-radius: 10px;
  background: #0c1019;
  font-size: 13px;
  line-height: 1.55;
}
.hidden { display: none !important; }
.confirm-write { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid rgba(255,107,118,.28); border-radius: 10px; background: rgba(255,107,118,.06); }
.confirm-write input { width: 16px; height: 16px; margin: 0; accent-color: var(--danger); }
.confirm-write span { margin: 0 !important; color: #f1b1b6 !important; }
.button-row { display: flex; gap: 10px; margin-top: 6px; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 11px;
  font-weight: 700;
}
.primary-button { flex: 1; color: white; border: 0; background: linear-gradient(110deg, var(--accent), #c246e9); }
.secondary-button { color: #d8deea; border: 1px solid #3a4458; background: #171d29; }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .55; }

.result-panel { margin-top: 20px; padding: 24px; }
.result-heading { align-items: center; }
.status-chip { padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-chip.idle { color: var(--muted); background: #202736; }
.status-chip.loading { color: var(--warning); background: rgba(255,204,102,.1); }
.status-chip.success { color: var(--success); background: rgba(69,214,164,.1); }
.status-chip.error { color: var(--danger); background: rgba(255,107,118,.1); }

.metrics { display: grid; grid-template-columns: .7fr .7fr 1.8fr .8fr; gap: 1px; overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.metrics > div { min-width: 0; padding: 13px 15px; background: var(--panel-2); }
.metrics span, .metrics strong { display: block; }
.metrics span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.metrics strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

.debug-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.code-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #090d14; }
.code-card-heading { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.code-card h3 { margin: 0; font-size: 13px; }
pre { min-height: 300px; max-height: 520px; margin: 0; padding: 15px; overflow: auto; color: #c9d3e5; font: 12px/1.65 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.timeline { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 13px; }
.timeline-item { display: flex; align-items: center; gap: 9px; margin: 7px 0; color: #d4dbea; font-size: 13px; }
.timeline-item span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.timeline-item.muted { color: var(--muted); }
.timeline-item.muted span { background: #566176; }
.timeline-item.error { color: #ffb0b7; }
.timeline-item.error span { background: var(--danger); }

footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1440px; margin: 0 auto; padding: 0 32px 34px; color: #68758a; font-size: 11px; }

@media (max-width: 900px) {
  .workspace-grid, .debug-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .intro-card { align-items: start; flex-direction: column; }
  .security-note { width: 100%; }
}

@media (max-width: 600px) {
  .topbar, .page-shell, footer { padding-left: 18px; padding-right: 18px; }
  .topbar { padding-top: 18px; padding-bottom: 18px; }
  .environment-badge { display: none; }
  .intro-card, .panel, .result-panel { padding: 19px; border-radius: 14px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row .short-field { max-width: none; }
  .button-row { flex-direction: column; }
  .metrics { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}
