:root {
  --ink: #332b49;
  --muted: #887e98;
  --lilac: #7662d8;
  --lilac-deep: #5b45bb;
  --lavender: #eeeaff;
  --panel: rgba(255, 255, 255, .88);
  --line: #e9e4f1;
  --online: #62bd86;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f4f1ff;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { min-height: 100dvh; background: radial-gradient(circle at 8% 8%, #ffdce8 0, transparent 25rem), radial-gradient(circle at 92% 90%, #dcd5ff 0, transparent 28rem), #f6f3fc; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell { min-height: 100dvh; padding: 24px; display: grid; place-items: center; position: relative; overflow: hidden; }
.login-shell::before, .login-shell::after { content: ""; position: absolute; border: 1px solid rgba(118, 98, 216, .13); border-radius: 999px; pointer-events: none; }
.login-shell::before { width: min(76vw, 840px); height: min(76vw, 840px); top: -50%; left: -17%; }
.login-shell::after { width: min(64vw, 650px); height: min(64vw, 650px); bottom: -40%; right: -12%; }
.login-card { width: min(100%, 410px); padding: clamp(32px, 7vw, 52px); border: 1px solid rgba(255, 255, 255, .8); border-radius: 28px; background: rgba(255, 255, 255, .76); box-shadow: 0 24px 70px rgba(75, 53, 129, .14); backdrop-filter: blur(18px); position: relative; z-index: 1; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: linear-gradient(145deg, #8f78ec, #6049c3); color: #fff; font-size: 24px; box-shadow: 0 8px 18px rgba(102, 77, 199, .25); }
.eyebrow { margin: 30px 0 8px; letter-spacing: .14em; color: var(--lilac); font-weight: 800; font-size: 10px; }
.login-card h1 { margin: 0; font: 700 clamp(27px, 5vw, 35px)/1.18 Georgia, "Songti SC", serif; letter-spacing: -.03em; }
.login-copy { margin: 14px 0 28px; color: var(--muted); font-size: 14px; }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: #695f76; }
.login-form input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; background: rgba(255,255,255,.8); color: var(--ink); transition: border .18s, box-shadow .18s; }
.login-form input:focus { border-color: #a799eb; box-shadow: 0 0 0 3px #eeeaff; }
.form-error { min-height: 1.1em; margin: -5px 0 0; color: #cf5275; font-size: 12px; }
.primary-button, .send-button { border: 0; color: #fff; background: linear-gradient(135deg, #866fe4, #6048bf); box-shadow: 0 9px 18px rgba(98, 72, 191, .24); transition: transform .15s, filter .15s; }
.primary-button:hover, .send-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-button:active, .send-button:active { transform: translateY(1px); }
.login-button { border-radius: 13px; padding: 13px 16px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; }
.login-button span { font-size: 20px; }
.login-footer { position: absolute; bottom: 20px; color: #9d94ac; font-size: 11px; }

.chat-shell { min-height: 100dvh; padding: clamp(10px, 2vw, 24px); display: grid; grid-template-columns: minmax(190px, .45fr) minmax(500px, 2fr); gap: clamp(12px, 2vw, 24px); max-width: 1380px; margin: auto; }
.side-panel { min-height: calc(100dvh - clamp(20px, 4vw, 48px)); padding: 28px; border-radius: 30px; color: #fff; display: flex; flex-direction: column; background: linear-gradient(155deg, #8068db 0%, #6046bd 50%, #473298 100%); box-shadow: 0 18px 45px rgba(78, 55, 157, .24); overflow: hidden; position: relative; }
.side-panel::after { content:""; position:absolute; width: 230px; height:230px; border: 1px solid rgba(255,255,255,.18); border-radius:50%; bottom:-85px; left:-70px; }
.side-brand { font: 700 20px Georgia, serif; display: flex; align-items: center; gap: 9px; position: relative; z-index: 1; }
.mini-mark { display:grid; place-items:center; width:27px; height:27px; border-radius:10px; background:#fff; color:#684fc8; font-family: sans-serif; font-size: 15px; }
.side-orbit { margin: auto 0; width: 100%; aspect-ratio: 1; display: grid; place-items: center; position: relative; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; max-width: 270px; align-self: center; }
.side-orbit::before { content:""; width: 66%; height: 66%; position:absolute; border:1px dashed rgba(255,255,255,.3); border-radius:50%; }
.side-orbit strong { text-align:center; font: 700 clamp(19px, 2.3vw, 27px)/1.2 Georgia, "Songti SC", serif; position:relative; }
.side-orbit span, .side-orbit i { position:absolute; font-style:normal; }.side-orbit span { top:18%; right:20%; }.side-orbit i { bottom:19%; left:18%; font-size: 24px; }
.side-note { z-index:1; font: 500 19px/1.45 Georgia, "Songti SC", serif; letter-spacing: .04em; }
.quiet-button { position:relative; z-index:1; margin-top: 25px; padding: 0; text-align:left; color:rgba(255,255,255,.7); border:0; background:transparent; font-size: 12px; }.quiet-button:hover { color:#fff; }

.chat-card { min-height: calc(100dvh - clamp(20px, 4vw, 48px)); max-height: calc(100dvh - clamp(20px, 4vw, 48px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid rgba(255,255,255,.9); border-radius: 30px; background: var(--panel); box-shadow: 0 18px 50px rgba(75, 53, 129, .12); backdrop-filter: blur(18px); }
.chat-header { min-height: 83px; padding: 16px clamp(18px, 3vw, 30px); display:flex; align-items:center; gap:12px; border-bottom: 1px solid var(--line); }
.partner-avatar { width:45px; height:45px; display:grid; place-items:center; flex:0 0 auto; border-radius:16px; color:#725bcf; font-size:19px; background:linear-gradient(135deg, #f2e9ff, #e2dcff); }
.partner-meta { min-width: 0; }.partner-meta h1 { margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:16px; letter-spacing:-.01em; }.partner-meta p { margin:5px 0 0; color:var(--muted); font-size:12px; }.status-dot { display:inline-block; width:7px; height:7px; margin-right:5px; border-radius:99px; background:#b2abbc; }.status-dot.online { background:var(--online); box-shadow:0 0 0 3px #e0f5e8; }
.header-actions { margin-left:auto; display:flex; align-items:center; gap:9px; }.connection-state { color:var(--muted); font-size:11px; }.only-mobile { display: none; }
.message-scroll { overflow-y: auto; min-height: 0; padding: 25px clamp(15px, 3vw, 30px); scroll-behavior: smooth; position:relative; }
.message-list { display: flex; flex-direction:column; gap: 8px; max-width: 920px; margin:auto; }
.day-divider { display:flex; align-items:center; gap:10px; justify-content:center; margin: 6px 0 13px; color:#a49aae; font-size:11px; }.day-divider::before, .day-divider::after { content:""; height:1px; background:var(--line); flex:1; max-width:100px; }
.message-row { display:flex; align-items:flex-end; gap:8px; max-width:79%; animation: message-in .22s ease both; }.message-row.mine { align-self:flex-end; flex-direction:row-reverse; }.message-row.theirs { align-self:flex-start; }
@keyframes message-in { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } }
.tiny-avatar { width:25px; height:25px; border-radius:9px; background:#eeeaff; display:grid; place-items:center; color:#7861d3; font-size:11px; flex:0 0 auto; }.mine .tiny-avatar { background:#e5defe; }
.message-stack { min-width:0; }.bubble { padding: 10px 13px; border-radius: 15px 15px 15px 5px; background:#fff; color:#443b51; border:1px solid #f0edf3; box-shadow:0 3px 10px rgba(59,47,76,.035); overflow-wrap:anywhere; line-height:1.52; font-size:14px; white-space:pre-wrap; }.mine .bubble { border-radius:15px 15px 5px 15px; color:#fff; border:0; background:linear-gradient(135deg,#8b74e2,#6950c8); box-shadow:0 5px 13px rgba(102,76,194,.16); }
.message-info { padding: 3px 2px 0; display:flex; gap:6px; color:#a69dad; font-size:10px; }.mine .message-info { justify-content:flex-end; }.read-state { color:#836bd5; font-weight:700; }.mine .read-state { color:#6e56ca; }
.image-bubble, .sticker-bubble, .audio-bubble { padding:4px; white-space:normal; background:transparent !important; border:0 !important; box-shadow:none !important; }.image-bubble img { display:block; width:min(260px, 55vw); max-height:310px; object-fit:cover; border-radius:13px; background:#ece7f5; }.sticker-bubble img { display:block; width:min(150px, 34vw); max-height:150px; object-fit:contain; }.audio-bubble { min-width: 210px; padding:9px 11px; background:#fff !important; border:1px solid #eee8f5 !important; }.mine .audio-bubble { background:rgba(255,255,255,.16) !important; border-color:rgba(255,255,255,.2) !important; }.audio-bubble audio { display:block; width: 100%; height:32px; }
.code-bubble { white-space:normal; padding:0; overflow:hidden; }.code-bubble summary { padding:10px 13px; cursor:pointer; list-style:none; font-weight:700; font-size:12px; }.code-bubble summary::before { content:"</> "; opacity:.72; }.code-bubble pre { margin:0; padding:12px 13px; max-height:260px; overflow:auto; border-top:1px solid rgba(100,80,160,.12); font:12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space:pre; color:#3f3553; background:#f8f6fc; }.mine .code-bubble pre { color:#3f3553; background:#f9f8ff; }
.empty-state { min-height: 100%; display:grid; place-content:center; text-align:center; color:var(--muted); padding-bottom:80px; }.empty-state span { color:#a08ae9; font-size:43px; }.empty-state h2 { margin:13px 0 7px; font:700 20px Georgia, "Songti SC", serif; color:#5c506c; }.empty-state p { margin:0; font-size:13px; }
.jump-button { position:sticky; bottom: 0; left:50%; transform:translateX(-50%); border:0; border-radius:99px; padding:8px 12px; color:#665682; background:#fff; box-shadow:0 4px 16px rgba(67,50,96,.14); font-size:12px; }

.composer-area { position:relative; padding: 9px clamp(15px, 3vw, 30px) max(14px, env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:rgba(255,255,255,.6); }.composer { display:flex; align-items:flex-end; gap:9px; padding:7px 8px 7px 14px; border:1px solid #e5dff0; border-radius:17px; background:#fff; transition: box-shadow .2s, border .2s; }.composer:focus-within { border-color:#ab9ce2; box-shadow:0 0 0 3px #f1eeff; }.composer textarea { min-width:0; width:100%; max-height:120px; resize:none; border:0; outline:0; background:transparent; padding:7px 0 6px; color:var(--ink); line-height:1.4; }.composer textarea::placeholder { color:#aea5b5; }.composer-actions { display:flex; gap:2px; align-items:center; }.icon-button { min-width:32px; height:32px; padding:0 7px; display:grid; place-items:center; color:#8f85a2; border:0; border-radius:10px; background:transparent; font-size:16px; transition: background .15s, color .15s; }.icon-button:hover { background:#f1edfb; color:#6a52c5; }.icon-button input, .upload-sticker input { display:none; }.record-button.recording { color:#fff; background:#db6788; animation:pulse 1s infinite; }@keyframes pulse { 50% { box-shadow:0 0 0 5px #ffe3ea; } }.send-button { width:34px; height:34px; display:grid; place-items:center; flex:0 0 auto; border-radius:11px; font-size:19px; }.composer-hint { margin:6px 4px 0; color:#aaa1b4; font-size:10px; }.composer-tools { position:absolute; z-index:5; bottom:calc(100% + 8px); left:15px; right:15px; display:none; padding:10px; border:1px solid var(--line); border-radius:15px; background:#fff; box-shadow:0 10px 24px rgba(71,54,95,.12); }.composer-tools.open { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }.emoji-row { display:flex; gap:2px; flex-wrap:wrap; }.emoji-choice { width:31px; height:31px; border:0; border-radius:9px; background:transparent; font-size:18px; }.emoji-choice:hover { background:#f0ecfb; }.upload-sticker { margin-left:auto; padding:7px 9px; color:#7159c9; border:1px dashed #b9ade7; border-radius:9px; cursor:pointer; font-size:11px; font-weight:700; }

@media (max-width: 760px) { .chat-shell { padding:0; display:block; }.side-panel { display:none; }.chat-card { min-height:100dvh; max-height:100dvh; border:0; border-radius:0; }.chat-header { min-height:68px; padding:11px 16px; }.partner-avatar { width:39px; height:39px; border-radius:13px; }.only-mobile { display:grid; }.message-scroll { padding:18px 14px; }.message-row { max-width:88%; }.composer-area { padding:8px 12px max(11px, env(safe-area-inset-bottom)); }.composer-tools { left:12px; right:12px; }.composer-hint { display:none; }.header-actions .connection-state { display:none; } }
@media (max-width: 420px) { .composer-actions { gap:0; }.icon-button { min-width:29px; padding:0 5px; }.send-button { width:32px; }.upload-sticker { margin-left:0; } }
@media (min-width: 761px) and (max-width: 920px) { .chat-shell { grid-template-columns: 175px minmax(0, 1fr); }.side-panel { padding:20px; }.side-orbit { max-width:160px; }.side-note { font-size:16px; } }
