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

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

header h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 10px;
}

#emailInput {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
}

#loadEmailsBtn {
    padding: 12px 24px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

#loadEmailsBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.main-content {
    min-height: 600px;
}

.email-content {
    position: relative;
}

.email-list {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

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

.email-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.email-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.email-item.unread {
    border-left: 4px solid #667eea;
    background: #f8f9ff;
}

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

.email-from {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.email-date {
    color: #999;
    font-size: 14px;
}

.email-subject {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.email-intro {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.email-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
}

.email-detail {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.email-detail.hidden {
    display: none;
}

.back-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
    transition: background 0.2s;
}

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

.detail-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.detail-header h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.detail-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    font-size: 14px;
}

.detail-meta strong {
    color: #666;
}

.detail-meta span {
    color: #333;
}

.email-body {
    background: white;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.email-body-html {
    max-width: 100%;
    overflow-x: auto;
}

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

.email-body-text {
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    color: #333;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 18px;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 6px;
    margin: 20px;
    border-left: 4px solid #c33;
}


