/* 前台 —— 对话式（GPT 风）文案搭子 */

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }

/* ── 氛围背景 ── */
.atmosphere { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(64px); opacity: 0.4; will-change: transform; transform: translateZ(0); }
/* 静态光球：不做动画——动的背景会逼迫上层 backdrop-filter 每帧重绘，是卡顿主因 */
.orb-1 { width: 46vw; height: 46vw; top: -16vw; right: -8vw; background: radial-gradient(circle at 30% 30%, oklch(82% 0.12 235), transparent 70%); }
.orb-2 { width: 38vw; height: 38vw; bottom: -18vw; left: -10vw; background: radial-gradient(circle at 60% 40%, oklch(86% 0.09 200), transparent 70%); }
.grain { position: absolute; inset: 0; opacity: 0.35; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E"); }
/* 只平移、不缩放——缩放会让大模糊层每帧重新栅格化，非常吃 GPU、导致卡顿 */
@keyframes float1 { to { transform: translate3d(-4vw, 5vw, 0); } }
@keyframes float2 { to { transform: translate3d(5vw, -4vw, 0); } }

/* ── Header ── */
.site-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 40px); position: sticky; top: 0; z-index: 20; background: oklch(98.6% 0.006 235); border-bottom: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { transition: transform var(--dur) var(--ease); }
.brand:hover .brand-mark { transform: translateY(-2px) rotate(-3deg); }
.bm-node { transform-origin: 47px 11.5px; animation: pulse 3.4s var(--ease-soft) infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.12rem; font-weight: 800; letter-spacing: .5px; color: var(--ink-900); }
.brand-text em { font-style: normal; font-size: 0.66rem; letter-spacing: 2px; color: var(--brand-600); }
.btn-new { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--text-sm); color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-200); padding: 9px 16px; border-radius: 999px; transition: all var(--dur-fast) var(--ease); }
.btn-new:hover { background: var(--brand-100); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-new:active { transform: scale(0.97); }

/* ── 对话区 ── */
.chat { flex: 1 1 auto; overflow-y: auto; scroll-behavior: smooth; }
.thread { max-width: 760px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 24px) 40px; display: flex; flex-direction: column; gap: 12px; }

/* 开场 */
.welcome { text-align: center; padding: clamp(28px, 6vh, 64px) 0 12px; }
.eyebrow { display: inline-block; font-size: var(--text-sm); font-weight: 700; letter-spacing: 3px; color: var(--brand-600); background: var(--brand-50); border: 1px solid var(--brand-200); padding: 5px 14px; border-radius: 999px; margin: 0 0 18px; }
.welcome h1 { font-size: var(--text-2xl); font-weight: 850; line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.5px; }
.grad { background: linear-gradient(100deg, var(--brand-600), var(--brand-400) 60%, oklch(70% 0.12 200)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome .lede { max-width: 540px; margin: 0 auto 26px; color: var(--ink-500); font-size: var(--text-base); }
.welcome .lede b { color: var(--brand-600); font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.chip { font-size: var(--text-sm); color: var(--ink-700); background: var(--surface); border: 1px solid var(--line); padding: 9px 14px; border-radius: 14px; transition: all var(--dur-fast) var(--ease); text-align: left; box-shadow: var(--shadow-sm); }
.chip:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); transform: translateY(-2px); }
.chip:active { transform: translateY(0) scale(0.98); }

/* ── 消息 ── */
.msg { display: flex; gap: 12px; opacity: 0; transform: translateY(12px); animation: msgIn var(--dur-slow) var(--ease) forwards; }
.msg.no-in { animation: none; opacity: 1; transform: none; }  /* 回放历史时不播动画 */
@keyframes msgIn { to { opacity: 1; transform: translateY(0); } }
.msg-user { flex-direction: row-reverse; }
.msg-avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-600)); box-shadow: var(--shadow-sm); }
.msg-user .msg-avatar { background: linear-gradient(135deg, oklch(74% 0.02 245), oklch(64% 0.02 245)); }
.msg-body { min-width: 0; max-width: 100%; }

