/* ============ 设计令牌（浅色主题） ============ */
:root {
  --bg: #eef1f7;
  --bg-soft: #f7f9fc;
  --panel: rgba(255, 255, 255, 0.62);
  --panel-strong: rgba(255, 255, 255, 0.88);
  --border: rgba(28, 42, 80, 0.1);
  --border-strong: rgba(28, 42, 80, 0.18);
  --text: #1d2433;
  --text-dim: #5b6577;
  --text-faint: #97a0b3;
  --accent-1: #6a4cff;
  --accent-2: #0098e0;
  --accent-grad: linear-gradient(135deg, #6a4cff 0%, #00a6f0 100%);
  --danger: #e0335c;
  --ok: #0fae84;
  --warn: #e08c1f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(30, 45, 90, 0.14);
  --shadow-soft: 0 6px 24px rgba(30, 45, 90, 0.08);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============ 柔光背景 ============ */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #f2f5fb 0%, #e9edf6 100%); }
.aurora::before, .aurora::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.55;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora::before { width: 580px; height: 580px; left: -140px; top: -200px; background: radial-gradient(circle, #cfc3ff 0%, transparent 70%); }
.aurora::after { width: 660px; height: 660px; right: -200px; bottom: -260px; background: radial-gradient(circle, #b6e3ff 0%, transparent 70%); animation-delay: -13s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(70px, 50px) scale(1.15); }
}

/* ============ 通用控件 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--panel-strong); color: var(--text); font-size: 14px; font-family: var(--font);
  cursor: pointer; transition: all 0.18s ease; white-space: nowrap; user-select: none;
  box-shadow: 0 1px 3px rgba(30, 45, 90, 0.06);
}
.btn:hover { border-color: var(--border-strong); background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-grad); border: none; color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(106, 76, 255, 0.32); }
.btn-primary:hover { background: var(--accent-grad); filter: brightness(1.07); box-shadow: 0 8px 26px rgba(106, 76, 255, 0.42); }
.btn-danger { color: var(--danger); border-color: rgba(224, 51, 92, 0.3); }
.btn-danger:hover { background: rgba(224, 51, 92, 0.07); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 9px; border-radius: 10px; line-height: 0; }

.input, textarea.input, select.input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff;
  color: var(--text); font-size: 14px; font-family: var(--font);
  outline: none; transition: border 0.18s, box-shadow 0.18s;
}
.input:focus { border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(106, 76, 255, 0.14); }
.input::placeholder { color: var(--text-faint); }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
.badge-admin { background: rgba(106, 76, 255, 0.1); color: #6a4cff; border: 1px solid rgba(106, 76, 255, 0.35); }
.badge-editor { background: rgba(0, 152, 224, 0.09); color: #0086c8; border: 1px solid rgba(0, 152, 224, 0.32); }
.badge-user { background: rgba(28, 42, 80, 0.05); color: var(--text-dim); border: 1px solid var(--border); }
.badge-ok { background: rgba(15, 174, 132, 0.09); color: var(--ok); border: 1px solid rgba(15, 174, 132, 0.32); }
.badge-off { background: rgba(224, 51, 92, 0.07); color: var(--danger); border: 1px solid rgba(224, 51, 92, 0.28); }

/* ============ Toast ============ */
.toast-host { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 11px 22px; border-radius: 12px; font-size: 14px; color: var(--text);
  background: rgba(255, 255, 255, 0.95); border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-12px); transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-color: rgba(224, 51, 92, 0.45); color: #c02550; }
.toast-success { border-color: rgba(15, 174, 132, 0.45); color: #0a8c6a; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center;
  background: rgba(40, 52, 84, 0.32); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.modal-mask.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(480px, 92vw); max-height: 86vh; overflow: auto;
  background: #fff;
  border: 1px solid var(--border); border-radius: 20px; padding: 26px;
  box-shadow: var(--shadow); transform: scale(0.94) translateY(12px); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.modal-mask.open .modal { transform: scale(1) translateY(0); }
.modal h3 { font-size: 18px; margin-bottom: 18px; }
.modal .field { margin-bottom: 14px; }
.modal .field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal.modal-wide { width: min(760px, 94vw); }

/* ============ 登录页 ============ */
.auth-wrap { height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: min(420px, 94vw); padding: 42px 38px;
  background: rgba(255, 255, 255, 0.78); border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px; backdrop-filter: blur(22px); box-shadow: var(--shadow);
  animation: rise 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 30px; }
.auth-brand .orb { width: 64px; height: 64px; }
.auth-brand h1 { font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.auth-brand p { color: var(--text-dim); font-size: 13.5px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-dim); }
.auth-switch a { color: var(--accent-1); cursor: pointer; text-decoration: none; font-weight: 600; }
.auth-tip { margin-top: 22px; padding: 12px 14px; border-radius: 12px; background: rgba(106, 76, 255, 0.06); border: 1px solid rgba(106, 76, 255, 0.18); font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }
.auth-tip code { color: #6a4cff; font-family: var(--mono); }
.apk-link { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; font-size: 13px; color: var(--text-dim); text-decoration: none; padding: 9px; border-radius: 10px; border: 1px dashed var(--border-strong); transition: all 0.18s; }
.apk-link:hover { color: var(--accent-1); border-color: var(--accent-1); background: rgba(106, 76, 255, 0.05); }

/* ============ 助手光球 ============ */
.orb {
  position: relative; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(from 180deg, #6a4cff, #00a6f0, #2fd8b0, #6a4cff);
  animation: spin 7s linear infinite;
  box-shadow: 0 4px 18px rgba(106, 76, 255, 0.4), inset 0 0 12px rgba(255, 255, 255, 0.5);
}
.orb::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #ffffff 0%, #eef0fb 55%, #d6dcf2 100%); }
@keyframes spin { to { transform: rotate(360deg); } }
.orb.thinking { animation-duration: 1.6s; box-shadow: 0 4px 26px rgba(106, 76, 255, 0.65), inset 0 0 12px rgba(255,255,255,0.5); }
.orb.listening { animation: spin 3s linear infinite, pulse 1.5s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 166, 240, 0.45); }
  100% { box-shadow: 0 0 0 22px rgba(0, 166, 240, 0); }
}

/* ============ 聊天布局 ============ */
.app { display: flex; height: 100vh; }

.sidebar {
  width: 282px; flex-shrink: 0; display: flex; flex-direction: column;
  background: rgba(255, 255, 255, 0.66); border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.side-head { display: flex; align-items: center; gap: 12px; padding: 20px 18px 14px; }
.side-head .name { font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.side-head .tagline { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; letter-spacing: 0.5px; }
.side-new { margin: 6px 14px 10px; }
.side-new .btn { width: 100%; }
.side-search { margin: 0 14px 10px; }
.side-search .input { padding: 8px 12px; font-size: 13px; background: rgba(255,255,255,0.7); }
.session-list { flex: 1; overflow-y: auto; padding: 0 10px; }
.session-item {
  display: flex; align-items: center; gap: 6px; padding: 11px 12px; margin-bottom: 4px;
  border-radius: 11px; cursor: pointer; color: var(--text-dim); font-size: 13.5px;
  border: 1px solid transparent; transition: all 0.15s;
}
.session-item:hover { background: rgba(255, 255, 255, 0.95); color: var(--text); box-shadow: 0 1px 4px rgba(30,45,90,0.06); }
.session-item.active { background: rgba(106, 76, 255, 0.08); border-color: rgba(106, 76, 255, 0.3); color: var(--text); }
.session-item .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-item .op { opacity: 0; border: none; background: none; color: var(--text-faint); cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 6px; transition: all 0.15s; }
.session-item:hover .op { opacity: 1; }
.session-item .op:hover { color: var(--accent-1); background: rgba(106, 76, 255, 0.1); }
.session-item .op.del:hover { color: var(--danger); background: rgba(224, 51, 92, 0.08); }

.side-foot { padding: 14px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad); color: #fff; font-weight: 700; font-size: 16px;
}
.user-card .meta { flex: 1; min-width: 0; }
.user-card .uname { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .links { display: flex; gap: 8px; flex-wrap: wrap; }
.side-foot .links .btn { flex: 1; font-size: 13px; }
.side-foot .apk-link { margin-top: 10px; }

/* ============ 主区 ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 26px;
  border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(14px);
}
.chat-head .who .title { font-size: 16px; font-weight: 700; }
.chat-head .who .status { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.status-dot.busy { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.status-dot.listen { background: var(--accent-2); box-shadow: 0 0 6px var(--accent-2); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.chat-head .spacer { flex: 1; }

.toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px;
  border-radius: 99px; border: 1px solid var(--border); cursor: pointer;
  font-size: 12.5px; color: var(--text-dim); background: rgba(255,255,255,0.55); user-select: none; transition: all 0.18s;
}
.toggle:hover { border-color: var(--border-strong); color: var(--text); background: #fff; }
.toggle.on { color: #0086c8; border-color: rgba(0, 152, 224, 0.45); background: rgba(0, 166, 240, 0.07); }
.toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); transition: all 0.18s; }
.toggle.on .dot { background: var(--accent-2); box-shadow: 0 0 6px var(--accent-2); }

/* ============ 消息区 ============ */
.messages { flex: 1; overflow-y: auto; padding: 30px 0 18px; scroll-behavior: smooth; }
.messages-inner { max-width: 820px; margin: 0 auto; padding: 0 26px; display: flex; flex-direction: column; gap: 26px; }

.msg { display: flex; gap: 14px; animation: msgIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@keyframes msgIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.msg .bubble-wrap { max-width: 78%; min-width: 0; position: relative; }
.msg .bubble {
  padding: 13px 17px; border-radius: 18px; font-size: 14.5px; line-height: 1.75;
  word-wrap: break-word; overflow-wrap: break-word;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: linear-gradient(135deg, #6a4cff, #5a6cff); border-bottom-right-radius: 6px; color: #fff; box-shadow: 0 8px 22px rgba(106, 76, 255, 0.28); }
.msg.assistant .bubble { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 6px; box-shadow: var(--shadow-soft); }
.msg .bubble p + p { margin-top: 8px; }

.msg-tools { display: flex; gap: 6px; margin-top: 7px; opacity: 0; transition: opacity 0.18s; }
.msg:hover .msg-tools { opacity: 1; }
.msg-tools button {
  border: 1px solid var(--border); background: rgba(255,255,255,0.85); color: var(--text-faint);
  font-size: 11.5px; padding: 3px 10px; border-radius: 7px; cursor: pointer; transition: all 0.15s; font-family: var(--font);
}
.msg-tools button:hover { color: var(--accent-1); border-color: var(--accent-1); }

.md-code { background: #20263a; color: #e3e9f7; border-radius: 10px; padding: 13px 15px; margin: 9px 0; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.md-inline { background: rgba(106, 76, 255, 0.09); border-radius: 5px; padding: 1.5px 6px; font-family: var(--mono); font-size: 13px; color: #6a4cff; }
.md-h { margin: 10px 0 6px; font-size: 15.5px; }
.md-list { margin: 6px 0 6px 22px; display: flex; flex-direction: column; gap: 4px; }
.md-quote { border-left: 3px solid var(--accent-1); padding: 6px 12px; margin: 8px 0; color: var(--text-dim); background: rgba(106, 76, 255, 0.05); border-radius: 0 8px 8px 0; }
.md-hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.md-table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 13.5px; }
.md-table th, .md-table td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
.md-table th { background: rgba(28, 42, 80, 0.04); }
.msg.assistant .bubble a { color: var(--accent-2); }

.sources { margin-top: 9px; font-size: 12.5px; }
.sources summary { cursor: pointer; color: var(--text-faint); user-select: none; }
.sources summary:hover { color: var(--accent-2); }
.source-item { margin-top: 7px; padding: 9px 12px; border-radius: 9px; background: rgba(0, 166, 240, 0.05); border: 1px solid rgba(0, 152, 224, 0.18); color: var(--text-dim); line-height: 1.6; }
.source-item b { color: #0086c8; font-weight: 600; }

.typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-7px); opacity: 1; } }

/* ============ 欢迎页 ============ */
.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 26px; gap: 18px; animation: rise 0.5s ease; }
.welcome .orb { width: 84px; height: 84px; }
.welcome h2 { font-size: 30px; font-weight: 700; background: linear-gradient(90deg, #2b3550, #6a4cff 60%, #00a6f0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome p { color: var(--text-dim); font-size: 14.5px; max-width: 480px; line-height: 1.8; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.chip { padding: 9px 17px; border-radius: 99px; border: 1px solid var(--border); background: rgba(255,255,255,0.75); color: var(--text-dim); font-size: 13.5px; cursor: pointer; transition: all 0.18s; }
.chip:hover { border-color: var(--accent-1); color: var(--accent-1); background: #fff; transform: translateY(-2px); box-shadow: var(--shadow-soft); }

/* ============ 输入区 ============ */
.composer-zone { padding: 14px 26px 22px; }
.voice-hint { max-width: 820px; margin: 0 auto 10px; display: none; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 13px; background: rgba(0, 166, 240, 0.06); border: 1px solid rgba(0, 152, 224, 0.3); font-size: 13.5px; color: #0086c8; }
.voice-hint.show { display: flex; animation: rise 0.25s ease; }
.voice-bars { display: flex; gap: 3px; align-items: center; height: 18px; }
.voice-bars i { width: 3px; border-radius: 2px; background: var(--accent-2); animation: bar 0.9s ease-in-out infinite; }
.voice-bars i:nth-child(1) { height: 8px; } .voice-bars i:nth-child(2) { height: 15px; animation-delay: 0.12s; }
.voice-bars i:nth-child(3) { height: 11px; animation-delay: 0.24s; } .voice-bars i:nth-child(4) { height: 16px; animation-delay: 0.36s; }
.voice-bars i:nth-child(5) { height: 9px; animation-delay: 0.48s; }
@keyframes bar { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1.3); } }

.composer {
  max-width: 820px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px;
  padding: 11px 12px 11px 18px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--border);
  backdrop-filter: blur(18px); box-shadow: 0 10px 34px rgba(30, 45, 90, 0.12);
  transition: border 0.2s, box-shadow 0.2s;
}
.composer:focus-within { border-color: rgba(106, 76, 255, 0.5); box-shadow: 0 12px 38px rgba(106, 76, 255, 0.16); }
.composer textarea {
  flex: 1; resize: none; border: none; outline: none; background: none;
  color: var(--text); font-size: 14.5px; font-family: var(--font); line-height: 1.6;
  max-height: 150px; padding: 8px 0;
}
.composer textarea::placeholder { color: var(--text-faint); }

.image-btn, .ppt-btn, .mic-btn, .send-btn {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 13px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.18s; position: relative;
}
.image-btn { background: rgba(28, 42, 80, 0.04); border: 1px solid var(--border); color: var(--text-dim); }
.image-btn:hover { color: var(--accent-1); border-color: rgba(106, 76, 255, 0.35); background: #fff; }
.image-btn.loading { pointer-events: none; opacity: 0.55; }
.ppt-btn {
  background: rgba(106, 76, 255, 0.08); border: 1px solid rgba(106, 76, 255, 0.22);
  color: var(--accent-1); font-size: 11px; font-weight: 800;
}
.ppt-btn:hover { background: #fff; border-color: rgba(106, 76, 255, 0.45); }
.ppt-btn.loading { pointer-events: none; opacity: 0.55; }
.mic-btn { background: rgba(28, 42, 80, 0.04); border: 1px solid var(--border); color: var(--text-dim); }
.mic-btn:hover { color: var(--text); border-color: var(--border-strong); background: #fff; }
.mic-btn.live { background: rgba(0, 166, 240, 0.1); border-color: var(--accent-2); color: var(--accent-2); animation: micPulse 1.4s ease-out infinite; }
@keyframes micPulse { 0% { box-shadow: 0 0 0 0 rgba(0, 166, 240, 0.35); } 100% { box-shadow: 0 0 0 14px rgba(0, 166, 240, 0); } }
.mic-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.send-btn { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 16px rgba(106, 76, 255, 0.35); }
.send-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.send-btn:disabled { opacity: 0.4; filter: none; transform: none; cursor: not-allowed; }
.image-preview-strip {
  max-width: 820px; margin: 9px auto 0; display: none; flex-wrap: wrap; gap: 8px;
  align-items: center; overflow: hidden;
}
.image-preview-strip.show { display: flex; }
.image-chip {
  display: inline-flex; align-items: center; gap: 8px; width: 210px; max-width: 100%;
  padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,0.86);
  border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(30,45,90,0.06);
  overflow: hidden;
}
.image-preview-strip .image-chip > img {
  display: block; width: 56px !important; height: 56px !important;
  min-width: 56px; max-width: 56px; min-height: 56px; max-height: 56px;
  border-radius: 8px; object-fit: cover; background: rgba(28,42,80,0.06);
}
.image-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-dim); }
.image-chip button {
  width: 22px; height: 22px; border: none; border-radius: 7px; cursor: pointer;
  color: var(--text-faint); background: rgba(28,42,80,0.05); flex-shrink: 0;
}
.image-chip button:hover { color: var(--danger); background: rgba(224, 51, 92, 0.08); }
.msg-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg-images img {
  width: min(180px, 42vw); max-height: 180px; object-fit: cover;
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.35);
}
.msg.assistant .msg-images img { border-color: var(--border); }
.presentation-result {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px;
  border-radius: 14px; border: 1px solid rgba(106, 76, 255, 0.2);
  background: linear-gradient(135deg, rgba(106, 76, 255, 0.08), rgba(0, 166, 240, 0.05));
}
.presentation-result-icon {
  display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  flex-shrink: 0; border-radius: 12px; color: #fff; font-size: 12px; font-weight: 800;
  background: var(--accent-grad); box-shadow: 0 6px 16px rgba(106, 76, 255, 0.25);
}
.presentation-result-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.presentation-result-copy b { font-size: 14px; }
.presentation-result-copy span {
  color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.presentation-download {
  padding: 9px 13px; border: none; border-radius: 10px; cursor: pointer;
  color: #fff; background: var(--accent-grad); font-weight: 700; white-space: nowrap;
}
.presentation-download:hover { filter: brightness(1.08); }
.generated-media-card {
  margin-top: 12px; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.75);
}
.generated-media-card img,
.generated-media-card video {
  display: block; width: 100%; max-width: 680px; max-height: 520px;
  object-fit: contain; background: #0c1020;
}
.generated-media-actions {
  display: flex; justify-content: flex-end; padding: 10px 12px;
}
.generated-media-actions a {
  padding: 8px 13px; border-radius: 9px; color: #fff;
  background: var(--accent-grad); font-size: 13px; font-weight: 700;
  text-decoration: none;
}
.foot-note { text-align: center; font-size: 11.5px; color: var(--text-faint); margin-top: 10px; }

/* ============ 通知铃铛与面板 ============ */
.bell-wrap { position: relative; }
.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(224, 51, 92, 0.4);
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 372px; max-height: 480px; z-index: 200;
  display: none; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.notif-panel.open { display: flex; animation: rise 0.22s ease; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.notif-list { overflow-y: auto; }
.notif-empty { padding: 36px 0; text-align: center; color: var(--text-faint); font-size: 13px; }
.notif-item { padding: 13px 16px; border-bottom: 1px solid rgba(28, 42, 80, 0.05); position: relative; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(106, 76, 255, 0.04); }
.notif-item.unread::before { content: ""; position: absolute; left: 6px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-1); }
.notif-item .n-title { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.notif-item .n-body { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 88px; overflow: hidden; }
.notif-item .n-time { font-size: 11px; color: var(--text-faint); margin-top: 5px; }
.notif-item .n-actions { display: flex; gap: 8px; margin-top: 8px; }
.n-icon { font-size: 14px; }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(28, 42, 80, 0.16); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(28, 42, 80, 0.3); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: none; }
  .msg .bubble-wrap { max-width: 92%; }
}
