/* bbxbox Python - 深色主题 */
:root {
  --bg-base: #0d0e0f;
  --bg-card: #1a1b1d;
  --bg-input: #151618;
  --border: #2a2b2d;
  --text-primary: #e8e8e8;
  --text-secondary: #a1a1a1;
  --text-muted: #525252;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* Layout */
.app { display: flex; height: 100vh; }

/* Sidebar */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-input);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-cat { padding: 0 12px; margin-bottom: 8px; }
.sidebar-cat-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 4px 12px;
  margin-bottom: 4px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
}
.sidebar-item:hover { background: var(--bg-card); color: var(--text-secondary); }
.sidebar-item.active {
  background: var(--bg-card);
  color: var(--accent);
  border-left: 2px solid var(--accent);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

/* Header */
.header {
  height: 48px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}
.header-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; letter-spacing: 2px; }
.header-badge { font-size: 10px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; }

/* Main */
.main { flex: 1; overflow-y: auto; padding: 24px; }

/* Components */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
}
.card-sm { padding: 16px; }

input, textarea, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  width: 100%;
  font-family: inherit;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { min-height: 120px; resize: vertical; font-family: 'Courier New', monospace; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--bg-base); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; }

/* Result / code display */
.result {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--accent);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 12px;
}

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Input groups */
.input-group { display: flex; gap: 8px; align-items: end; }
.input-group > * { flex: 1; }

/* Status */
.status-ok { color: var(--success); }
.status-err { color: var(--danger); }
.status-warn { color: var(--warning); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Code */
code { color: var(--accent); font-family: 'Courier New', monospace; }

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.badge-green { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--warning); }

/* Progress bar */
.progress { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }

/* Loading spinner */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tooltip / copy feedback */
.copied { color: var(--success); font-size: 12px; opacity: 0; transition: opacity .2s; }
.copied.show { opacity: 1; }

/* Inline flex helpers */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 12px; }
.font-mono { font-family: 'Courier New', monospace; }
.font-bold { font-weight: 700; }

/* Page title */
.page-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.page-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* Tabs */
.tabs { display: flex; gap: 2px; background: var(--bg-input); padding: 4px; border-radius: 8px; width: fit-content; margin-bottom: 16px; }
.tab {
  padding: 6px 14px; border-radius: 6px; font-size: 12px; cursor: pointer;
  color: var(--text-secondary); transition: all .15s; border: none; background: none;
}
.tab.active { background: var(--accent); color: var(--bg-base); }

/* Slider */
input[type="range"] {
  -webkit-appearance: none; height: 4px; background: var(--border); border-radius: 2px;
  padding: 0; border: none; width: 100%; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; background: var(--accent);
  border-radius: 50%; cursor: pointer;
}
