/* ========== 设计变量 ========== */
:root {
  --primary: #1A1A2E;
  --primary-light: #3A3A5C;
  --primary-dark: #0D0D1A;
  --accent: #007AFF;
  --accent-hover: #0051D5;
  --bg: #FFFFFF;
  --bg-secondary: #F5F5F7;
  --bg-card: #FFFFFF;
  --text: #1C1C1E;
  --text-light: #8E8E93;
  --text-muted: #C7C7CC;
  --border: #E5E5EA;
  --shadow: none;
  --shadow-lg: 0 1px 3px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --max-w: 480px;
}

/* ========== 全局重置 ========== */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html, body {
  height: 100%; width: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  justify-content: center;
}

/* ========== 视图系统 ========== */
.view {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateX(-50%) translateY(12px);
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ========== 欢迎页 ========== */
#welcome {
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.welcome-bg {
  display: none;
}

.welcome-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 48px 32px;
  text-align: center;
  color: var(--text);
}

.welcome-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.welcome-icon svg {
  width: 50px;
  height: 50px;
  stroke: #ffffff;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
  color: var(--text);
}

.welcome-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-light);
  margin-bottom: 40px;
  max-width: 280px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 40px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  font-family: var(--font);
}

.btn-start {
  background: var(--primary);
  color: #fff;
}

.btn-start:hover {
  background: var(--primary-light);
}

.btn-start:active {
  opacity: 0.9;
}

.welcome-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.btn-history-link {
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
}

.btn-history-link:hover {
  text-decoration: underline;
}

/* 暗黑模式切换 */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.theme-toggle:hover {
  background: var(--border);
}

/* 历史弹窗 */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-mask {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90%;
  max-width: var(--max-w);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  background: var(--bg-secondary);
}

.history-list {
  overflow-y: auto;
  padding: 12px;
}

.history-empty {
  text-align: center;
  color: var(--text-light);
  padding: 40px 20px;
  font-size: 14px;
}

.history-item {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.history-item:hover {
  background: var(--bg-secondary);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.history-date {
  font-size: 12px;
  color: var(--text-light);
}

.history-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.badge-good {
  background: rgba(52, 199, 89, 0.12);
  color: #34C759;
}

.badge-bad {
  background: rgba(255, 59, 48, 0.12);
  color: #FF3B30;
}

.history-options {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}

.hist-opt {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.hist-opt.win {
  background: var(--accent);
  color: #fff;
}

.hist-vs {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
}

.history-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light);
}

.history-recommend {
  font-weight: 500;
  color: var(--text);
}

/* 复盘按钮 */
.review-section {
  margin-top: 24px;
  text-align: center;
}

.review-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.review-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.review-btn {
  padding: 10px 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s ease;
}

.review-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.review-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* AI 头像 */
.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.msg-ai {
  flex-direction: row;
}

.msg-ai .msg-bubble {
  margin-left: 0;
}

/* 开场动画 */
.welcome-content {
  animation: welcomeIn 0.6s ease-out;
}

@keyframes welcomeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-icon {
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 导出按钮 */
.btn-export {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-export:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 抛硬币动画 */
.coin-flip-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.coin {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: bold;
  color: #8B4513;
  box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4);
  animation: coinFlip 1.5s ease-in-out;
}

@keyframes coinFlip {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(1080deg) scale(1.2); }
  100% { transform: rotateY(2160deg) scale(1); }
}

.coin-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 100px);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  animation: resultIn 0.5s ease 1.5s both;
}

@keyframes resultIn {
  from { opacity: 0; transform: translate(-50%, 120px); }
  to { opacity: 1; transform: translate(-50%, 100px); }
}

/* ========== 暗黑模式 ========== */
[data-theme="dark"] {
  --primary: #E5E5EA;
  --primary-light: #C7C7CC;
  --primary-dark: #FFFFFF;
  --accent: #0A84FF;
  --accent-hover: #409CFF;
  --bg: #000000;
  --bg-secondary: #1C1C1E;
  --bg-card: #1C1C1E;
  --text: #FFFFFF;
  --text-light: #8E8E93;
  --text-muted: #48484A;
  --border: #38383A;
  --shadow-lg: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] body {
  background: var(--bg);
}

[data-theme="dark"] .view {
  background: var(--bg);
}

[data-theme="dark"] .welcome-bg {
  opacity: 0.03;
}

[data-theme="dark"] .msg-bubble {
  background: var(--bg-secondary);
}

