* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* 左侧面板 */
.left-panel {
    width: 360px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.panel-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    display: flex;
    align-items: center;
}

.panel-header h1 svg {
    color: #4299e1;
    flex-shrink: 0;
}

.email-section {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #3182ce;
}

.btn-primary:active {
    transform: scale(0.98);
}

.email-info {
    margin-top: 16px;
}

.info-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.info-item label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #718096;
    margin-bottom: 6px;
}

.info-value {
    font-size: 14px;
    color: #2d3748;
    word-break: break-all;
    font-family: 'SF Mono', Consolas, monospace;
    flex: 1;
}

.btn-copy {
    padding: 8px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
}

.btn-copy:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #4299e1;
}

.btn-copy:active {
    transform: scale(0.95);
}

.btn-delete {
    padding: 6px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.mail-item:hover .btn-delete {
    opacity: 1;
}

.btn-delete:hover {
    background: #fee;
    color: #e53e3e;
}

.btn-delete:active {
    transform: scale(0.9);
}

.status-message {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-message.success::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='2'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-size: contain;
    flex-shrink: 0;
}

.status-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-message.error::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23991b1b' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
    background-size: contain;
    flex-shrink: 0;
}

.status-message.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #93c5fd;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-message.info::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231e40af' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
    background-size: contain;
    flex-shrink: 0;
}

/* 邮件列表 */
.mail-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mail-list-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.mail-list-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.mail-count {
    background: #edf2f7;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.mails-list {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}

.mail-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f7fafc;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.mail-item:hover {
    background: #f7fafc;
}

.mail-item.active {
    background: #ebf8ff;
    border-left: 3px solid #4299e1;
}

.mail-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 24px;
    width: 6px;
    height: 6px;
    background: #4299e1;
    border-radius: 50%;
}

.mail-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.mail-subject {
    font-size: 14px;
    font-weight: 500;
    color: #1a202c;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-from {
    font-size: 13px;
    color: #718096;
}

.mail-date {
    font-size: 12px;
    color: #a0aec0;
    white-space: nowrap;
    margin-left: 8px;
}

.mail-preview {
    font-size: 13px;
    color: #a0aec0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 右侧面板 */
.right-panel {
    flex: 1;
    background: #ffffff;
    overflow: hidden;
}

.mail-detail-container {
    height: 100%;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a0aec0;
}

.empty-state svg {
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 15px;
    color: #a0aec0;
}

/* 邮件详情 */
.mail-detail {
    padding: 32px 40px;
    max-width: 900px;
    margin: 0 auto;
}

.mail-detail-header {
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.mail-detail-subject {
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 16px;
    line-height: 1.3;
}

.mail-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-row {
    display: flex;
    font-size: 14px;
}

.meta-label {
    min-width: 80px;
    color: #718096;
    font-weight: 500;
}

.meta-value {
    color: #2d3748;
    word-break: break-all;
}

.mail-detail-body {
    font-size: 15px;
    line-height: 1.7;
    color: #2d3748;
}

.mail-content-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #718096;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #4299e1;
}

.tab-btn.active {
    color: #4299e1;
    border-bottom-color: #4299e1;
}

.tab-content {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.mail-text-content {
    white-space: pre-wrap;
    word-break: break-word;
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.8;
    color: #1a202c;
    max-height: none;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mail-html-iframe {
    width: 100%;
    min-height: 600px;
    height: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.mail-raw-content {
    white-space: pre-wrap;
    word-break: break-all;
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #4a5568;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'SF Mono', Consolas, monospace;
}

/* 滚动条样式 */
.mails-list::-webkit-scrollbar,
.mail-detail-container::-webkit-scrollbar,
.mail-text-content::-webkit-scrollbar,
.mail-raw-content::-webkit-scrollbar {
    width: 6px;
}

.mails-list::-webkit-scrollbar-track,
.mail-detail-container::-webkit-scrollbar-track,
.mail-text-content::-webkit-scrollbar-track,
.mail-raw-content::-webkit-scrollbar-track {
    background: transparent;
}

.mails-list::-webkit-scrollbar-thumb,
.mail-detail-container::-webkit-scrollbar-thumb,
.mail-text-content::-webkit-scrollbar-thumb,
.mail-raw-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.mails-list::-webkit-scrollbar-thumb:hover,
.mail-detail-container::-webkit-scrollbar-thumb:hover,
.mail-text-content::-webkit-scrollbar-thumb:hover,
.mail-raw-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 没有邮件时的空状态 */
.no-mails {
    padding: 40px 20px;
    text-align: center;
    color: #a0aec0;
    font-size: 14px;
}

/* 自定义确认对话框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 28px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    margin-bottom: 16px;
}

.modal-icon {
    display: none;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.modal-message {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 80px;
}

.modal-btn-cancel {
    background: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.modal-btn-cancel:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.modal-btn-confirm {
    background: #e53e3e;
    color: white;
}

.modal-btn-confirm:hover {
    background: #c53030;
}

.modal-btn:active {
    transform: scale(0.98);
}

