* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, "Microsoft YaHei", sans-serif; background: #f2f4f8; color: #222; }
.hidden { display: none !important; }

.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(20,40,80,.12); padding: 28px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: #777; margin: 0 0 18px; font-size: 13px; }

label { display: block; font-size: 13px; color: #555; margin-bottom: 12px; }
input { width: 100%; padding: 10px 12px; margin-top: 4px; border: 1px solid #d4d9e2; border-radius: 8px; font-size: 15px; }
input:focus, textarea:focus { outline: 2px solid #9dbdff; border-color: #2f6fed; }

button { width: 100%; padding: 11px; border: 0; border-radius: 8px; background: #2f6fed; color: #fff; font-size: 15px; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.err { color: #d33; font-size: 13px; min-height: 18px; margin-bottom: 6px; }

.chat-wrap { height: 100vh; display: flex; flex-direction: column; max-width: 860px; margin: 0 auto; background: #fff; }
.chat-wrap header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #e8ebf1; font-weight: 600; }
.ghost { width: auto; background: none; color: #2f6fed; padding: 6px 10px; font-size: 13px; }
#msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 15px; }
.msg.user { align-self: flex-end; background: #2f6fed; color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #eef2f8; border-bottom-left-radius: 4px; }

.chat-wrap footer { display: flex; gap: 10px; padding: 12px; border-top: 1px solid #e8ebf1; }
#chat-input { flex: 1; resize: none; border: 1px solid #d4d9e2; border-radius: 8px; padding: 10px; font-size: 15px; font-family: inherit; }
footer button { width: auto; padding: 0 22px; }

.modal { position: fixed; inset: 0; background: rgba(15,25,45,.45); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal .card { width: 100%; max-width: 360px; }
.modal h2 { font-size: 17px; margin: 0 0 14px; }
