/* 苹果风格超简约设计 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 苹果风格色彩 */
  --primary: #2d7ff9;
  --primary-dark: #1760c4;
  --secondary: #6c5ce7;
  --success: #34c759;
  --warning: #ff9500;
  --danger: #ff3b30;

  /* 中性色 */
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #c7c7cc;
  --background: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e6eb;

  /* 阴影 */
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* 圆角 */
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 16px;
  --radius-xl: 20px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
}

body {
  background: #f7f8fa;
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial,
    sans-serif;
  color: #222;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

.app {
  max-width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  text-align: center;
  margin: 32px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 1px 0;
  position: relative;
}

.header i {
  font-size: 2.4rem;
  color: var(--primary);
  animation: rotate 20s linear infinite;
}

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

.header h1 {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.02em;
}

/* 主内容区域 */
.main {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 问题输入区 */
.question-section {
  margin-bottom: var(--space-lg);
}

.input-card {
  background: var(--surface);
  border-radius: var(--radius-large);
  padding: var(--space-lg);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);
}

.input-card textarea {
  width: 100%;
  border: none;
  resize: none;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: transparent;
}

.input-card textarea:focus {
  outline: none;
}

/* 数字输入区 */
.numbers-section {
  margin-bottom: var(--space-lg);
}

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.number-input {
  background: var(--surface);
  border-radius: var(--radius-large);
  padding: var(--space-lg);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);
}

.number-input label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.input-with-btn {
  display: flex;
  gap: var(--space-sm);
}

.input-with-btn input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 10px 12px;
  font-size: 1rem;
}

.input-with-btn input:focus {
  outline: none;
  border-color: var(--primary);
}

.random-btn {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.random-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 计算按钮 */
.action-section {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.calculate-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-medium);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.calculate-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.calculate-btn i {
  font-size: 1.1rem;
}

/* 结果区域 */
.results {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  animation: fadeInUp 0.5s ease;
}

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

.result-card {
  background: var(--surface);
  border-radius: var(--radius-large);
  padding: var(--space-lg);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);
}

.result-card.gua-name {
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
}

.result-card.gua-name .hexagram-name {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

/* 聊天区域 */
.chat-section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: none;
  margin: 0;
  padding: 0;
  height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-light);
}

.chat-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.chat-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  width: 100%;
  padding: 0 12px;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-left: 12px;
}

.back-home-btn:hover {
  background: rgba(22, 119, 255, 0.08);
}

.back-home-btn i {
  font-size: 16px;
}

.title-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.title-container .fa-yin-yang {
  color: var(--primary);
}

/* 确保返回按钮不会被标题遮挡 */
.back-home-btn {
  z-index: 1;
}

.chat-main {
  flex: 1;
  overflow-y: auto;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 100px;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-small);
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.chat-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: transparent;
  border: none;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.chat-messages {
  height: 80vh;
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

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

.chat-footer {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  background: transparent;
  border: none;
  margin: 0 16px;
  z-index: 100;
}

/* 向下按钮 */
.scroll-to-bottom-btn {
  position: absolute;
  float: right;
  bottom: 124px;
  right: 10px;
  width: 30px;
  height: 26px;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  z-index: 1000;
}

.visible {
  display: flex;
  transform: translateY(0);
}

.chat-input-bar {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  padding: 0 24px;
  align-items: center;
  background: white;
  border-radius: 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

#chat-input {
  flex: 1;
  min-height: 68px;
  max-height: 120px;
  border: none;
  border-radius: 28px;
  padding: 20px;
  font-size: 16px;
  line-height: 1.5;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  background: transparent;
  resize: none;
  overflow-y: auto;
}

#chat-input:focus {
  background: transparent;
}

