/* TxtPress 核心样式表
   Theme: Kaiyuan Modern (Premium Gaming Grid)
   Design: Grid Layout, High Contrast, Red/Gold/Black
   Compatible: TxtPress v30 (Image Tag Support)
*/

:root {
    /* === 核心配色：黑金红 === */
    --primary-color: #1a1a1a;      /* 深邃黑：用于标题、页头背景 */
    --accent-color: #c0392b;       /* 幸运红：用于强调、按钮、Hover */
    --gold-color: #d4af37;         /* 香槟金：用于细节点缀 */
    --text-color: #333333;         /* 正文黑 */
    --text-light: #666666;         /* 辅助灰 */
    
    --bg-body: #f5f7fa;            /* 浅灰背景，突出卡片 */
    --bg-white: #ffffff;
    
    --border-color: #eaeaea;
    --container-width: 1100px;     
    
    --spacing-md: 20px;
    --spacing-lg: 40px;
    --radius: 8px;                 
    
    /* 阴影效果 */
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 30px rgba(192, 57, 43, 0.15); 
}

/* === 全局重置 === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
a:hover { color: var(--accent-color); }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

/* === Header Layout (黑金风格) === */
.site-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    color: #fff;
}
.header-inner {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo a {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}
.logo a::before {
    content: '♠';
    color: var(--gold-color);
    margin-right: 8px;
    font-size: 1.2rem;
}

/* === Desktop Navigation === */
.desktop-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap; 
    justify-content: flex-end;
}
.desktop-nav a {
    margin-left: 25px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 5px;
}
.desktop-nav a:hover,
.desktop-nav a.active {
    color: #fff;
}
.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold-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: #fff;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* === Mobile Menu Overlay === */
.mobile-menu-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 999; 
    padding: 20px;
    overflow-y: auto;
}
.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
.close-btn {
    font-size: 1rem;
    padding: 8px 15px;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.mobile-nav-links {
    display: flex;
    flex-direction: column;
}
.mobile-nav-links a {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}
.mobile-nav-links a:last-child { border-bottom: none; }

/* === Main Content === */
.site-main {
    flex: 1;
    padding-top: var(--spacing-lg);
    padding-bottom: 60px;
}

.page-header {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}
.page-header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: -0.5px;
}
.page-header h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* === Post List (Grid Layout) === */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    border: 1px solid transparent; 
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(212, 175, 55, 0.3); /* 淡金色边框 */
}

/* === 修正：适配 <img> 标签的封面图 === */
.post-cover-link { 
    display: block; 
    overflow: hidden;
    height: 200px; /* 固定高度，确保网格整齐 */
    position: relative;
}
.post-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 裁剪图片以填满容器，不变形 */
    transition: transform 0.5s ease;
    display: block;
}
.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;
    color: var(--text-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.post-meta .cat {
    background: rgba(192, 57, 43, 0.1);
    color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}
.post-card h2 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    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.9rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1; 
}

/* 阅读更多按钮化 */
.read-more {
    display: block;
    text-align: center;
    background-color: var(--bg-body);
    color: var(--text-color);
    padding: 10px 0;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.post-card:hover .read-more {
    background-color: var(--accent-color);
    color: #fff;
}

.no-content {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    background: var(--bg-white);
}

/* === Pagination === */
.pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn {
    display: inline-block;
    padding: 10px 25px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 50px; 
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s;
}
.btn:hover:not(.disabled) {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(192, 57, 43, 0.3);
}
.btn.disabled { opacity: 0.5; cursor: not-allowed; background: #eee; }
.pagination .current { 
    font-size: 0.9rem; 
    color: var(--text-light); 
    margin: 0 10px;
}

/* === Single Post & Markdown === */
.single-post {
    background: var(--bg-white);
    padding: 50px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.single-header {
    text-align: center;
    margin-bottom: 50px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
}

/* === Breadcrumbs (面包屑) === */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 25px;
    font-weight: 500;
    display: inline-block;
    line-height: 1.5;
}
.breadcrumb a {
    color: var(--text-light);
    position: relative;
    transition: color 0.2s;
}
.breadcrumb a:hover {
    color: var(--accent-color);
}
.breadcrumb .sep {
    margin: 0 10px;
    color: #ddd;
    font-size: 0.8rem;
}
.breadcrumb span:not(.sep) {
    color: var(--primary-color);
    font-weight: 700;
    cursor: default;
}

.single-header h1 {
    font-size: 2.4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.single-header .meta {
    color: var(--text-light);
    font-size: 0.9rem;
}
.single-header .cat-link {
    color: var(--accent-color);
    font-weight: 700;
}

/* Post Navigation */
.post-navigation {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}
.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
.nav-previous, .nav-next { 
    flex: 1; 
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.3s;
}
.nav-previous:hover, .nav-next:hover {
    border-color: var(--accent-color);
    background: rgba(192, 57, 43, 0.02);
}
.nav-next { text-align: right; }
.nav-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.nav-links a {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Markdown Typrography */
.markdown-body { font-size: 1.1rem; color: #2c3e50; line-height: 1.9; }
.markdown-body h2 { 
    margin-top: 1.5em; 
    margin-bottom: 0.8em; 
    color: var(--primary-color);
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
}
.markdown-body p { margin-bottom: 1.5em; }
.markdown-body img { max-width: 100%; border-radius: 4px; display: block; margin: 30px auto; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.markdown-body blockquote {
    border-left: 4px solid var(--gold-color);
    background: #fff9e6; /* 淡金色背景 */
    padding: 15px 20px;
    margin: 20px 0;
    color: #555;
}
.markdown-body pre {
    background: #2d3436;
    color: #dfe6e9;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 25px;
}
.markdown-body code { 
    background: #fdf0ed; /* 淡红色背景 */
    color: var(--accent-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, monospace; 
}

/* === Footer === */
.site-footer {
    background: #1a1a1a; 
    padding: 40px 0;
    text-align: center;
    color: #888;
    border-top: none;
    margin-top: auto;
}
.site-footer a { color: #aaa; }
.site-footer a:hover { color: #fff; }

/* === Responsive Rules === */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-menu-trigger { display: flex; }
    .header-inner { padding: 0 15px; }
    .logo { flex: 1; }
    
    .post-list {
        grid-template-columns: 1fr; /* 移动端单列 */
        gap: 20px;
    }
    
    /* 修正移动端图片高度 */
    .post-cover-link { height: 200px; }
    
    .single-post { padding: 25px; }
    .single-header h1 { font-size: 1.8rem; }
    
    .breadcrumb {
        margin-bottom: 15px;
        font-size: 0.8rem;
        white-space: nowrap; 
        overflow-x: auto; 
        max-width: 100%;
        display: block;
    }
    
    .nav-links { flex-direction: column; }
    .nav-next { text-align: left; }
}