/* API测试页面样式 */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

header h1 {
    color: var(--primary-color);
    margin: 0;
}

nav {
    display: flex;
    gap: 1rem;
}

.test-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-in-out;
}

.test-section h2 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.result-box,
.info-box,
.emails-box,
.email-detail-box {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--background-color);
}

.email-detail-box {
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.email-detail-content {
    margin-top: 1rem;
}

.detail-item {
    display: flex;
    margin-bottom: 0.8rem;
    align-items: flex-start;
}

.detail-item label {
    font-weight: 600;
    min-width: 80px;
    color: var(--text-color);
    margin-right: 1rem;
}

.detail-item span {
    color: var(--text-dark-color);
    word-break: break-all;
}

.detail-body {
    margin-top: 1.5rem;
}

.detail-body label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

#detail-body-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    font-family: -apple-system, system-ui, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* HTML邮件内容样式 */
#detail-body-content * {
    max-width: 100%;
}

#detail-body-content img {
    max-width: 100%;
    height: auto;
}

#detail-body-content table {
    border-collapse: collapse;
    width: 100%;
}

#detail-body-content td,
#detail-body-content th {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
}

.email-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.email-from {
    font-weight: 600;
    color: var(--text-color);
}

.email-time {
    font-size: 0.9rem;
    color: var(--text-dark-color);
}

.email-subject {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.email-body {
    color: var(--text-dark-color);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.email-actions {
    margin-top: 1rem;
    text-align: right;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.view-detail-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.view-detail-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.view-detail-btn svg {
    transition: transform 0.2s ease;
}

.view-detail-btn:hover svg {
    transform: translateX(2px);
}

.result-box.success {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.result-box.error {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--surface-color);
    border-radius: 4px;
}

.info-item label {
    font-weight: 600;
    margin: 0;
}

.whitelist-info h4 {
    margin: 1rem 0 0.5rem 0;
    color: var(--text-primary);
}

.whitelist-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.whitelist-info li {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: var(--surface-color);
    border-radius: 4px;
    font-family: monospace;
}

.quick-senders {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.quick-senders h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.quick-sender-btn {
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.quick-sender-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.emails-content {
    max-height: 400px;
    overflow-y: auto;
}

.email-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-color);
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.email-from {
    font-weight: 600;
    color: var(--primary-color);
}

.email-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.email-subject {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.email-body {
    color: var(--text-secondary);
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.status-message {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.status-message.success {
    background: #10b981;
    color: white;
}

.status-message.error {
    background: #ef4444;
    color: white;
}

.status-message.info {
    background: #3b82f6;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 输入框与按钮组合 */
.input-with-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.input-with-buttons input {
    flex: 1;
}

.input-buttons {
    display: flex;
    gap: 0.5rem;
}

.input-buttons .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.input-buttons .btn span:first-child {
    font-size: 1rem;
}

/* 邮箱信息卡片样式 */
.mailbox-info-card {
    margin-top: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-icon {
    font-size: 1.5rem;
}

.card-title h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.close-card-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-card-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-icon {
    font-size: 1.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    flex-shrink: 0;
}

.info-details {
    flex: 1;
}

.info-details label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark-color);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-details span {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
    word-break: break-all;
}

.whitelist-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-icon {
    font-size: 1.25rem;
}

.section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.whitelist-content {
    background: var(--background-color);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.whitelist-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.whitelist-content li {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-color);
}

.whitelist-content li:last-child {
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .input-with-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .input-buttons {
        margin-top: 0.75rem;
        justify-content: stretch;
    }

    .input-buttons .btn {
        flex: 1;
        justify-content: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        padding: 1rem;
    }

    .card-content {
        padding: 1rem;
    }

    .quick-sender-btn {
        display: block;
        width: 100%;
        margin: 0.25rem 0;
    }
    
    .status-message {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
    }
}
