* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 邮箱卡片 */
.mailbox-section {
    margin-bottom: 20px;
}

.mailbox-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.mailbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mailbox-header h2 {
    font-size: 1.5em;
    color: #333;
}

.btn-refresh {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.btn-refresh:hover {
    background: #5568d3;
}

.email-display {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.email-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
    background: #f5f5f5;
    color: #333;
}

.email-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-copy {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #45a049;
}

.btn-copy.copied {
    background: #2196f3;
}

.mailbox-info {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.9em;
}

.email-count {
    font-weight: 600;
    color: #667eea;
}

/* 邮件列表 */
.emails-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.emails-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.emails-header h2 {
    font-size: 1.5em;
    color: #333;
}

.btn-small {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #5568d3;
}

.emails-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.hint {
    font-size: 0.9em !important;
    color: #bbb;
}

.email-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.email-item:hover {
    background: #f0f0f0;
    border-color: #667eea;
    transform: translateX(5px);
}

.email-item.unread {
    background: #e3f2fd;
    border-color: #2196f3;
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.email-subject {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.email-time {
    color: #999;
    font-size: 0.9em;
    white-space: nowrap;
}

.email-from {
    color: #666;
    font-size: 0.95em;
}

.email-preview {
    color: #999;
    font-size: 0.9em;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    font-size: 1.3em;
    color: #333;
    flex: 1;
    margin-right: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

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

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.email-meta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.meta-item {
    margin-bottom: 10px;
    color: #666;
}

.meta-item strong {
    color: #333;
    margin-right: 10px;
}

.email-content {
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.email-content img {
    max-width: 100%;
    height: auto;
}

.email-attachments {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.attachment-item {
    display: inline-block;
    background: #f5f5f5;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 5px;
    color: #666;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .email-display {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
    }

    .mailbox-info {
        flex-direction: column;
        gap: 10px;
    }

    .modal-content {
        max-height: 95vh;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

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

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