/* 用户气泡 */
.msg-user .msg-body { background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); color: #fff; padding: 12px 16px; border-radius: 18px 18px 4px 18px; box-shadow: var(--shadow-brand); }
.msg-user .msg-body p { margin: 0; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.msg-user .msg-body p.muted { opacity: 0.8; font-style: italic; }
.msg-img { display: block; max-width: 220px; max-height: 200px; border-radius: 12px; border: 1px solid oklch(100% 0 0 / 0.3); margin-bottom: 8px; }
.msg-user .msg-body:has(.msg-img) { padding: 8px; }

/* bot 普通气泡（提示/系统话）*/
.msg-bot .bubble { background: var(--surface); border: 1px solid var(--line); padding: 13px 16px; border-radius: 18px 18px 18px 4px; box-shadow: var(--shadow-sm); line-height: 1.7; color: var(--ink-900); }
.msg-bot .bubble.notice { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.msg-bot .bubble.warn { background: var(--warn-bg); border-color: oklch(80% 0.12 32); color: var(--warn); }

/* 版本卡片消息 */
.ver-msg .msg-body { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 13px 16px; box-shadow: var(--shadow-sm); transition: box-shadow var(--dur) var(--ease), border-color var(--dur); }
.ver-msg .msg-body:hover { box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.ver-msg.liked .msg-body { border-color: var(--brand-400); box-shadow: 0 8px 24px oklch(64% 0.145 236 / 0.18); }
.ver-msg.disliked .msg-body { opacity: 0.6; }
.ver-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ver-index { font-family: var(--font-num); font-size: var(--text-sm); font-weight: 700; color: var(--brand-600); letter-spacing: .5px; }
.ver-index b { font-size: 1.1rem; }
.ver-flag { font-size: var(--text-xs); font-weight: 700; color: var(--brand-700); background: var(--brand-50); padding: 3px 10px; border-radius: 999px; }
.ver-text { font-size: var(--text-base); color: var(--ink-900); word-break: break-word; }
.ver-text p { margin: 0 0 0.42em; line-height: 1.62; }
.ver-text p:last-child { margin-bottom: 0; }

.ver-actions { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.act { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-700); font-size: var(--text-sm); font-weight: 600; padding: 7px 12px; border-radius: 10px; transition: all var(--dur-fast) var(--ease); }
.act:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); transform: translateY(-1px); }
.act:active { transform: scale(0.95); }
.act-fb { margin-left: auto; color: var(--ink-500); }
.act-copy.done { background: var(--good-bg); color: var(--good); border-color: oklch(80% 0.1 150); }
.act-like[aria-pressed="true"] { background: var(--brand-500); color: #fff; border-color: var(--brand-500); box-shadow: 0 4px 12px oklch(64% 0.145 236 / 0.4); }
.act-dislike[aria-pressed="true"] { background: var(--warn-bg); color: var(--warn); border-color: oklch(80% 0.12 32); }
.act .cnt { font-family: var(--font-num); min-width: 5px; }
.act-like.bump { animation: bump 0.4s var(--ease); }
@keyframes bump { 30% { transform: scale(1.22); } 60% { transform: scale(0.94); } }

/* 打字指示 */
.typing { display: inline-flex; gap: 5px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; box-shadow: var(--shadow-sm); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-400); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* zs 小标记 */
.round-meta { display: flex; gap: 8px; align-items: center; font-size: var(--text-xs); color: var(--ink-400); padding-left: 46px; margin-top: -6px; }
.zs-badge { font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--good-bg); color: var(--good); border: 1px solid oklch(80% 0.1 150); }
.zs-badge.off { background: var(--surface-2); color: var(--ink-500); border-color: var(--line); }

/* ── 图标（mask）── */
.ico { width: 15px; height: 15px; display: inline-block; background: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.ico-copy { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E"); }
.ico-like { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v12'/%3E%3Cpath d='M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v12'/%3E%3Cpath d='M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z'/%3E%3C/svg%3E"); }
.ico-dislike { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 14V2'/%3E%3Cpath d='M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 14V2'/%3E%3Cpath d='M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z'/%3E%3C/svg%3E"); }
.ico-chat { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }

/* ── 输入栏 dock ── */
.composer-dock { flex: 0 0 auto; position: sticky; bottom: 0; z-index: 15; padding: 14px clamp(16px, 4vw, 24px) 18px; background: linear-gradient(to top, var(--bg) 60%, transparent); }
.composer-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow-lg); transition: border-color var(--dur), box-shadow var(--dur); }
.composer-inner:focus-within { border-color: var(--brand-400); box-shadow: var(--shadow-lg), 0 0 0 3px var(--brand-100); }
.composer-inner.dragover { border-color: var(--brand-500); box-shadow: var(--shadow-lg), 0 0 0 3px var(--brand-200); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.btn-attach { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-500); border-radius: 12px; display: grid; place-items: center; transition: all var(--dur-fast) var(--ease); }
.btn-attach:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); }
.btn-attach.has { border-color: var(--brand-400); color: var(--brand-600); background: var(--brand-50); }
/* 语音输入按钮 */
.btn-mic { position: relative; flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-500); border-radius: 12px; display: grid; place-items: center; transition: all var(--dur-fast) var(--ease); }
.btn-mic:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); }
.btn-mic.recording { border-color: var(--warn); color: #fff; background: var(--warn); animation: micPulse 1.2s infinite; }
@keyframes micPulse { 0%,100% { box-shadow: 0 0 0 0 oklch(64% 0.16 30 / 0.5); } 50% { box-shadow: 0 0 0 7px oklch(64% 0.16 30 / 0); } }
.btn-mic .mic-spin { display: none; position: absolute; width: 18px; height: 18px; border: 2.5px solid var(--brand-200); border-top-color: var(--brand-600); border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn-mic.transcribing .mic-ico { visibility: hidden; }
.btn-mic.transcribing .mic-spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.img-preview { position: relative; width: fit-content; padding: 4px 4px 0 4px; }
.img-preview img { max-height: 96px; max-width: 200px; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; box-shadow: var(--shadow-sm); }
.img-remove { position: absolute; top: -2px; right: -2px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink-900); color: #fff; font-size: 16px; line-height: 1; display: grid; place-items: center; }
.img-remove:hover { background: var(--warn); }
#prompt { flex: 1; border: none; resize: none; font-size: var(--text-base); line-height: 1.6; color: var(--ink-900); background: transparent; padding: 10px 4px; max-height: 180px; font-family: inherit; }
#prompt::placeholder { color: var(--ink-400); }
#prompt:focus { outline: none; }
.btn-send { flex: 0 0 auto; width: 44px; height: 44px; border: none; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-600)); box-shadow: var(--shadow-brand); transition: transform var(--dur) var(--ease), filter var(--dur); }
.btn-send:hover { transform: translateY(-1px) scale(1.04); }
.btn-send:active { transform: scale(0.95); }
.btn-send:disabled { filter: grayscale(.4) opacity(.6); cursor: not-allowed; }
.composer-tip { max-width: 760px; margin: 8px auto 0; font-size: var(--text-xs); color: var(--ink-400); text-align: center; }

