/* 豆包千问风格 - 酒店智能管家 */
:root {
  --primary: #06C655;
  --primary-dark: #05A047;
  --primary-light: #E8FDF0;
  --accent: #67E8A2;
  --success: #06C655;
  --warning: #FF9500;
  --danger: #FF3B30;
  --surface: #FFFFFF;
  --surface-secondary: #F5F5F7;
  --surface-tertiary: #E8E8ED;
  --border: #E5E5EA;
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-muted: #8E8E93;
  --bg-gradient-start: #F8F9FA;
  --bg-gradient-end: #E8FDF0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(6, 198, 85, 0.15);
  --shadow-xl: 0 12px 40px rgba(6, 198, 85, 0.2);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 聊天头部 */
.chat-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  transition: background 0.2s;
}

.back-btn:hover {
  background: var(--surface-secondary);
}

.header-info {
  flex: 1;
}

.bot-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.bot-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.bot-status.online {
  color: var(--success);
}

.bot-status.error {
  color: var(--danger);
}

.bot-status.offline {
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.action-btn:hover {
  background: var(--surface-secondary);
}

/* 聊天容器 */
.chat-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 消息样式 */
.message {
  display: flex;
  gap: 10px;
  max-width: 100%;
}

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

.message.guest {
  align-self: flex-end;
}

.message.system {
  align-self: center;
  text-align: center;
}

/* AI头像 */
.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  box-shadow: 0 4px 12px rgba(6, 198, 85, 0.3);
  position: relative;
  overflow: hidden;
}

.ai-avatar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}

.ai-avatar svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
}

/* 消息内容 */
.message-content {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 22px;
  line-height: 1.6;
  transition: all 0.3s ease;
}

.message.ai .message-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-left-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.message.guest .message-content {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-top-right-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.message-content p {
  font-size: 14px;
  margin: 0;
  word-break: break-word;
}

.message.guest .message-content p {
  color: white;
}

/* 快捷回复 */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quick-btn {
  padding: 8px 18px;
  background: var(--primary-light);
  border: 1px solid var(--accent);
  border-radius: 24px;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-btn::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.6;
}

.quick-btn:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 198, 85, 0.3);
}

.quick-btn:active {
  transform: translateY(0);
}

/* 输入区域 */
.input-area {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-secondary);
  border-radius: 32px;
  padding: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-row:focus-within {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--primary), 0 4px 16px rgba(6, 198, 85, 0.2);
}

.voice-toggle-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  box-shadow: 0 4px 12px rgba(6, 198, 85, 0.4);
}

.voice-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(6, 198, 85, 0.5);
}

.voice-toggle-btn:active {
  transform: scale(0.95);
}

.voice-toggle-btn.recording {
  animation: pulse 1.5s ease-in-out infinite;
  background: linear-gradient(135deg, var(--danger) 0%, #CC0000 100%);
  box-shadow: 0 0 20px rgba(255, 59, 48, 0.6);
}

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

.text-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  color: var(--text-primary);
}

.text-input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--primary);
  border-radius: 50%;
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.send-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

/* 语音输入区域 */
.voice-input-area {
  background: var(--surface-secondary);
  border-radius: 20px;
  padding: 16px;
  margin-top: 10px;
}

.voice-status {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
  margin-bottom: 12px;
}

.wave-bar {
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 2px;
  animation: wave 0.5s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.2); }
}

.voice-preview {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  min-height: 44px;
}

.voice-preview p {
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.voice-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.voice-action-btn {
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.voice-action-btn.cancel-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.voice-action-btn.cancel-btn:hover {
  background: var(--surface-secondary);
}

.voice-action-btn.send-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.voice-action-btn.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* 滚动条样式 */
.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

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

.chat-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 响应式设计 */
@media (max-width: 480px) {
  .message-content {
    max-width: 85%;
  }
  
  .message.ai .message-content,
  .message.guest .message-content {
    padding: 10px 14px;
  }
  
  .input-area {
    padding: 10px 12px;
  }
}
