﻿/*
 * style.css
 * 极简清新，适配手机
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    padding: 0 12px 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

.site-header {
    text-align: center;
    padding: 30px 0 20px;
}

.site-header h1 {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: #3a6ea5;
align-items: center;
}

.site-header .subtitle {
    color: #7f8c8d;
    font-size: 1rem;
    margin-top: 5px;
}

.home-grid {
display: flex;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
    }

.card {
 background: #ffffff;
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.02), 0 6px 6px rgba(0,0,0,0.03);
    flex: 1 1 calc(50% - 10px);
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.02);
  }
/* 当 n 为单数时，最后一个 item 占满整行 */
.card:last-child:nth-child(odd) {
    flex: 1 1 100%;
}
.card h2 {
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef2f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge {
    background-color: #e1e8ed;
    color: #506680;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 30px;
    font-weight: 400;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
max-height: 800px;
overflow-y: auto;
}

.article-item {
    display: block;
    padding: 12px 15px;
    background: #f9fafc;
    border-radius: 16px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.article-item:hover {
    background: #eef2f6;
    border-color: #d0ddee;
}

.article-item h3 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 5px;
    color: #2c5282;
}

.article-item .summary {
    font-size: 0.9rem;
    color: #5d6d7e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty {
    color: #a0b3c6;
    text-align: center;
    padding: 20px 0;
    font-style: italic;
}

/* C板块幻灯片 (横向滚动缩略图) */
.card-c .thumbnail-strip {
    width: 900px;
display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 8px 4px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.thumb-link {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    scroll-snap-align: start;
    transition: transform 0.2s;
}

.thumb-link:hover {
    transform: scale(0.98);
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #eef2f6;
}

.hint {
    text-align: center;
    font-size: 0.8rem;
    color: #8a9bb0;
    margin-top: 8px;
}

/* 文章详情页 */
.article-detail {
    max-width: 750px;
    margin: 0 auto;
text-align: center;}

.detail-card {
    padding: 30px 25px;
    text-align:center;
}

.article-title {
font-size: 2rem;
font-weight: 400;
    color: #1e3a5f;
    margin-bottom: 25px;
    border-bottom: 2px solid #e2eaf2;
    padding-bottom: 15px;
}

.article-body {
    font-size: 1.05rem;
    color: #2d3e50;
}

.article-body p {
    margin: 1.2em 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 10px 0;
}

.article-body a {
    color: #2b6f9b;
    text-decoration: underline;
}

.post-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px solid #eef2f6;
    gap: 15px;
}

.nav-prev, .nav-next {
    flex: 1 1 200px;
}

.nav-home {
    flex: 0 0 auto;
}

.nav-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f0f4fa;
    border-radius: 30px;
    font-size: 0.95rem;
    color: #2c5282;
    transition: background 0.2s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link.disabled {
    color: #b3c2d1;
    background-color: #f1f3f6;
    pointer-events: none;
}

.nav-link:hover:not(.disabled) {
    background-color: #dbe4f0;
}

.home-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: #3a6ea5;
    color: white;
    border-radius: 40px;
    font-weight: 500;
    transition: background 0.2s;
    box-shadow: 0 4px 8px rgba(58,110,165,0.2);
}

.home-btn:hover {
    background-color: #2c5282;
}

footer {
    text-align: center;
    margin-top: 50px;
    color: #8f9eb0;
    font-size: 0.85rem;
}

/* 手机优化 */
@media (max-width: 600px) {
    .site-header h1 {
        font-size: 1.8rem;
    }
    .card {
        padding: 20px 15px;
    }
    .article-title {
        font-size: 1.6rem;
    }
    .post-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-prev, .nav-next, .nav-home {
        text-align: center;
    }
    .nav-link {
        white-space: normal;
        width: 100%;
        text-align: center;
    }
    .thumb-link {
        width: 90px;
        height: 90px;
    }
}

/* lightbox 适配移动 */
.lb-loader, .lightbox {
    text-align: center !important;
}
/* 媒体详情页 */
.media-detail {
    max-width: 900px;
    margin: 0 auto;
}

.media-card {
    text-align: center;
}

.media-title {
    text-align: center;
font-size: 1.5rem;
    margin-bottom: 20px;
    word-break: break-all;
}

.media-container {
    background: #f0f2f5;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

.media-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.media-video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
}

/* 返回链接增加锚点 */
#c-section {
    scroll-margin-top: 20px;
}