/* 全局样式优化 - 性能增强版 */
:root {
  --primary-color: #007AFF;
  --success-color: #34C759;
  --warning-color: #FF9500;
  --danger-color: #FF3B30;
  --background-color: #F2F2F7;
  --card-background: #FFFFFF;
  --text-primary: #000000;
  --text-secondary: #8E8E93;
  --border-color: #C6C6C8;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 性能优化: 使用GPU加速和减少重绘 */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 优化滚动性能 */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 修复标签栏固定定位 - 确保标签栏始终可见 */
.toolbar.tabbar,
.toolbar-bottom {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 5000 !important;
  background: #f7f7f8 !important;
  border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
}

/* 确保页面内容不被标签栏遮挡 */
.page-content {
  background: var(--background-color);
  padding-bottom: 60px !important;
  /* 为底部标签栏留出空间 */
}

/* 确保标签栏链接可见且可点击 */
.toolbar.tabbar .tab-link {
  pointer-events: auto !important;
  z-index: 5001 !important;
}

/* 输入表单优化 */
.input-section {
  background: var(--card-background);
  border-radius: 12px;
  margin: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 16px;
}

/* 修改f7Select的label字体大小 */
.form-group .item-title {
  font-size: 14px;
  /* 调整为你想要的大小 */
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: block;
  font-size: 20px;
}

/* 调整搜索区域与顶部的距离 */
.search-filter-block {
  margin-top: 20px !important;
  padding-top: 10px !important;
}

/* 缩小 f7Grid 行距 */
.search-filter-block .row {
  margin-top: 0px !important;
  margin-bottom: 0px !important;
}

/* 缩小 f7Text、f7Select 的上边距 */
.search-filter-block .item-input,
.search-filter-block .item-inner,
.search-filter-block .item-content {
  margin-top: 0px !important;
  padding-top: 0px !important;
  padding-bottom: 0px !important;
}

/* 缩小按钮外边距 */
.search-filter-block .button {
  margin-top: 5px !important;
}

/* 缩小 label 高度 */
.search-filter-block label {
  margin-bottom: 2px !important;
}

.chart-note {
  font-size: 13px;
  color: #888888;
  margin-top: 6px;
  text-align: center;
  font-style: italic;
}

/* 选择器样式增强 */
.item-inner {
  padding-left: 13px !important;
  padding-right: 13px !important;
}

.item-title {
  font-weight: 500 !important;
  color: var(--text-primary) !important;
}

.item-after {
  color: var(--primary-color) !important;
  font-weight: 500 !important;
}

/* 计算按钮优化 */
.calculate-button-container {
  margin: 24px 16px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.calculate-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0056CC 100%) !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  /* 减少左右内边距 */
  font-size: 17px !important;
  /* 进一步增大字体到24px */
  font-weight: 700 !important;
  /* 增加字体粗细 */
  min-width: 150px !important;
  /* 从200px减少到100px，约为原来的一半 */
  max-width: 150px !important;
  /* 添加最大宽度限制 */
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3) !important;
  transition: all 0.3s ease !important;
  margin: 0 auto !important;
  /* 确保按钮水平居中 */
  display: flex !important;
  /* 使用flex布局 */
  justify-content: center !important;
  /* 文本水平居中 */
  align-items: center !important;
  /* 文本垂直居中 */
  text-align: center !important;
  /* 文本居中对齐 */
}

/* 针对按钮内部文本的额外样式 */
.calculate-btn span,
.calculate-btn .button-text,
.calculate-btn * {
  font-size: 20px !important;
  font-weight: 700 !important;
}

/* 检出率展示卡片 */
.detection-rate-card {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 122, 255, 0.05) 100%);
  border-radius: 16px;
  margin: 16px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(0, 122, 255, 0.2);
  backdrop-filter: blur(10px);
}

.detection-rate-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 8px 0;
  text-shadow: 0 2px 4px rgba(0, 122, 255, 0.2);
}

.detection-rate-label {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.detection-rate-description {
  font-size: 14px;
  color: var(--text-primary);
  opacity: 0.8;
}

.calculate-btn:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2) !important;
}

