* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 登录弹窗 */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-modal.active {
    display: flex;
}

.auth-box {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #1a73e8;
}

.auth-box input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.auth-btn {
    width: 100%;
    padding: 0.8rem;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background-color: #1557b0;
}

.auth-box p {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.auth-box a {
    color: #1a73e8;
    text-decoration: none;
}

/* 聊天界面 */
.chat-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.chat-header {
    background-color: #1a73e8;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message.ai {
    justify-content: flex-start;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #1a73e8;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.message.user .avatar {
    background-color: #4285f4;
    order: 2;
    margin-left: 0.5rem;
    margin-right: 0;
}

.message-content {
    max-width: 70%;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    background-color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
}

.message.user .message-content {
    background-color: #1a73e8;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai .message-content {
    background-color: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-input {
    display: flex;
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #eee;
}

#user-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#user-input:focus {
    border-color: #1a73e8;
}

.send-btn {
    margin-left: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1a73e8;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.send-btn:hover {
    background-color: #1557b0;
}

/* 打字动画 */
.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    margin: 0 2px;
    animation: blink 1.4s infinite both;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}