/* ============================================================
   AI 助手 · Coze 风格对话界面
   ============================================================ */
:root {
  --bg:        #f4f5f7;
  --panel:     #ffffff;
  --line:      #e7e9ee;
  --line-soft: #f0f2f5;
  --text:      #1c2129;
  --text-2:    #5b6270;
  --text-3:    #9aa2b0;
  --accent:    #3370ff;
  --accent-2:  #2a5bd7;
  --accent-weak: #eaf1ff;
  --danger:    #f04438;
  --ok:        #1fbf8f;
  --radius:    16px;
  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --shadow-pop: 0 8px 30px rgba(16,24,40,.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
select { font-family: inherit; }
textarea { font-family: inherit; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
       stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.thread { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

/* ==================== 侧栏 ==================== */
.sidebar {
  width: 276px; flex: none;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 16px 12px 12px;
  z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; flex: none;
              box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .2px; }

.btn-new {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff;
  height: 40px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  transition: background .15s, transform .05s;
  border: 1px solid #cbcbcbf2;
}
.btn-new:hover { background: var(--accent-2); }
.btn-new:active { transform: scale(.99); }
.btn-new.small { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; }

.side-label { font-size: 12px; color: var(--text-3); padding: 18px 8px 8px; }

.session-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.session-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 9px; margin-bottom: 2px;
  color: var(--text-2); font-size: 14px; cursor: pointer; position: relative;
  transition: background .12s;
}
.session-item:hover { background: var(--line-soft); }
.session-item.active { background: var(--accent-weak); color: var(--accent-2); }
.session-item .s-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-item .s-time { font-size: 11px; color: var(--text-3); flex: none; }
.session-item .s-del {
  display: none; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; color: var(--text-3); flex: none;
}
.session-item:hover .s-del { display: flex; }
.session-item .s-del:hover { background: rgba(240,68,56,.12); color: var(--danger); }

.side-foot { padding: 8px 8px 0; font-size: 12px; color: var(--text-3); }

.scrim {
  display: none; position: fixed; inset: 0; background: rgba(15,20,30,.4);
  z-index: 25; opacity: 0; transition: opacity .2s;
}
.menu-btn { display: none; }

/* ==================== 顶栏 ==================== */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: 62px; flex: none;
  background: rgba(244,245,247,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bot-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .5px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.avatar.lg { width: 58px; height: 58px; font-size: 22px; border-radius: 18px; }
.bot-text { min-width: 0; }
.bot-name { font-size: 16px; font-weight: 700; }
.bot-bio { font-size: 12.5px; color: var(--text-3); margin-top: 1px;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.model-pick { display: flex; align-items: center; gap: 6px; }
.model-pick-label { font-size: 12px; color: var(--text-3); }
.model-select {
  appearance: none; -webkit-appearance: none;
  height: 34px; padding: 0 28px 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa2b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  font-size: 13px; color: var(--text); cursor: pointer; max-width: 200px;
  outline: none;
}
.model-select:focus { border-color: var(--accent); }

.think-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 9px; flex: none;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.think-toggle .ic { width: 14px; height: 14px; }
.think-toggle:hover { border-color: var(--accent); color: var(--accent); }
.think-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); flex: none;
}
.icon-btn:hover { background: var(--line-soft); color: var(--text); }

/* 演示提示条 */
.demo-notice {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 20px 0; padding: 8px 12px;
  background: #fff7e6; border: 1px solid #ffe1a8; color: #8a5a00;
  font-size: 13px; border-radius: 10px;
}
.demo-notice .ic { color: #d48806; }
.demo-notice code { background: rgba(0,0,0,.05); padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 12px; }
.notice-x { margin-left: auto; color: inherit; opacity: .6; width: 22px; height: 22px;
            display: flex; align-items: center; justify-content: center; border-radius: 6px; flex: none; }
.notice-x:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ==================== 对话流 ==================== */
.messages {
  max-width: 860px; margin: 0 auto;
  padding: 20px 20px 32px;
  display: flex; flex-direction: column; gap: 22px;
}

/* —— 欢迎页 —— */
.welcome { padding: 9vh 24px 0; text-align: center; max-width: 800px; margin: 0 auto; }
.welcome-avatar { margin: 0 auto 18px; box-shadow: var(--shadow-pop); }
.welcome-title { font-size: 25px; font-weight: 700; margin: 0 0 8px; }
.welcome-sub { color: var(--text-2); font-size: 14.5px; margin: 0 auto 22px; line-height: 1.7; max-width: 480px; }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.starter {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 12px; padding: 12px 14px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.55;
  transition: border-color .15s, box-shadow .15s, transform .05s;
  text-align: left;
}
.starter:hover { border-color: var(--accent); color: var(--accent-2); box-shadow: var(--shadow); }
.starter:active { transform: scale(.995); }

/* —— 消息 —— */
.msg { display: flex; gap: 12px; }
.msg.user { justify-content: flex-end; }
.msg .m-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; margin-top: 2px;
  display: none; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.msg.assistant .m-avatar { display: flex; }
.msg .m-body { display: flex; flex-direction: column; gap: 6px; max-width: 100%; min-width: 0; }
.msg.assistant .m-body { max-width: calc(100% - 44px); }
.msg.user .m-body { align-items: flex-end; max-width: 86%; }

/* 气泡 —— 参考 ChatGPT 风格：
   AI 回复不带边框底色（正文直接平铺在页面上）；
   用户消息浅灰大圆角（右对齐） */
.bubble {
  background: transparent;
  border: 0;
  border-radius: 4px 14px 14px 14px;
  padding: 2px 2px;
  box-shadow: none;
  overflow-wrap: break-word;
  min-width: 0;
}
.msg.user .bubble {
  background: #f1f3f6; border: 0; color: var(--tx);
  border-radius: 20px;
  padding: 10px 16px;
}
/* 报错条：以前只改背景色，借用普通气泡的 15px 正文字号和透明背景，
   一段「接口返回错误 HTTP 402…」拉满整行、红色背景却只有字那么宽，很难读。
   这里按「提示条」排：整宽浅红底、13px、左侧红色竖条，并让长英文串能断行。 */
.msg.error .bubble {
  display: block; width: 100%;
  background: #fef3f2; border: 1px solid #fecdca; color: #b42318;
  border-left: 3px solid #f04438;
  border-radius: 10px;
  padding: 10px 13px;
}
.msg.error .bubble.error-text {
  font-size: 13px; line-height: 1.7; white-space: pre-wrap;
  overflow-wrap: anywhere; word-break: break-word;
}
.msg.error .bubble > *:first-child { margin-top: 0; }
.msg.error .bubble > *:last-child { margin-bottom: 0; }
html[data-theme="dark"] .msg.error .bubble {
  background: rgba(240, 68, 56, .12); border-color: rgba(240, 68, 56, .38); color: #ffb4ab;
}
.bubble .md { width: 100%; }
.msg.user .bubble .md { color: var(--tx); }

/* 思考过程 */
.think {
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 10px;
  overflow: hidden;
  align-self: stretch;
}
.think-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; width: 100%; text-align: left;
  color: var(--text-2); font-size: 12.5px;
}
.think-head .think-state { display: inline-flex; align-items: center; gap: 6px; flex: 1; }
.think-head .ic-thinking { color: var(--accent); }
.think-head .chev { transition: transform .18s; margin-left: auto; color: var(--text-3); }
.think.open .chev { transform: rotate(180deg); }
.think-body {
  display: none;
  border-top: 1px solid var(--line-soft);
  padding: 10px 12px 12px;
  font-size: 13px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; overflow-wrap: break-word;
  max-height: 320px; overflow-y: auto;
}
.think.open .think-body { display: block; }

/* 思考中的动画点 */
.dots { display: inline-flex; gap: 3px; align-items: center; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
          animation: dblink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dblink { 0%,80%,100% { opacity: .25; transform: translateY(0);} 40% { opacity: 1; transform: translateY(-2px);} }

/* 流式光标 */
.cursor {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 2px;
  vertical-align: text-bottom; background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 消息操作条 */
.msg-actions {
  display: flex; gap: 2px; align-items: center;
  opacity: 0; transition: opacity .15s;
  padding: 0 2px; margin-top: 1px;
}
.msg:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.act {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px;
}
.act:hover { background: var(--line-soft); color: var(--text); }
.act.active { color: var(--accent); background: var(--accent-weak); }
.act.danger:hover { color: var(--danger); background: rgba(240,68,56,.1); }
.act .ic { width: 15px; height: 15px; }
.act .a-label { font-size: 11px; }
.msg.user .msg-actions { justify-content: flex-end; }

/* 推荐追问 */
.suggests { display: flex; flex-wrap: wrap; gap: 8px; }
.sugg { border: 1px solid var(--line); background: var(--panel); color: var(--text-2);
        font-size: 13px; padding: 7px 13px; border-radius: 999px;
        transition: border-color .15s, color .15s, background .15s; max-width: 100%; }
.sugg:hover { border-color: var(--accent); color: var(--accent-2); background: #f8fbff; }
.sugg:disabled { opacity: .5; cursor: not-allowed; }

/* 时间戳/状态小字 */
.meta-note { font-size: 11.5px; color: var(--text-3); padding: 0 2px; }

/* ==================== Markdown ==================== */
/* 正文排版（参考 DeepSeek 官网：15px 字号、1.8 行距、段落间距宽松、标题不夸张） */
.md { line-height: 1.8; font-size: 15px; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: .8em 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.2em 0 .5em; line-height: 1.5; font-weight: 700; }
.md h1 { font-size: 1.25em; } .md h2 { font-size: 1.15em; } .md h3 { font-size: 1.05em; }
.md h4 { font-size: 1em; }
.md ul, .md ol { margin: .5em 0; padding-left: 1.5em; }
.md li { margin: .3em 0; }
.md li > p { margin: .3em 0; }
.md a { color: var(--accent); text-decoration: none; }
.md a:hover { text-decoration: underline; }
.md blockquote { margin: .6em 0; padding: .2em 1em; border-left: 3px solid var(--accent);
                 background: var(--line-soft); border-radius: 0 8px 8px 0; color: var(--text-2); }
.md hr { border: none; border-top: 1px solid var(--line); margin: .9em 0; }
.md table { border-collapse: collapse; margin: .6em 0; width: 100%; font-size: 13px; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: var(--line-soft); font-weight: 600; }
.md img { max-width: 100%; border-radius: 8px; }

.md code {
  font-family: var(--mono); font-size: .9em;
  background: #f2f3f7; padding: .12em .4em; border-radius: 5px;
  color: #c7254e;
}
.msg.user .md code { background: rgba(255,255,255,.22); color: #fff; }

.code-wrap { position: relative; margin: .7em 0; }
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #1e2430; color: #aeb6c6;
  font-size: 12px; padding: 6px 12px;
  border-radius: 10px 10px 0 0;
}
.code-head .lang { font-family: var(--mono); }
.code-copy { display: inline-flex; align-items: center; gap: 4px; color: #aeb6c6; padding: 2px 6px;
             border-radius: 6px; font-size: 12px; }
.code-copy:hover { background: rgba(255,255,255,.12); color: #fff; }
.md pre {
  margin: 0; background: #1e2430; color: #d6dae2;
  padding: 12px 14px; overflow-x: auto; border-radius: 0 0 10px 10px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
.md pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.code-wrap.no-head .md pre { border-radius: 10px; }

/* ==================== 输入区 ==================== */
.composer-wrap { flex: none; padding: 8px 20px 12px; }
.composer {
  max-width: 860px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 8px 10px 6px;
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(51,112,255,.12); }
.input {
  display: block; width: 100%;
  border: none; outline: none; resize: none;
  padding: 6px 6px 2px; font-size: 15px; line-height: 1.6;
  max-height: 180px; background: transparent; color: var(--text);
}
.composer-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.composer-left, .composer-right { display: flex; align-items: center; gap: 4px; }
.tool-btn {
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.tool-btn:hover { background: var(--line-soft); color: var(--text-2); }
.model-tip { font-size: 12px; color: var(--text-3); margin-right: 6px; max-width: 180px;
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-send {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .05s;
}
.btn-send:hover { background: var(--accent-2); }
.btn-send:active { transform: scale(.96); }
.btn-send:disabled { background: #c8d4f5; cursor: not-allowed; }
.btn-stop {
  height: 36px; padding: 0 14px; border-radius: 10px;
  background: var(--text); color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-stop:hover { background: #3a4252; }
.footnote { text-align: center; font-size: 11.5px; color: var(--text-3); margin: 8px 0 0; }

/* ==================== Toast ==================== */
/* 底部居中、贴在输入框上方：原来的 bottom:90px 正好压在输入框上，
   报错时 toast 和输入框叠在一起互相挡字，看不清也点不到。
   报错原文很长，toast 里最多显示两行，完整内容看消息里的红条。 */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px);
  background: rgba(28,33,41,.92); color: #fff; font-size: 13px; line-height: 1.5;
  padding: 9px 16px; border-radius: 10px; z-index: 400;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: min(560px, calc(100vw - 32px));
  box-shadow: 0 10px 26px rgba(16, 24, 40, .22);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  text-align: center; word-break: break-word;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* 输入框约 110px 高，在桌面端把 toast 抬到输入框之上 */
@media (min-width: 861px) {
  .toast { bottom: 140px; }
}

/* 公众号发送成功弹窗 */
.send-success-modal {
  position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center;
  background: rgba(12, 28, 52, .28); backdrop-filter: blur(2px);
}
.send-success-modal[hidden] { display: none; }
.send-success-card {
  position: relative; width: min(360px, calc(100vw - 40px)); padding: 28px 24px 22px;
  border: 1px solid #c8eee3; border-radius: 18px; background: var(--card);
  box-shadow: 0 18px 50px rgba(17, 45, 76, .2); text-align: center;
}
.send-success-close {
  position: absolute; top: 9px; right: 12px; border: 0; background: transparent;
  color: var(--tx3); font-size: 24px; line-height: 1; cursor: pointer;
}
.send-success-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #e2f8f0; color: #0b9b78; font-size: 28px; font-weight: 700;
}
.send-success-title { color: var(--tx); font-size: 18px; font-weight: 700; }
.send-success-text { margin-top: 7px; color: var(--tx2); font-size: 14px; }
.send-success-ok {
  min-width: 104px; margin-top: 20px; padding: 8px 18px; border: 0; border-radius: 9px;
  background: #0e9f7d; color: #fff; font: inherit; font-size: 13px; cursor: pointer;
}
.send-success-ok:hover { background: #087f68; }

/* ==================== 侧栏用户卡 ==================== */
.side-user {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px 6px 2px; margin-top: 8px;
}
.su-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #5b7cfa, #8b5cf6);
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.su-info { flex: 1; min-width: 0; }
.su-name { font-size: 13.5px; font-weight: 600; overflow: hidden;
           text-overflow: ellipsis; white-space: nowrap; }
.su-sub { font-size: 11px; color: var(--text-3); }
.su-logout {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.su-logout:hover { background: var(--line-soft); color: var(--danger); }

/* ==================== 登录 / 注册页 ==================== */
.auth-body {
  min-height: 100vh; margin: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #edf4fb 0%, #f7faff 52%, #edf5f5 100%);
  padding: 32px 20px;
}
.auth-body::before, .auth-body::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(2px);
}
.auth-body::before { width: 520px; height: 520px; left: -220px; top: -250px; background: rgba(40, 143, 178, .09); }
.auth-body::after { width: 460px; height: 460px; right: -190px; bottom: -230px; background: rgba(24, 160, 137, .08); }
.auth-wrap {
  position: relative; z-index: 1; width: 900px; max-width: 100%; min-height: 560px;
  display: grid; grid-template-columns: 1fr 260px; align-items: stretch; gap: 0;
  filter: drop-shadow(0 26px 55px rgba(28, 58, 96, .14));
}
.auth-intro {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  grid-column: 2; grid-row: 1; padding: 42px 28px; border-radius: 0 0 0 0; color: #fff;
  background:
    linear-gradient(180deg, rgba(9, 31, 54, .42), rgba(6, 32, 53, .68)),
    radial-gradient(circle at 76% 22%, #c59443 0 10%, transparent 11%),
    linear-gradient(125deg, #1b4f5a 0%, #9b6e23 52%, #d9a64d 100%);
}
.auth-intro::after {
  content: ''; position: absolute; right: -86px; bottom: -80px; width: 250px; height: 250px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.045), 0 0 0 56px rgba(255,255,255,.03);
}
.auth-intro::before {
  content: '医'; position: absolute; right: 24px; bottom: 56px; color: rgba(255,255,255,.10);
  font-size: 150px; line-height: 1; font-weight: 800; transform: rotate(-8deg);
}
.intro-kicker { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.75); font-size: 12px; letter-spacing: .08em; }
.intro-dot { width: 7px; height: 7px; border-radius: 50%; background: #a7f3d0; box-shadow: 0 0 0 5px rgba(167,243,208,.14); }
.auth-intro h1 { position: relative; z-index: 1; margin: 22px 0 10px; font-size: 28px; line-height: 1.2; letter-spacing: .02em; font-weight: 700; }
.auth-intro p { position: relative; z-index: 1; max-width: 190px; margin: 0; color: rgba(255,255,255,.82); font-size: 12px; line-height: 1.8; }
.intro-register { position: relative; z-index: 1; width: 104px; height: 36px; margin-top: 28px; border: 1px solid rgba(255,255,255,.86); border-radius: 20px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, transform .15s; }
.intro-register:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.intro-orbit { position: absolute; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.intro-orbit-one { width: 220px; height: 220px; top: 52px; right: -76px; }
.intro-orbit-two { width: 160px; height: 160px; top: 82px; right: -46px; }
.auth-card {
  background: #fff; border: 1px solid #e8edf5;
  grid-column: 1; grid-row: 1; border-radius: 22px 0 0 22px; box-shadow: none;
  padding: 54px 86px 40px; display: flex; flex-direction: column; justify-content: center;
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-logo {
  width: 54px; height: 54px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 14px;
  box-shadow: 0 10px 22px rgba(47,107,255,.24), inset 0 0 0 1px rgba(255,255,255,.28);
}
.auth-title { color: #172238; font-size: 21px; font-weight: 700; letter-spacing: .2px; }
.auth-sub { color: #8490a4; font-size: 12.5px; margin: 7px auto 0; line-height: 1.65; max-width: 280px; }

.auth-tabs {
  display: flex; background: #f4f7fb; border-radius: 9px; padding: 3px;
  margin-bottom: 22px; border: 1px solid #edf1f6;
}
.auth-tab {
  flex: 1; height: 35px; border-radius: 7px; font-size: 13.5px;
  color: #7e899b; font-weight: 500; transition: color .15s, background .15s, box-shadow .15s;
}
.auth-tab.active { background: #fff; color: #2f6df6; font-weight: 600; box-shadow: 0 2px 7px rgba(31,55,88,.08); }

.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.auth-field label { color: #4e5b70; font-size: 12.5px; font-weight: 600; }
.auth-field input {
  height: 44px; border: 1px solid #dfe6ef; border-radius: 9px;
  padding: 0 13px; font-size: 14px; outline: none; background: #fbfcfe; color: #172238;
  transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus { background: #fff; border-color: #5d8dff; box-shadow: 0 0 0 3px rgba(51,112,255,.11); }

.auth-error {
  font-size: 12.5px; color: #b42318; background: #fef3f2;
  border: 1px solid #fecdca; border-radius: 8px; padding: 8px 11px;
  line-height: 1.5; margin: 0 0 10px;
}
.auth-submit {
  height: 45px; border-radius: 9px; border: none;
  background: linear-gradient(135deg, #3476f5 0%, #265ce1 100%);
  color: #fff; font-size: 14px; font-weight: 600; margin-top: 7px;
  box-shadow: 0 9px 20px rgba(47,107,246,.24);
  transition: opacity .15s, transform .05s;
}
.auth-submit:hover { background: #255fe2; opacity: 1; }
.auth-submit:active { transform: scale(.995); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }
.auth-switch { text-align: center; font-size: 12.5px; color: #8a95a6; margin: 16px 0 0; }
.auth-switch a { color: #2f6df6; text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.auth-foot { text-align: center; font-size: 12px; color: var(--text-3); }
.auth-foot a { color: var(--text-3); }

@media (max-width: 420px) {
  .auth-body { padding: 18px 14px; }
  .auth-card { padding: 28px 21px 23px; border-radius: 16px; }
}

@media (max-width: 760px) {
  .auth-wrap { display: block; min-height: 0; width: 390px; filter: drop-shadow(0 16px 34px rgba(28, 58, 96, .11)); }
  .auth-intro { display: none; }
  .auth-card { border-radius: 18px; box-shadow: none; padding: 34px 30px 27px; }
}

/* 左右切换登录 / 注册页（参考 dowebok 交互结构） */
.auth-body .dowebok {
  overflow: hidden; position: relative; width: 900px; height: 550px; margin: 0 auto;
  background: #fff; box-shadow: 0 24px 60px rgba(35, 47, 65, .14);
}
.auth-body .dowebok .form {
  position: absolute; top: 0; width: 640px; height: 100%; padding: 54px 30px 0;
  transition: transform .6s ease-in-out;
}
.auth-body .dowebok .sign-in { left: 0; z-index: 1; }
.auth-body .dowebok .sub-cont {
  overflow: hidden; position: absolute; left: 640px; top: 0; width: 900px; height: 100%;
  padding-left: 260px; background: #fff; transition: transform .6s ease-in-out;
}
.auth-body .dowebok .sign-up { left: 260px; padding-top: 54px; transform: translateX(900px); }
.auth-body .dowebok.s--signup .sign-in { transform: translateX(-640px); }
.auth-body .dowebok.s--signup .sub-cont { transform: translateX(-640px); }
.auth-body .dowebok.s--signup .sign-up { transform: translateX(0); }
.auth-body .dowebok .auth-brand { display: none; }
.auth-body .dowebok h2 { width: 100%; margin: 4px 0 40px; color: #101820; font-size: 32px; font-weight: 600; text-align: center; }
.auth-body .dowebok label { display: block; width: 260px; margin: 25px auto 0; text-align: center; }
.auth-body .dowebok label span { color: #8b96a6; font-size: 14px; }
.auth-body .dowebok label input {
  display: block; width: 100%; height: 32px; margin-top: 5px; padding: 0 2px 7px;
  border: 0; border-bottom: 1px solid #aeb7c2; border-radius: 0; background: transparent;
  color: #202938; font-size: 18px; text-align: center; box-shadow: none;
}
.auth-body .dowebok label input:focus { border-bottom-color: #c99d5b; box-shadow: none; }
.auth-body .dowebok label input::placeholder { color: #c2c9d2; }
.auth-body .dowebok .forgot-pass { margin: 19px 0 0; color: #b2bac5; font-size: 13px; text-align: center; }
.auth-body .dowebok .submit {
  display: block; width: 260px; height: 38px; margin: 40px auto 16px; border: 0;
  border-radius: 22px; background: #cda66d; color: #fff; cursor: pointer; font-size: 16px;
  letter-spacing: .16em; box-shadow: 0 9px 18px rgba(205,166,109,.18); transition: background .18s, transform .18s;
}
.auth-body .dowebok .submit:hover { background: #bd9253; transform: translateY(-1px); }
.auth-body .dowebok .submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.auth-body .dowebok .auth-error { width: 260px; margin: 16px auto 0; }
.auth-body .dowebok .auth-hint { width: 260px; margin: 16px auto 0; }
.auth-body .dowebok .img {
  overflow: hidden; z-index: 2; position: absolute; left: 0; top: 0; width: 260px; height: 100%;
  padding-top: 56px; color: #fff; background: linear-gradient(145deg, #294c51, #b17d30 55%, #d9b06c);
}
.auth-body .dowebok .img::before {
  content: ''; position: absolute; right: 0; top: 0; width: 900px; height: 100%;
  background-image: linear-gradient(138deg, rgba(19,51,63,.48), rgba(120,78,18,.35) 58%, rgba(10,31,40,.58)), url('../login-side.png');
  background-size: cover; background-position: center;
  transition: transform .6s ease-in-out;
}
.auth-body .dowebok .img::after { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: rgba(4, 19, 29, .24); }
.auth-body .dowebok .img__text { z-index: 2; position: absolute; left: 0; top: 55px; width: 100%; padding: 0 20px; color: #fff; text-align: center; transition: transform .6s ease-in-out; }
.auth-body .dowebok .img__text h2 { margin: 0 0 12px; color: #fff; font-size: 29px; font-weight: 400; }
.auth-body .dowebok .img__text p { color: rgba(255,255,255,.9); font-size: 14px; line-height: 1.7; }
.auth-body .dowebok .img__text.m--in { transform: translateX(-520px); }
.auth-body .dowebok.s--signup .img__text.m--up { transform: translateX(520px); }
.auth-body .dowebok.s--signup .img__text.m--in { transform: translateX(0); }
.auth-body .dowebok .img__btn {
  overflow: hidden; z-index: 2; position: absolute; left: 80px; bottom: 72px; width: 100px; height: 38px;
  border: 0; border-radius: 22px; background: transparent; color: #fff; cursor: pointer;
}
.auth-body .dowebok .img__btn::after { content: ''; z-index: 2; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.9); border-radius: 22px; }
.auth-body .dowebok .img__btn span { position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 14px; letter-spacing: .16em; transition: transform .6s; }
.auth-body .dowebok .img__btn span.m--in { transform: translateY(-72px); }
.auth-body .dowebok.s--signup .img__btn span.m--up { transform: translateY(72px); }
.auth-body .dowebok.s--signup .img__btn span.m--in { transform: translateY(0); }

@media (max-width: 760px) {
  .auth-body .dowebok { width: min(100%, 420px); height: 560px; }
  .auth-body .dowebok .form { width: 100%; padding-left: 24px; padding-right: 24px; }
  .auth-body .dowebok .sub-cont { left: 0; width: 100%; padding-left: 0; transform: translateX(100%); }
  .auth-body .dowebok.s--signup .sub-cont { transform: translateX(0); }
  .auth-body .dowebok .sign-up { left: 0; width: 100%; transform: translateX(0); }
  .auth-body .dowebok .img { display: none; }
  .auth-body .dowebok.s--signup .sign-in { transform: translateX(-100%); }
}

/* 桌面端放大比例，去掉浏览器默认黑色焦点框 */
@media (min-width: 761px) {
  .auth-body .dowebok {
    width: min(1060px, calc(100vw - 48px));
    height: min(640px, calc(100vh - 42px));
  }
  .auth-body .dowebok .form { width: 760px; padding-top: 66px; }
  .auth-body .dowebok .sub-cont { left: 760px; width: 1060px; padding-left: 300px; }
  .auth-body .dowebok .sign-up { left: 300px; transform: translateX(1060px); }
  .auth-body .dowebok.s--signup .sign-in { transform: translateX(-760px); }
  .auth-body .dowebok.s--signup .sub-cont { transform: translateX(-760px); }
  .auth-body .dowebok .img { width: 300px; }
  .auth-body .dowebok .img__btn { left: 100px; }
  .auth-body .dowebok label,
  .auth-body .dowebok .submit,
  .auth-body .dowebok .auth-error,
  .auth-body .dowebok .auth-hint { width: 330px; }
  .auth-body .dowebok label input,
  .auth-body .dowebok label input:focus { outline: 0 !important; -webkit-appearance: none; }
  .auth-body .dowebok label input:focus { border: 0; border-bottom: 1px solid #c99d5b; }
}

/* ==================== 补充 UI ==================== */
.session-empty {
  padding: 18px 12px; font-size: 13px; color: var(--text-3);
  text-align: center; line-height: 1.7;
}
.stream-ph { color: var(--text-3); font-size: 13px; }
.table-scroll { overflow-x: auto; }
.md .code-copy { color: #c3c9d6; }
.md .code-copy .ic { width: 13px; height: 13px; }

/* 编辑态 */
.msg.user .bubble.editing {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 14px; width: 100%;
}
.bubble.editing .edit-box { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.edit-input {
  border: 1px solid var(--line); border-radius: 10px; outline: none;
  padding: 9px 11px; font-size: 14px; line-height: 1.6;
  background: #fff; color: var(--text); resize: none; min-height: 72px;
  width: 100%;
}
.edit-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(51,112,255,.12); }
.edit-bar { display: flex; justify-content: flex-end; gap: 8px; }
.mini-btn {
  height: 30px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); background: var(--line-soft);
}
.mini-btn:hover { background: var(--line); color: var(--text); }
.mini-btn.primary { background: var(--accent); color: #fff; }
.mini-btn.primary:hover { background: var(--accent-2); }

.msg.error .msg-actions { opacity: 1; }
.msg-actions:empty { display: none; }

/* ==================== 智能体（Agent） ==================== */
.agent-pick { display: flex; align-items: center; gap: 6px; }
.agent-pick .model-select { max-width: 132px; }

/* 侧栏会话上的智能体小标签 */
.session-item .s-agent {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

/* 欢迎页：智能体选择面板 */
.agent-panel { margin: 2px auto 26px; max-width: 720px; }
.agent-panel-title {
  font-size: 12px; color: var(--text-3); letter-spacing: .3px;
  margin-bottom: 10px; text-align: center;
}
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 10px; text-align: left;
}
.agent-card {
  position: relative;
  display: flex; flex-direction: column; gap: 5px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 12px 10px; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.agent-card:hover { border-color: #cdd5e4; box-shadow: var(--shadow); transform: translateY(-1px); }
.agent-card:active { transform: scale(.99); }
.agent-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(51,112,255,.14);
  background: #fbfcff;
}
.ac-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ac-avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.ac-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ac-check { width: 16px; height: 16px; color: var(--accent); margin-left: auto; flex: none; }
.ac-bio {
  font-size: 11.5px; line-height: 1.5; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 0;
}
.ac-skills { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-size: 10.5px; line-height: 1; background: var(--line-soft);
  color: var(--text-2); border-radius: 999px; padding: 3px 7px;
}
.ac-auto { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.auto-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; line-height: 1.2; border-radius: 6px; padding: 3px 6px;
  max-width: 100%;
}
.auto-ai { background: #e8f4ff; color: #0b6bcb; }
.auto-human { background: #fff3e6; color: #c7741a; }
.auto-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* ==================== 响应式 ==================== */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; opacity: 1; }
  .menu-btn { display: inline-flex; }
  .model-pick-label, .bot-bio { display: none; }
  .think-toggle span { display: none; }
  .think-toggle { padding: 0 9px; }
  .msg .m-body { max-width: 100%; }
  .msg-actions { opacity: 1; }
  .msg.assistant .m-body { max-width: calc(100% - 44px); }
  .msg.user .m-body { max-width: 92%; }
  .starters { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: repeat(2, 1fr); }
  .agent-pick .model-select { max-width: 110px; }
  .top-actions { gap: 6px; }
}

@media (max-width: 560px) {
  .top-actions .model-select { max-width: 108px; }
  .agent-pick { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .05s !important; }
}