/* 风险卡片设计 - 性能优化 */
.risk-card {
  margin: 16px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.risk-card-header {
  padding: 24px;
  text-align: center;
  color: white;
  position: relative;
}

.risk-score-display {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.risk-level-display {
  font-size: 15px;
  font-weight: 600;
  margin: 8px 0 0 0;
  opacity: 0.95;
}

.risk-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 20px;
  opacity: 0.7;
}

/* 图表容器优化 - 性能增强 */
.chart-container {
  background: var(--card-background);
  border-radius: 12px;
  margin: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  contain: layout style;
  content-visibility: auto;
}

.chart-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: center;
}

/* 人体可视化优化 - 性能增强 */
.body-visualization {
  border-radius: 16px;
  margin: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  contain: layout style;
  content-visibility: auto;
}

.organ-display {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  font-weight: bold;
  margin: 20px auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.organ-display:hover {
  transform: scale(1.05);
}

/* 详细信息卡片 */
.info-card {
  background: var(--card-background);
  border-radius: 12px;
  margin: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.info-card h4 {
  color: var(--primary-color);
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 20px;
}

.info-card h5 {
  font-size: 18px;
  /* 增加副标题字体大小 */
}

.info-card p {
  font-size: 16px;
  /* 增加段落文字大小 */
  line-height: 1.6;
  /* 增加行间距提高可读性 */
}

.info-card li {
  font-size: 16px;
  /* 增加列表项字体大小 */
}

.info-card strong {
  font-size: 16px;
  /* 确保加粗文字大小一致 */
}

/* 风险等级说明 */
.risk-legend {
  background: var(--card-background);
  border-radius: 12px;
  margin: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.risk-legend h3 {
  font-size: 20px;
  /* 增加标题字体大小 */
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 12px 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}

.legend-color {
  width: 28px;
  /* 增加色块大小 */
  height: 28px;
  /* 增加色块大小 */
  border-radius: 50%;
  margin-right: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-text {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 16px;
  /* 增加文字字体大小 */
  line-height: 1.5;
  /* 增加行间距 */
}

/* 性能指标卡片 */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 16px;
}

.metric-card {
  background: var(--card-background);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.metric-card:active {
  transform: scale(0.98);
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.metric-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 加载动画 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  flex-direction: column;
}

.loading-text {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 响应式适配 */
@media (max-width: 480px) {
  .input-section {
    margin: 12px;
    padding: 16px;
  }

  .chart-container {
    margin: 12px;
    padding: 16px;
  }

  .risk-score-display {
    font-size: 40px;
  }

  .performance-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 12px;
  }

}

@media (max-width: 768px) {
  .risk-score-display {
    font-size: 20px;
  }

  .risk-level-display {
    font-size: 16px;
  }
}

@media (min-width: 769px) {
  .risk-score-display {
    font-size: 24px;
  }

  .risk-level-display {
    font-size: 20px;
  }
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 122, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
  }
}

/* qa 界面css */
/* 优化的CSS样式设计 */
/* 基础页面样式 */
.page-content {
  background: #f5f7fa !important;
  min-height: 100vh;
}

/* 搜索容器样式 */
.search-section {
  background: white;
  margin: 10px;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e1e8ed;
}

/* 输入框样式优化 */
.item-input-wrap {
  background: #f8f9fa !important;
  border-radius: 8px !important;
  border: 1px solid #dee2e6 !important;
  transition: all 0.2s ease;
}

.item-input-wrap:focus-within {
  border-color: #007AFF !important;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1) !important;
}

.item-input input {
  font-size: 15px !important;
  color: #333 !important;
  padding: 10px 12px !important;
}

.item-input input::placeholder {
  color: #999 !important;
}

/* Label font size for f7Text and f7Select components */
.item-label,
.item-floating-label,
.list .item-content .item-inner .item-title {
  font-size: 17px !important;
  font-weight: 500 !important;
}

/* Floating label spacing adjustments */
.item-floating-label {
  margin-bottom: 6px !important;
  padding-bottom: 4px !important;
}

/* Specific targeting for input labels */
.item-input .item-label {
  margin-bottom: 8px !important;
  display: block !important;
  font-size: 17px !important;
}

/* Select component label styling */
.smart-select .item-title {
  font-size: 17px !important;
  margin-bottom: 8px !important;
  padding-bottom: 6px !important;
}

/* 按钮样式 */
.button {
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  height: 44px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.button-fill {
  background: #007AFF !important;
}

.button-fill.color-red {
  background: #ff3b30 !important;
}

/* 选择器样式 */
.item-floating-label {
  color: #007AFF !important;
  font-weight: 500 !important;
}

/* 问题列表容器 */
.questions-wrapper {
  padding: 0 16px;
}

/* 问题卡片样式 - 极简版 */
.question-card {
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
}

.question-card:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: white;
}

.question-card:active {
  transform: scale(0.98);
  background: #f2f2f7;
}

/* 问题标题样式 */
.question-title {
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.4;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* 分类标签样式 */
.question-category {
  font-size: 11px;
  font-weight: 600;
  color: #007AFF;
  background: rgba(0, 122, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-block;
  letter-spacing: 0.3px;
}

/* 不同分类的颜色 - 保持一致但更柔和 */
.category-高风险人群 {
  color: #FF3B30 !important;
  background: rgba(255, 59, 48, 0.1) !important;
}

.category-筛查方法 {
  color: #FF9500 !important;
  background: rgba(255, 149, 0, 0.1) !important;
}

.category-生活习惯 {
  color: #34C759 !important;
  background: rgba(52, 199, 89, 0.1) !important;
}

.category-疾病预防 {
  color: #AF52DE !important;
  background: rgba(175, 82, 222, 0.1) !important;
}

/* 答案框样式 */
/* 答案框样式 - 极简版 */
.answer-box {
  background: #F2F2F7;
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  border: none;
  display: none;
}

.answer-box.show {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 答案标题样式 */
.answer-title {
  color: #34C759;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
  border-bottom: none;
  padding-bottom: 0;
  display: flex;
  align-items: center;
}

.answer-title::before {
  content: "💡";
  margin-right: 6px;
  font-size: 16px;
}

/* 答案内容样式 */
.answer-content {
  line-height: 1.6;
  color: #1c1c1e;
  font-size: 15px;
}

.answer-content strong {
  color: #007AFF;
  font-weight: 600;
}

/* 搜索高亮 */
.highlight {
  background-color: #fff3cd;
  color: #856404;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 500;
}

/* 标题样式 */
.block-title {
  color: #333 !important;
  font-weight: 600 !important;
  font-size: 18px !important;
  margin: 16px 10px 8px 10px !important;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.empty-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}

.empty-state-subtitle {
  font-size: 13px;
  opacity: 0.7;
}

/* 加载状态 */
.loading-container {
  display: flex;
  justify-content: center;
  padding: 30px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007AFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* 移动端适配 */
@media (max-width: 480px) {
  .search-section {
    margin: 8px;
    padding: 12px;
  }

  .question-card {
    padding: 12px;
    margin-bottom: 10px;
  }

  .question-title {
    font-size: 15px;
  }

  .block-title {
    font-size: 16px !important;
  }
}

/* 确保在较老的设备上兼容性 */
.question-card,
.search-section,
.answer-box {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.load-more-section {
  border-top: 1px solid #e0e0e0;
  background-color: #fafafa;
  border-radius: 8px;
  margin: 10px 0;
}

.load-more-section .button {
  min-width: 200px;
  transition: all 0.3s ease;
}

.load-more-section .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.end-message {
  border-top: 1px solid #e0e0e0;
  background-color: #f5f5f5;
  border-radius: 8px;
  margin: 10px 0;
}

.question-item {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== AI聊天机器人样式 ========== */
/* API密钥状态指示器 */
.api-status-indicator {
  animation: fadeIn 0.3s ease-in;
  transition: all 0.3s ease;
}

.api-status-indicator:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.api-status-indicator .button {
  background: transparent !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  height: 34px;
  padding: 0 14px;
}

.api-status-indicator .button:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .api-status-indicator {
    margin: 0 12px 10px 12px !important;
    padding: 10px 12px !important;
    font-size: 12px !important;
  }

  .api-status-indicator span {
    font-size: 12px !important;
  }

  .api-status-indicator .button {
    height: 30px;
    padding: 0 12px;
  }
}

.chat-container {
  max-width: 100%;
  margin: 0;
  height: calc(100vh - 140px);
  background: white;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: none;
}

/* 聊天头部 - 增强设计 */
/* 聊天头部 - 极简现代化设计 */
.chat-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 100;
  transition: all 0.3s ease;
}

.chat-header::after {
  display: none;
}

.chat-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
  color: #1c1c1e;
}

.header-icon {
  font-size: 22px;
  margin-right: 8px;
  filter: none;
  animation: none;
}

.header-actions {
  display: flex;
  gap: 10px;
  position: absolute;
  right: 16px;
  z-index: 1;
}

.header-actions button {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: #007AFF;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.header-actions button:hover {
  background: rgba(0, 122, 255, 0.1);
  transform: translateY(-1px);
}

.header-actions button:active {
  transform: scale(0.96);
}

/* 消息容器 - 增强设计 */
/* 消息容器 - 极简现代化设计 */
.messages-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px;
  background: #F2F2F7;
  /* iOS system background */
  scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
  width: 6px;
}

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

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

/* 消息样式 - 极简版 */
.message {
  display: flex;
  margin-bottom: 16px;
  animation: messageSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  flex-direction: row-reverse;
}

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.message.user .message-avatar {
  background: #007AFF;
  color: white;
  margin-left: 8px;
}

.message.ai .message-avatar {
  background: white;
  color: #007AFF;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.5;
  word-wrap: break-word;
  font-size: 16px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.user .message-content {
  background: #007AFF;
  color: white;
  border-bottom-right-radius: 4px;
}

.message.ai .message-content {
  background: white;
  color: #1c1c1e;
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 11px;
  color: #8e8e93;
  margin-top: 4px;
  padding: 0 4px;
  font-weight: 400;
}

.message.user .message-time {
  text-align: right;
}

.message.ai .message-time {
  text-align: left;
}

/* Markdown内容样式 */
.markdown-content {
  font-size: 15px;
  line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  margin: 12px 0 8px 0;
  font-weight: 600;
  color: #333;
}

.markdown-content h1 {
  font-size: 20px;
}

.markdown-content h2 {
  font-size: 18px;
}

.markdown-content h3 {
  font-size: 16px;
}

.markdown-content h4 {
  font-size: 15px;
}

.markdown-content h5 {
  font-size: 14px;
}

.markdown-content h6 {
  font-size: 13px;
}

.markdown-content p {
  margin: 0 0 8px 0;
  line-height: 1.6;
}

.markdown-content ul,
.markdown-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.markdown-content li {
  margin: 4px 0;
  line-height: 1.6;
}

.markdown-content code {
  background: rgba(0, 0, 0, 0.06);
  padding: 3px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  color: #e83e8c;
}

.message.ai .markdown-content code {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.markdown-content pre {
  background: #f8f9fa;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  overflow-x: auto;
  font-size: 13px;
}

.markdown-content pre code {
  background: transparent;
  padding: 0;
  color: #333;
}

.markdown-content blockquote {
  border-left: 4px solid #667eea;
  padding-left: 12px;
  margin: 8px 0;
  color: #666;
  font-style: italic;
  opacity: 0.9;
}

.markdown-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 14px;
}

.markdown-content table th,
.markdown-content table td {
  border: 1px solid #e1e8ed;
  padding: 8px 12px;
  text-align: left;
}

.markdown-content table th {
  background: rgba(0, 0, 0, 0.04);
  font-weight: 600;
}

.markdown-content a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.markdown-content a:hover {
  text-decoration: underline;
  color: #764ba2;
}

.markdown-content strong {
  font-weight: 600;
  color: #333;
}

.markdown-content em {
  font-style: italic;
  color: #666;
}

.markdown-content mark {
  background: #fff3cd;
  padding: 2px 4px;
  border-radius: 3px;
  color: #333;
}

/* 加载动画 - 极简版 */
.loading-message .message-avatar {
  background: white;
  color: #007AFF;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-message .message-avatar::before {
  display: none;
}

.loading-message .message-avatar::after {
  display: none;
}


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

/* 打字指示器容器 - 极简版 */
.typing-indicator-container {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  padding: 12px 16px !important;
  min-height: 24px !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  background: white !important;
  border-radius: 18px !important;
  border-bottom-left-radius: 4px !important;
  margin: 0 !important;
  z-index: 10 !important;
  width: fit-content !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  animation: containerFadeIn 0.3s ease-out forwards !important;
}

.typing-indicator-container.visible {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (prefers-color-scheme: dark) {
  .typing-indicator-container {
    background: #1c1c1e !important;
  }
}

@keyframes containerFadeIn {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-indicator-container::before {
  display: none;
}

.typing-text {
  color: #8e8e93 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}

.typing-text::after {
  display: none;
}

/* 优化的均衡器动画 - 移除 */
.loading-eq {
  display: none;
}

/* 骨架屏加载动画优化 - 极简版 */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  position: relative;
  overflow: hidden;
  padding: 4px 0;
}

.loading-skeleton .line {
  height: 10px;
  border-radius: 5px;
  background: #E5E5EA;
  animation: pulse 1.5s infinite ease-in-out;
}

.loading-skeleton .line::after {
  display: none;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

.loading-skeleton .line:nth-child(1) {
  width: 60%;
}

.loading-skeleton .line:nth-child(2) {
  width: 80%;
  animation-delay: 0.2s;
}

.loading-skeleton .line:nth-child(3) {
  width: 50%;
  animation-delay: 0.4s;
}

/* 打字指示器 - 极简版 */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  height: 100%;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8e8e93;
  display: inline-block;
  animation: typing 1.4s infinite ease-in-out both;
  opacity: 0.4;
  box-shadow: none;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typing {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  50% {
    transform: translateY(-4px);
    opacity: 1;
  }

}

/* 加载消息的增强样式 */
.loading-message {
  display: flex;
  align-items: center;
  opacity: 1;
  visibility: visible;
  position: relative;
}

.wave-loader {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 波浪路径样式 */
.wave-path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  animation: path-pulse 2s ease-in-out infinite;
}

@keyframes path-pulse {

  0%,
  100% {
    opacity: 0.5;
    stroke-width: 2;
  }

  50% {
    opacity: 0.9;
    stroke-width: 3;
  }
}

/* 波浪上的圆点 - 使用上下浮动动画 */
.wave-dot {
  animation: dot-float 1.8s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 122, 255, 0.3));
}

.wave-dot:nth-child(3) {
  animation-delay: 0s;
}

.wave-dot:nth-child(4) {
  animation-delay: 0.3s;
}

.wave-dot:nth-child(5) {
  animation-delay: 0.6s;
}

@keyframes dot-float {

  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }

  50% {
    transform: translateY(-6px);
    opacity: 0.8;
  }
}



/* 删除不再需要的气泡样式，保留占位条样式 */

/* 加载消息的增强样式 */
#chat_messages .loading-message,
.chat-messages .loading-message {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
}

#chat_messages .loading-message::before,
.chat-messages .loading-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 122, 255, 0.05) 0%, transparent 70%);
  border-radius: 12px;
  z-index: 0;
  animation: pulse-overlay 3s infinite ease-in-out;
}

@keyframes pulse-overlay {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.95);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

/* 消息弹入动画 */
@keyframes messagePopIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05) translateY(-5px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 消息摇摆动画 */
@keyframes messageWobble {

  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  25% {
    transform: rotate(1deg) scale(1.01);
  }

  50% {
    transform: rotate(-1deg) scale(1.02);
  }

  75% {
    transform: rotate(0.5deg) scale(1.01);
  }
}

/* 消息果冻动画 */
@keyframes messageJelly {

  0%,
  100% {
    transform: scale(1, 1);
    border-radius: 25px;
  }

  25% {
    transform: scale(1.03, 0.97);
    border-radius: 27px;
  }

  50% {
    transform: scale(0.97, 1.03);
    border-radius: 23px;
  }

  75% {
    transform: scale(1.02, 0.98);
    border-radius: 26px;
  }
}

/* 头像浮动动画 */
@keyframes avatarFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 滑入动画 */
@keyframes slideInRight {
  from {
    transform: translateX(100px);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100px);
  }

  to {
    transform: translateX(0);
  }
}

/* 淡入滑入组合动画 */
@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 消息出现时的微弹跳效果 */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  50% {
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 打字机效果 */
@keyframes typewriter {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

.typewriter-text {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.typewriter-text.typewriter-complete {
  opacity: 1;
  transform: translateY(0);
}

.usage-footer {
  margin: 16px;
  padding: 12px;
  text-align: center;
  color: #666;
  font-size: 14px;
  border-top: 1px solid #eee;
  background: #fafafa;
  border-radius: 8px;
}

/* 使用概览卡片 - 全新设计 */
.usage-summary {
  margin: 0 16px 24px 16px;
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  box-shadow: 0 8px 32px rgba(0, 71, 171, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* 鼠标悬停效果 */
.usage-summary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 71, 171, 0.18), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.usage-summary-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* 标题图标美化 */
.usage-summary-title::before {
  content: "📊";
  font-size: 24px;
  margin-right: 5px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.usage-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}

.usage-chip {
  background: linear-gradient(145deg, #ffffff 0%, #f5f7ff 100%);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 255, 0.8);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.usage-chip:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 71, 171, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.usage-chip-label {
  font-size: 14px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 为每个数据类型添加图标 */
.usage-chip:nth-child(1) .usage-chip-label::before {
  content: "🖱️";
  font-size: 16px;
}

.usage-chip:nth-child(2) .usage-chip-label::before {
  content: "👁️";
  font-size: 16px;
}

.usage-chip-value {
  font-size: 28px;
  font-weight: 800;
  color: #2563eb;
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
  position: relative;
}

/* 数字发光效果 */
.usage-chip-value::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
  border-radius: 12px;
  z-index: -1;
  filter: blur(5px);
  opacity: 0.7;
}

.usage-chip-value span {
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
}

/* 装饰性元素 */
.usage-chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 2px;
}

.usage-chip::after {
  content: "";
  position: absolute;
  right: -15px;
  bottom: -15px;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 70%);
  border-radius: 50%;
  z-index: 0;
}

/* 背景装饰 */
.usage-summary::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0) 70%);
  border-radius: 50%;
}

/* 添加动画效果 */
@keyframes pulse-glow {

  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* 响应式优化 */
@media (max-width: 420px) {
  .usage-summary {
    margin: 0 12px 20px 12px;
    padding: 20px;
  }

  .usage-summary-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .usage-chip {
    padding: 18px;
  }

  .usage-chip-value {
    font-size: 26px;
  }

  .usage-chip-label {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 输入容器样式 - 增强版 */
/* 输入容器样式 - 极简版 */
.input-container {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  transition: all 0.3s ease;
}

.input-container.loading {
  opacity: 0.8;
  pointer-events: none;
}

.input-wrapper {
  flex: 1;
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
}

#user_input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #E5E5EA;
  border-radius: 20px;
  font-size: 16px;
  resize: none;
  font-family: inherit;
  transition: all 0.2s ease;
  max-height: 120px;
  min-height: 40px;
  background: #FFFFFF;
  line-height: 1.4;
  box-sizing: border-box;
  color: #1c1c1e;
}

#user_input::placeholder {
  color: #aeaeb2;
}

#user_input:focus {
  outline: none;
  border-color: #007AFF;
  background: #FFFFFF;
}

#user_input:disabled {
  background: #F2F2F7;
  color: #aeaeb2;
}

.char-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 10px;
  color: #aeaeb2;
  pointer-events: none;
  display: none;
  /* Hide char count for cleaner look unless needed */
}

