/* ============================================================
   Simi Listen — 样式表（移动端优先，暗色主题）
   ============================================================ */

:root {
  --bg: #111827;
  --surface: #1f2937;
  --border: #374151;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}

.container {
  max-width: 480px;
  width: 100%;
  padding-bottom: 80px;
}

/* ---- 头部 ---- */
header {
  text-align: center;
  padding: 32px 0 24px;
}

header h1 {
  font-size: 28px;
  margin-bottom: 4px;
}

header .subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- 卡片 ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

/* ---- 表单 ---- */
.form-group {
  margin-bottom: 14px;
}

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
}

/* ---- 按钮 ---- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  min-width: 44px;
  min-height: 44px;
  text-align: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-accent {
  background: var(--success);
  color: #111827;
  width: 100%;
}

.btn-secondary {
  background: var(--border);
  color: var(--text);
  width: 100%;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--danger);
  color: #fff;
  border-radius: 6px;
}

/* ---- 状态栏 ---- */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}

.status-dot.connecting {
  background: var(--warning);
  animation: pulse 1s infinite;
}

.status-dot.connected {
  background: var(--success);
}

.status-dot.active {
  background: var(--success);
  animation: pulse 2s infinite;
}

.status-dot.error {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

#status-text {
  font-size: 15px;
}

.status-message {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---- Bias 混音滑块 ---- */
.bias-control {
  margin-top: 16px;
}

.bias-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bias-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--text-muted) 0%, var(--accent) 100%);
  border-radius: 3px;
  outline: none;
}

.bias-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.bias-values {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- 字幕 ---- */
.subtitle-original {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
  min-height: 20px;
  word-break: break-word;
}

.subtitle-translated {
  font-size: 20px;
  font-weight: 600;
  min-height: 28px;
  word-break: break-word;
}

/* ---- 底部 ---- */
footer {
  text-align: center;
  padding: 16px 0;
  font-size: 12px;
  color: var(--text-muted);
}

footer p {
  margin-bottom: 8px;
}

/* ---- 焦点可见（无障碍） ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
