* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: #fff; color: #1f2329; overflow: hidden;
}

#app { display: flex; height: 100vh; }

/* ---------- 侧边栏 ---------- */
#sidebar {
  width: 260px; flex-shrink: 0; background: #f7f8fa;
  border-right: 1px solid #eceef1;
  display: flex; flex-direction: column;
  transition: margin-left .25s ease;
}
.side-top { padding: 14px 14px 8px; }
.brand { font-size: 15px; font-weight: 700; padding: 4px 6px 12px; }
.new-chat {
  width: 100%; border: 1px solid #dddfe4; background: #fff; border-radius: 10px;
  padding: 9px 0; font-size: 13px; cursor: pointer; color: #333;
}
.new-chat:hover { background: #f0effe; border-color: #6c5ce7; color: #6c5ce7; }

.session-list { flex: 1; overflow-y: auto; padding: 8px; }
.session-item {
  position: relative; padding: 9px 30px 9px 10px; border-radius: 9px;
  font-size: 13px; color: #444; cursor: pointer; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-item:hover { background: #eef0f3; }
.session-item.active { background: #e8e6fd; color: #5a4bd1; font-weight: 500; }
.session-item .sdel {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: #aab; font-size: 14px; cursor: pointer;
  display: none; padding: 2px 4px;
}
.session-item:hover .sdel { display: block; }
.session-item .sdel:hover { color: #d4380d; }
.session-empty { font-size: 12px; color: #b0b7c3; text-align: center; padding: 20px 0; }

.side-bottom { padding: 12px 14px; border-top: 1px solid #eceef1; }
.side-btn {
  width: 100%; border: none; background: none; text-align: left;
  font-size: 13px; color: #555; cursor: pointer; padding: 8px 6px; border-radius: 8px;
}
.side-btn:hover { background: #eef0f3; }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #d4380d; margin-left: 6px; vertical-align: middle;
}
.dot.ok { background: #18a058; }
.side-note { font-size: 11px; color: #b0b7c3; padding: 4px 6px 0; }

#mask {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40;
}

/* ---------- 主区域 ---------- */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

#topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid #f0f1f3;
}
#menuBtn { display: none; border: none; background: none; font-size: 18px; cursor: pointer; color: #666; }
#chatTitle { font-size: 14px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-tag { font-size: 11px; color: #98a0ad; background: #f2f3f7; border-radius: 99px; padding: 3px 10px; }

#chatFlow { flex: 1; overflow-y: auto; padding: 24px 18px 10px; }
#messages { max-width: 780px; margin: 0 auto; }

/* 空状态 */
#emptyState { max-width: 720px; margin: 6vh auto 0; text-align: center; }
.empty-logo { font-size: 44px; }
#emptyState h1 { font-size: 26px; margin: 12px 0 8px; }
.empty-sub { color: #98a0ad; font-size: 14px; margin-bottom: 28px; }
.examples { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ex-card {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: #f7f8fa; border: 1px solid #eef0f3; border-radius: 14px;
  padding: 14px 16px; font-size: 13px; color: #4a5060; cursor: pointer;
  transition: all .15s;
}
.ex-card:hover { border-color: #6c5ce7; background: #f6f4ff; transform: translateY(-1px); }
.ex-card i { font-style: normal; font-size: 20px; }

/* 消息 */
.msg { margin-bottom: 26px; }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; }
.user-bubble {
  background: #6c5ce7; color: #fff; border-radius: 18px 18px 4px 18px;
  padding: 11px 16px; max-width: 78%; font-size: 14px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.user-refs { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; justify-content: flex-end; }
.user-refs img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 10px;
  border: 1px solid #e5e7eb; cursor: zoom-in;
}
.msg-ai { display: flex; flex-direction: column; align-items: flex-start; }
.ai-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.ai-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #f0effe;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.ai-name { font-size: 12px; color: #98a0ad; }
.ai-images { display: flex; gap: 10px; flex-wrap: wrap; }
.ai-img-wrap { position: relative; }
.ai-img-wrap img {
  max-width: 340px; max-height: 340px; border-radius: 14px; display: block;
  cursor: zoom-in; box-shadow: 0 2px 10px rgba(31,35,41,.1);
}
.ai-img-wrap.small img { max-width: 220px; max-height: 220px; }
.ai-img-wrap .dl {
  position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px;
  border: none; border-radius: 50%; background: rgba(255,255,255,.92);
  box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer; font-size: 14px; color: #444;
}
.ai-img-wrap .dl:hover { color: #6c5ce7; }
.ai-meta { display: flex; align-items: center; gap: 14px; margin-top: 9px; font-size: 12px; color: #aab2bf; }
.ai-meta .act { border: none; background: none; color: #7a8290; font-size: 12px; cursor: pointer; padding: 2px 0; }
.ai-meta .act:hover { color: #6c5ce7; }
.ai-loading {
  display: inline-flex; align-items: center; gap: 9px; color: #7a8290; font-size: 13px;
  background: #f7f8fa; border-radius: 12px; padding: 12px 16px;
}
.spin {
  width: 14px; height: 14px; border: 2px solid #d9d2f7; border-top-color: #6c5ce7;
  border-radius: 50%; animation: sp 0.8s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }
.ai-error {
  color: #d4380d; font-size: 13px; background: #fff2f0; border: 1px solid #ffccc7;
  border-radius: 12px; padding: 12px 16px; white-space: pre-wrap; max-width: 90%;
}

/* ---------- 输入区 ---------- */
#composerWrap { padding: 10px 18px 16px; }
#composer {
  max-width: 780px; margin: 0 auto; background: #fff;
  border: 1px solid #e3e5ea; border-radius: 20px; padding: 12px 14px 8px;
  box-shadow: 0 4px 18px rgba(31,35,41,.07);
}
#composer:focus-within { border-color: #b9aef2; }
#refChips { display: flex; gap: 8px; flex-wrap: wrap; }
#refChips:empty { display: none; }
#refChips { margin-bottom: 4px; }
.chip { position: relative; width: 56px; height: 56px; }
.chip img { width: 56px; height: 56px; object-fit: cover; border-radius: 9px; border: 1px solid #e5e7eb; }
.chip .x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; cursor: pointer; line-height: 1;
}
#prompt {
  width: 100%; border: none; outline: none; resize: none;
  font-size: 15px; font-family: inherit; line-height: 1.6;
  padding: 6px 2px; max-height: 160px; background: transparent;
}
.composer-bar { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.composer-bar .spacer { flex: 1; }
#attachBtn {
  width: 34px; height: 34px; border: none; border-radius: 50%; background: #f2f3f7;
  font-size: 16px; cursor: pointer; color: #555;
}
#attachBtn:hover { background: #e8e6fd; color: #6c5ce7; }
#attachBtn.has-refs { background: #e8e6fd; color: #6c5ce7; }
.composer-bar select {
  border: 1px solid #e3e5ea; background: #fff; border-radius: 8px;
  font-size: 12px; color: #666; padding: 5px 6px; cursor: pointer;
}
#sendBtn {
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: #6c5ce7; color: #fff; font-size: 15px; cursor: pointer;
}
#sendBtn:hover { background: #5a4bd1; }
#sendBtn:disabled { background: #c9c4ee; cursor: not-allowed; }
#statusLine {
  max-width: 780px; margin: 7px auto 0; font-size: 12px; color: #98a0ad;
  min-height: 16px; text-align: center;
}
#statusLine.err { color: #d4380d; }

/* ---------- 弹窗 ---------- */
.dlg { border: none; border-radius: 16px; padding: 22px; width: 400px; max-width: 92vw; }
.dlg::backdrop, dialog::backdrop { background: rgba(20,20,30,.5); }
.dlg h3 { font-size: 16px; margin-bottom: 8px; }
.dlg-hint { font-size: 12px; color: #98a0ad; margin-bottom: 14px; line-height: 1.6; }
.dlg-row { display: flex; gap: 8px; margin-bottom: 16px; }
.dlg-row input {
  flex: 1; min-width: 0; border: 1px solid #d9dce3; border-radius: 10px;
  padding: 10px 12px; font-size: 14px;
}
.dlg-row input:focus { outline: 2px solid #6c5ce7; border-color: transparent; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn { border: none; border-radius: 10px; padding: 9px 18px; font-size: 13px; cursor: pointer; }
.btn.primary { background: #6c5ce7; color: #fff; }
.btn.ghost { background: #f2f3f7; color: #555; text-decoration: none; display: inline-block; }

.viewer { width: auto; max-width: 94vw; }
.viewer img { max-width: 88vw; max-height: 68vh; display: block; border-radius: 10px; }
.viewer .p { font-size: 13px; color: #555; margin: 12px 0; max-width: 88vw; line-height: 1.6; }

/* ---------- 参考图/操作按钮 ---------- */
.act-btn {
  border: 1px solid #e3e5ea; background: #fff; border-radius: 99px;
  padding: 6px 12px; font-size: 12px; color: #555; cursor: pointer;
}
.act-btn:hover { border-color: #6c5ce7; color: #6c5ce7; background: #f6f4ff; }
.act-btn.on { background: #e8e6fd; border-color: #6c5ce7; color: #6c5ce7; }

/* ---------- 局部重绘 ---------- */
.mask-dlg { width: 540px; }
.mask-stage { position: relative; margin: 10px 0; border-radius: 12px; overflow: hidden; background: #111; display: inline-block; }
.mask-stage canvas { display: block; }
#maskOverlay { position: absolute; left: 0; top: 0; cursor: crosshair; opacity: .55; }
.mask-tools { display: flex; align-items: center; gap: 10px; }
.mask-tools .brush-label { font-size: 13px; color: #555; display: flex; align-items: center; gap: 6px; }
.mask-tools input[type="range"] { width: 90px; }
.mask-tools .spacer { flex: 1; }

/* ---------- 图片分析卡片 ---------- */
.analysis-card {
  background: #f8f7ff; border: 1px solid #e8e4fb; border-radius: 14px;
  padding: 14px 16px; max-width: 100%; min-width: 260px;
}
.analysis-card .ac-title { font-weight: 700; font-size: 14px; margin-bottom: 10px; color: #5a4bd1; }
.ac-row { display: flex; gap: 8px; margin: 7px 0; font-size: 13px; align-items: flex-start; }
.ac-row .ac-k {
  color: #6c5ce7; font-weight: 600; flex-shrink: 0; width: 64px;
  background: #efecfd; border-radius: 6px; padding: 2px 8px; text-align: center; font-size: 12px;
}
.ac-row .ac-v { color: #3d4250; line-height: 1.6; }
.ac-swatches { display: inline-flex; gap: 6px; vertical-align: middle; margin-left: 6px; }
.ac-swatches i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.ac-desc {
  margin: 12px 0 0; font-size: 13px; line-height: 1.8; color: #4a5060;
  background: #fff; border-radius: 10px; padding: 10px 12px; border: 1px solid #f0edfc;
}
.ac-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- 多模型：选择器 / 密钥管理 ---------- */
#modelSel { max-width: 210px; font-size: 12px; }
.composer-bar select:disabled { opacity: .55; }
.model-tag { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.prov-list { max-height: 46vh; overflow-y: auto; margin-bottom: 12px; }
.prov-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border: 1px solid #eceef1; border-radius: 10px; margin-bottom: 6px;
}
.prov-row .pname { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 10px; border-radius: 99px; padding: 2px 8px; flex-shrink: 0; }
.badge.chat { background: #e8f7ee; color: #18a058; }
.badge.img { background: #e8e6fd; color: #5a4bd1; }
.badge.ok { background: #e8f7ee; color: #18a058; }
.badge.no { background: #f2f3f7; color: #98a0ad; }
.badge.cors { background: #fff4e6; color: #d46b08; }
.prov-row .bset { border: none; background: #f2f3f7; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.prov-row .bset:hover { background: #e8e6fd; color: #6c5ce7; }

.prov-dlg { width: 480px; }
.f-label { display: block; font-size: 12px; color: #7a8290; margin: 12px 0 5px; }
.f-input {
  width: 100%; border: 1px solid #d9dce3; border-radius: 10px; padding: 9px 12px;
  font-size: 13px; background: #fff;
}
.f-input:focus { outline: 2px solid #6c5ce7; border-color: transparent; }
.btn.sm { padding: 6px 12px; font-size: 12px; margin-top: 6px; }
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.model-chips .chip2 {
  font-size: 11px; border: 1px solid #e3e5ea; border-radius: 99px; padding: 3px 9px;
  background: #f7f8fa; cursor: pointer; color: #555;
}
.model-chips .chip2:hover { border-color: #6c5ce7; color: #6c5ce7; }
.test-result { font-size: 12px; margin-top: 8px; color: #555; white-space: pre-wrap; line-height: 1.6; }
.test-result.ok { color: #18a058; }
.test-result.err { color: #d4380d; }
.btn.danger { background: #fff1f0; color: #d4380d; }

/* ---------- 对话消息 ---------- */
.chat-bubble {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 4px 18px 18px 18px;
  padding: 12px 16px; max-width: 92%; font-size: 14px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word; color: #333;
}
.chat-bubble pre {
  background: #f6f7f9; border-radius: 8px; padding: 10px 12px; overflow-x: auto;
  font-size: 12px; line-height: 1.6; margin: 6px 0;
}
.chat-bubble code { font-family: Consolas, Monaco, monospace; }
.chat-bubble :not(pre) > code {
  background: #f0f1f4; border-radius: 4px; padding: 1px 5px; font-size: 12px;
}
.chat-bubble strong { color: #1f2329; }
.chat-bubble a { color: #6c5ce7; }
.chat-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: #aab2bf; align-items: center; }
.chat-meta .act { border: none; background: none; color: #7a8290; font-size: 12px; cursor: pointer; padding: 2px 0; }
.chat-meta .act:hover { color: #6c5ce7; }

/* ---------- 会话搜索 / 顶栏操作 / 拖拽 / 快捷功能 ---------- */
.side-search { padding: 0 14px 6px; }
.side-search input {
  width: 100%; border: 1px solid #e3e5ea; border-radius: 9px; padding: 7px 10px;
  font-size: 12px; background: #fff; color: #444;
}
.side-search input:focus { outline: 2px solid #6c5ce7; border-color: transparent; }

.topbar-actions { display: flex; gap: 5px; margin-left: 6px; }
.tb-btn {
  width: 30px; height: 30px; border: none; border-radius: 8px; background: #f2f3f7;
  font-size: 14px; cursor: pointer; color: #666; line-height: 1;
}
.tb-btn:hover { background: #e8e6fd; color: #6c5ce7; }

#dragOverlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(108, 92, 231, .08); border: 2px dashed #6c5ce7;
  align-items: center; justify-content: center; pointer-events: none;
}
#dragOverlay.show { display: flex; }
.drag-inner {
  background: #6c5ce7; color: #fff; border-radius: 14px; padding: 18px 30px;
  font-size: 16px; box-shadow: 0 6px 24px rgba(108, 92, 231, .4);
}

.user-bubble-wrap { position: relative; max-width: 78%; }
.uacts {
  position: absolute; top: -9px; right: -9px; display: none; gap: 4px;
}
.uacts button {
  width: 24px; height: 24px; border: none; border-radius: 50%;
  background: #fff; color: #6c5ce7; font-size: 12px; cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,.15); line-height: 1;
}
.uacts button:hover { background: #f0effe; }
.user-bubble-wrap:hover .uacts { display: flex; }

.quote-block {
  border-left: 3px solid #6c5ce7; background: rgba(108,92,231,.07);
  border-radius: 0 8px 8px 0; padding: 6px 10px; margin-bottom: 8px;
  font-size: 12px; color: #6a6f7a; white-space: pre-wrap; word-break: break-word;
  max-height: 84px; overflow: hidden;
}

.quote-bar {
  display: flex; align-items: center; gap: 8px;
  background: #f6f4ff; border: 1px solid #e8e4fb; border-radius: 10px;
  padding: 7px 10px; margin-bottom: 8px; font-size: 12px;
}
.quote-bar.hidden { display: none; }
.quote-label { color: #6c5ce7; font-weight: 600; flex-shrink: 0; }
.quote-text { flex: 1; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-close { border: none; background: none; color: #999; font-size: 15px; cursor: pointer; }
.quote-close:hover { color: #d4380d; }

.stats-line {
  font-size: 12px; color: #666; background: #f7f8fa; border-radius: 10px;
  padding: 9px 12px; margin: 4px 0 14px; line-height: 1.7;
}
.session-item .sren {
  position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: #aab; font-size: 12px; cursor: pointer;
  display: none; padding: 2px 3px;
}
.session-item:hover .sren { display: block; }
.session-item .sren:hover { color: #6c5ce7; }

.followup { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.followup .fchip {
  border: 1px solid #e3e5ea; background: #fff; border-radius: 99px;
  padding: 6px 12px; font-size: 12px; color: #555; cursor: pointer;
}
.followup .fchip:hover { border-color: #6c5ce7; color: #6c5ce7; background: #f6f4ff; }

/* ---------- 先聊后画（融合模式） ---------- */
.fusion-switch {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  border: 1px solid #e3e5ea; background: #fff; border-radius: 99px;
  padding: 5px 10px; font-size: 12px; color: #555; user-select: none;
}
.fusion-switch:hover { border-color: #6c5ce7; color: #6c5ce7; }
.fusion-switch input { accent-color: #6c5ce7; cursor: pointer; }
.fusion-switch.on { background: #e8e6fd; border-color: #6c5ce7; color: #6c5ce7; }
#fusionGo.on { background: #e8e6fd; border-color: #6c5ce7; color: #6c5ce7; }

/* ---------- 移动端 ---------- */
@media (max-width: 820px) {
  #sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    margin-left: -280px; box-shadow: 2px 0 14px rgba(0,0,0,.12);
  }
  #sidebar.open { margin-left: 0; }
  #mask.show { display: block; }
  #menuBtn { display: block; }
  .examples { grid-template-columns: 1fr; }
  .user-bubble { max-width: 88%; }
  .ai-img-wrap img { max-width: 82vw; }
}

/* ---------- GPT 风格工作区覆盖 ---------- */
:root {
  --ink: #202123;
  --muted: #6b6f76;
  --line: #e6e6e6;
  --soft: #f7f7f8;
  --accent: #10a37f;
  --accent-dark: #0d8a6b;
  --violet: #6c5ce7;
}
body { background: #fff; color: var(--ink); }
#sidebar { width: 276px; background: #f7f7f8; border-right: 1px solid #e8e8e8; }
.side-top { padding: 18px 14px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font-size: 15px; letter-spacing: .01em; }
.brand-mark, .empty-logo { display: inline-flex; align-items: center; justify-content: center; }
.brand-mark { width: 27px; height: 27px; border-radius: 8px; background: #202123; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.new-chat { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 12px; border: 1px solid #d9d9dc; border-radius: 8px; font-weight: 600; text-align: left; }
.new-chat-icon { font-size: 19px; font-weight: 400; line-height: 1; }
.new-chat-key { margin-left: auto; color: #a0a2a8; font-size: 10px; font-weight: 500; }
.new-chat:hover { background: #fff; border-color: #bcbec4; color: var(--ink); }
.side-search { position: relative; padding: 5px 14px 10px; }
.side-search input { height: 35px; padding-left: 31px; border-color: #dedee1; border-radius: 8px; background: #fff; }
.search-icon { position: absolute; left: 25px; top: 11px; z-index: 1; color: #8b8d93; font-size: 19px; line-height: 1; transform: rotate(-20deg); }
.session-list { padding: 8px; }
.session-item { padding: 10px 34px 10px 12px; border-radius: 8px; color: #505257; }
.session-item.active { background: #e9e9eb; color: #202123; font-weight: 600; }
.session-item:hover { background: #ececee; }
.side-bottom { padding: 13px 14px 15px; background: #f7f7f8; }
.side-btn { display: flex; align-items: center; gap: 9px; padding: 9px 7px; color: #55575c; }
.side-icon { width: 19px; color: #7a7d83; font-size: 16px; text-align: center; }
.side-note { display: flex; align-items: center; gap: 6px; padding-top: 9px; color: #a0a2a8; }
.privacy-dot { width: 6px; height: 6px; border-radius: 50%; background: #10a37f; }
#main { background: #fff; }
#topbar { height: 58px; padding: 0 24px; border-bottom: 1px solid #efefef; }
.icon-btn { display: none; border: 0; background: transparent; color: #666; cursor: pointer; }
.title-block { display: flex; align-items: center; gap: 10px; min-width: 0; }
#chatTitle { font-size: 14px; color: #34363a; }
.model-tag { color: #777a80; background: #f4f4f5; border: 1px solid #e9e9ea; border-radius: 6px; padding: 4px 8px; }
.context-tag { color: #8a8d93; background: #fafafa; border: 1px solid #ededee; border-radius: 6px; padding: 4px 8px; font-size: 11px; }
.context-tag.active { color: #0d8a6b; border-color: #cceee4; background: #f2fbf8; }
.topbar-actions { gap: 3px; }
.tb-btn { width: 32px; height: 32px; border-radius: 7px; background: transparent; color: #777a80; font-size: 17px; }
.tb-btn:hover { background: #f2f2f3; color: #202123; }
#chatFlow { padding: 34px 24px 12px; }
#messages { max-width: 860px; }
#emptyState { max-width: 760px; margin: 12vh auto 0; }
.empty-logo { width: 48px; height: 48px; margin: 0 auto; border: 1px solid #d7d7d9; border-radius: 14px; background: #fff; color: #202123; font-weight: 800; font-size: 15px; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
#emptyState h1 { margin-top: 18px; font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.empty-sub { margin-top: 10px; color: #8a8d93; }
.examples { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.ex-card { min-height: 77px; border: 1px solid #e5e5e7; border-radius: 10px; background: #fff; padding: 14px; box-shadow: none; }
.ex-card:hover { border-color: #bdbdc2; background: #fafafa; transform: translateY(-1px); }
.ex-card i { display: inline-flex; width: 27px; height: 27px; align-items: center; justify-content: center; border: 1px solid #dedee1; border-radius: 7px; color: #65676d; font-size: 16px; }
.ex-card span { display: flex; flex-direction: column; gap: 4px; color: #303237; }
.ex-card b { font-size: 13px; font-weight: 600; }
.ex-card small { color: #92949a; font-size: 11px; }
.msg { margin-bottom: 28px; }
.msg-user { align-items: flex-end; }
.user-bubble { max-width: min(700px, 82%); background: #f3f3f3; color: #26272a; border: 1px solid #e7e7e8; border-radius: 17px 17px 4px 17px; padding: 11px 15px; }
.msg-ai { max-width: 100%; }
.ai-head { margin-bottom: 8px; }
.ai-avatar { width: 25px; height: 25px; border-radius: 7px; background: #202123; color: #fff; font-size: 9px; font-weight: 700; }
.ai-name { color: #85878d; }
.chat-bubble { max-width: 94%; border: 0; border-radius: 0; padding: 0 0 1px 32px; color: #2d2f33; line-height: 1.82; background: transparent; }
.chat-bubble pre { border: 1px solid #e4e4e6; background: #f7f7f8; border-radius: 8px; }
.chat-meta, .ai-meta { padding-left: 32px; color: #a0a2a8; }
.chat-meta .act, .ai-meta .act { color: #898c92; }
.followup { padding-left: 32px; }
.followup .fchip { border-radius: 7px; background: #fff; padding: 6px 10px; }
.ai-images { padding-left: 32px; }
.ai-img-wrap img { border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.ai-loading { margin-left: 32px; background: #f7f7f8; border-radius: 9px; }
.ai-error { margin-left: 32px; }
#composerWrap { padding: 9px 24px 17px; }
#composer { max-width: 860px; border-color: #d9d9dc; border-radius: 15px; padding: 10px 13px 8px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
#composer:focus-within { border-color: #b8b9bd; box-shadow: 0 2px 14px rgba(0,0,0,.08); }
#prompt { min-height: 30px; padding: 6px 3px; font-size: 15px; }
.smart-strip { display: flex; align-items: center; gap: 10px; min-height: 25px; color: #85878d; font-size: 11px; }
.smart-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.smart-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 25px; height: 15px; padding: 2px; border-radius: 99px; background: #c9cace; transition: .2s; }
.switch-track span { display: block; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: .2s; }
.smart-switch input:checked + .switch-track { background: var(--accent); }
.smart-switch input:checked + .switch-track span { transform: translateX(10px); }
#responseModeSel { border: 0; padding: 3px 4px; background: transparent; color: #7d8086; font-size: 11px; }
.intent-hint { margin-left: auto; color: #a0a2a8; }
.composer-bar { padding-top: 6px; gap: 6px; }
#attachBtn { width: 30px; height: 30px; background: transparent; border: 1px solid #dedee1; color: #666; }
.composer-bar select { border-color: #e3e3e5; border-radius: 7px; padding: 5px 7px; }
#modelSel { max-width: 190px; }
.fusion-switch, .act-btn { border-radius: 7px; padding: 6px 9px; }
#sendBtn { width: 31px; height: 31px; background: #202123; font-size: 19px; line-height: 1; }
#sendBtn:hover { background: #000; }
#sendBtn:disabled { background: #b9babe; }
#statusLine { max-width: 860px; margin-top: 6px; color: #8d8f95; }
.composer-note { max-width: 860px; margin: 5px auto 0; color: #a5a7ac; font-size: 10px; text-align: center; }
.quote-bar { border-color: #e2e2e4; background: #fafafa; }
.analysis-card { margin-left: 32px; background: #fafafa; border-color: #e4e4e6; border-radius: 10px; }
.dlg { border-radius: 12px; }
@media (max-width: 820px) {
  #topbar { padding: 0 14px; }
  .icon-btn { display: block; font-size: 18px; }
  #chatFlow { padding: 24px 14px 10px; }
  #composerWrap { padding: 7px 10px 12px; }
  .examples { grid-template-columns: 1fr; }
  .ex-card { min-height: 62px; }
  .composer-bar { flex-wrap: wrap; }
  .composer-bar .spacer { display: none; }
  #modelSel { max-width: 150px; }
  .user-bubble { max-width: 90%; }
  .chat-bubble, .ai-images, .chat-meta, .ai-meta, .followup, .analysis-card { padding-left: 0; margin-left: 0; }
  .ai-loading, .ai-error { margin-left: 0; }
  .intent-hint { display: none; }
}
