*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-input: #0f3460;
  --text: #eee;
  --text-dim: #999;
  --primary: #e94560;
  --primary-hover: #ff6b81;
  --success: #2ecc71;
  --success-hover: #27ae60;
  --danger: #e74c3c;
  --danger-hover: #c0392b;
  --warning: #f39c12;
  --gold: #f1c40f;
  --felt: #0d5e2e;
  --felt-dark: #0a4a24;
  --border: #2a2a4a;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  display: none;
  min-height: calc(100vh - 48px);
}
.page.active {
  display: block;
}

/* Top Bar */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 48px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: bold; font-size: 16px; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e74c3c;
}
.status-dot.connected { background: #2ecc71; }
.status-dot.disconnected { background: #e74c3c; }

/* Buttons */
button {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--success-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-secondary { background: var(--bg-input); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #1a5090; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-gold { background: var(--gold); color: #333; }

input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
input:focus { border-color: var(--primary); }
input::placeholder { color: var(--text-dim); }

.hidden { display: none !important; }

/* Toast */
#toast-container {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  animation: toastIn 0.3s ease;
  max-width: 320px;
}
.toast.error { background: var(--danger); }
.toast.info { background: var(--bg-input); }
.toast.success { background: var(--success); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
  body { font-size: 13px; }
  button { padding: 6px 12px; font-size: 12px; }
  input { padding: 6px 10px; font-size: 12px; }
  #top-bar { padding: 0 10px; height: 40px; }
  .logo { font-size: 14px; }
}
