/* ==========================================
   Bonfire Comics Theme - 主样式文件
   ========================================== */

/* CSS 变量 */
:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-100: #f5f5f5;
    --color-gray-200: #eeeeee;
    --color-gray-300: #e0e0e0;
    --color-gray-400: #bdbdbd;
    --color-gray-500: #9e9e9e;
    --color-gray-600: #757575;
    --color-gray-700: #616161;
    --color-gray-800: #424242;
    --color-gray-900: #212121;
    --color-primary: #FF1A75;
    --color-accent: #ff6b6b;

    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;

    --header-height: 55px;
    --content-width: 1200px;
    --post-width: 780px;
    --sidebar-width: 300px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--color-gray-900);
    background-color: var(--color-gray-100);
    line-height: 1.6;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   导航栏
   ========================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-black);
    z-index: 1000;
}

.header-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.site-brand {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-white);
    transition: all 0.3s;
}

.site-nav {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.nav-menu,
.site-nav .nav {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.nav-menu a,
.site-nav .nav a {
    display: block;
    padding: 8px 12px;
    color: var(--color-gray-300);
    font-size: 14px;
    transition: color 0.2s;
}

.nav-menu a:hover,
.site-nav .nav a:hover {
    color: var(--color-white);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-links a {
    color: var(--color-gray-400);
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--color-white);
}

.search-toggle {
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.search-toggle:hover {
    color: var(--color-white);
}

/* ==========================================
   主内容区 - 首页
   ========================================== */
.site-main {
    min-height: calc(100vh - var(--header-height));
}

/* 首页特殊处理 */
.home-template .site-main {
    margin-top: 0;
}

/* 首页英雄区域 - 大封面图 */
.home-hero {
    position: relative;
    width: 100%;
    height: 66.67vh;
    min-height: 450px;
    max-height: 700px;
    margin-top: var(--header-height);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}

.home-container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 30px 20px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    padding: 60px 20px;
    color: var(--color-white);
    max-width: var(--content-width);
    margin: 0 auto;
    width: 100%;
}

.hero-label {
    display: inline-block;
    padding: 6px 16px;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-excerpt {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 25px;
    opacity: 0.9;
}

.hero-link {
    display: inline-block;
    padding: 12px 24px;
    background: var(--color-white);
    color: var(--color-black);
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s;
}

.hero-link:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* 分类标签 */
.category-tabs {
    padding: 20px 0;
    border-bottom: 2px solid var(--color-black);
    margin-bottom: 30px;
}

.tabs-inner {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--color-gray-700);
    border-right: 1px solid var(--color-gray-400);
    transition: all 0.2s;
}

.tab:last-child {
    border-right: none;
}

.tab:hover,
.tab.active {
    color: var(--color-black);
    font-weight: 500;
}

/* 内容布局 */
.content-wrapper {
    display: flex;
    gap: 40px;
}

.posts-section {
    flex: 1;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 文章卡片 */
.post-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-bottom: 2px solid var(--color-black);
    border-right: 2px solid var(--color-black);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

.post-card-link {
    display: flex;
}

.post-card-image {
    width: 300px;
    min-height: 180px;
    flex-shrink: 0;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-image-placeholder {
    background: linear-gradient(135deg, var(--color-gray-200), var(--color-gray-300));
}

.post-card-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-card-tags {
    margin-bottom: 8px;
}

.post-card-tags .tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

.post-card-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--color-black);
}

.post-card-meta {
    font-size: 13px;
    color: var(--color-gray-500);
}

.post-card-meta time {
    display: block;
    margin-bottom: 5px;
}

.post-card-excerpt {
    color: var(--color-gray-600);
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.sidebar-section {
    background: var(--color-white);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--color-gray-300);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-black);
}

/* 热门文章 */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-post a {
    display: flex;
    gap: 12px;
}

.popular-post-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    overflow: hidden;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content {
    flex: 1;
}

.popular-post-content h4 {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 5px;
    color: var(--color-gray-900);
}

.popular-post-content time {
    font-size: 12px;
    color: var(--color-gray-500);
}

/* 订阅框 */
.newsletter-section {
    background: var(--color-black);
    color: var(--color-white);
}

.newsletter-section h3 {
    color: var(--color-white);
    border-bottom-color: var(--color-gray-700);
}

.newsletter-section p {
    font-size: 14px;
    margin-bottom: 15px;
    color: var(--color-gray-300);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input {
    padding: 10px 12px;
    border: 1px solid var(--color-gray-700);
    background: var(--color-gray-900);
    color: var(--color-white);
    font-size: 14px;
}

.newsletter-form input::placeholder {
    color: var(--color-gray-500);
}

.newsletter-form button {
    padding: 10px 12px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: #e01565;
}

/* ==========================================
   文章页
   ========================================== */
.post-page {
    background: var(--color-gray-100);
}

/* 特色图片头部 */
.post-header {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    margin-top: var(--header-height);
}

.featured-image-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

.featured-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

/* 文章内容区 */
.post-content-wrapper {
    position: relative;
    z-index: 10;
    margin-top: -120px;
    background: transparent;
}

.post-content {
    max-width: var(--post-width);
    margin: 0 auto;
    padding: 0;
}

/* 标题卡片 */
.post-header-card {
    margin-bottom: 0;
    position: relative;
    z-index: 10;
}

.post-header-inner {
    background: var(--color-white);
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.post-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.post-tags .tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    transition: all 0.2s;
}

.post-tags .tag:hover {
    background: var(--color-gray-200);
}

.post-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    color: var(--color-black);
}

.post-excerpt {
    font-size: 18px;
    color: var(--color-gray-600);
    font-weight: 400;
    font-style: italic;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--color-gray-500);
}

