/* TxtPress Theme: Kyushu Sports (Modern Grid)
   Design: Dynamic, Grid-based, High Contrast
*/

:root {
    /* 配色方案：专业海军蓝 + 活力运动橙 */
    --primary-color: #0f172a;   /* 深邃蓝黑，更具现代质感 */
    --secondary-color: #1e293b; /* 次级深色 */
    --accent-color: #f97316;    /* 活力橙，用于按钮和高亮 */
    --accent-hover: #ea580c;    /* 橙色加深 */
    
    --text-main: #334155;       /* 主要文字色 */
    --text-light: #64748b;      /* 辅助文字色 */
    
    --bg-body: #f1f5f9;         /* 极淡的冷灰背景 */
    --bg-card: #ffffff;
    
    --container-width: 1200px;  /* 增加宽度以适应网格 */
    --radius: 4px;              /* 小圆角，更硬朗 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

/* === 全局重置 === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* === Header Layout (运动风格顶栏) === */
.site-header {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--accent-color); /* 顶部橙色线条，像运动服的饰条 */
}
.header-inner {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo a {
    font-size: 1.6rem;
    font-weight: 800; /* 极粗字体 */
    color: var(--primary-color);
    letter-spacing: -0.5px;
    text-transform: uppercase;
    font-style: italic; /* 斜体，增加速度感 */
}

/* Navigation */
.desktop-nav a {
    margin-left: 24px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    position: relative;
}
.desktop-nav a:hover, .desktop-nav a.active {
    color: var(--accent-color);
}
/* 导航下划线动效 */
.desktop-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}
.desktop-nav a:hover::after, .desktop-nav a.active::after {
    width: 100%;
}

/* Mobile Trigger */
.mobile-menu-trigger {
    display: none;
    cursor: pointer;
    color: var(--primary-color);
}

/* Mobile Menu */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #fff;
    z-index: 999;
    padding: 20px;
}
.mobile-menu-header { display: flex; justify-content: flex-end; margin-bottom: 30px; }
.mobile-nav-links a {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    color: var(--primary-color);
}

/* === Main Content === */
.site-main {
    flex: 1;
    padding-top: 40px;
    padding-bottom: 60px;
}

.page-header {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}
.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: -1px;
}
.page-header p {
    color: var(--text-light);
    max-width: 600px;
    margin: 10px auto 0;
}

/* === Grid Post System (核心修改：网格布局) === */
.post-list {
    display: grid;
    /* 自动填充：最小宽度300px，自动换行 */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    display: flex;
    flex-direction: column; /* 确保卡片内容垂直分布 */
    height: 100%; /* 等高卡片 */
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.post-cover-link {
    display: block;
    overflow: hidden; /* 限制图片放大溢出 */
    position: relative;
    padding-top: 60%; /* 固定宽高比 16:9 左右 */
}

.post-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease; /* 图片缩放动画 */
}

.post-card:hover .post-cover-img {
    transform: scale(1.1); /* 鼠标悬停放大 */
}

.post-content {
    padding: 24px;
    flex: 1; /* 撑满剩余空间 */
    display: flex;
    flex-direction: column;
}

.post-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.post-meta .cat {
    color: var(--accent-color);
    margin-right: 10px;
}

.post-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--primary-color);
}
.post-card h2 a:hover { color: var(--accent-color); }

.summary {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
    /* 关键：限制摘要行数，保持卡片整齐 */
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 按钮沉底 */
.read-more {
    margin-top: auto; 
    display: inline-block;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 2px;
}
.read-more:hover {
    color: var(--accent-color);
}

/* 暂无文章 */
.no-content {
    grid-column: 1 / -1; /* 占满整行 */
    text-align: center;
    padding: 60px;
    background: #fff;
    color: var(--text-light);
}

/* === Pagination === */
.pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.btn {
    padding: 10px 25px;
    background: var(--bg-card);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn:hover:not(.disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: #fff;
}
.btn.disabled { opacity: 0.5; cursor: not-allowed; border-color: transparent; }
.pagination .current {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text-light);
}

/* === Single Post / Page === */
.single-post {
    background: var(--bg-card);
    padding: 50px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    max-width: 900px; /* 文章页不需要太宽，保持阅读体验 */
    margin: 0 auto;   /* 居中 */
}
.single-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 30px;
}
.single-header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 15px;
}
.breadcrumb { margin-bottom: 20px; font-size: 0.85rem; color: var(--text-light); }

/* Markdown Content Styling */
.markdown-body { font-size: 1.125rem; color: #374151; line-height: 1.8; }
.markdown-body h2 { 
    margin-top: 2em; 
    margin-bottom: 0.8em; 
    color: var(--primary-color); 
    font-weight: 700;
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
}
.markdown-body h3 { margin-top: 1.5em; color: var(--secondary-color); font-weight: 600; }
.markdown-body p { margin-bottom: 1.6em; }
.markdown-body img { 
    max-width: 100%; 
    border-radius: 4px; 
    box-shadow: var(--shadow-md); 
    margin: 30px auto; 
    display: block; 
}
.markdown-body blockquote {
    background: #fff7ed; /* 极淡的橙色背景 */
    border-left: 4px solid var(--accent-color);
    padding: 15px 20px;
    color: #9a3412;
    font-style: italic;
    margin: 25px 0;
}
.markdown-body table { width: 100%; border-collapse: collapse; margin: 30px 0; font-size: 0.95rem; }
.markdown-body th { background-color: var(--primary-color); color: #fff; padding: 12px; text-align: left; }
.markdown-body td { border: 1px solid #e2e8f0; padding: 12px; }
.markdown-body tr:nth-child(even) { background-color: #f8fafc; }

/* Post Nav (Prev/Next) */
.post-navigation { margin-top: 60px; padding-top: 30px; border-top: 1px solid #eee; }
.nav-links { display: flex; gap: 20px; }
.nav-previous, .nav-next { flex: 1; }
.nav-next { text-align: right; }
.nav-label { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; display: block;}
.nav-links a { font-weight: 700; color: var(--primary-color); font-size: 1.1rem; }
.nav-links a:hover { color: var(--accent-color); }

/* === Footer === */
.site-footer {
    background: var(--primary-color); /* 深色页脚 */
    color: #94a3b8;
    padding: 40px 0;
    text-align: center;
    margin-top: auto;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent-color); }

/* === Responsive === */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-menu-trigger { display: flex; }
    .header-inner { height: 60px; padding: 0 15px; }
    
    .post-list { 
        grid-template-columns: 1fr; /* 手机端强制单列 */
        gap: 20px;
    }
    
    .single-post { padding: 25px; }
    .single-header h1 { font-size: 1.8rem; }
    
    .nav-links { flex-direction: column; }
    .nav-next { text-align: left; }
}