/* TxtPress Theme: Mingsheng Sports
   Style: Modern Grid, Energetic, Clean
   Version: Fixed Image Overflow
*/

:root {
    /* --- 品牌配色 --- */
    --primary-color: #1a253a;   /* 深午夜蓝：专业背景 */
    --secondary-color: #2c3e50; /* 次级文字色 */
    --accent-color: #ff6b00;    /* 活力橙：强调运动感 */
    --accent-hover: #e65100;    /* 深橙色：悬停状态 */
    
    /* --- 背景与边框 --- */
    --bg-body: #f0f2f5;         /* 浅灰背景，突出内容 */
    --bg-white: #ffffff;
    --border-color: #eaedf1;
    
    /* --- 尺寸与排版 --- */
    --container-width: 1100px;  /* 加宽容器以适应网格 */
    --radius-sm: 4px;
    --radius-md: 8px;
    
    /* --- 阴影效果 --- */
    --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 12px 24px rgba(0,0,0,0.12);
}

/* === 全局重置与排版 === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--secondary-color);
    line-height: 1.7;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
a:hover { color: var(--accent-color); }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* === 顶部导航 (Header) === */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo 样式 - 更具品牌感 */
.logo a {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    text-transform: uppercase;
    font-style: italic; /* 运动品牌常用的倾斜感 */
}
.logo a::after {
    content: '.';
    color: var(--accent-color);
    font-size: 2rem;
    line-height: 0;
}

/* 桌面导航 */
.desktop-nav {
    display: flex;
    gap: 30px;
}
.desktop-nav a {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
}
.desktop-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}
.desktop-nav a:hover::after,
.desktop-nav a.active::after {
    width: 100%;
}
.desktop-nav a.active { color: var(--accent-color); }

/* === 移动端菜单逻辑 === */
.mobile-menu-trigger {
    display: none; 
    cursor: pointer;
    color: var(--primary-color);
    padding: 10px;
}
.mobile-menu-overlay {
    display: none; 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    z-index: 999; 
    padding: 20px;
}
.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}
.close-btn {
    font-size: 1rem;
    padding: 10px 20px;
    background: var(--bg-body);
    border-radius: 20px;
    font-weight: 600;
    color: var(--primary-color);
}
.mobile-nav-links { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.mobile-nav-links a {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* === 主内容区域 === */
.site-main {
    flex: 1;
    padding: 40px 0 60px;
}

.page-header {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}
.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    display: inline-block;
    margin-bottom: 10px;
}
.page-header p {
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* === 文章列表 (Grid Layout) === */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid transparent;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0,0,0,0.05);
}

/* 封面图容器 */
.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.05);
}

/* 卡片内容 */
.post-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    font-size: 0.8rem;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.post-meta .cat {
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.post-meta .date { color: #999; }

.post-card h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    line-height: 1.4;
    font-weight: 700;
}
.post-card h2 a { color: var(--primary-color); }
.post-card h2 a:hover { color: var(--accent-color); }

.summary {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: auto;
    border-bottom: 2px solid transparent;
}
.post-card:hover .read-more {
    border-bottom-color: var(--accent-color);
}

.no-content { grid-column: 1 / -1; text-align: center; padding: 50px; }

/* === 翻页按钮 === */
.pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.btn {
    padding: 10px 25px;
    background: var(--bg-white);
    border: 1px solid #ddd;
    border-radius: 50px;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.2s;
}
.btn:hover:not(.disabled) {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 107, 0, 0.3);
}
.btn.disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .current {
    display: flex;
    align-items: center;
    color: #888;
    font-size: 0.9rem;
    margin: 0 15px;
}

/* === 单篇文章 & Markdown === */
.single-post {
    background: var(--bg-white);
    padding: 50px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    max-width: 900px;
    margin: 0 auto;
}

.single-header {
    text-align: center;
    margin-bottom: 50px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 40px;
}
.single-header .meta {
    color: #888;
    margin-bottom: 15px;
    font-size: 0.9rem;
}
.single-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    line-height: 1.25;
}

/* 面包屑优化 */
.breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 20px;
    color: #999;
}
.breadcrumb a:hover { color: var(--accent-color); text-decoration: none; }

/* 正文排版 */
.markdown-body {
    font-size: 1.125rem;
    color: #333;
    overflow-wrap: break-word; /* 确保长文本换行 */
}
.markdown-body h2 {
    font-size: 1.8rem;
    margin-top: 2em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-body);
    color: var(--primary-color);
}
.markdown-body h3 {
    font-size: 1.5rem;
    margin-top: 1.5em;
    color: var(--primary-color);
}
.markdown-body blockquote {
    border-left: 5px solid var(--accent-color);
    background: #fff8f2;
    color: #555;
    font-style: italic;
    padding: 20px;
    margin: 30px 0;
}

/* [修复] 文章图片样式 */
.markdown-body img {
    max-width: 100%; /* 核心修复：限制最大宽度 */
    height: auto;    /* 保持比例 */
    display: block;  /* 独占一行 */
    margin: 30px auto; /* 居中并增加间距 */
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.markdown-body ul, .markdown-body ol { margin-left: 20px; margin-bottom: 20px; }
.markdown-body li { margin-bottom: 10px; }
.markdown-body p { margin-bottom: 1.5em; }
.markdown-body pre {
    background: #1a253a; /* 深色代码背景 */
    color: #e0e6ed;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 30px 0;
}
.markdown-body :not(pre) > code {
    background: #f0f2f5;
    color: var(--accent-color);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* 文章底部导航 */
.post-navigation {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}
.nav-links { display: flex; justify-content: space-between; gap: 20px; }
.nav-next { text-align: right; }
.nav-links a {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}
.nav-label {
    display: block;
    color: var(--accent-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

/* === Footer === */
.site-footer {
    background: #151e2e;
    color: #8b9bb4;
    padding: 50px 0;
    margin-top: auto;
    font-size: 0.9rem;
    text-align: center;
}
.site-footer a { color: #fff; border-bottom: 1px dotted #555; }
.site-footer a:hover { color: var(--accent-color); border-bottom-style: solid; }

/* === 响应式调整 === */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-menu-trigger { display: flex; }
    .post-list { grid-template-columns: 1fr; }
    
    .single-post { padding: 25px; }
    .single-header h1 { font-size: 1.8rem; }
    
    .header-inner { height: 60px; }
    .post-cover-link { padding-top: 55%; }
    .nav-links { flex-direction: column; }
    .nav-next { text-align: left; }
}