.send-btn {
  width: 44px;
  height: 44px;
  margin: 12px 6px;
  border: none;
  background: #1677ff;
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.send-btn:hover {
  background: #0056d6;
  transform: scale(1.05);
}

/* 系统消息样式 */
.system-message {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px 24px;
  font-size: 1rem;
  background: rgba(45, 127, 249, 0.02);
  border-radius: var(--radius-medium);
  margin: 24px auto;
  max-width: 800px;
}

.system-message i {
  margin-right: 8px;
  color: var(--primary);
}

/* 对话消息无气泡，DeepSeek风格 */
.message {
  margin: 24px auto;
  padding: 0 24px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  width: 100%;
  font-size: 1.15rem;
  line-height: 1.8;
  word-break: break-word;
  display: block;
  box-sizing: border-box;
  max-width: 800px;
}

.user-message {
  /* background: #f5f8ff;
  border-radius: 16px;
  border: 1px solid #e5eaf3;
  box-shadow: 0 2px 8px 0 rgba(22, 119, 255, 0.04); */
  max-width: 710px;
  margin-left: auto;
  margin-right: auto;
  text-align: right;
  color: var(--primary);
  padding: 16px 0;
  margin-bottom: 16px;
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.8;
}

.ai-message {
  text-align: left;
  color: #222;
  background: none;
  padding-left: 24px;
  margin: 0 auto;
}

/* 格式化AI回复内容 */
.ai-formatted-message {
  background: #f5f8ff;
  border-radius: 16px;
  box-shadow: 0 2px 8px 0 rgba(22, 119, 255, 0.04);
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid #e5eaf3;
  color: #222;
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.6;
  max-width: 95%;
  margin-left: auto;
  margin-right: auto;
}

/* Markdown标题样式 */
.ai-formatted-message h1,
.ai-formatted-message h2,
.ai-formatted-message h3,
.ai-formatted-message h4,
.ai-formatted-message h5,
.ai-formatted-message h6 {
  margin-top: 16px;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Markdown引用样式 */
.ai-formatted-message blockquote {
  margin: 12px 0;
  padding: 10px 16px;
}

.ai-formatted-message blockquote p {
  margin: 6px 0;
}

/* 列表样式 */
.ai-formatted-message ul,
.ai-formatted-message ol {
  margin: 8px 0 8px 24px;
  padding: 0;
}

.ai-formatted-message ul li,
.ai-formatted-message ol li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.ai-formatted-message ul li::marker {
  color: #1677ff;
}

.ai-formatted-message ol li::marker {
  color: #1677ff;
  font-weight: 500;
}

/* 嵌套列表样式 */
.ai-formatted-message ul ul,
.ai-formatted-message ul ol,
.ai-formatted-message ol ul,
.ai-formatted-message ol ol {
  margin-top: 8px;
  margin-bottom: 8px;
}

/* 段落样式 */
.ai-formatted-message p {
  margin: 8px 0;
  line-height: 1.6;
}

/* 粗体文本样式 */
.ai-formatted-message strong {
  color: #1677ff;
  font-weight: 600;
}

.core-tip {
  color: #ff9800;
  font-weight: 600;
}

.reminder {
  background: #fffbe6;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 10px;
  color: #b26a00;
  font-size: 15px;
}

h3,
.section-title {
  font-size: 18px;
  color: #1677ff;
  font-weight: 600;
  margin: 32px 0 12px 0;
  border-left: 4px solid #1677ff;
  padding-left: 10px;
  background: none;
}

/* 段落标题样式 */
.ai-message strong {
  color: var(--primary);
  font-weight: 600;
}

/* 卦象解读格式 */
.ai-message h3 {
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-top: 20px;
  font-size: 1.2rem;
}

/* 列表项样式 */
.ai-message li {
  margin-bottom: 6px;
}

/* 特殊格式 - 卦象总览等标题 */
.ai-message h3:first-of-type {
  margin-top: 0;
}

/* 格式化AI回复中的特殊标记 */
.ai-message {
  white-space: pre-wrap;
}

/* 替换原始文本为格式化HTML */
.ai-formatted-message h3:first-child {
  margin-top: 0;
}

/* 卦象总览样式 */
.ai-formatted-message h3:first-child + ul {
  background: rgba(45, 127, 249, 0.03);
  padding: 16px 24px;
  border-radius: var(--radius-medium);
  margin: 16px 0;
}

/* 动态内容加载动画已移至.ai-content-streaming类 */

@keyframes loading-dots {
  0% {
    content: ".";
  }
  33% {
    content: "..";
  }
  66% {
    content: "...";
  }
  100% {
    content: ".";
  }
}

/* 限制图片、代码块、表格等内容宽度 */
.message img,
.message pre,
.message code,
.message table {
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-all;
  overflow-x: auto;
}
.message pre {
  white-space: pre-wrap;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  font-size: 0.95em;
}

/* 响应式优化 */
@media (max-width: 700px) {
  .app-container {
    padding: 0 16px;
  }

  .header {
    margin: 16px auto;
    padding: 8px 0;
  }

  .header h1 {
    font-size: 1.4rem;
  }

  .message {
    padding: 0 16px;
    font-size: 1rem;
    margin: 20px auto;
  }

  .chat-input-area {
    padding: 16px;
    bottom: 16px;
    border-radius: var(--radius-medium);
  }

  .chat-messages {
    padding-bottom: 100px;
  }

  .system-message {
    margin: 16px;
    padding: 24px 16px;
  }

  .numbers-grid {
    grid-template-columns: 1fr;
  }

  .back-btn {
    right: 16px;
    width: 32px;
    height: 32px;
  }

  .random-btn {
    width: 32px;
    height: 32px;
  }
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-secondary);
}

.loading::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin: var(--space-md) auto 0;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 动爻样式 */
.active-yao {
  background: var(--background);
  border-radius: var(--radius-small);
  padding: var(--space-sm);
  margin: var(--space-xs) 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.yao-number {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

/* 流式输出动画 */
.ai-content-streaming::after {
  content: "▋";
  animation: blink 1s infinite;
  color: var(--primary);
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* 通知样式 */
.notification {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  background: var(--surface);
  color: var(--text-primary);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-heavy);
  border: 1px solid var(--border);
  z-index: 1000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: 300px;
}

.notification.show {
  transform: translateX(0);
}

.notification.error {
  border-left: 4px solid var(--danger);
}

.notification.success {
  border-left: 4px solid var(--success);
}

.notification.error i {
  color: var(--danger);
}

.notification.success i {
  color: var(--success);
}

/* 全局加载 */
.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.global-loading.show {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: white;
  margin-top: var(--space-md);
  font-size: 1rem;
  font-weight: 500;
}

/* 隐藏数字输入框的上下箭头（spinner） */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

.error {
  color: var(--danger);
  text-align: center;
  padding: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--danger);
  border-radius: var(--radius-medium);
  margin: var(--space-md) 0;
}

/* 新增UI元素样式 */
.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.input-label i {
  color: var(--primary);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.section-header i {
  color: var(--primary);
  font-size: 1.2rem;
}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* 提示区域 */
.numbers-hint {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--background);
  border-radius: var(--radius-medium);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hint-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.hint-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.hint-item i {
  color: var(--primary);
  margin-top: 4px;
  font-size: 1rem;
}

.hint-item p {
  margin: 0;
  line-height: 1.5;
  color: var(--text-secondary);
  flex: 1;
}

@media (max-width: 700px) {
  .hint-detail {
    gap: var(--space-sm);
  }

  .hint-item {
    font-size: 0.85rem;
  }
}

.back-btn {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--background);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: var(--primary);
  color: white;
}

.input-tools {
  display: flex;
  gap: 8px;
  margin-right: 8px;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: var(--background);
  color: var(--primary);
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #1677ff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 10px 4px 0;
  margin-right: 16px;
  border-radius: 6px;
  transition: background 0.15s;
}

.back-home-btn:hover {
  background: #f0f6ff;
}

.back-home-btn i {
  font-size: 18px;
}

/* AI内容样式 - 保持原始格式 */
.ai-content {
  background: #f5f8ff;
  border-radius: 16px;
  box-shadow: 0 2px 8px 0 rgba(22, 119, 255, 0.04);
  padding: 24px 28px;
  margin-bottom: 32px;
  border: 1px solid #e5eaf3;
  color: #222;
  text-align: left;
  overflow-wrap: break-word;
}

/* pre标签样式 - 保持原始格式 */
.ai-content pre {
  white-space: pre-wrap;
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  overflow: visible;
}

/* 代码块样式 */
.ai-content code {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  background: #f1f1f1;
  padding: 2px 4px;
  border-radius: 4px;
  color: #333;
  font-size: 14px;
}

/* 保持流式输出样式 */
.ai-content-streaming {
  position: relative;
  min-height: 24px;
}

.ai-content-streaming:after {
  content: "...";
  animation: loading-dots 1.5s infinite;
  display: inline-block;
  width: 24px;
}

/* 用户消息样式 */
.user-content {
  text-align: right;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.user-content .raw-text {
  white-space: pre-wrap;
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: none;
  overflow: visible;
  text-align: right;
}

/* 原始文本样式 - 完全不进行任何格式化 */
.raw-text {
  white-space: pre-wrap;
  font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.8;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  overflow: visible;
  color: #222;
}

/* 代码块样式 */
.ai-formatted-message pre.code-block {
  margin: 12px 0;
  padding: 14px;
}

/* 行内代码样式 */
.ai-formatted-message code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,
    monospace;
  background: #f6f8fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: #24292e;
}

/* 斜体样式 */
.ai-formatted-message em {
  font-style: italic;
  color: #666;
}

/* 删除线样式 */
.ai-formatted-message del {
  text-decoration: line-through;
  color: #999;
}

/* 水平线样式 */
.ai-formatted-message hr {
  margin: 16px 0;
}

/* 链接样式 */
.ai-formatted-message a {
  color: #1677ff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ai-formatted-message a:hover {
  color: #4096ff;
  text-decoration: underline;
}

/* 图片样式 */
.ai-formatted-message img {
  margin: 12px 0;
}

/* 强调样式优化 */
.ai-formatted-message strong em,
.ai-formatted-message em strong {
  color: #1677ff;
  font-weight: 600;
  font-style: italic;
}

/* 顶部简介 */
.intro-brief {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  background: rgba(45, 127, 249, 0.05);
  border-radius: var(--radius-medium);
  border-left: 3px solid var(--primary);
}

.intro-brief i {
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
}

.intro-brief p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 介绍部分 */
.intro-card {
  background: var(--surface);
  border-radius: var(--radius-large);
  padding: var(--space-lg);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border);
}

.intro-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.intro-header i {
  font-size: 1.4rem;
  color: var(--primary);
}

.intro-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.intro-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.intro-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  background: var(--background);
  border-radius: var(--radius-medium);
  transition: all 0.3s ease;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

.feature i {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.feature span {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

@media (max-width: 700px) {
  .intro-features {
    grid-template-columns: 1fr;
  }
}

/* 反馈按钮 */
.feedback-button {
    position: fixed;
    right: 20px;
    bottom: 80px;
    background-color: #12B7F5;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(18, 183, 245, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    text-decoration: none;
    font-size: 14px;
}

.feedback-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(18, 183, 245, 0.4);
    background-color: #0ea4e0;
}

.feedback-button i {
    font-size: 1.1em;
    color: #fff;
}

.feedback-button span {
    color: #fff;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .feedback-button {
        bottom: auto;
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 16px;
    }
    
    .feedback-button i {
        font-size: 1em;
    }
}

/* 针对超小屏幕 */
@media (max-width: 320px) {
    .feedback-button span {
        display: none;
    }
    
    .feedback-button {
        padding: 6px;
        border-radius: 50%;
    }
    
    .feedback-button i {
        margin: 0;
    }
}

/* 页脚样式更新 */
.footer {
    background-color: var(--bg-light);
    padding: 15px 0;
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid #eee;
}

.beian {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.beian-link {
    color: var(--text-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.beian-link:hover {
    color: var(--primary-color);
}

.beian i {
    font-size: 1.1em;
    color: #666;
}

.beian-separator {
    margin: 0 10px;
    color: #999;
}

/* 移动端适配补充 */
@media (max-width: 700px) {
    .contact-item {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .contact-info {
        text-align: center;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 语言切换按钮 */
.lang-switch {
  position: absolute;
  top: 8px;
  right: 16px;
}

.lang-switch button {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.2s ease;
}

.lang-switch button:hover {
  background: var(--primary);
  color: #fff;
}