/* 发送按钮 - 极简版 */
#send_btn {
  background: #007AFF;
  color: white;
  border: none;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}

#send_btn::after {
  content: "↑";
  /* Simple arrow or icon */
  font-size: 20px;
  font-weight: 600;
  display: block;
  margin-top: -2px;
}

#send_btn:hover:not(:disabled) {
  background: #0062cc;
  transform: scale(1.05);
}

#send_btn:active:not(:disabled) {
  transform: scale(0.95);
}

#send_btn:disabled {
  background: #E5E5EA;
  color: #aeaeb2;
  box-shadow: none;
  cursor: default;
}

/* 空状态样式 - 极简版 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
  color: #8e8e93;
  text-align: center;
  background: transparent;
}

.empty-state-icon {
  font-size: 60px;
  margin-bottom: 20px;
  opacity: 0.5;
  filter: grayscale(100%);
}

.empty-state h3 {
  font-size: 20px;
  margin: 0 0 8px 0;
  color: #1c1c1e;
  font-weight: 600;
}

.empty-state p {
  font-size: 15px;
  margin: 0;
  color: #8e8e93;
  line-height: 1.5;
  max-width: 280px;
}

/* 移动端优化 */
@media (max-width: 480px) {
  .chat-container {
    margin: 0;
    height: calc(100vh - 120px);
    border-radius: 0;
  }

  .chat-header {
    padding: 16px 16px;
  }

  .chat-header h2 {
    font-size: 18px;
  }

  .header-icon {
    font-size: 24px;
    margin-right: 8px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
  }

  .messages-container {
    padding: 20px 16px;
  }

  .message {
    margin-bottom: 14px;
  }

  .message-content {
    max-width: 85%;
    padding: 12px 14px;
    font-size: 14px;
  }

  .message-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .input-container {
    padding: 12px 14px;
    gap: 8px;
  }

  #user_input {
    font-size: 14px;
    padding: 10px 14px 24px 14px;
    min-height: 44px;
    border-radius: 20px;
  }

  #send_btn {
    width: 44px;
    height: 44px;
  }

  #send_btn::after {
    font-size: 16px;
  }

  .typing-indicator {
    max-width: 70px;
  }

  .empty-state {
    padding: 40px 20px;
  }

  .empty-state-icon {
    font-size: 56px;
    margin-bottom: 20px;
  }

  .empty-state h3 {
    font-size: 18px;
  }

  .empty-state p {
    font-size: 14px;
  }
}

