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

:root {
  --bg: #0b0d10;
  --panel: #14171c;
  --border: #22272e;
  --text: #e6e8eb;
  --muted: #8b929b;
  --user: #3b82f6;
  --assistant: #1f2937;
  --accent: #ef4444;
  --accent-active: #dc2626;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 720px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}
header h1 { font-size: 20px; font-weight: 600; }
header .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.user {
  background: var(--user);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}
.bubble.assistant {
  background: var(--assistant);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  border: 1px solid var(--border);
}
.bubble.thinking {
  color: var(--muted);
  font-style: italic;
}

.timing {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 2px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.timing.assistant { align-self: flex-start; }
.timing.user { align-self: flex-end; }
.timing .t-total { color: var(--text); font-weight: 600; }
.timing .t-claude { color: #fbbf24; }
.timing .t-sep { opacity: 0.4; }

.controls {
  padding: 20px 24px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.record-btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  transition: transform 0.1s ease, background 0.15s ease;
}
.record-btn:hover { background: var(--accent-active); }
.record-btn:active { transform: scale(0.97); }
.record-btn.recording {
  background: var(--accent-active);
  animation: pulse 1.2s ease-in-out infinite;
}
.record-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: white;
  display: inline-block;
}
.record-btn.recording .dot {
  background: white;
  animation: blink 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status {
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}
