* {
    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;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 认证页面 */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.auth-header {
    text-align: center;
    padding: 40px 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.auth-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.auth-header p {
    opacity: 0.9;
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

.auth-form {
    display: none;
    padding: 30px;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.input-with-suffix input {
    flex: 1;
    border: none;
    border-radius: 0;
}

.input-with-suffix .suffix {
    padding: 0 12px;
    background: #f5f5f5;
    color: #666;
    white-space: nowrap;
}

/* 按钮 */
.btn-primary,
.btn-secondary,
.btn-icon {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: #667eea;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #5568d3;
}

/* 主界面 */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 28px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #667eea;
    font-weight: 500;
}

.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
    display: flex;
    gap: 30px;
    height: calc(100vh - 140px);
}

/* 侧边栏 */
.sidebar {
    width: 350px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-header h3 {
    color: #333;
    font-size: 18px;
}

.mailbox-list {
    flex: 1;
    overflow-y: auto;
}

.mailbox-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.mailbox-item:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.mailbox-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.mailbox-email {
    font-weight: 500;
    margin-bottom: 5px;
    word-break: break-all;
}

.mailbox-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.7;
}

/* 主内容区 */
.main-content {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-state h2 {
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
}

.email-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.email-list-header h2 {
    color: #333;
    font-size: 20px;
}

.emails {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-item {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.email-item:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.email-item.unread {
    background: #f0f4ff;
    border-left: 3px solid #667eea;
}

.email-sender {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.email-subject {
    color: #666;
    margin-bottom: 8px;
}

.email-date {
    font-size: 12px;
    color: #999;
}

.email-detail {
    padding: 20px;
}

.email-detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.email-detail-header h2 {
    color: #333;
    margin-bottom: 15px;
}

.email-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.email-body {
    line-height: 1.6;
    color: #333;
}

.email-body-html {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #fafafa;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    color: #333;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    width: auto;
    padding: 10px 20px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