/* 用户反馈页面样式 */
.feedback-page {
  height: 100%;
  overflow-y: auto;
  background: #F2F2F7;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.feedback-container {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.feedback-header {
  text-align: center;
  margin-bottom: 32px;
}

.feedback-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
  animation: float-icon 3s ease-in-out infinite;
}

.feedback-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1c1c1e;
  margin: 0 0 8px 0;
}

.feedback-header p {
  font-size: 16px;
  color: #8e8e93;
  margin: 0;
}

.feedback-content {
  width: 100%;
  margin-bottom: 32px;
}

.feedback-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background: #F2F2F7;
  border-radius: 16px;
  margin-bottom: 16px;
  transition: transform 0.2s ease;
}

.feedback-item:hover {
  transform: translateY(-2px);
  background: #E5E5EA;
}

.item-icon {
  font-size: 24px;
  margin-right: 16px;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.item-text h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1c1c1e;
  margin: 0 0 4px 0;
}

.item-text p {
  font-size: 14px;
  color: #636366;
  margin: 0;
  line-height: 1.5;
}

.feedback-action {
  width: 100%;
  text-align: center;
}

.feedback-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #007AFF;
  color: white;
  font-size: 17px;
  font-weight: 600;
  padding: 16px 32px;
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
  width: 100%;
  box-sizing: border-box;
}

.feedback-button:hover {
  background: #0062cc;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.feedback-button:active {
  transform: scale(0.98);
}

.feedback-button span {
  margin-right: 8px;
}

.feedback-note {
  font-size: 12px;
  color: #aeaeb2;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .feedback-page {
    padding: 16px;
  }

  .feedback-container {
    padding: 24px 16px;
  }

  .feedback-header h2 {
    font-size: 20px;
  }

  .feedback-icon {
    font-size: 40px;
  }

  .feedback-button {
    padding: 14px 24px;
    font-size: 16px;
  }
}