* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f7f7f5; color: #1f2328; display: flex; flex-direction: column; height: 100vh; }
header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e5e5e0; flex-wrap: wrap; gap: 8px; }
.brand { font-weight: 700; font-size: 18px; }
.brand span { font-weight: 400; font-size: 13px; color: #666; margin-left: 6px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
select, button { font-size: 14px; }
button { cursor: pointer; border: 1px solid #d0d0c8; background: #fff; border-radius: 8px; padding: 7px 12px; }
button:hover { background: #f0f0ea; }
button.ghost { background: transparent; }
main { flex: 1; overflow-y: auto; padding: 20px 16px; max-width: 860px; width: 100%; margin: 0 auto; }
.msg { margin: 0 0 16px; display: flex; }
.msg .bubble { max-width: 92%; padding: 12px 16px; border-radius: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: #1a73e8; color: #fff; border-bottom-right-radius: 4px; }
.msg.model .bubble { background: #fff; border: 1px solid #e5e5e0; border-bottom-left-radius: 4px; }
.msg.error .bubble { background: #fdecea; border: 1px solid #f5c6c0; color: #8a1f11; }
.msg .files { font-size: 12px; opacity: .85; margin-bottom: 6px; }
.empty { text-align: center; color: #888; margin-top: 12vh; line-height: 2; }
.file-tray { max-width: 860px; width: 100%; margin: 0 auto; padding: 8px 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.file-tray.hidden { display: none; }
.chip { background: #e8f0fe; border: 1px solid #c3d7f7; padding: 5px 10px; border-radius: 999px; font-size: 13px; display: inline-flex; gap: 8px; align-items: center; }
.chip button { border: none; background: none; padding: 0; font-size: 13px; }
footer { background: #fff; border-top: 1px solid #e5e5e0; padding: 12px 16px 8px; }
.composer { max-width: 860px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid #d0d0c8; border-radius: 12px; padding: 11px 14px; font-size: 15px; font-family: inherit; max-height: 160px; }
#attachBtn { font-size: 18px; padding: 8px 11px; }
#sendBtn { background: #1a73e8; color: #fff; border-color: #1a73e8; padding: 10px 20px; }
#sendBtn:disabled { opacity: .5; cursor: wait; }
.hint { max-width: 860px; margin: 8px auto 2px; font-size: 12px; color: #888; line-height: 1.6; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 14px; padding: 24px; width: min(92vw, 360px); }
.modal-box input { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #d0d0c8; border-radius: 8px; font-size: 15px; }
.modal-box button { width: 100%; background: #1a73e8; color: #fff; border-color: #1a73e8; padding: 10px; }