/* ── 弹窗 ── */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: oklch(22% 0.03 245 / 0.4); backdrop-filter: blur(4px); animation: fade var(--dur) var(--ease); }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: 26px; width: min(480px, 100%); box-shadow: var(--shadow-lg); animation: pop var(--dur) var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.modal h3 { margin: 0 0 4px; font-size: var(--text-xl); }
.modal-sub { margin: 0 0 14px; color: var(--ink-500); font-size: var(--text-sm); }
.modal-copy { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--brand-400); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px; font-size: var(--text-sm); line-height: 1.75; color: var(--ink-700); white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow-y: auto; }
.modal textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; font-size: var(--text-base); font-family: inherit; resize: vertical; line-height: 1.6; }
.modal textarea:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-100); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-700); padding: 10px 18px; border-radius: var(--r-md); font-weight: 600; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-solid { background: var(--brand-600); border: none; color: #fff; padding: 10px 20px; border-radius: var(--r-md); font-weight: 700; box-shadow: var(--shadow-brand); }
.btn-solid:hover { background: var(--brand-700); transform: translateY(-1px); }

/* ── Toast ── */
.toast-wrap { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: var(--ink-900); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: var(--text-sm); font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn var(--dur) var(--ease); }
.toast.good { background: var(--good); } .toast.warn { background: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } }

/* ════════ 账号 + 多会话布局 ════════ */
body { height: 100vh; overflow: hidden; }

/* 登录闸门 */
.login-gate { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; }
.login-gate[hidden] { display: none; }
.login-card { width: min(380px, 100%); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 40px 34px; box-shadow: var(--shadow-lg); animation: pop var(--dur-slow) var(--ease); }
.login-card h1 { margin: 14px 0 4px; font-size: 1.8rem; }
.login-sub { margin: 0 0 24px; color: var(--ink-500); font-size: var(--text-sm); }
.btn-feishu { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border: none; border-radius: var(--r-md); background: linear-gradient(120deg, var(--brand-600), var(--brand-500)); color: #fff; font-weight: 800; font-size: var(--text-base); box-shadow: var(--shadow-brand); transition: transform var(--dur) var(--ease); }
.btn-feishu[hidden] { display: none; }
.btn-feishu:hover { transform: translateY(-2px); }
.dev-login[hidden] { display: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-400); font-size: var(--text-xs); margin: 18px 0 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dev-login input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--text-base); margin-bottom: 10px; font-family: inherit; }
.dev-login input:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-100); }
.btn-solid.wide { width: 100%; }
.login-note { margin: 14px 0 0; font-size: var(--text-xs); color: var(--ink-400); }
.login-note[hidden] { display: none; }

