:root {
  --brand: #FF7700;
  --brand-dark: #E56700;
  --brand-soft: #FFF0E0;
  --bg: #FFF8F0;
  --panel: #ffffff;
  --sidebar-bg: #f9fafc;
  --text: #1a1d24;
  --text-2: #5b6170;
  --text-3: #9aa1af;
  --line: #e8ebf1;
  --user-bubble: #FF7700;
  --think-bg: #f2f4f8;
  --danger: #e5484d;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── 登录页 ─────────────────────────────── */
.login-wrap {
  height: 100%;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  /* 对齐「小易管家管理后台」登录页的橙色渐变 */
  background: linear-gradient(135deg, #FF7700 0%, #FF9A3C 100%);
}

/* 背景装饰（光晕 + 圆 + 波浪 + 星星 + 圆点，对齐管理后台登录页风格） */
.bg-decor { position: absolute; inset: 0; pointer-events: none; }

.deco-circle { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.05); }
.deco-circle.c1 { top: -120px; right: -80px; width: 340px; height: 340px; }
.deco-circle.c2 { bottom: -60px; left: -80px; width: 260px; height: 260px; }
.deco-circle.c3 { bottom: 100px; right: -20px; width: 140px; height: 140px; background: rgba(255, 255, 255, 0.03); }

.deco-glow { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 154, 60, 0.5) 0%, rgba(255, 119, 0, 0) 100%); }
.deco-glow.g1 { top: 60px; left: 30px; width: 380px; height: 380px; }
.deco-glow.g2 { bottom: -120px; right: -60px; width: 460px; height: 460px; }

.deco-wave { position: absolute; bottom: 0; left: -40px; width: 540px; height: 180px; background: rgba(255, 255, 255, 0.03); border-radius: 80px 80px 0 0; }

.deco-star { position: absolute; }
.deco-star.s1 { top: 16%; left: 12%; width: 18px; height: 18px; }
.deco-star.s2 { top: 24%; right: 13%; width: 14px; height: 14px; }
.deco-star.s3 { bottom: 16%; right: 20%; width: 12px; height: 12px; }
.deco-star.s4 { bottom: 30%; left: 16%; width: 16px; height: 16px; }
.deco-star.s5 { top: 42%; right: 5%; width: 11px; height: 11px; }

