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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 登录页面样式 */
#login-page, #admin-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 400px;
    max-width: 90vw;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-container input:focus {
    outline: none;
    border-color: #667eea;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-container button:hover {
    background: #5a6fd8;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-top: 10px;
}

.admin-link, .back-link {
    text-align: center;
    margin-top: 20px;
}

.admin-link a, .back-link a {
    color: #667eea;
    text-decoration: none;
}

/* 主界面样式 */
.header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info button {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.container {
    display: flex;
    height: calc(100vh - 70px);
}

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #ddd;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 15px;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.list {
    max-height: 200px;
    overflow-y: auto;
}

.list-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: between;
    align-items: center;
}

.list-item:hover {
    background: #f8f9fa;
}

.list-item.active {
    background: #3498db;
    color: white;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
}

.chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-header {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.message-time {
    font-size: 12px;
    color: #7f8c8d;
    float: right;
}

.message-content {
    color: #333;
    line-height: 1.4;
}

.message-input {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.message-input textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 60px;
}

.message-input button {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-end;
}

.message-input button:hover {
    background: #2980b9;
}

.message-input button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* 管理员界面样式 */
.admin-header {
    background: #8e44ad;
}

.admin-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 16px;
}

.tab-btn.active {
    color: #8e44ad;
    border-bottom-color: #8e44ad;
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
}

.admin-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
    min-width: 200px;
}

.admin-list {
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.admin-list-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-list-item:last-child {
    border-bottom: none;
}

.admin-list-item:hover {
    background: #f8f9fa;
}

.item-info {
    flex: 1;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.modal input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal button {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.modal button[type="button"] {
    background: #95a5a6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
    }
    
    .admin-form {
        flex-direction: column;
    }
    
    .admin-form input {
        min-width: auto;
    }
    
    .item-actions {
        flex-direction: column;
    }
}