/* 基础变量与主题 */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1e293b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --radius: 8px;
  --log-bg: #f8fafc;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #e2e8f0;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --log-bg: #1e293b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

button, select, input, textarea {
  font: inherit;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button.primary {
  background: var(--primary);
  color: white;
  border: none;
}
button.primary:disabled, button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.status {
  font-weight: 500;
  margin-left: auto;
}
.status.idle { color: #6b7280; }
.status.speaking { color: #10b981; }
.status.silent { color: #f59e0b; }

.volume-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
progress { flex: 1; height: 0.8rem; }

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
  .panels { grid-template-columns: 1fr; }
}

.content-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 150px;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-box {
  max-height: 150px;
  font-family: monospace;
  font-size: 0.85rem;
  background: var(--log-bg);
}

.settings {
  margin-top: 1.5rem;
}
.settings-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}
textarea { resize: vertical; }