/* 通用样式 */
* {
    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;
    padding: 20px;
    color: #333;
}

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

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 40px 20px;
}

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;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Code Display */
.code-display {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-value {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    font-family: 'Courier New', monospace;
    letter-spacing: 5px;
}

.code-meta {
    margin-top: 15px;
    font-size: 0.9em;
    color: #6c757d;
}

.loading {
    color: #6c757d;
    font-style: italic;
}

.error {
    color: #dc3545;
}

/* Status Display */
.status-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #6c757d;
}

.status-display.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-display.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 10px;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
}

.btn-info:hover {
    background: #138496;
}

/* Form */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1em;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Results */
.results {
    margin-top: 20px;
}

.result-item {
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.result-item strong {
    color: #667eea;
    font-size: 1.2em;
}

/* Mails List */
.mails-list {
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.mail-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.mail-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.mail-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.mail-from {
    font-weight: bold;
    color: #667eea;
}

.mail-date {
    color: #6c757d;
    font-size: 0.9em;
}

.mail-subject {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #333;
}

.mail-preview {
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* API List */
.api-list {
    margin-top: 15px;
}

.api-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.api-item strong {
    color: #667eea;
    font-family: 'Courier New', monospace;
    display: block;
    margin-bottom: 8px;
}

.api-item p {
    color: #6c757d;
    margin: 0;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 30px;
}

footer a {
    color: white;
    text-decoration: underline;
}

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

    .code-value {
        font-size: 2em;
    }

    .card {
        padding: 20px;
    }
}

/* 滚动条样式 */
.mails-list::-webkit-scrollbar {
    width: 8px;
}

.mails-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.mails-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.mails-list::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}
