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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f5f6f8;
  color: #1a1a1a;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部状态栏 */
.header {
  background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
  color: white;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
}

.ai-icon {
  font-size: 20px;
}

.status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
}

.status-loading { background: rgba(255,255,255,0.2); }
.status-ready { background: rgba(255,255,255,0.3); }
.status-error { background: #ff4d4f; }

/* 客户信息 */
.customer-info {
  background: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eee;
}

.customer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
}

.customer-detail {
  flex: 1;
}

.customer-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

.customer-label {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

/* 通用区块 */
.reply-section,
.manual-section,
.history-section {
  background: white;
  margin: 10px 12px;
  border-radius: 10px;
  padding: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.msg-count {
  font-size: 11px;
  color: #999;
  font-weight: normal;
}

/* AI推荐回复 */
.reply-content {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  min-height: 80px;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.reply-content.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.empty-state {
  text-align: center;
  padding: 20px 10px;
  color: #999;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 12px;
  line-height: 1.5;
}

.btn-refresh {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.btn-refresh:hover {
  color: #07c160;
  background: #f0f0f0;
}

.btn-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* 按钮 */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary {
  background: #07c160;
  color: white;
  flex: 1;
}

.btn-primary:hover {
  background: #06ad56;
}

.btn-secondary {
  background: #f0f0f0;
  color: #666;
}

.btn-secondary:hover {
  background: #e8e8e8;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

/* 手动输入 */
.input-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.input-group textarea:focus {
  border-color: #07c160;
}

/* 消息历史 */
.message-list {
  max-height: 300px;
  overflow-y: auto;
}

.message-item {
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}

.message-item:last-child {
  border-bottom: none;
}

.message-role {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.message-role.user {
  color: #07c160;
}

.message-role.assistant {
  color: #1890ff;
}

.message-text {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-time {
  font-size: 10px;
  color: #ccc;
  margin-top: 4px;
}

.empty-history {
  text-align: center;
  padding: 20px;
  color: #ccc;
  font-size: 12px;
}

/* 底部 */
.footer {
  text-align: center;
  padding: 12px;
  color: #bbb;
  font-size: 11px;
  margin-top: auto;
}

/* Toast提示 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 9999;
  animation: fadeIn 0.2s;
}

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

/* 加载动画 */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e0e0e0;
  border-top-color: #07c160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