.post-meta .author a {
    color: var(--color-black);
    font-weight: 500;
}

/* 正文样式 */
.post-body {
    padding: 40px;
    background: var(--color-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.post-body h2 {
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.post-body h3 {
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.post-body p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.post-body img {
    margin: 30px auto;
    max-width: 100%;
}

.post-body figure {
    margin: 30px 0;
}

.post-body figcaption {
    font-size: 14px;
    color: var(--color-gray-500);
    text-align: center;
    margin-top: 10px;
}

.post-body blockquote {
    padding: 20px 30px;
    margin: 30px 0;
    background: var(--color-gray-100);
    border-left: 4px solid var(--color-black);
    font-style: italic;
}

.post-body blockquote p {
    margin-bottom: 0;
    font-size: 18px;
}

.post-body ul,
.post-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.post-body li {
    margin-bottom: 10px;
}

.post-body pre {
    background: var(--color-gray-900);
    color: var(--color-gray-100);
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.post-body code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
}

/* 作者信息框 */
.author-box {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: var(--color-gray-100);
    margin-bottom: 40px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.author-info p {
    font-size: 14px;
    color: var(--color-gray-600);
    margin-bottom: 0;
}

/* 相关文章 */
.related-posts {
    margin-bottom: 50px;
}

.related-posts h3 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-black);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-post a {
    display: block;
}

.related-post-image {
    height: 120px;
    overflow: hidden;
    margin-bottom: 10px;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-post:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post h4 {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* ==========================================
   页脚
   ========================================== */
.site-footer {
    background: var(--color-black);
    color: var(--color-gray-400);
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-content p:last-child {
    margin-bottom: 0;
}

/* ==========================================
   分页
   ========================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 40px 0;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    font-size: 14px;
}

.pagination a:hover {
    background: var(--color-gray-100);
}

.pagination .active {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

/* ==========================================
   响应式
   ========================================== */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-black);
        padding: 20px;
    }

    .site-nav.open {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-menu a {
        padding: 12px 0;
        border-bottom: 1px solid var(--color-gray-800);
    }

    .post-card-link {
        flex-direction: column;
    }

    .post-card-image {
        width: 100%;
        height: 200px;
    }

    .post-title {
        font-size: 24px;
    }

    .post-header {
        height: 40vh;
        min-height: 250px;
    }

    .post-header-card {
        margin-top: -60px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .social-links {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 15px;
    }

    .logo-img {
        height: 28px;
    }

    .post-card-title {
        font-size: 18px;
    }

    .post-content {
        padding: 0 15px;
    }

    .post-header-inner {
        padding: 20px;
    }
}

/* ==========================================
   图片灯箱
   ========================================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 文章图片样式 */
.post-body img {
    cursor: zoom-in;
    transition: transform 0.2s;
}

.post-body img:hover {
    transform: scale(1.01);
}

/* 公安备案样式 */
.footer-content .beian {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.footer-content .beian img {
    width: 18px;
    height: 18px;
}

.footer-content .beian a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
}

.footer-content .beian a:hover {
    color: #fff;
}
