:root { color: #1c2632; background: #eef2f3; font-family: Arial, "Microsoft YaHei", sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.app-shell { min-height: 100vh; }
.login-view { display: grid; place-items: center; align-content: center; min-height: 100vh; padding: 24px; background: #f8fafb; }
.login-mark, .avatar { display: inline-grid; place-items: center; background: #df6d86; color: #fff; font-weight: 700; }
.login-mark { width: 52px; height: 52px; border-radius: 8px; font-size: 28px; }
.login-view h1 { margin: 18px 0 4px; font-size: 28px; font-weight: 700; }
.login-view p { margin: 0 0 28px; color: #61707d; }
.login-form { width: min(100%, 320px); display: grid; gap: 9px; }
label { color: #52606c; font-size: 14px; }
input, textarea { width: 100%; border: 1px solid #cdd6dc; border-radius: 6px; background: #fff; color: #1c2632; padding: 11px 12px; outline: none; }
input:focus, textarea:focus { border-color: #df6d86; box-shadow: 0 0 0 3px #f8dfe5; }
.login-form button, .memory-form button { min-height: 40px; border: 0; border-radius: 6px; background: #df6d86; color: #fff; }
.form-error { min-height: 18px; color: #b4233d; font-size: 13px; }
.chat-view { max-width: 920px; min-height: 100vh; margin: auto; display: grid; grid-template-rows: 60px 1fr auto; background: #fff; border-left: 1px solid #dce3e7; border-right: 1px solid #dce3e7; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid #e4e9ec; }
.identity { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.avatar { width: 30px; height: 30px; border-radius: 50%; }
.device-status { margin-left: auto; display: flex; align-items: center; gap: 7px; color: #63717c; font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a8b2b9; }
.device-status.online .status-dot { background: #3c9b73; }
.icon-button { width: 34px; height: 34px; border: 1px solid #d6dfe3; border-radius: 6px; background: #fff; color: #52606c; }
.conversation { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding: 24px max(18px, 6%); }
.message { max-width: min(82%, 620px); padding: 11px 13px; border-radius: 6px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.message.user { align-self: flex-end; background: #dceff0; }
.message.assistant { align-self: flex-start; background: #f4f5f6; }
.message.note { align-self: center; color: #75818a; font-size: 13px; padding: 4px; }
.composer { display: grid; grid-template-columns: 1fr 42px; gap: 9px; padding: 14px 18px; border-top: 1px solid #e4e9ec; background: #fff; }
.composer textarea { resize: none; min-height: 42px; max-height: 160px; }
.send-button { border: 0; border-radius: 6px; background: #df6d86; color: #fff; font-size: 19px; }
.memory-drawer { position: fixed; top: 0; right: 0; width: min(100%, 380px); height: 100vh; overflow-y: auto; background: #fff; border-left: 1px solid #dce3e7; box-shadow: -8px 0 24px #1d2b3617; padding: 18px; }
.memory-drawer header { display: flex; align-items: center; justify-content: space-between; }
.memory-drawer h2 { margin: 0; font-size: 18px; }
.memory-form { display: grid; gap: 8px; margin: 22px 0; }
.memory-list { display: grid; gap: 10px; }
.memory-item { border-top: 1px solid #e4e9ec; padding: 12px 0; }
.memory-item p { margin: 0 0 8px; line-height: 1.5; }
.memory-item footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #74808a; font-size: 12px; }
.memory-item button { border: 0; background: transparent; color: #b4233d; padding: 3px; }
@media (max-width: 640px) { .chat-view { border: 0; } .conversation { padding: 18px; } .message { max-width: 90%; } }
