* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f0; /* 奶白色背景 */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 700px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.chat-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.header-buttons button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.header-buttons button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

#new-chat-button {
    background: rgba(76, 175, 80, 0.8); /* 绿色背景，不是粉色 */
    border-color: rgba(76, 175, 80, 0.5);
}

#new-chat-button:hover {
    background: rgba(76, 175, 80, 1);
}

.chat-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

/* 模型选择器样式 */
.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.model-selector label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
    white-space: nowrap;
}

.model-selector select {
    padding: 8px 32px 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.3s ease;
    min-width: 160px;
}

.model-selector select:hover {
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.model-selector select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 2px 12px rgba(0, 0, 0, 0.15);
}

.model-selector select option {
    padding: 10px;
    font-size: 14px;
    background: white;
    color: #333;
}

.chat-tabs {
    background: white;
    padding: 10px 20px;
    border-bottom: 1px solid #e1e1e1;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
}

.chat-tabs::-webkit-scrollbar {
    height: 4px;
}

.chat-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-tabs::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.chat-tabs::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.tab {
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e1e1e1;
    white-space: nowrap;
}

.tab:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.tab.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: #4facfe;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

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

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #e1e1e1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

.message-content {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: 16px;
    position: relative;
}

.user-message .message-content {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e1e1e1;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.message.thinking .message-content {
    background: #f0f0f0;
    border: 1px solid #ddd;
}

.message.thinking .message-content::after {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid #999;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chat-input {
    padding: 20px;
    background: white;
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e1e1e1;
}

#message-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e1e1;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

#message-input:focus {
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

#send-button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

#send-button:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
    
    .chat-input {
        border-radius: 0;
    }
    
    .message-content {
        max-width: 85%;
    }
}
