/* static/css/style.css */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4a6fa5 0%, #3a5a8c 100%);
    color: white;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 28px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-container input {
    flex: 1;
    min-width: 250px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-container button {
    padding: 12px 25px;
    background: #5cb85c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-container button:hover {
    background: #4cae4c;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#refreshBtn {
    background: #5bc0de;
}

#refreshBtn:hover {
    background: #46b8da;
}

/* 主要内容区域 */
.content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 邮件列表样式 */
.mail-list-container {
    width: 45%;
    border-right: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mail-list-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mail-list-header h2 {
    font-size: 22px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats {
    font-size: 14px;
    color: #666;
    background: #e9ecef;
    padding: 5px 12px;
    border-radius: 15px;
}

.mail-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* 单个邮件项样式 */
.mail-item {
    padding: 20px;
    border-bottom: 1px solid #eaeaea;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mail-item:hover {
    background: #f8f9fa;
}

.mail-item.selected {
    background: #e8f4ff;
    border-left: 4px solid #4a6fa5;
}

.mail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.mail-sender {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mail-date {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

.mail-subject {
    font-size: 15px;
    color: #555;
    font-weight: 500;
    line-height: 1.4;
}

.mail-preview {
    font-size: 14px;
    color: #777;
    line-height: 1.5;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.loading i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

/* 邮件详情区域样式 */
.mail-detail-container {
    width: 55%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mail-detail-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mail-detail-header h2 {
    font-size: 22px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-detail {
    background: #dc3545;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-detail:hover {
    background: #c82333;
    transform: rotate(90deg);
}

.mail-detail {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.no-selection {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-selection i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ddd;
}

.no-selection p {
    font-size: 18px;
    color: #888;
}

/* 邮件详情内容样式 */
.mail-detail-content {
    padding: 30px;
}

.detail-header {
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.detail-subject {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.meta-item strong {
    color: #333;
    min-width: 60px;
}

.detail-body {
    line-height: 1.6;
    color: #333;
    font-size: 16px;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.detail-body pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 14px;
}

/* 页脚样式 */
.footer {
    background: #f8f9fa;
    padding: 15px 30px;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.footer p {
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .content {
        flex-direction: column;
    }
    
    .mail-list-container,
    .mail-detail-container {
        width: 100%;
        height: 50%;
    }
    
    .mail-list-container {
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-container input,
    .search-container button {
        width: 100%;
    }
    
    .footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}