:root { --ink:#0d0d0d; --muted:#676767; --line:#e8e8e8; --soft:#f7f7f7; }
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; background:#fff; }
button,textarea,select { font:inherit; }
button { cursor:pointer; }
.sidebar { position:fixed;inset:0 auto 0 0;width:260px;background:#f9f9f9;z-index:6;padding:12px 10px;display:flex;flex-direction:column;border-right:1px solid #eee;transition:transform .2s; }
.side-head { display:flex;align-items:center;justify-content:space-between;padding:0 4px 10px; }
.brand { width:32px;height:32px;border:0;border-radius:10px;background:#111;color:white;font-weight:800;font-size:16px; }
.icon-btn { width:36px;height:36px;border:0;background:transparent;border-radius:9px;padding:8px; }
.icon-btn:hover { background:#ececec; }
.icon-btn svg,#send svg { fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
.close-side { font-size:21px;line-height:1; }
.side-new { border:0;background:transparent;border-radius:9px;padding:10px;display:flex;align-items:center;gap:11px;text-align:left; }
.side-new:hover { background:#ececec; }
.side-new svg { width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
.history-label { color:#777;font-size:12px;padding:22px 10px 7px; }
.conversation-list { overflow:auto;flex:1; }
.history-item { display:flex;align-items:center;border-radius:8px;margin:2px 0; }
.history-item.active,.history-item:hover { background:#ececec; }
.history-title { flex:1;border:0;background:transparent;text-align:left;padding:9px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px; }
.history-more { opacity:0;border:0;background:transparent;padding:6px 9px;font-size:16px; }
.history-item:hover .history-more { opacity:1; }
.side-foot { border-top:1px solid #e8e8e8;padding:12px 7px 2px;display:flex;align-items:center;gap:9px;font-size:13px; }
.profile { width:30px;height:30px;border:1px solid #ddd;border-radius:50%;background:white;font-size:12px;display:grid;place-items:center; }
main { min-height:100vh; margin-left:260px; position:relative; }
header { height:64px; display:flex;align-items:center;justify-content:space-between;padding:0 22px;position:fixed;top:0;left:260px;right:0;background:rgba(255,255,255,.88);backdrop-filter:blur(12px);z-index:4; }
.header-left { display:flex;align-items:center; }
.menu-btn { display:none;border:0;background:transparent;font-size:21px;padding:8px; }
.model-trigger { border:0;background:transparent;font-weight:650;font-size:18px;display:flex;gap:7px;align-items:center;padding:8px 10px;border-radius:9px; }
.model-trigger:hover,.ghost:hover { background:var(--soft); }
.header-actions { display:flex;align-items:center;gap:8px; }
.usage { font-size:12px;color:#666;white-space:nowrap; }
.ghost,.dark { border:1px solid #ddd;border-radius:20px;padding:8px 14px;background:white; }
.dark { background:#111;color:white;border-color:#111; }
.welcome { position:absolute;inset:0;display:grid;place-items:center;padding-bottom:110px; }
.welcome h1 { font-size:30px;line-height:1.2;font-weight:500;letter-spacing:-.6px;margin:0; }
.conversation { width:min(760px,calc(100% - 36px));margin:0 auto;padding:100px 0 190px;display:none; }
.message { margin:0 0 34px;line-height:1.7;font-size:16px; }
.message.user { display:flex;justify-content:flex-end; }
.bubble { max-width:80%;padding:10px 16px;background:#f4f4f4;border-radius:18px;white-space:pre-wrap; }
.message.assistant { padding-right:20px; }
.assistant .label { font-weight:650;margin-bottom:8px;display:flex;align-items:center;gap:8px; }
.ai-dot { width:23px;height:23px;border-radius:7px;background:#111;color:#fff;display:grid;place-items:center;font-size:11px; }
.content { white-space:pre-wrap; }
.cursor::after { content:"";display:inline-block;width:7px;height:16px;margin-left:2px;background:#111;vertical-align:-2px;animation:blink .9s infinite; }
@keyframes blink { 50% { opacity:0; } }
.composer-wrap { position:fixed;left:260px;right:0;bottom:0;padding:18px 18px 9px;background:linear-gradient(transparent,#fff 24%,#fff);z-index:3;display:flex;flex-direction:column; }
#composer { width:min(770px,100%);margin:0 auto;background:#fff;border:1px solid #dedede;border-radius:26px;box-shadow:0 8px 24px rgba(0,0,0,.06);padding:13px 14px 10px; }
textarea { border:0;outline:0;resize:none;width:100%;min-height:28px;max-height:160px;padding:2px 5px;background:transparent;font-size:16px;line-height:24px;display:block; }
textarea::placeholder { color:#888; }
.composer-bottom { display:flex;justify-content:space-between;align-items:center;margin-top:7px; }
.round { width:32px;height:32px;border:0;background:transparent;border-radius:50%;font-size:24px;font-weight:300;display:grid;place-items:center; }
.round:hover { background:#f0f0f0; }
.attachments { width:min(740px,calc(100% - 30px));margin:0 auto 8px;display:flex;gap:8px;overflow-x:auto;position:relative;z-index:4;pointer-events:none;order:-1; }
.file-chip { pointer-events:auto;display:flex;align-items:center;gap:8px;max-width:220px;border:1px solid #ddd;background:#fff;border-radius:12px;padding:8px 10px;font-size:12px;box-shadow:0 4px 14px rgba(0,0,0,.05); }
.file-thumb { width:30px;height:30px;object-fit:cover;border-radius:6px;background:#eee; }
.file-icon { width:30px;height:30px;border-radius:6px;background:#ececec;display:grid;place-items:center;font-size:10px;font-weight:700; }
.file-name { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.remove-file { border:0;background:transparent;font-size:18px;padding:0;color:#777; }
.message-files { display:flex;gap:6px;flex-wrap:wrap;margin-bottom:7px;justify-content:flex-end; }
.message-file { font-size:12px;background:#e9e9e9;border-radius:8px;padding:5px 8px; }
.right-tools { display:flex;gap:8px;align-items:center; }
select { border:0;background:#f5f5f5;border-radius:16px;padding:7px 11px;max-width:180px;outline:0;font-size:13px; }
#send { width:34px;height:34px;border:0;border-radius:50%;background:#111;color:white;padding:8px;display:grid;place-items:center; }
#send:disabled { background:#d2d2d2; }
.note { text-align:center;color:#777;font-size:12px;margin:9px 0 0; }
.error { color:#b42318; }
.overlay { position:fixed;inset:0;background:rgba(255,255,255,.82);backdrop-filter:blur(8px);z-index:20;display:grid;place-items:center;padding:20px; }
.overlay[hidden] { display:none; }
.modal { width:min(430px,100%);background:#fff;border:1px solid #e5e5e5;border-radius:20px;box-shadow:0 24px 70px rgba(0,0,0,.12);padding:30px; }
.auth-modal { text-align:center; }
.modal-brand { width:42px;height:42px;background:#111;color:#fff;border-radius:13px;display:grid;place-items:center;margin:0 auto 22px;font-size:20px;font-weight:800; }
.modal h2 { margin:0 0 8px;font-size:24px; }
.modal p { color:#777;margin:0 0 24px; }
.modal form { display:grid;gap:12px; }
.modal input { width:100%;border:1px solid #d9d9d9;border-radius:10px;padding:12px 13px;outline:none; }
.modal input:focus { border-color:#222;box-shadow:0 0 0 2px rgba(0,0,0,.08); }
.primary { border:0;background:#111;color:#fff;border-radius:10px;padding:12px 16px;font-weight:600; }
.text-btn { border:0;background:transparent;color:#666;padding:5px; }
.text-btn:hover { color:#111; }
.form-error { min-height:18px;color:#b42318;font-size:13px; }
.admin-modal { width:min(760px,100%);max-height:85vh;overflow:auto; }
.modal-head { display:flex;justify-content:space-between;align-items:center;margin-bottom:22px; }
.close { border:0;background:#f3f3f3;border-radius:50%;width:34px;height:34px;font-size:22px; }
.create-user { grid-template-columns:1fr 1.35fr 1fr auto!important;align-items:center; }
.create-user label { font-size:12px;color:#666;display:grid;gap:5px;text-align:left; }
.generated { background:#f3faf5;border:1px solid #c8ead2;color:#176c36;border-radius:10px;padding:12px;margin:14px 0;font-family:ui-monospace,monospace;white-space:pre-wrap;word-break:break-all; }
.table-wrap { overflow:auto;margin-top:10px; }
table { width:100%;border-collapse:collapse;font-size:14px; }
th,td { text-align:left;padding:12px 8px;border-bottom:1px solid #eee;white-space:nowrap; }
td input { width:120px!important;padding:7px!important; }
.small-btn { border:1px solid #ddd;background:white;border-radius:8px;padding:7px 9px;margin-left:5px; }
@media (max-width:700px) {
  .sidebar { transform:translateX(-100%);box-shadow:8px 0 30px rgba(0,0,0,.12); }
  .sidebar.open { transform:translateX(0); }
  main { margin-left:0; }
  header { left:0;padding:0 12px; }
  .menu-btn { display:block; }
  .ghost { display:none; }
  .composer-wrap { left:0;padding-inline:10px; }
  .welcome h1 { font-size:25px; }
  .conversation { width:calc(100% - 28px);padding-top:84px; }
  .bubble { max-width:90%; }
  .usage { display:none; }
  .admin-modal { padding:20px; }
  .create-user { grid-template-columns:1fr!important; }
}