/* 应用骨架 */
.app { display: flex; height: 100vh; }
.app[hidden] { display: none; }

/* 侧边栏 */
.sidebar { flex: 0 0 264px; width: 264px; display: flex; flex-direction: column; background: oklch(97% 0.006 235); border-right: 1px solid var(--line); z-index: 25; }
.sb-top { padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 12px; }
.sb-top .brand { padding: 2px 6px; }
.btn-new-full { width: 100%; padding: 11px; border: 1px dashed var(--brand-300); background: var(--brand-50); color: var(--brand-700); border-radius: var(--r-md); font-weight: 700; transition: all var(--dur-fast) var(--ease); }
.btn-new-full:hover { background: var(--brand-100); border-style: solid; transform: translateY(-1px); }
.conv-list { flex: 1; overflow-y: auto; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.conv-item { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink-700); font-size: var(--text-sm); transition: background var(--dur-fast); }
.conv-item:hover { background: var(--surface); }
.conv-item.active { background: var(--surface); box-shadow: inset 2px 0 0 var(--brand-500); color: var(--brand-700); font-weight: 600; }
.conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-del { opacity: 0; border: none; background: none; color: var(--ink-400); font-size: 15px; padding: 2px 6px; border-radius: 6px; flex: 0 0 auto; }
.conv-item:hover .conv-del { opacity: 1; }
.conv-del:hover { color: var(--warn); background: var(--warn-bg); }
.conv-empty { color: var(--ink-400); font-size: var(--text-sm); text-align: center; padding: 24px 12px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.u-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background-size: cover; background-position: center; flex: 0 0 auto; }
.u-name { flex: 1; font-size: var(--text-sm); font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-logout { border: 1px solid var(--line); background: var(--surface); color: var(--ink-500); font-size: var(--text-xs); padding: 5px 10px; border-radius: 8px; }
.u-logout:hover { border-color: var(--warn); color: var(--warn); }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.sb-toggle { display: none; border: none; background: none; font-size: 20px; color: var(--ink-700); padding: 4px 10px; border-radius: 8px; }
.cur-title { flex: 1; font-weight: 700; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-base); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-200); padding: 5px 12px; border-radius: 999px; font-weight: 600; }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 oklch(64% 0.15 150 / 0.5); } 70%,100% { box-shadow: 0 0 0 8px oklch(64% 0.15 150 / 0); } }
.sb-backdrop { position: fixed; inset: 0; background: oklch(22% .03 245 / .4); z-index: 24; }
.sb-backdrop[hidden] { display: none; }

@media (max-width: 860px) {
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; transform: translateX(-100%); transition: transform var(--dur) var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sb-toggle { display: block; }
}
@media (min-width: 861px) { .sb-backdrop { display: none !important; } }

.loading-conv { display: grid; place-items: center; padding: 48px 0; }

/* ════════ 手机端适配（≤560px）：更紧凑、输入框不挤 ════════ */
@media (max-width: 560px) {
  .thread { padding: 16px 12px 28px; gap: 10px; }
  .welcome { padding: 18px 0 6px; }
  .welcome h1 { font-size: 1.5rem; margin-bottom: 10px; }
  .welcome .lede { font-size: var(--text-sm); margin-bottom: 16px; }
  .eyebrow { font-size: var(--text-xs); letter-spacing: 2px; margin-bottom: 12px; }
  .chips { gap: 8px; }
  .chip { font-size: var(--text-xs); padding: 9px 12px; border-radius: 12px; }
  .msg { gap: 8px; }
  .msg-avatar { width: 28px; height: 28px; border-radius: 9px; font-size: .85rem; }

  /* 输入栏：缩小图标、留足输入框 */
  .composer-dock { padding: 8px 10px 12px; }
  .composer-inner { padding: 6px; gap: 6px; border-radius: var(--r-md); }
  .composer-row { gap: 6px; }
  .btn-attach, .btn-mic { width: 36px; height: 36px; border-radius: 10px; }
  .btn-attach svg, .btn-mic svg { width: 18px; height: 18px; }
  .btn-send { width: 38px; height: 38px; border-radius: 11px; }
  .btn-send svg { width: 18px; height: 18px; }
  #prompt { padding: 8px 2px; font-size: var(--text-sm); }
  .composer-tip { font-size: 10px; margin-top: 6px; line-height: 1.5; }
}
