/* ========================================================================
   豆包AI对话 — 全局样式（商务蓝 · 简洁版）
   视觉基准：Axure原型（豆包蓝白风）—— 品牌蓝 #1E6FFF / 白底 / 浅灰
   2026-08-26 重构：剔除卡通涂鸦，回归商务蓝简洁画风
   ======================================================================== */

/* ---------- 1. 设计 Token ---------- */
:root {
  /* 配色（商务蓝） */
  --blue:        #1E6FFF;   /* 品牌蓝：发送按钮/主强调/链接/选中 */
  --blue-deep:   #0D5FDB;   /* 深蓝：按下态 */
  --blue-soft:   #E8F0FF;   /* 用户消息气泡浅蓝 */
  --blue-mid:    #D9E9FF;   /* 用户消息含图区 */
  --blue-tint:   #F0F6FF;   /* 浅蓝底：图标底/选中浅底 */
  --bg:          #FFFFFF;   /* 全局背景 */
  --bg-gray:     #F0F0F0;   /* 状态栏灰 */
  --surface:     #FFFFFF;   /* 卡片/输入框白底 */
  --bubble-ai:   #F7F8FA;   /* AI欢迎气泡米白 */
  --ink:         #272636;   /* 主文字 */
  --ink-muted:   #575B66;   /* 次要文字 */
  --placeholder: #B0B0B0;   /* 占位符 */
  --border:      #E0E0E0;   /* 卡片/输入框边框 */
  --divider:     #EEEEEE;   /* 分隔线 */
  --danger:      #C62828;   /* 删除×/警告红 */
  --icon:        #575B66;   /* 图标色 */
  --icon-2:      #AAAAAA;   /* 图标灰 */
  --label-bg:    #F0F1F3;   /* 搜索框/标签背景 */

  /* 字号 */
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-base: 14px;
  --fs-md:   16px;
  --fs-lg:   18px;
  --fs-xl:   20px;

  /* 间距（8px 网格） */
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* 圆角（标准，非歪扭） */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-full: 999px;

  /* 字体（系统，干净） */
  --font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC',
               'Microsoft YaHei', 'Helvetica Neue', sans-serif;
}

/* ---------- 2. Reset & 基础 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 375px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

/* 滚动条隐藏 */
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 3. 系统状态栏（App 不自绘，仅预留顶部安全区；系统状态栏由手机原生显示） ---------- */
.page-landing,
.page-chat {
  padding-top: env(safe-area-inset-top, 0px);
}

/* ---------- 4. 品宣页（index.html） ---------- */
.page-landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* 冒泡动画背景层 */
.bubble-bg {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.bubble {
  position: absolute;
  white-space: nowrap;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  opacity: 0.30;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); opacity: 0.30; }
  50%      { transform: translateY(-10px) rotate(1deg);  opacity: 0.45;  }
}

/* 功能卡片区 */
.landing-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 var(--sp-4);
}

.card-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.feature-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 100px;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.feature-card:active {
  transform: scale(0.98);
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(30, 111, 255, 0.12);
}
.feature-card .card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--blue-tint);
}
.feature-card .card-icon svg {
  width: 26px;
  height: 26px;
}
.feature-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.feature-card .card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
}
.feature-card .card-desc {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
}
.feature-card .card-hint {
  font-size: var(--fs-xs);
  color: var(--icon-2);
}

/* Logo + 品牌区 */
.brand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-4);
}
.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  border: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--blue-tint);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--blue);
}
.brand-name {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--ink);
  height: 28px;
  line-height: 28px;
}
.brand-subtitle {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  height: 20px;
  line-height: 20px;
}

/* "立刻开始"按钮 */
.start-btn {
  width: 100%;
  height: 52px;
  margin-bottom: var(--sp-8);
  background: var(--blue);
  color: #fff;
  font-size: var(--fs-lg);
  font-weight: 600;
  border: none;
  border-radius: var(--r-md);
  animation: breathe 3s ease-in-out infinite;
  transition: filter 0.2s;
}
.start-btn:active { filter: brightness(1.08); }

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

/* ---------- 5. 对话页通用骨架 ---------- */
.page-chat {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* 顶部导航 */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 var(--sp-4);
  flex-shrink: 0;
  border-bottom: 1px solid var(--divider);
}
.top-nav .nav-left {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.top-nav .nav-logo {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--blue);
}
.top-nav .nav-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.top-nav .nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-nav .nav-icon svg,
.top-nav .nav-icon img {
  width: 22px;
  height: 22px;
}

