/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.login-header h1 {
    color: #2c5aa0;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a8a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(44, 90, 160, 0.3);
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
    font-size: 0.8rem;
    color: #666;
}

/* 主邮箱界面样式 */
.email-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f8f9fa;
}

.email-header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

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

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.email-header h1 {
    color: #2c5aa0;
    font-size: 1.5rem;
}

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

.user-info {
    color: #666;
    font-size: 0.9rem;
}

.logout-btn {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #c82333;
}

.email-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 侧边栏样式 */
.email-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e1e5e9;
    padding: 20px;
    overflow-y: auto;
}

.compose-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.compose-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

.email-nav ul,
.admin-nav ul {
    list-style: none;
}

.email-nav li,
.admin-nav li {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #2c5aa0;
}

.nav-link.active {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a8a 100%);
    color: white;
}

.nav-link .icon {
    font-size: 1.2rem;
}

.unread-count {
    background: #dc3545;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.admin-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.admin-section h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 主内容区域样式 */
.email-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.email-view {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.view-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.view-header h2 {
    color: #2c5aa0;
    font-size: 1.5rem;
}

.view-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.action-btn {
    padding: 8px 16px;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #1e3a8a;
}

.action-btn.delete {
    background: #dc3545;
}

.action-btn.delete:hover {
    background: #c82333;
}

.search-input {
    padding: 8px 15px;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    width: 250px;
    font-size: 14px;
}

/* 邮件列表样式 */
.email-list {
    max-height: 600px;
    overflow-y: auto;
}

.email-item {
    padding: 15px 30px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.email-item.unread {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.email-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a8a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.email-content {
    flex: 1;
}

.email-sender {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.email-subject {
    color: #666;
    margin-bottom: 5px;
}

.email-preview {
    color: #999;
    font-size: 0.9rem;
}

.email-date {
    color: #999;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* 联系人列表样式 */
.contacts-list {
    padding: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

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

.contact-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

.contact-info h3 {
    color: #333;
    margin-bottom: 5px;
}

.contact-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

/* 用户管理样式 */
.users-list {
    padding: 20px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.3s ease;
}

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

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.user-details h4 {
    color: #333;
    margin-bottom: 5px;
}

.user-details p {
    color: #666;
    font-size: 0.9rem;
}

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

.user-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #ffc107;
    color: #333;
}

.edit-btn:hover {
    background: #e0a800;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

/* 统计信息样式 */
.stats-content {
    padding: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-header h3 {
    color: #2c5aa0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f1f3f4;
    color: #333;
}

.compose-form,
.user-form {
    padding: 30px;
}

.compose-form textarea {
    min-height: 200px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.send-btn,
.save-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.send-btn:hover,
.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

.draft-btn {
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.draft-btn:hover {
    background: #5a6268;
}

.cancel-btn {
    padding: 12px 24px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #e9ecef;
}

/* 邮件详情样式 */
.email-details {
    padding: 30px;
}

.email-meta {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.email-meta div {
    margin-bottom: 10px;
}

.email-meta div:last-child {
    margin-bottom: 0;
}

.email-body {
    background: white;
    padding: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    margin-bottom: 20px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.email-actions {
    display: flex;
    gap: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .email-container {
        flex-direction: column;
    }
    
    .email-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
    }
    
    .email-header {
        padding: 10px 20px;
    }
    
    .header-left h1 {
        font-size: 1.2rem;
    }
    
    .view-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误消息样式 */
.message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    font-size: 0.9rem;
}

