/*
 * MailExpress - 主样式表
 * 版本: 1.3 (格式化修复版)
 * 包含：基础、动画、响应式、警告、健康度、连接测试样式
 */

/* --- 中文注释：全局样式和字体设置 --- */
body {
    font-family: "Helvetica Neue", "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft Yahei", sans-serif;
    background-color: #f4f7f9;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5vh 2vw;
    margin: 0;
    min-height: 90vh;
}

.container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 600px;
    transition: all 0.3s ease;
}

/* --- 中文注释：标题和表单样式 --- */
h1 {
    color: #1a202c;
    text-align: center;
}

.search-form {
    display: flex;
    margin-bottom: 30px;
}

.search-form input {
    flex-grow: 1;
    border: 2px solid #ddd;
    padding: 12px 15px;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-form input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.search-form button {
    border: none;
    background-color: #4299e1;
    color: white;
    padding: 12px 20px;
    border-radius: 0 8px 8px 0;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.search-form button:hover {
    background-color: #3182ce;
    transform: translateY(-2px);
}

/* --- 中文注释：加载动画 (Spinner) 样式 --- */
.loader {
    display: none;
    margin: 30px auto;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #4299e1;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- 中文注释：结果区域和卡片样式 --- */
.results h2 {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 20px;
}

.protocol-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    background-color: #fff;
}

.protocol-card strong {
    text-transform: uppercase;
    color: #4299e1;
    font-size: 14px;
}

.protocol-card p {
    margin: 8px 0;
    font-size: 16px;
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    color: #718096;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

/* --- 中文注释：页脚样式 --- */
.footer {
    margin-top: auto;
    padding-top: 40px;
    color: #718096;
    font-size: 14px;
    text-align: center;
}

/* --- 中文注释：动画效果 --- */
.animated {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fadeInUp {
    animation-name: fadeInUp;
}

/* --- 中文注释：移动端响应式设计 --- */
@media (max-width: 768px) {
    body {
        padding: 5vh 5vw;
    }
    .container {
        padding: 25px;
    }
    h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .search-form {
        flex-direction: column;
    }
    .search-form input {
        border-radius: 8px;
        margin-bottom: 10px;
        text-align: center;
    }
    .search-form button {
        border-radius: 8px;
    }
}

/* --- 中文注释：用于部分结果的警告提示卡片样式 --- */
.protocol-card.card-warning {
    background-color: #FFFBEB; /* 淡黄色背景 */
    border-left: 5px solid #FBBF24; /* 左侧有醒目的黄色边框 */
}

.protocol-card.card-warning strong {
    color: #D97706; /* 标题颜色加深 */
}

/* --- 中文注释：邮件健康度诊断功能样式 --- */
.health-check-area {
    margin-top: 30px;
    text-align: center;
}

.health-check-btn {
    background-color: #f0fdf4; /* 浅绿色背景 */
    color: #16a34a; /* 绿色文字 */
    border: 1px solid #86efac; /* 绿色边框 */
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.health-check-btn:hover {
    background-color: #dcfce7;
    border-color: #4ade80;
}

.health-report {
    margin-top: 20px;
    text-align: left;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.health-report h3 {
    margin-top: 0;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.health-report-item {
    margin-bottom: 10px;
}

.health-report-item .status-found {
    color: green;
    font-weight: bold;
}

.health-report-item .status-not-found {
    color: #b91c1c; /* 暗红色 */
    font-weight: bold;
}

.health-report-item .record {
    font-family: monospace;
    background-color: #f1f5f9;
    padding: 5px;
    border-radius: 4px;
    word-break: break-all;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* --- 中文注释：连接测试功能样式 --- */
.test-btn-container {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.test-btn {
    font-size: 12px;
    padding: 5px 10px;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.test-btn:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
}

.test-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.test-result {
    margin-left: 10px;
    font-size: 12px;
    font-weight: bold;
}

.test-result .spinner {
    display: inline-block;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #64748b;
    width: 12px;
    height: 12px;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}

.test-result .success {
    color: #16a34a; /* 绿色 */
}

.test-result .failure {
    color: #dc2626; /* 红色 */
}