/* 推荐系统系列文章页面样式 */

.page-hero {
    height: 50vh;
    min-height: 260px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding-top: 100px;
}

.page-hero .hero-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: fadeInUp 1s ease-out;
}

.page-hero .hero-content .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.page-hero .hero-content .series {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 1rem;
}

.page-hero .hero-content .series a {
    color: white;
    text-decoration: underline;
}

.article-nav {
    max-width: 800px;
    margin: -20px auto 0;
    padding: 1rem 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-nav a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.article-nav a:hover {
    text-decoration: underline;
}

.blog-content h2 {
    color: #2c3e50;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.blog-content h3 {
    color: #34495e;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.blog-content th, .blog-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.blog-content th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.blog-content tr:hover {
    background: #f8f9ff;
}

.blog-content blockquote {
    border-left: 4px solid #667eea;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8f9ff;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

.blog-content ul, .blog-content ol {
    margin: 1rem 0 1.5rem 0;
    padding-left: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-nav-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.article-nav-bottom a {
    color: #667eea;
    text-decoration: none;
}

.article-nav-bottom a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .page-hero {
        height: auto;
        min-height: auto;
        padding: 100px 20px 60px;
    }

    .page-hero .hero-content h1 {
        font-size: 1.5rem;
    }

    .article-nav {
        margin: -20px 1rem 0;
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ===== Figures & Captions ===== */
.blog-content figure {
    margin: 2rem 0;
    text-align: center;
}

.blog-content figure img {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.blog-content figcaption {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    clear: both;
}

/* Allow manual width override via inline style or class */
.blog-content figure img.width-60  { width: 60%; }
.blog-content figure img.width-70  { width: 70%; }
.blog-content figure img.width-80  { width: 80%; }
.blog-content figure img.width-90  { width: 90%; }
.blog-content figure img.width-full { width: 100%; }

/* ===== Generic images (non-figure) ===== */
.blog-content img {
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
    display: block;
}

.blog-content pre {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    line-height: 1.45;
}

.blog-content code {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

.blog-content pre code {
    background: transparent;
    padding: 0;
    border: none;
}

/* ===== Math rendering (MathJax-free) ===== */
.math-display {
    text-align: center;
    margin: 1.5rem 0;
    font-size: 1.05rem;
    color: #2c3e50;
    overflow-x: auto;
}

.math-display .formula-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.math-display .sum-block,
.math-display .sum-op {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    line-height: 1.1;
}

.math-display .sum-symbol {
    font-size: 1.6rem;
    font-weight: 400;
}

.math-display .sum-limits,
.math-display .sum-limits-top,
.math-display .sum-limits-bottom {
    font-size: 0.72rem;
    line-height: 1;
}

.math-display .sum-limits-top,
.math-display .sum-limits-top {
    align-self: flex-start;
}

.math-display .sum-limits-bottom,
.math-display .sum-limits-bottom {
    align-self: flex-end;
}

.math-display .paren {
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1;
}

.math-display .cdot {
    margin: 0 0.15rem;
}

.math-inline-math {
    white-space: nowrap;
}

.math-inline-math sub,
.math-inline-math sup {
    font-size: 0.75em;
}
