:root {
  --primary: #4285f4;
  --primary-dark: #3367d6;
  --danger: #ea4335;
  --danger-dark: #c5221f;
  --success: #34a853;
  --warning: #fbbc04;
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-input: #0f3460;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --border-radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0f0f23 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.header {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c4dff 100%);
}

.header h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
}

.main {
  padding: 24px;
}

.api-key-section {
  margin-bottom: 24px;
}

.api-key-section label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.api-key-section input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: box-shadow 0.2s;
}

.api-key-section input:focus {
  box-shadow: 0 0 0 2px var(--primary);
}

.api-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
}

.api-link:hover {
  text-decoration: underline;
}

.status-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 24px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: background 0.3s;
}

.status-indicator.connected {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-indicator.listening {
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning);
  animation: pulse 1.5s infinite;
}

.status-indicator.speaking {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: pulse 0.5s infinite;
}

.status-indicator.error {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.audio-visualizer {
  height: 80px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}

#visualizerCanvas {
  width: 100%;
  height: 100%;
}

.transcript-section {
  margin-bottom: 24px;
}

.transcript-section h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.transcript {
  height: 150px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.transcript::-webkit-scrollbar {
  width: 6px;
}

.transcript::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 3px;
}

.transcript .user {
  color: var(--primary);
}

.transcript .ai {
  color: var(--success);
}

.transcript .system {
  color: var(--text-secondary);
  font-style: italic;
}

.controls {
  display: flex;
  gap: 16px;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #7c4dff 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(66, 133, 244, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #ff6b6b 100%);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(234, 67, 53, 0.4);
}

.footer {
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
