* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', 'Noto Sans', 'Source Han Sans CN', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background: url('../img/background.png') center/cover fixed;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #4a76a8 0%, #2c4361 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-selector {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
    background: transparent;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 500;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile {
    display: flex;
    align-items: center;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.chat-header h1 {
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#clear-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

#clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(255, 255, 255, 0.5);
}

.message {
    display: flex;
    max-width: 80%;
}

.user {
    align-self: flex-end;
}

.bot {
    align-self: flex-start;
}

.message-content {
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

.message-content:hover {
    transform: translateY(-2px);
}

.user .message-content {
    background: linear-gradient(135deg, #dcf8c6 0%, #b4e597 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.bot .message-content {
    background: linear-gradient(135deg, #f0f0f0 0%, #e1e1e1 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.message p {
    line-height: 1.6;
    font-size: 1.1rem;
}

.chat-input {
    display: flex;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    gap: 10px;
}

#user-input {
    flex: 1;
    min-width: 0; /* 防止flex子项溢出 */
    padding: 15px 25px;
    border: 2px solid rgba(74, 118, 168, 0.2);
    border-radius: 30px;
    outline: none;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

#send-btn {
    flex-shrink: 0; /* 防止按钮被压缩 */
    padding: 0 30px;
    background: linear-gradient(135deg, #4a76a8 0%, #2c4361 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap; /* 防止文字换行 */
}

@media screen and (max-width: 768px) {
    .chat-input {
        padding: 10px;
    }

    #user-input {
        padding: 10px 15px;
    }

    #send-btn {
        padding: 0 20px;
        min-width: 60px; /* 确保按钮有最小宽度 */
    }
}
#user-input:focus {
    border-color: #4a76a8;
    box-shadow: 0 0 10px rgba(74, 118, 168, 0.2);
}

#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 118, 168, 0.3);
}

.typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
}

.typing span {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite both;
}

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

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

@keyframes typing {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
}

.suggestion-bubbles {
    display: flex;
    overflow-x: auto;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 118, 168, 0.5) transparent;
}

.suggestion-bubbles::-webkit-scrollbar {
    height: 6px;
}

.suggestion-bubbles::-webkit-scrollbar-track {
    background: transparent;
}

.suggestion-bubbles::-webkit-scrollbar-thumb {
    background-color: rgba(74, 118, 168, 0.5);
    border-radius: 3px;
}

.bubble {
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(74, 118, 168, 0.2);
    white-space: nowrap;
    flex-shrink: 0;
}

.bubble:hover {
    background: rgba(74, 118, 168, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 调整其他字体大小 */
.chat-header h1 {
    font-size: 1.8rem;
}

.message p {
    font-size: 1rem;
    line-height: 1.5;
}

#user-input {
    font-size: 0.95rem;
    padding: 12px 20px;
}

#send-btn {
    font-size: 0.95rem;
    padding: 0 25px;
}

#clear-btn {
    font-size: 0.85rem;
}

/* 添加响应式设计 */
@media screen and (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .header-controls {
        flex-direction: column;
        gap: 10px;
    }

    .language-selector {
        order: 2;
    }

    #clear-btn {
        order: 1;
    }

    .chat-header h1 {
        font-size: calc(1.2rem + 1vw);
    }

    .avatar {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }

    .message {
        max-width: 90%;
    }

    .message p {
        font-size: calc(0.9rem + 0.5vw);
    }

    #user-input {
        font-size: calc(0.85rem + 0.5vw);
        padding: 10px 15px;
    }

    #send-btn {
        font-size: calc(0.85rem + 0.5vw);
        padding: 0 15px;
    }

    #clear-btn {
        font-size: calc(0.75rem + 0.5vw);
        padding: 8px 15px;
    }

    .bubble {
        font-size: calc(0.75rem + 0.5vw);
        padding: 5px 10px;
    }
}

@media screen and (min-width: 769px) {
    .chat-header h1 {
        font-size: calc(1.5rem + 0.5vw);
    }

    .message p {
        font-size: calc(1rem + 0.3vw);
    }

    #user-input {
        font-size: calc(0.95rem + 0.3vw);
    }

    #send-btn {
        font-size: calc(0.95rem + 0.3vw);
    }

    #clear-btn {
        font-size: calc(0.85rem + 0.3vw);
    }

    .bubble {
        font-size: calc(0.85rem + 0.3vw);
    }
}