/* --- 全局变量 --- */
:root {
    --primary-blue: #0f172a;   /* 深蓝黑 */
    --brand-blue: #2563eb;     /* 品牌亮蓝 */
    --bg-light: #f0f4f8;       /* 页面背景：舒适的灰蓝 */
    --text-main: #334155;      /* 正文深灰 */
    --text-light: #64748b;     /* 辅助浅灰 */
    --white: #ffffff;
    --border: #e2e8f0;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light); /* 恢复实心背景 */
    color: var(--text-main);
    line-height: 1.7;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- 1. 固定顶部导航 --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo { font-weight: 800; font-size: 20px; color: var(--primary-blue); }

.menu { display: flex; gap: 30px; }
.menu a { font-size: 15px; font-weight: 500; color: var(--text-main); padding: 22px 0; border-bottom: 3px solid transparent; }
.menu a:hover, .menu a.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }

/* --- 2. 首页布局 (Hero & Grid) --- */
main {
    max-width: 1200px;
    margin: 100px auto 50px; /* 留出顶部导航空间 */
    padding: 0 20px;
}

.hero-section {
    text-align: center;
    padding: 60px 0;
    margin-bottom: 40px;
}
.hero-section h1 { font-size: 48px; color: var(--primary-blue); margin-bottom: 10px; }
.hero-section p { font-size: 18px; color: var(--text-light); margin-bottom: 30px; }

.btn-group { display: flex; gap: 20px; justify-content: center; }
.btn { padding: 12px 30px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--brand-blue); color: var(--white); border: none; }
.btn-outline { border: 1px solid var(--border); background: var(--white); color: var(--text-main); }

.section-title { 
    font-size: 24px; 
    color: var(--primary-blue); 
    border-left: 5px solid var(--brand-blue); 
    padding-left: 15px; 
    margin: 60px 0 30px; 
}

/* 网格系统 */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.card {
    background: var(--white);
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.05); 
    border-color: var(--brand-blue); 
}
.card h3 { font-size: 18px; margin-bottom: 10px; color: var(--primary-blue); }
.card p { font-size: 14px; color: var(--text-light); }

/* --- 3. 子页面布局 (侧边栏 + 内容) --- */
.page-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* 左侧边栏 */
.sidebar {
    width: 250px;
    position: sticky;
    top: 90px;
    flex-shrink: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}
.sidebar h3 { font-size: 14px; text-transform: uppercase; color: var(--text-light); margin-bottom: 15px; letter-spacing: 1px; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 10px; }
.sidebar a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 15px; color: var(--text-main); }
.sidebar a:hover { background: #eff6ff; color: var(--brand-blue); }

/* 右侧内容区 */
.content-area {
    flex: 1;
    background: var(--white);
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 500px;
}
.content-area h1 { font-size: 32px; color: var(--primary-blue); border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 30px; }
.content-area h2 { font-size: 24px; color: var(--primary-blue); margin-top: 40px; margin-bottom: 15px; scroll-margin-top: 100px; }
.placeholder-text { background: #f8fafc; padding: 20px; border-radius: 6px; color: #64748b; font-style: italic; border: 1px dashed #cbd5e1; }

/* 页脚 */
footer { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; margin-top: 50px; border-top: 1px solid var(--border); }
footer a { color: var(--brand-blue); }

/* 响应式 */
@media (max-width: 768px) {
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .page-wrapper { flex-direction: column; }
    .sidebar { width: 100%; position: static; margin-bottom: 20px; }
    .menu { display: none; }
}
/* --- 内容配图样式 --- */
/* --- 内容配图样式 (精致统一版) --- */
figure {
    margin: 30px 0;
    text-align: center; /* 容器居中 */
}

/* --- 内容配图样式 (最终修正版：精致卡片大小) --- */
/* --- 内容配图样式 (最终强制版) --- */
figure {
    margin: 30px 0;
    text-align: center; /* 容器居中 */
    width: 100%;        /* 容器占满行 */
}

figure img {
    /* 核心修改：强制设定宽度为容器的 70% */
    /* 这样图片永远比文字（100%）窄，两边一定会有留白 */
    width: 70% !important; 
    
    /* 兜底：在大屏幕上最大不超过 700px，防止过大 */
    max-width: 700px !important; 
    
    height: auto;
    display: block;
    margin: 0 auto; /* 自身居中 */
    
    /* 美化样式 */
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* 手机端适配：手机屏幕小，70%太小看不清，改为 90% */
@media (max-width: 768px) {
    figure img {
        width: 90% !important;
        max-width: none !important;
    }
}

figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #64748b; /* 说明文字用灰色 */
    font-style: italic;
}