/* General Layout / 基础布局 */
body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    
    /* The Fix */
    display: flex;
    flex-direction: column; /* Stacks main and footer vertically */
    align-items: center;    /* Centers both main and footer */
    
    min-height: 100vh;
    margin: 0;
    padding: 50px 20px;
}

.container {
    max-width: 800px;
    width: 100%; /* Ensures it takes up space correctly */
    text-align: center;
}

/* Button Styling / 按钮样式 */
.btn-open {
    display: inline-block;
    padding: 12px 24px;
    background-color: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-open:hover {
    background-color: #1d4ed8;
}

/* MODAL LOGIC / 弹窗逻辑 */

/* The overlay covers the whole screen but is hidden by default */
/* 遮罩层覆盖整个屏幕，但默认隐藏 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Hiding logic / 隐藏逻辑 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* THE KEY SELECTOR / 核心选择器
   When the URL hash matches the ID, show the modal.
   当 URL 哈希值匹配 ID 时，显示弹窗。
*/
.modal-overlay:target {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    text-align: left;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay:target .modal-content {
    transform: scale(1);
}

/* Close Button / 关闭按钮 */
.btn-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    text-decoration: none;
    color: #64748b;
}

/* Explanation UI / 说明界面 */
.logic-explanation {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    text-align: left;
    border-top: 1px solid #e2e8f0;
    padding-top: 2rem;
}

@media (max-width: 600px) {
    .logic-explanation {
        grid-template-columns: 1fr;
    }
}
/* SEO Insight Box Styling / SEO 见解区块样式 */
.seo-insight-box {
    margin: 3rem auto;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    text-align: left; /* Ensure text is left-aligned even if container is centered */
}

.seo-insight-box h2 {
    color: #2563eb;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.insight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.seo-insight-box article h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

.seo-insight-box p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: #475569;
}

.seo-insight-box p[lang="zh"] {
    color: #64748b;
    font-size: 0.9rem;
    border-left: 3px solid #eff6ff;
    padding-left: 1rem;
}

@media (max-width: 768px) {
    .insight-grid { grid-template-columns: 1fr; }
}

/* Footer Styling */
.pattern-footer {
    width: 100%;
    max-width: 800px; /* Keeps footer width consistent with main */
    margin: 4rem auto;
    padding: 2rem 1rem;
    text-align: center;
}

.back-nav a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

.corporate-links {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #64748b;
}

.corporate-links a {
    color: var(--accent-blue);
    text-decoration: none;
}

@media (max-width: 768px) {
    .insight-grid { grid-template-columns: 1fr; }
}