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

:root {
    --primary-color: #007AFF;
    --primary-hover: #0051D5;
    --success-color: #34C759;
    --error-color: #FF3B30;
    --bg-color: #F2F2F7;
    --card-bg: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --border-color: #C6C6C8;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
}

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;
    line-height: 1.6;
    color: var(--text-primary);
}

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

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

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

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.label-text {
    font-size: 0.95rem;
}

.required {
    color: var(--error-color);
    margin-left: 4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

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

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.email-content {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.email-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.btn-close {
    background: var(--bg-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.btn-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.email-subject {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 8px;
}

.email-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.meta-item {
    padding: 10px 15px;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.meta-item strong {
    color: var(--text-secondary);
    margin-right: 5px;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.email-body {
    font-size: 1rem;
    line-height: 1.8;
}

.email-body #emailBody {
    margin-top: 10px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
}

/* HTML邮件内容样式 */
.email-body #emailBody img {
    max-width: 100%;
    height: auto;
}

.email-body #emailBody a {
    color: var(--primary-color);
    text-decoration: underline;
}

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.alert-error {
    background: #FFE5E5;
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.alert-icon {
    font-size: 1.5rem;
}

footer {
    text-align: center;
    color: white;
    padding: 20px;
    opacity: 0.9;
}

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

footer a:hover {
    opacity: 0.8;
}

/* 系统信息样式 */
.system-info {
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.status-ok {
    color: var(--success-color);
}

.status-error {
    color: var(--error-color);
}

/* 警告样式 */
.alert-warning {
    background: #FFF3CD;
    color: #856404;
    border: 2px solid #FFC107;
    margin-bottom: 20px;
}

/* 成功样式 */
.alert-success {
    background: #D4EDDA;
    color: #155724;
    border: 2px solid var(--success-color);
}

/* 表单提示文字 */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* code标签样式 */
code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 10px;
}

.button-group .btn {
    flex: 1;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

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

.btn-secondary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
}

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

.btn-success:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* 全部邮件列表样式 */
.all-emails-content {
    max-height: 600px;
    overflow-y: auto;
}

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

.email-item {
    padding: 15px;
    background: var(--bg-color);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.email-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.1);
}

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

.email-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.email-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.email-item-subject {
    margin-bottom: 8px;
    font-size: 1rem;
    word-break: break-word;
}

.email-item-from {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.email-item-preview {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.email-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.email-badge.read {
    background: #e0e0e0;
    color: #666;
}

.email-badge.unread {
    background: var(--primary-color);
    color: white;
}

.email-item-code {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.verification-code {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
    user-select: all;
}

.btn-copy {
    padding: 6px 12px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #28a745;
    transform: scale(1.05);
}

.btn-copy:active {
    transform: scale(0.95);
}

.btn-view {
    width: 100%;
    padding: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    margin-top: 10px;
}

.btn-view:hover {
    background: var(--primary-hover);
}

@media (max-width: 1024px) {
    .button-group {
        flex-wrap: wrap;
    }
    
    .button-group .btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        flex: 1 1 100%;
    }
    
    .verification-code {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .email-meta {
        flex-direction: column;
        gap: 10px;
    }
}

