/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    overflow: hidden;
}

/* 应用容器 */
.app-container {
    display: flex;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 聊天列表区 */
.chat-list-container {
    width: 300px;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
}

/* 顶部状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f8f8f8;
    font-size: 12px;
    color: #666;
}

/* 顶部标题栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: white;
    border-bottom: 1px solid #e5e5e5;
}

.header .title {
    font-size: 18px;
    font-weight: bold;
}

.header-buttons {
    display: flex;
    gap: 15px;
}

.header-buttons button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.header-buttons button:hover {
    background-color: #f0f0f0;
}

/* 聊天列表 */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.chat-item:hover {
    background-color: #f5f5f5;
}

.chat-item.active {
    background-color: #e8f0fe;
}

.chat-item .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
    overflow: hidden;
}

.chat-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-item .chat-info {
    flex: 1;
    min-width: 0;
}

.chat-item .chat-name {
    font-weight: bold;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item .last-message {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 底部导航栏 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    background-color: white;
    border-top: 1px solid #e5e5e5;
}

.nav-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.nav-btn.active {
    background-color: #07c160;
    color: white;
}

/* 聊天详情区 */
.chat-detail-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    display: none;
}

.chat-detail-container.show {
    display: flex;
}

/* 聊天头部 */
.chat-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: white;
    border-bottom: 1px solid #e5e5e5;
}

.back-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin-right: 15px;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background-color: #f0f0f0;
}

.chat-title {
    flex: 1;
    font-size: 16px;
    font-weight: bold;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #f0f0f0;
}

/* 聊天消息区 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.message.user {
    align-self: flex-end;
    background-color: #07c160;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background-color: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message .content {
    word-wrap: break-word;
    line-height: 1.4;
}

.message .time {
    font-size: 10px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.message.assistant .time {
    text-align: left;
    color: #999;
}

/* 底部输入区 */
.chat-input-area {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: white;
    border-top: 1px solid #e5e5e5;
    gap: 10px;
}

.message-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    resize: none;
}

.send-btn {
    background-color: #07c160;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: #06b357;
}

.send-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content.my-modal {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    text-align: right;
}

/* 设置项 */
.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.setting-item input,
.setting-item textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.setting-item input:focus,
.setting-item textarea:focus {
    border-color: #07c160;
}

.setting-item textarea {
    resize: vertical;
    min-height: 100px;
}

.setting-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.setting-section:last-child {
    border-bottom: none;
}

.setting-section h4 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

/* 按钮样式 */
.save-btn,
.create-btn {
    background-color: #07c160;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.save-btn:hover,
.create-btn:hover {
    background-color: #06b357;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #07c160;
}

input:focus + .slider {
    box-shadow: 0 0 1px #07c160;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 头像上传 */
.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e5e5e5;
    transition: border-color 0.2s;
}

.avatar-preview:hover {
    border-color: #07c160;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-btn {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #e5e5e5;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn:hover {
    background-color: #e5e5e5;
}

/* 聊天信息模态框 */
.chat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.avatar-section {
    position: relative;
    margin-bottom: 10px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    overflow: hidden;
    border: 2px solid #e5e5e5;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background-color: #07c160;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    border: 2px solid white;
}

.chat-info-name {
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}

/* AI列表 */
.ai-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #fafafa;
    border-radius: 8px;
    gap: 10px;
}

.ai-item .avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.ai-item .ai-info {
    flex: 1;
}

.ai-item .ai-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 3px;
}

.ai-item .ai-desc {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-btn {
    background-color: #ff4d4f;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background-color: #ff7875;
}

.delete-btn:active {
    background-color: #d9363e;
}

/* 箭头样式 */
.arrow {
    font-size: 16px;
    color: #999;
    margin-left: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .chat-list-container {
        width: 100%;
        height: 100vh;
    }
    
    .chat-detail-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}