* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f4f6f9;
    color: #1d2327;
}

/* ===== 登录 ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1ba1e2 0%, #764ba2 100%);
}
.login-form {
    background: #fff;
    padding: 36px 32px;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}
.login-form h1 {
    margin: 0 0 18px;
    font-size: 22px;
    text-align: center;
}
.login-section h3 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #555;
    font-weight: 600;
}
.login-form .hint {
    margin: -8px 0 12px;
    color: #777;
    font-size: 12px;
}
.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    font: inherit;
    font-size: 14px;
}
.login-form input:focus {
    outline: none;
    border-color: #1ba1e2;
    box-shadow: 0 0 0 2px rgba(27, 161, 226, .15);
}
.btn-primary {
    width: 100%;
    padding: 11px;
    background: #1ba1e2;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 4px;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.divider {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin: 18px 0;
    position: relative;
}
.divider::before, .divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: #eee;
}
.divider::before { left: 0; }
.divider::after  { right: 0; }
.divider span { background: #fff; padding: 0 10px; position: relative; z-index: 1; }

.sso-tip {
    text-align: center;
    font-size: 12px;
    color: #777;
    margin: 8px 0 0;
}
.sso-tip a {
    color: #1ba1e2;
    text-decoration: none;
    font-weight: 500;
}
.sso-tip a:hover { text-decoration: underline; }

/* ===== 聊天 ===== */
.chat-wrap {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .05);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #1ba1e2;
    color: #fff;
}
.chat-title { font-size: 16px; font-weight: 600; }
.chat-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.chat-user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .6);
    background: #fff;
}
.link-btn {
    background: none;
    border: none;
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 0 4px;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f8f8;
}

.msg {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    align-items: flex-start;
}
.msg-self { flex-direction: row-reverse; }

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
    flex-shrink: 0;
    display: block;
}
.msg-avatar-link {
    display: block;
    line-height: 0;
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform .15s, box-shadow .15s;
}
.msg-avatar-link:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(27, 161, 226, .35);
}
.msg-avatar-link .msg-avatar {
    display: block;
}
.msg-body {
    max-width: 70%;
    background: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.msg-self .msg-body {
    background: #d6f0ff;
}
.msg-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}
.msg-self .msg-meta { justify-content: flex-end; }
.msg-name { font-weight: 600; color: #555; }
.msg-time { color: #aaa; }
.msg-text {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e5e5e5;
    background: #fff;
}
#msgInput {
    flex: 1;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    min-height: 40px;
    max-height: 160px;
}
#msgInput:focus {
    outline: none;
    border-color: #1ba1e2;
    box-shadow: 0 0 0 2px rgba(27, 161, 226, .15);
}
#sendBtn {
    background: #1ba1e2;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 20px;
    font-size: 14px;
    cursor: pointer;
}
#sendBtn:disabled { opacity: .6; cursor: not-allowed; }
#sendBtn:hover:not(:disabled) { filter: brightness(1.05); }

/* 移动端 */
@media (max-width: 720px) {
    .chat-wrap {
        height: 100vh;
        box-shadow: none;
    }
    .msg-body { max-width: 80%; }
}