.deco-dot { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.deco-dot.d1 { top: 12%; left: 22%; width: 10px; height: 10px; opacity: .38; }
.deco-dot.d2 { top: 30%; right: 18%; width: 7px; height: 7px; opacity: .31; }
.deco-dot.d3 { bottom: 24%; left: 11%; width: 6px; height: 6px; opacity: .25; }
.deco-dot.d4 { bottom: 30%; right: 10%; width: 9px; height: 9px; opacity: .31; }
.deco-dot.d5 { top: 8%; right: 32%; width: 5px; height: 5px; opacity: .38; }
.deco-dot.d6 { top: 55%; left: 5%; width: 8px; height: 8px; opacity: .19; }
.deco-dot.d7 { bottom: 12%; right: 28%; width: 6px; height: 6px; opacity: .21; }

.login-card {
  width: 100%; max-width: 400px;
  position: relative; z-index: 2;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px; padding: 40px 32px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex: none;
}
.login-logo h1 { font-size: 24px; font-weight: 700; }
.login-sub { color: var(--text-2); font-size: 14px; margin-bottom: 28px; }
.field { margin-bottom: 14px; }
.field input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 16px; color: var(--text); background: #fafbfd;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
.field-code { display: flex; gap: 10px; }
.field-code input { flex: 1; }
.code-btn {
  height: 48px; padding: 0 16px; white-space: nowrap;
  border: 1px solid var(--brand); border-radius: 12px;
  background: #fff; color: var(--brand); font-size: 14px; cursor: pointer;
}
.code-btn:disabled { color: var(--text-3); border-color: var(--line); cursor: not-allowed; }
.login-btn {
  width: 100%; height: 48px; border: none; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.login-btn:hover { background: var(--brand-dark); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--text-3); text-align: center; }

/* ── 聊天页（侧边栏 + 主区） ─────────────── */
.chat-wrap { height: 100%; display: flex; }

.sidebar {
  width: 260px; flex: none;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.sidebar-head { padding: 16px 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.sidebar-logo .logo-mark { width: 34px; height: 34px; border-radius: 9px; font-size: 17px; }
.logo-text { font-size: 17px; font-weight: 700; }

.new-chat-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 40px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.new-chat-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.session-list { flex: 1; overflow-y: auto; padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.session-item {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  color: var(--text-2); font-size: 14px;
  transition: background .12s;
}
.session-item:hover { background: #eef0f5; }
.session-item.active { background: var(--brand-soft); color: var(--brand); }
.session-item .si-icon { flex: none; opacity: .6; }
.session-item.active .si-icon { opacity: 1; }
.session-item .si-body { flex: 1; min-width: 0; }
.session-item .si-title {
  font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-item.active .si-title { color: var(--brand); }
.session-item .si-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.session-item .si-del {
  flex: none; width: 24px; height: 24px; border: none; background: none;
  color: var(--text-3); border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s;
}
.session-item:hover .si-del { opacity: 1; }
.session-item .si-del:hover { color: var(--danger); background: #fdecec; }

.sidebar-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.logout-btn {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--text-2);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.logout-btn:hover { color: var(--danger); border-color: var(--danger); }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-header {
  height: 56px; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.sidebar-toggle {
  display: none; width: 36px; height: 36px; border: none; background: none;
  color: var(--text-2); border-radius: 8px; cursor: pointer;
  align-items: center; justify-content: center;
}
.sidebar-toggle:hover { background: var(--think-bg); }
.header-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.header-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }

.msg-list {
  flex: 1; overflow-y: auto; padding: 24px 0;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.msg-list .inner { width: 100%; max-width: 820px; padding: 0 20px; }

.msg { display: flex; margin-bottom: 4px; }
.msg.user { justify-content: flex-end; }
.msg.ai { justify-content: flex-start; }

.msg .avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
}
.msg.ai .avatar { background: linear-gradient(135deg, #FF7700, #FFA64D); margin-right: 10px; }
.msg.user .avatar { background: #34c759; margin-left: 10px; order: 2; }

.bubble {
  max-width: 76%;
  padding: 12px 16px; border-radius: 16px;
  font-size: 15px; line-height: 1.75; word-break: break-word;
}
.msg.user .bubble { background: var(--user-bubble); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }

/* 思考折叠条 */
.think-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.think-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--think-bg);
  color: var(--text-2); font-size: 13px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.think-toggle:hover { color: var(--brand); border-color: var(--brand); }
.think-toggle .arrow { transition: transform .2s; font-size: 10px; }
.think-toggle.open .arrow { transform: rotate(180deg); }
.think-body { display: none; margin-bottom: 8px; }
.think-body.show { display: block; }
.think-content {
  border-left: 3px solid #d7deeb; padding: 10px 14px;
  color: var(--text-3); font-size: 13px; line-height: 1.7;
  background: var(--think-bg); border-radius: 0 8px 8px 0;
  white-space: pre-wrap; word-break: break-word;
}

/* mermaid 图表（正文内联插图，白底圆角和气泡统一） */
.mermaid {
  margin: 10px 0;
  padding: 12px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  text-align: center;
}
.mermaid svg { max-width: 100%; height: auto; }

/* ECharts 图表 JSON 容器（固定高度，否则图表可能不显示） */
.chart-json {
  width: 100%;
  height: 320px;
  margin: 10px 0;
}

/* 流式过程中未闭合的 mermaid 围栏占位 */
.mermaid-pending {
  margin: 10px 0;
  padding: 14px 12px;
  background: #fafbfc;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

/* 工具状态提示 */
.tool-hint {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
  padding: 8px 14px; border-radius: 999px; background: var(--brand-soft);
  margin-bottom: 8px;
}
.tool-hint .spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #FFD9B3; border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 附件解析进度提示 */
.attach-progress {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
  padding: 8px 14px; border-radius: 999px; background: var(--brand-soft);
  margin-bottom: 8px;
}
.attach-progress .spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #FFD9B3; border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
.attach-progress .ap-text { color: var(--text-2); }

.cursor { display: inline-block; width: 8px; height: 17px; background: var(--brand); vertical-align: text-bottom; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Markdown */
.md h1, .md h2, .md h3, .md h4 { margin: 12px 0 8px; line-height: 1.4; font-weight: 700; }
.md h1 { font-size: 20px; } .md h2 { font-size: 18px; } .md h3 { font-size: 16px; } .md h4 { font-size: 15px; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 4px 0; }
.md code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  background: #f0f2f6; padding: 2px 6px; border-radius: 5px; font-size: 13px; color: #c2410c;
}
.md pre {
  background: #0f172a; color: #e2e8f0; padding: 14px 16px;
  border-radius: 10px; overflow-x: auto; margin: 10px 0; line-height: 1.6;
}
.md pre code { background: none; color: inherit; padding: 0; font-size: 13px; }
.md blockquote {
  border-left: 3px solid var(--brand); background: var(--brand-soft);
  padding: 8px 14px; margin: 8px 0; color: var(--text-2); border-radius: 0 8px 8px 0;
}
.md a { color: var(--brand); text-decoration: none; }
.md a:hover { text-decoration: underline; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.md table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.md th { background: var(--think-bg); font-weight: 600; }
.md strong { font-weight: 700; }

/* 输入栏 */
.input-bar {
  flex: none; padding: 12px 20px 14px;
  background: var(--panel); border-top: 1px solid var(--line);
}
.input-bar .inner {
  width: 100%; max-width: 820px; margin: 0 auto;
  display: flex; flex-direction: column;
}
.input-box {
  flex: 1; border: 1px solid var(--line); border-radius: 16px;
  background: #fff; padding: 9px 12px; display: flex; align-items: center;
}
.input-box textarea {
  width: 100%; border: none; outline: none; resize: none;
  font-size: 15px; line-height: 1.6; max-height: 140px; font-family: inherit; color: var(--text);
}
.send-btn {
  width: 44px; height: 44px; flex: none; border: none; border-radius: 12px;
  background: var(--brand); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.send-btn:hover { background: var(--brand-dark); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 遮罩（移动端） */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; }

/* 来源 chips（千问式「参考资料」横排卡片，默认折叠收起，像思考过程一样点击展开） */
.cite-bar {
  margin-bottom: 10px;
}
.cite-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--think-bg);
  color: var(--text-2); font-size: 13px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.cite-toggle:hover { color: var(--brand); border-color: var(--brand); }
.cite-toggle .arrow { transition: transform .2s; font-size: 10px; }
.cite-toggle.open .arrow { transform: rotate(180deg); }
.cite-body { display: none; margin-top: 8px; }
.cite-body.show { display: block; }
.ascii-art-hint {
  font-size: 12px; color: var(--text-3); padding: 6px 10px;
  border-left: 2px solid var(--line); margin: 6px 0;
}
.cite-chips-head {
  font-size: 12px; color: var(--text-3); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.cite-chips-head::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); flex: none;
}
.cite-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cite-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s;
  max-width: 100%;
}
.cite-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.chip-num {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.chip-title {
  font-size: 13px; color: var(--text-2);
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 正文数字圆圈引用标记 */
.cite-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11px; font-weight: 600;
  vertical-align: super; margin: 0 1px; cursor: pointer;
  border: 1px solid #FFD9B3;
  line-height: 1;
}
.cite-num:hover { background: var(--brand); color: #fff; }

/* 右侧引用面板 */
.cite-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 340px; max-width: 90vw; background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  transform: translateX(100%); transition: transform .25s;
  z-index: 40; display: flex; flex-direction: column;
}
.cite-panel.open { transform: translateX(0); }
.cite-panel-head {
  height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--line); font-weight: 700;
}
.cite-panel-close { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--text-2); line-height: 1; }
.cite-panel-close:hover { color: var(--danger); }
.cite-panel-body { flex: 1; overflow-y: auto; padding: 12px; }
.cite-item {
  display: flex; gap: 10px; padding: 12px; border-radius: 10px;
  cursor: pointer; border: 1px solid transparent; margin-bottom: 4px;
}
.cite-item:hover { background: #f6f8fb; }
.cite-item.highlight { background: var(--brand-soft); border-color: var(--brand); }
.cite-item-num {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.cite-item-title { font-size: 14px; line-height: 1.5; color: var(--text); word-break: break-word; }

/* 空状态 */
.empty-sessions { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 30;
    transform: translateX(-100%); transition: transform .2s;
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .bubble { max-width: 84%; }
}

/* ================= 对话增强：操作条 ================= */
.msg-actions {
  display: flex; align-items: center; gap: 4px;
  margin-top: 2px; padding: 0 2px;
  opacity: 0; transition: opacity .15s;
}
.msg.user ~ .msg-actions { justify-content: flex-end; }
.inner:hover .msg-actions { opacity: 1; }
.action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; background: none; cursor: pointer;
  color: var(--text-3); font-size: 12px;
  padding: 4px 8px; border-radius: 6px;
}
.action-btn:hover { color: var(--brand); background: var(--brand-soft); }
.action-btn svg { width: 14px; height: 14px; }

/* ================= 对话增强：引用追问 ================= */
.quote-bar {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--brand-soft); border: 1px solid #FFD9B3;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 8px;
}
.quote-mark { width: 3px; align-self: stretch; background: var(--brand); border-radius: 2px; flex: none; }
.quote-text {
  flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.quote-cancel { border: none; background: none; color: var(--text-3); font-size: 18px; cursor: pointer; line-height: 1; padding: 0 2px; flex: none; }
.quote-cancel:hover { color: var(--danger); }

/* 消息气泡内的引用卡片 */
.quote-ref {
  font-size: 12px; color: var(--text-3);
  background: #f6f8fb; border-left: 2px solid var(--brand);
  padding: 5px 10px; border-radius: 0 6px 6px 0; margin-bottom: 6px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ================= 对话增强：附件 ================= */
.input-row { display: flex; align-items: flex-end; gap: 10px; width: 100%; }
.input-row .input-box { flex: 1; }
.attach-btn {
  width: 34px; height: 34px; flex: none;
  border: none; background: none; color: var(--text-2);
  cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.attach-btn:hover { color: var(--brand); background: var(--brand-soft); }

.attach-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.attach-item {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  background: #f6f8fb; border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; font-size: 12px; color: var(--text-2);
  max-width: 220px;
}
.attach-item img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; flex: none; }
.attach-item .a-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.attach-item .a-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item .a-del { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; flex: none; }
.attach-item .a-del:hover { color: var(--danger); }
.attach-item.uploading { border-color: #FFD9B3; }
/* 上传进度条 */
.attach-item .a-progress { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.attach-item .a-progress-track { flex: 1; height: 4px; background: #e7ecf3; border-radius: 2px; overflow: hidden; }
.attach-item .a-progress-bar { height: 100%; background: var(--brand); border-radius: 2px; transition: width .15s linear; }
.attach-item .a-progress-num { font-size: 10px; color: var(--text-3); width: 30px; text-align: right; flex: none; }

/* 气泡内附件展示 */
.bubble .attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bubble .attach-card {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f6f8fb; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--text);
  text-decoration: none; max-width: 240px; cursor: pointer;
}
.bubble .attach-card:hover { border-color: var(--brand); }
.bubble .attach-card img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.bubble .attach-card .a-ico { font-size: 22px; }
.bubble .attach-card .a-meta { display: flex; flex-direction: column; min-width: 0; }
.bubble .attach-card .a-meta .a-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble .attach-card .a-meta .a-size { font-size: 11px; color: var(--text-3); }

/* 编辑态：用户消息转输入框 */
.msg .bubble .edit-box { width: 100%; }
.msg .bubble .edit-box textarea {
  width: 100%; border: 1px solid var(--brand); border-radius: 8px; outline: none;
  font-size: 15px; line-height: 1.6; padding: 8px 10px; resize: none;
  font-family: inherit; color: var(--text); background: #fff;
}
.msg .bubble .edit-actions { display: flex; gap: 6px; margin-top: 6px; justify-content: flex-end; }
.edit-actions .ea-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 12px; padding: 4px 12px; border-radius: 6px; cursor: pointer;
}
.edit-actions .ea-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.edit-actions .ea-btn.primary:hover { background: var(--brand-dark); }
.edit-actions .ea-btn:hover { border-color: var(--brand); color: var(--brand); }

/* 轻提示 toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(0,0,0,.75); color: #fff; font-size: 13px;
  padding: 8px 16px; border-radius: 999px; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

/* 拖拽上传高亮遮罩 */
.chat-wrap.dragging::after {
  content: '松开即可上传附件';
  position: fixed; inset: 0;
  background: rgba(255, 119, 0, 0.08);
  border: 3px dashed var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: var(--brand);
  z-index: 50; pointer-events: none;
}
