/* ── Global Styles ── */
:root {
  --bg: #0a0d12;
  --bg-card: #11161d;
  --bg-card-hover: #181e27;
  --text: #e6eaf0;
  --text-dim: #88909c;
  --text-muted: #4e5662;
  --border: #1c222b;
  --blue: #5398e8;
  --blue-bg: rgba(83,152,232,0.13);
  --blue-bg-active: rgba(83,152,232,0.30);
  --red: #e85d6e;
  --red-bg: rgba(232,93,110,0.13);
  --red-bg-active: rgba(232,93,110,0.30);
  --gold: #cfb05a;
  --gold-bg: rgba(207,176,90,0.13);
  --gold-bg-active: rgba(207,176,90,0.30);
  --green: #45c456;
  --radius: 10px;
  --font: 'Segoe UI', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  min-height: 100vh;
}

.screen { display:none; width:100%; }
.screen:not(.hidden) { display:flex; flex-direction:column; align-items:center; }
.hidden { display:none !important; }

/* Overlay */
.overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.90);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  z-index:200;
}
.overlay.hidden { display:none; }

/* Typography */
h1 {
  font-size: 1.65rem; font-weight: 700; text-align: center;
  letter-spacing: -0.01em; color: #fff; margin-bottom: 16px;
}
h2 {
  font-size: 1.05rem; font-weight: 600; color: var(--text-dim);
  text-align: center; margin-bottom: 14px;
}

/* Buttons */
.btn {
  padding: 10px 22px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text); font-size: 14px; cursor: pointer;
  transition: all 0.18s; font-family: var(--font);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.btn:hover { background: var(--bg-card-hover); border-color: #4a5462; color: #fff; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: #1e7e34; border-color: #1e7e34; color: #fff; }
.btn-primary:hover { background: #238f3c; border-color: #238f3c; }
.btn-danger { background: #b33a3a; border-color: #b33a3a; color: #fff; }
.btn-danger:hover { background: #c74444; }
.btn-small { padding: 7px 16px; font-size: 12px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 14px;
  width: 100%; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row label { color: var(--text-dim); font-size: 14px; }
.setting-row input {
  width: 90px; padding: 7px 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 14px; text-align: center;
  font-family: var(--font);
}
.setting-row input:focus { outline: none; border-color: var(--blue); }

.button-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }

.connecting-spinner {
  width: 44px; height: 44px; border: 3px solid var(--border);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-waiting { color: var(--gold); }
.status-success { color: var(--green); }
.status-warning { color: var(--red); }