[data-theme="dark"] .choice-btn {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .choice-btn:hover {
  background: #2C2C2E;
}

[data-theme="dark"] .choice-btn .choice-letter {
  background: var(--border);
  color: var(--text-light);
}

[data-theme="dark"] .choice-btn:hover .choice-letter {
  background: var(--accent);
  color: #fff;
}

[data-theme="dark"] .chat-input-bar,
[data-theme="dark"] .topbar {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] #chat-input {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .report-recommend-card,
[data-theme="dark"] .report-comfort-card {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .struggle-bar {
  background: var(--border);
}

[data-theme="dark"] .api-key-input {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .chip {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .chip:hover {
  border-color: var(--accent);
}

[data-theme="dark"] .btn-export,
[data-theme="dark"] .review-btn {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .btn-export:hover,
[data-theme="dark"] .review-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .history-item {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .history-item:hover {
  background: #2C2C2E;
}

[data-theme="dark"] .hist-opt {
  background: var(--bg);
}

[data-theme="dark"] .voice-overlay-content {
  background: var(--bg-secondary);
  border-color: var(--border);
}

[data-theme="dark"] .voice-wave span {
  background: var(--text-light);
}

* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* 快捷示例 */
.welcome-examples {
  margin-top: 32px;
  text-align: center;
}

.examples-label {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.example-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.chip {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  background: #EBEBF0;
  border-color: #D1D1D6;
}

/* ========== 顶部栏 ========== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 52px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-logo {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.topbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.topbar-back {
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  color: var(--text-light);
}

.topbar-back:hover {
  background: var(--bg-secondary);
}

/* ========== 步骤指示器 ========== */
.step-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
}

.step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s ease;
}

.step-dot.active {
  background: var(--primary);
}

.step-dot.done {
  background: var(--text);
}

/* ========== 聊天页 ========== */
#chat {
  background: var(--bg);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* 消息气泡 */
.msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: msgIn 0.25s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-ai {
  align-self: flex-start;
}

.msg-user {
  align-self: flex-end;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
}

.msg-ai .msg-bubble {
  background: var(--bg-secondary);
  color: var(--text);
  border-bottom-left-radius: 3px;
}

.msg-user .msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.msg-images {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.msg-image {
  max-width: 120px;
  max-height: 120px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.msg-text {
  word-break: break-word;
}

/* 打字动画 */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 0.8; }
}

.chat-bottom {
  flex-shrink: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

/* 选项按钮区 */
.choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  animation: msgIn 0.2s ease;
}

.choice-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s ease;
}

.choice-btn:hover {
  border-color: var(--primary);
  background: var(--bg-secondary);
}

.choice-btn:active {
  background: #EBEBF0;
}

/* 输入栏 */
.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 10px 16px 14px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 10px 16px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  resize: none;
  min-height: 42px;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
}

.chat-input:focus {
  border-color: var(--primary);
}

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

.btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-send:hover {
  background: var(--primary-light);
}

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

/* 语音按钮 */
.btn-voice {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-voice:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-voice.recording {
  background: #FF3B30;
  border-color: #FF3B30;
  color: #fff;
}

.btn-voice.hidden {
  display: none;
}

/* 图片按钮 */
.btn-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-image:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-image.has-images {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 122, 255, 0.06);
}

/* 图片预览条 */
.image-preview-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}

.image-preview-bar::-webkit-scrollbar {
  height: 3px;
}

.image-preview-bar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.image-preview-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 语音输入全屏浮层 */
.voice-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(28, 28, 30, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.voice-overlay-content {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.voice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF3B30;
  animation: voiceBlink 1s ease-in-out infinite;
}

@keyframes voiceBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.voice-text {
  width: 100%;
  min-height: 120px;
  max-height: 240px;
  overflow-y: auto;
  color: #fff;
  font-size: 20px;
  line-height: 1.5;
  text-align: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  word-break: break-word;
  white-space: pre-wrap;
}

.voice-text:empty::before {
  content: '请开始说话...';
  color: rgba(255, 255, 255, 0.3);
  font-size: 16px;
}

.voice-text .interim {
  color: rgba(255, 255, 255, 0.5);
}

.voice-text .final {
  color: #fff;
}

.voice-actions {
  display: flex;
  gap: 32px;
}

.voice-action-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}

.voice-action-btn:active {
  transform: scale(0.92);
}

.voice-action-cancel {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 59, 48, 0.6);
  color: #FF3B30;
}

.voice-action-cancel:hover {
  background: rgba(255, 59, 48, 0.15);
}

.voice-action-confirm {
  background: rgba(0, 122, 255, 0.15);
  border-color: #007AFF;
  color: #007AFF;
}

.voice-action-confirm:hover {
  background: rgba(0, 122, 255, 0.3);
}

.voice-hint {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  text-align: center;
  margin: 0;
}

/* ========== 报告页 ========== */
#report {
  background: var(--bg);
}

#confetti-canvas {
  display: none;
}

.report-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-recommend-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  text-align: center;
  border: 1.5px solid var(--primary);
  animation: cardIn 0.4s ease;
}

.recommend-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.recommend-option {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.recommend-score {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.score-explain {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.report-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  animation: cardIn 0.5s ease;
}

.report-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.recommend-reasons {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recommend-reasons li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light);
}

.recommend-reasons li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* 安心提示卡片 */
.report-comfort-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
  animation: cardIn 0.5s ease;
}

.comfort-icon {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-light);
}

.comfort-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

/* 纠结指数 */
.struggle-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.struggle-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.struggle-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  width: 0%;
  transition: width 1.2s ease;
}

.struggle-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  min-width: 44px;
  text-align: right;
}

.struggle-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.btn-restart {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  width: 100%;
  margin-top: 8px;
}

.btn-restart:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.api-key-section {
  width: 100%;
  max-width: 280px;
  margin-bottom: 12px;
}

.api-key-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
}

.api-key-input:focus {
  border-color: var(--primary);
}

.api-key-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* 模型选择器 */
.model-select-section {
  width: 100%;
  max-width: 280px;
  margin-bottom: 20px;
}

.model-select-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
  text-align: left;
  letter-spacing: 0.5px;
}

.model-options {
  display: flex;
  gap: 8px;
}

.model-option {
  flex: 1;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-light);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s ease;
}

.model-option.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(26, 26, 46, 0.04);
}

.model-option:hover:not(.active) {
  border-color: var(--text-muted);
  color: var(--text);
}

/* 选项按钮区 - 考试答题卡风格 */
.choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 12px;
  animation: msgIn 0.2s ease;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s ease;
  text-align: left;
  line-height: 1.4;
}

.choice-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  flex-shrink: 0;
}

.choice-btn:hover {
  border-color: var(--primary);
  background: var(--bg-secondary);
}

.choice-btn:hover .choice-letter {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.choice-btn:active {
  background: #EBEBF0;
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .view {
    max-width: 100%;
  }
}

@media (min-width: 481px) {
  body {
    background: var(--bg-secondary);
  }
}