/* 消息流区 */
.chat-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* 固定区：欢迎气泡+模式选择+快捷标签，不随消息列表滚动 */
.chat-fixed-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* 消息列表区 */
#messageList {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* AI 欢迎气泡 */
.welcome-bubble {
  align-self: flex-start;
  max-width: 78%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bubble-ai);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  color: var(--ink);
}

/* 消息气泡通用 */
.msg-bubble {
  max-width: 78%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  word-wrap: break-word;
}
.msg-user {
  align-self: flex-end;
  background: var(--blue-soft);
  color: var(--ink);
}
.msg-ai {
  align-self: flex-start;
  background: var(--surface);
  color: var(--ink);
}

/* 用户消息图片卡片 */
.msg-user .msg-image {
  width: 100%;
  max-width: 200px;
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-2);
}

/* AI 回复 — 深度思考折叠区 */
.think-fold {
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.think-fold .think-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
}
.think-fold .think-header svg,
.think-fold .think-header img {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}
.think-fold.expanded .think-header svg {
  transform: rotate(180deg);
}
.think-fold .think-body {
  display: none;
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px dashed var(--border);
  white-space: pre-wrap;
}
.think-fold.expanded .think-body {
  display: block;
}

/* AI 回复操作栏 */
.action-bar {
  display: flex;
  gap: var(--sp-4);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--divider);
}
.action-bar .action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  transition: background 0.2s;
}
.action-bar .action-btn svg,
.action-bar .action-btn img {
  width: 18px;
  height: 18px;
  stroke: var(--icon);
}
.action-bar .action-btn.active svg {
  stroke: var(--blue);
  fill: var(--blue);
}
.action-bar .action-btn:active {
  background: var(--blue-tint);
}

/* ---------- 6. 模式选择 ---------- */
.mode-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.mode-row {
  display: flex;
  gap: var(--sp-2);
}
.mode-tag {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  transition: all 0.2s;
}
.mode-tag.selected {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.mode-tag .check {
  display: none;
  font-size: 14px;
  line-height: 1;
}
.mode-tag.selected .check {
  display: inline;
}
.mode-desc {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  padding-left: var(--sp-2);
}

/* ---------- 7. 快捷标签 ---------- */
/* 快捷标签：单行不换行，放不下横向滑动 */
.quick-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--sp-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.quick-tags::-webkit-scrollbar {
  display: none;
}
.quick-tag {
  flex: 0 0 auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--ink);
  transition: all 0.2s;
}
.quick-tag.emphasis {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-tint);
}
.quick-tag:active {
  background: var(--blue-tint);
}
/* 快捷标签右侧可点箭头 */
.quick-tag::after {
  content: '›';
  margin-left: 3px;
  color: var(--icon-2);
  font-size: var(--fs-sm);
  line-height: 1;
}
.quick-tag.emphasis::after {
  color: var(--blue);
}

/* ---------- 8. 上传预览区 ---------- */
.upload-preview {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.thumb-item {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-item .thumb-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border: 1.5px solid var(--surface);
  z-index: 1;
}
/* 文件附件样式 */
.thumb-item.file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  padding: 2px;
}
.thumb-item.file-item svg {
  width: 24px;
  height: 24px;
}

.thumb-add {
  width: 64px;
  height: 64px;
  border: 1px dashed var(--icon-2);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--icon-2);
  background: transparent;
}

/* 文件附件 chip（格式徽标 + 文件名 + ×） */
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--ink);
}
.file-chip .file-type {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--blue-tint);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}
.file-chip .file-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-chip .file-del {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--icon-2);
  font-size: 14px;
  line-height: 1;
}
.file-chip .file-del:active {
  background: var(--danger);
  color: #fff;
}

/* 上下文标签（上传附件后的小标签） */
.context-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px var(--sp-2);
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  color: var(--ink);
}
.context-tag svg,
.context-tag img {
  width: 14px;
  height: 14px;
}

/* ---------- 8.5 底部工具区（模式选择+快捷键，模块整体下移到输入区上方） ---------- */
.chat-bottom-tools {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-2);
  background: var(--bg);
  border-top: 1px solid var(--divider);
}

/* ---------- 9. 底部输入区 ---------- */
.input-area {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg);
  border-top: 1px solid var(--divider);
}
.input-area .btn-attach {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}
.input-area .btn-attach svg,
.input-area .btn-attach img {
  width: 24px;
  height: 24px;
  stroke: var(--icon);
}
.input-area .input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
}
.input-area textarea {
  flex: 1;
  font-size: var(--fs-base);
  color: var(--ink);
  resize: none;
  max-height: 80px;
  line-height: 1.4;
}
.input-area textarea::placeholder {
  color: var(--placeholder);
}
/* 发送按钮：空输入置灰 / 有内容高亮蓝（商务蓝） */
.input-area .btn-send {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: var(--placeholder);
  transition: background 0.2s;
}
.input-area .btn-send.active {
  background: var(--blue);
}
.input-area .btn-send img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  opacity: 0.55;
}
.input-area .btn-send.active img {
  opacity: 1;
}

