/* 邮箱工具样式 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 邮箱容器 */
.email-container {
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
}

/* 左侧导航 */
.email-sidebar {
    width: 250px;
    border-right: 1px solid #e0e0e0;
    background-color: #f9f9f9;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f0f0f0;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.menu-btn.active {
    background-color: #e3f2fd;
    color: #667eea;
    border-left-color: #667eea;
}

/* 右侧内容区域 */
.email-content {
    flex: 1;
    padding: 2rem;
}

.content-section {
    display: none;
}

.content-section.show {
    display: block;
}

.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.content-section p {
    margin-bottom: 2rem;
    color: #666;
}

/* 表单样式 */
.email-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: #667eea;
}

/* 按钮样式 */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-btn:hover {
    opacity: 0.9;
}

/* 结果消息 */
.result-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.result-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 邮箱列表 */
.email-list {
    margin-top: 1.5rem;
}

.email-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.email-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.email-item .email-info {
    flex: 1;
}

.email-item .email-address {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.email-item .email-status {
    font-size: 0.8rem;
    color: #666;
}

.email-item .email-actions {
    display: flex;
    gap: 0.5rem;
}

/* 模态框样式 */
.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-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .email-container {
        flex-direction: column;
    }

    .email-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
    }

    .menu-btn {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .menu-btn.active {
        border-left: none;
        border-bottom-color: #667eea;
    }

    .email-content {
        padding: 1.5rem;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: #999;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 邮件收发相关样式 */

/* 邮箱选择器 */
.email-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.email-selector label {
    font-weight: 500;
    white-space: nowrap;
}

.email-selector select {
    flex: 1;
    min-width: 200px;
}

/* 邮件标签 */
.email-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background-color: #f0f0f0;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: white;
}

/* 邮件主区域 */
.email-main {
    display: flex;
    gap: 1.5rem;
    min-height: 500px;
}

/* 邮件列表面板 */
.email-list-panel {
    width: 350px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.emails-list {
    flex: 1;
    overflow-y: auto;
}

/* 邮件项 */
.email-item {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.email-item:hover {
    background-color: #f9f9f9;
}

.email-item.unread {
    background-color: #f0f8ff;
    font-weight: 500;
}

.email-item.read {
    color: #666;
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.email-sender {
    font-weight: 600;
}

.email-time {
    font-size: 0.8rem;
    color: #999;
}

.email-subject {
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.email-preview {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 邮件详情面板 */
.email-detail-panel {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.email-detail {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.email-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.email-detail-header h3 {
    margin: 0;
    color: #333;
}

.email-detail-actions {
    display: flex;
    gap: 0.5rem;
}

.email-detail-meta {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.email-detail-content {
    margin-bottom: 2rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.email-detail-attachments {
    border-top: 1px solid #e0e0e0;
    padding-top: 1.5rem;
}

.email-detail-attachments h4 {
    margin-bottom: 1rem;
    color: #333;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background-color: #f9f9f9;
    border-radius: 6px;
    font-size: 0.9rem;
}

.attachment-size {
    font-size: 0.8rem;
    color: #666;
}

/* 大模态框 */
.modal-content.large {
    max-width: 700px;
    width: 90%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .email-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .email-selector select {
        width: 100%;
    }

    .email-main {
        flex-direction: column;
    }

    .email-list-panel {
        width: 100%;
        max-height: 300px;
    }
}

/* 页脚样式 */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    border-top: 4px solid #667eea;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}