/* styled-article.css — 前端样式 */

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

body.sa-body {
    font-family: 'Inter', 'Noto Serif SC', sans-serif;
    background: #f0f4f8;
    color: #2d3748;
    line-height: 1.8;
}

/* ── 进度条 ── */
.sa-progress-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, var(--grad-start), var(--grad-mid), var(--grad-end));
    z-index: 9999; transition: width 0.1s linear;
}

/* ── 横幅 ── */
.sa-hero {
    padding: 60px 40px 50px;
    text-align: center;
    color: #fff;
}
.sa-hero__badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.sa-hero__title {
    font-family: 'Merriweather', 'Noto Serif SC', serif;
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.sa-hero__subtitle {
    font-size: 18px;
    opacity: 0.9;
    max-width: 640px;
    margin: 0 auto 24px;
}
.sa-hero__meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    opacity: 0.85;
}

/* ── 主布局 ── */
.sa-layout {
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    gap: 32px;
    align-items: flex-start;
}
.sa-main { flex: 1; min-width: 0; }

/* ── 区块卡片 ── */
.sa-section {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s, transform 0.2s;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.2s;
}
.sa-section.sa-visible { opacity: 1; transform: translateY(0); }
.sa-section:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.12); transform: translateY(-2px); }

.sa-section__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.sa-section__icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sa-section__icon svg { width: 24px; height: 24px; }
.sa-section__header h2 {
    font-family: 'Merriweather', 'Noto Serif SC', serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
}

.sa-section__content { line-height: 1.9; color: #4a5568; }
.sa-section__content p { margin-bottom: 1em; }

/* ── 提示框 ── */
.sa-callout {
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.7;
}
.sa-callout--info {
    background: #EBF5FB;
    border-left: 4px solid #2980b9;
    color: #1a4a6b;
}
.sa-callout--warning {
    background: #FEF9E7;
    border-left: 4px solid #f39c12;
    color: #7d5a00;
}
.sa-callout__label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

/* ── 数据统计 ── */
.sa-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.sa-stat-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}
.sa-stat-card__value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary, #1a5276);
    margin-bottom: 6px;
}
.sa-stat-card__label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── 目录 ── */
.sa-toc {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    background: #fff;
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.sa-toc__title {
    font-size: 14px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sa-toc__list { list-style: none; }
.sa-toc__list li { margin-bottom: 8px; }
.sa-toc__list a {
    text-decoration: none;
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
    display: block;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.sa-toc__list a:hover,
.sa-toc__list a.sa-active {
    background: #EBF5FB;
    color: var(--primary, #1a5276);
    font-weight: 600;
}

/* ── 底部 ── */
.sa-footer {
    background: #2d3748;
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
}

/* ── 返回顶部 ── */
.sa-scroll-top {
    position: fixed;
    bottom: 32px; right: 32px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--primary, #1a5276);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
}
.sa-scroll-top.sa-visible { opacity: 1; pointer-events: all; }
.sa-scroll-top:hover { transform: translateY(-2px); }

/* ── 响应式 ── */
@media (max-width: 900px) {
    .sa-toc { display: none; }
}
@media (max-width: 600px) {
    .sa-hero { padding: 40px 20px 30px; }
    .sa-section { padding: 24px 20px; }
    .sa-layout { margin: 20px auto; padding: 0 12px; }
}