/* ---------- 10. 侧滑抽屉（菜单栏） ---------- */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: none;
}
.drawer-overlay.show {
  display: block;
}
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 306px;
  max-width: 82%;
  background: var(--surface);
  z-index: 101;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.drawer.show {
  transform: translateX(0);
}
.drawer-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  margin-top: 24px;
}
.drawer-search .search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--label-bg);
}
.drawer-search .search-box svg,
.drawer-search .search-box img {
  width: 20px;
  height: 20px;
  stroke: var(--icon);
}
.drawer-search .search-box input {
  flex: 1;
  font-size: var(--fs-sm);
}
.drawer-search .btn-new {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.drawer-search .btn-new svg,
.drawer-search .btn-new img {
  width: 20px;
  height: 20px;
  stroke: var(--blue);
}
.convo-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--sp-4);
}
.convo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-base);
  color: var(--ink);
  transition: background 0.15s;
  cursor: pointer;
}
.convo-item.active {
  background: var(--blue-tint);
  color: var(--blue);
  font-weight: 600;
}
.convo-item:active {
  background: var(--blue-tint);
}
.convo-item .convo-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo-item .convo-del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-left: var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--icon-2);
  font-size: 15px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.convo-item .convo-del:active {
  background: var(--danger);
  color: #fff;
}
.convo-item .convo-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--blue);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.convo-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.convo-divider::before,
.convo-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--divider);
}

/* "更多会话" 折叠/展开 */
.convo-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--blue);
  cursor: pointer;
}
.convo-expand:active {
  background: var(--blue-tint);
}

/* 会话列表空态 */
.convo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--icon-2);
}
.drawer-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-top: 1px solid var(--divider);
  flex-shrink: 0;
}
.drawer-footer .avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--blue-tint);
  flex-shrink: 0;
}
.drawer-footer .vip-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--label-bg);
  font-size: var(--fs-sm);
  color: var(--ink);
  flex: 1;
}
.drawer-footer .vip-btn svg,
.drawer-footer .vip-btn img {
  width: 16px;
  height: 16px;
  stroke: var(--blue);
}
.drawer-footer .btn-settings {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drawer-footer .btn-settings svg,
.drawer-footer .btn-settings img {
  width: 22px;
  height: 22px;
  stroke: var(--icon);
}

/* ---------- 11. 附件选择面板 ---------- */
.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: none;
}
.sheet-overlay.show {
  display: block;
}
.attach-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 375px;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  z-index: 101;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: var(--sp-4) var(--sp-4) var(--sp-8);
}
.attach-sheet.show {
  transform: translateX(-50%) translateY(0);
}
.attach-sheet .sheet-title {
  text-align: center;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--sp-4);
}
.attach-sheet .sheet-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-base);
  color: var(--ink);
}
.attach-sheet .sheet-option:active {
  background: var(--blue-tint);
}
.attach-sheet .sheet-option svg,
.attach-sheet .sheet-option img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: var(--icon);
}
.attach-sheet .sheet-option .opt-desc {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-left: auto;
}
.attach-sheet .sheet-cancel {
  margin-top: var(--sp-4);
  padding: var(--sp-3);
  text-align: center;
  font-size: var(--fs-base);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}

/* ---------- 12. API Key 输入弹窗 ---------- */
.apikey-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.apikey-modal.show {
  display: flex;
}
.apikey-box {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.apikey-box h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}
.apikey-box p {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
}
.apikey-box input {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-3);
}
.apikey-box .apikey-actions {
  display: flex;
  gap: var(--sp-2);
}
.apikey-box .apikey-actions button {
  flex: 1;
  padding: var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  text-align: center;
}
.apikey-box .btn-save {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.apikey-box .btn-skip {
  background: var(--surface);
  color: var(--ink-muted);
}

/* ---------- 13. Toast 提示 ---------- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: var(--sp-3) var(--sp-5);
  background: rgba(39, 38, 54, 0.92);
  color: #fff;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.toast.show {
  opacity: 1;
}

/* ---------- 14. 加载态 ---------- */
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--sp-2) 0;
}
.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--icon);
  animation: dotPulse 1.4s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1);  }
}

/* ---------- 15. 无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
