/**
 * ==========================================
 * 前台样式文件 - 全新改版
 * 干净、大气、黑白灰+金色点缀
 * ==========================================
 */

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.8;
    color: #333;
    background: #fafafa;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 全局图片限制，防止溢出 */
img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
}

/* PC端默认隐藏悬浮菜单按钮 */
.floating-menu-btn {
    display: none !important;
}

/* 防止pre、code、table等元素溢出 */
pre, code, table, iframe, embed, object {
    max-width: 100% !important;
    overflow-x: auto !important;
}

/* pre和code特殊处理 */
pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
}

/* 表格响应式 */
table {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    overflow-x: auto;
}

a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #c9a962;
}

/* ==================== 头部悬浮 ==================== */
.header {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #eee;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 2px;
}

.nav a {
    display: inline-block;
    padding: 8px 20px;
    color: #666;
    font-size: 15px;
    margin-left: 5px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav a:hover {
    color: #c9a962;
    background: rgba(201, 169, 98, 0.1);
}

.nav a.active {
    color: #c9a962;
    font-weight: 500;
}

/* ==================== 容器布局 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main {
    padding: 40px 0;
    min-height: calc(100vh - 300px);
}

.content-wrapper {
    display: flex;
    gap: 40px;
}

.content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* ==================== 区块标题 ==================== */
.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1a1a1a;
}

.section-title h2 {
    font-size: 22px;
    color: #1a1a1a;
    font-weight: 600;
    letter-spacing: 1px;
}

.section-title .total {
    margin-left: auto;
    color: #999;
    font-size: 14px;
}

/* ==================== 文章卡片 ==================== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.3s;
    display: flex;
}

.article-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.article-card .card-image {
    width: 280px;
    height: 200px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-width: 100%;
}

.article-card .card-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
}

.article-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card .card-image .placeholder {
    color: #ccc;
    font-size: 14px;
}

.article-card .card-content {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-card .card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-card .card-title a {
    color: #1a1a1a;
}

.article-card .card-title a:hover {
    color: #c9a962;
}

.article-card .card-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
}

.article-card .card-meta span {
    margin-right: 20px;
}

.article-card .card-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .card-tags {
    margin-top: 15px;
}

.article-card .card-tags .tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f5f5f5;
    color: #666;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 8px;
    transition: all 0.3s;
}

.article-card .card-tags .tag:hover {
    background: #c9a962;
    color: #fff;
}

/* ==================== 内容详情页 ==================== */
.article-detail {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.article-detail .article-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.article-detail .article-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 20px;
}

.article-detail .article-meta {
    color: #999;
    font-size: 14px;
}

.article-detail .article-meta span {
    margin: 0 15px;
}

.article-detail .article-featured-image {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    border-radius: 8px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.article-detail .article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    font-size: 16px;
    line-height: 2;
    color: #444;
}

.article-content p {
    margin-bottom: 20px;
    text-indent: 2em;
}

.article-content h2, 
.article-content h3 {
    margin: 30px 0 15px;
    color: #1a1a1a;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
}

/* ==================== 侧边栏组件 ==================== */
.widget {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.widget-title {
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #c9a962;
    font-weight: 600;
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    color: #666;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.category-list a:hover {
    color: #c9a962;
}

.category-list .cat-count {
    color: #999;
}

/* 最新文章列表 */
.latest-articles-list {
    list-style: none;
}

.latest-articles-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.latest-articles-list li:last-child {
    border-bottom: none;
}

.latest-articles-list a {
    color: #666;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-articles-list a:hover {
    color: #c9a962;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud .tag {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f5f5;
    color: #666;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
}

.tag-cloud .tag:hover {
    background: #c9a962;
    color: #fff;
}

.random-list {
    list-style: none;
}

.random-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.random-list li:last-child {
    border-bottom: none;
}

.random-list a {
    color: #666;
    font-size: 14px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.random-list a:hover {
    color: #c9a962;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 18px;
    background: #fff;
    color: #666;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.pagination .current {
    background: #c9a962;
    color: #fff;
    border-color: #c9a962;
}

.pagination .ellipsis {
    display: inline-block;
    padding: 10px 8px;
    color: #999;
    border: none;
    background: none;
}

/* 简化分页样式 */
.page-btn {
    display: inline-block;
    padding: 10px 18px;
    background: #fff;
    color: #666;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
}

.page-btn:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.page-info {
    display: inline-block;
    padding: 10px 16px;
    color: #999;
    font-size: 14px;
}

/* PC端隐藏懒加载按钮（默认隐藏，手机端用CSS显示） */
.lazy-container {
    display: none;
}

.load-more-btn {
    display: none;
    justify-content: center;
    margin-top: 20px;
    cursor: pointer;
}

/* ==================== 面包屑 ==================== */
.breadcrumb {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 14px;
    color: #999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.breadcrumb a {
    color: #666;
}

.breadcrumb a:hover {
    color: #c9a962;
}

/* ==================== 底部 ==================== */
.footer {
    background: #1a1a1a;
    color: #999;
    padding: 50px 0 30px;
    margin-top: 80px;
}

.footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-nav {
    margin-bottom: 20px;
}

.footer-nav a {
    color: #999;
    margin: 0 15px;
    font-size: 14px;
}

.footer-nav a:hover {
    color: #c9a962;
}

.copyright {
    font-size: 13px;
    line-height: 1.8;
}

.copyright a {
    color: #c9a962;
}

/* ==================== 更多文章 ==================== */
.more-link {
    text-align: center;
    margin-top: 50px;
}

.more-link .btn-more {
    display: inline-block;
    padding: 14px 50px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.3s;
}

.more-link .btn-more:hover {
    background: #c9a962;
    color: #fff;
}

/* ==================== 相关文章 ==================== */
.related-articles {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.related-articles h3 {
    font-size: 18px;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.related-articles ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-articles li {
    padding: 15px;
    background: #fafafa;
    border-radius: 6px;
}

.related-articles a {
    color: #666;
    font-size: 14px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-articles a:hover {
    color: #c9a962;
}

/* ==================== 内链区域 ==================== */
.bottom-links {
    margin-top: 40px;
    padding: 30px;
    background: #fafafa;
    border-radius: 8px;
}

.bottom-links h3 {
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.bottom-links a {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    color: #666;
    border-radius: 4px;
    font-size: 14px;
    margin: 5px;
    transition: all 0.3s;
}

.bottom-links a:hover {
    background: #c9a962;
    color: #fff;
}

/* ==================== 空状态 ==================== */
.empty-tip {
    text-align: center;
    color: #999;
    padding: 60px 0;
    font-size: 15px;
}

.empty-tip a {
    color: #c9a962;
}

/* ==================== 响应式基础 ==================== */
@media (max-width: 992px) {
    /* 手机端简化分页样式 */
    .pagination {
        display: flex !important;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination a,
    .pagination span {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 36px;
    }

    .pagination .current {
        background: #c9a962;
        color: #fff;
    }

    .pagination .ellipsis {
        padding: 8px 4px;
    }

    .lazy-container,
    .load-more-btn {
        display: none !important;
    }

    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .article-card {
        flex-direction: column;
    }
    
    .article-card .card-image {
        width: 100%;
        height: 200px;
    }
    
    .related-articles ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 栏目页样式 ==================== */
.category-title {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.category-desc {
    color: #999;
    font-size: 14px;
    margin-bottom: 30px;
}

/* ==================== 图片自适应 ==================== */
.article-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .card-image img {
    transform: scale(1.05);
}

/* 内容页配图自适应 */
.article-detail .article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 文章内容图片自适应 - 使用强选择器覆盖内联样式 */
.article-content img,
.article-content p img,
.article-content div img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    max-height: 500px !important;
    object-fit: cover !important;
    margin: 20px auto !important;
    display: block !important;
    border-radius: 8px !important;
}

/* 确保p标签内的img不会溢出 */
.article-content p {
    overflow: hidden;
    max-width: 100%;
}

/* 侧边栏图片 */
.widget img {
    max-width: 100%;
    height: auto;
}

/* ==================== 手机端导航菜单（桌面隐藏） ==================== */
.menu-toggle {
    display: none;
}

/* ==================== 平板适配 (481px-768px) ==================== */
@media (max-width: 768px) and (min-width: 481px) {
    .article-detail {
        padding: 25px;
    }

    .article-detail .article-title {
        font-size: 24px;
    }

    .article-detail .article-featured-image {
        height: 250px;
    }

    .related-articles ul {
        grid-template-columns: 1fr;
    }

    .article-content img {
        max-height: 350px;
    }
}

/* ==================== 手机端适配 (<768px) ==================== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
        overflow-x: hidden;
    }

    body {
        background: #fafafa;
        overflow-x: hidden;
    }

    /* 确保所有容器不溢出 */
    .container,
    .header-inner,
    .footer .footer-inner {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* 头部 */
    .header {
        position: relative;
    }

    .header-inner {
        flex-wrap: wrap;
        padding: 12px 15px;
        height: auto;
        min-height: 60px;
    }

    /* 手机端：隐藏PC导航，显示悬浮按钮 */
    .nav {
        display: none !important;
        width: 100%;
        flex-direction: column;
        padding: 10px 0 0;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }

    .nav.active {
        display: flex !important;
    }

    .floating-menu-btn {
        display: block !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        background: #1a1a1a;
        color: #fff;
        border-radius: 50%;
        text-align: center;
        line-height: 50px;
        font-size: 14px;
        cursor: pointer;
        z-index: 999;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        transition: all 0.3s;
    }

    .floating-menu-btn:hover,
    .floating-menu-btn.active {
        background: #c9a962;
        transform: scale(1.1);
    }

    .logo {
        flex: 1;
        margin-bottom: 0;
    }

    .logo a {
        font-size: 18px;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: #333;
        position: absolute;
        left: 0;
        transition: all 0.3s;
    }

    .menu-toggle span:nth-child(1) { top: 2px; }
    .menu-toggle span:nth-child(2) { top: 9px; }
    .menu-toggle span:nth-child(3) { top: 16px; }

    .menu-toggle.active span:nth-child(1) {
        top: 9px;
        transform: rotate(45deg);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        top: 9px;
        transform: rotate(-45deg);
    }

    /* 导航链接样式 */
    .nav a {
        margin: 3px 0;
        padding: 10px 15px;
        text-align: center;
        background: #fafafa;
        border-radius: 4px;
        font-size: 14px;
    }

    .nav a:hover {
        background: rgba(201, 169, 98, 0.1);
    }

    /* 容器 */
    .container {
        padding: 0 12px;
    }

    .main {
        padding: 15px 0;
    }

    /* 面包屑 */
    .breadcrumb {
        padding: 10px 15px;
        font-size: 13px;
        margin-bottom: 15px;
    }

    /* 区块标题 */
    .section-title {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .section-title h2 {
        font-size: 18px;
    }

    .section-title .total {
        font-size: 12px;
    }

    /* 文章卡片 */
    .article-card {
        border-radius: 6px;
        margin-bottom: 15px;
    }

    .article-card .card-image {
        height: 160px;
    }

    .article-card .card-content {
        padding: 15px;
    }

    .article-card .card-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .article-card .card-meta {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .article-card .card-excerpt {
        font-size: 13px;
        line-height: 1.6;
        -webkit-line-clamp: 2;
    }

    .article-card .card-tags {
        margin-top: 10px;
    }

    .article-card .card-tags .tag {
        padding: 3px 10px;
        font-size: 11px;
    }

    /* 内容页 */
    .article-detail {
        padding: 20px 15px;
        border-radius: 6px;
    }

    .article-detail .article-header {
        margin-bottom: 25px;
        padding-bottom: 20px;
    }

    .article-detail .article-title {
        font-size: 20px;
        line-height: 1.4;
        margin-bottom: 15px;
    }

    .article-detail .article-meta {
        font-size: 12px;
    }

    .article-detail .article-featured-image {
        height: 180px;
        margin-bottom: 20px;
    }

    .article-content {
        font-size: 15px;
        line-height: 1.8;
    }

    .article-content p {
        margin-bottom: 15px;
        text-indent: 2em;
    }

    .article-content img,
    .article-content p img,
    .article-content div img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 300px !important;
        margin: 15px auto !important;
        border-radius: 6px !important;
        object-fit: cover !important;
    }

    /* 确保手机端所有内容区域不溢出 */
    .article-detail,
    .article-content,
    .article-content p {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    .article-content h2 {
        font-size: 18px;
        margin: 20px 0 10px;
    }

    .article-content h3 {
        font-size: 16px;
        margin: 15px 0 8px;
    }

    /* 标签 */
    .card-tags {
        margin-top: 15px;
    }

    .card-tags .tag {
        padding: 4px 12px;
        font-size: 12px;
    }

    /* 侧边栏 */
    .widget {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 6px;
    }

    .widget-title {
        font-size: 15px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .category-list li {
        padding: 8px 0;
    }

    .category-list a {
        font-size: 13px;
    }

    .tag-cloud .tag {
        padding: 6px 12px;
        font-size: 12px;
    }

    .random-list li {
        padding: 8px 0;
    }

    .random-list a {
        font-size: 13px;
    }

    /* 手机端分页样式 */
    .pagination {
        margin-top: 30px;
        padding-top: 20px;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 36px;
    }

    .pagination .current {
        background: #c9a962;
        color: #fff;
    }

    .pagination .ellipsis {
        padding: 8px 4px;
    }

    .lazy-container,
    .load-more-btn {
        display: none !important;
    }

    /* 相关文章 */
    .related-articles {
        margin-top: 30px;
        padding-top: 20px;
    }

    .related-articles h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .related-articles ul {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .related-articles li {
        padding: 12px;
    }

    .related-articles a {
        font-size: 13px;
    }

    /* 内链 */
    .bottom-links {
        margin-top: 25px;
        padding: 20px;
        border-radius: 6px;
    }

    .bottom-links h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .bottom-links a {
        padding: 6px 12px;
        font-size: 12px;
        margin: 4px;
    }

    /* 更多文章 */
    .more-link {
        margin-top: 30px;
    }

    .more-link .btn-more {
        padding: 12px 30px;
        font-size: 14px;
    }

    /* 底部 */
    .footer {
        padding: 30px 0 20px;
        margin-top: 50px;
    }

    .footer-nav {
        margin-bottom: 15px;
    }

    .footer-nav a {
        margin: 0 6px;
        font-size: 12px;
    }

    .copyright {
        font-size: 12px;
    }

    /* 栏目描述 */
    .category-desc {
        font-size: 13px;
        margin-bottom: 20px;
    }

    /* 空状态 */
    .empty-tip {
        padding: 40px 0;
        font-size: 14px;
    }
}

/* ==================== 首页专属样式 ==================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: box-shadow 0.3s;
}
.site-header.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.site-header .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-header .logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.site-header .logo a {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    letter-spacing: 1px;
}
.site-header .logo .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.site-header .nav a {
    display: inline-block;
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
}
.site-header .nav a:hover,
.site-header .nav a.active {
    color: #c9a962;
}

/* Hero区域 */
.hero {
    padding: 140px 30px 80px;
    text-align: center;
    background: linear-gradient(180deg, #faf9f7 0%, #fff 100%);
}
.hero h1 {
    font-size: 48px;
    font-weight: 300;
    color: #1a1a1a;
    margin-bottom: 20px;
    letter-spacing: 4px;
}
.hero p {
    font-size: 18px;
    color: #888;
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.8;
}
.hero-divider {
    width: 60px;
    height: 3px;
    background: #c9a962;
    margin: 0 auto;
}

/* 主容器 */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px 60px;
}

/* 置顶文章 */
.featured-post {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.06);
}
.featured-post .featured-image {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/10;
}
.featured-post .featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.featured-post:hover .featured-image img {
    transform: scale(1.05);
}
.featured-post .featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.featured-post .featured-label {
    display: inline-block;
    padding: 6px 16px;
    background: #c9a962;
    color: #fff;
    font-size: 12px;
    border-radius: 20px;
    margin-bottom: 20px;
    width: fit-content;
}
.featured-post h2 {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.4;
}
.featured-post h2 a {
    color: inherit;
    text-decoration: none;
}
.featured-post h2 a:hover {
    color: #c9a962;
}
.featured-post .featured-meta {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}
.featured-post .featured-excerpt {
    color: #666;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 24px;
}
.featured-post .read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c9a962;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* 底部推荐 */
.bottom-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}
.random-recommend {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.04);
}
.random-recommend ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.random-recommend li {
    padding: 16px 0;
    border-bottom: 1px dashed #eee;
}
.random-recommend li:last-child {
    border-bottom: none;
}
.random-recommend li a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.random-recommend li a:hover {
    color: #c9a962;
}
.random-recommend li .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f0f0f0;
    color: #999;
    font-size: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* 侧边栏 */
.home-sidebar .widget {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.04);
}
.home-sidebar .widget-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #c9a962;
}
.home-sidebar .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.home-sidebar .tag-cloud a {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
}
.home-sidebar .tag-cloud a:hover {
    background: #c9a962;
    color: #fff;
}

/* 首页响应式 */
@media (max-width: 992px) {
    .featured-post {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bottom-section {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .site-header .header-inner {
        padding: 0 20px;
        height: 60px;
    }
    .site-header .logo a {
        font-size: 20px;
    }
    .hero {
        padding: 120px 20px 50px;
    }
    .hero h1 {
        font-size: 32px;
        letter-spacing: 2px;
    }
    .hero p {
        font-size: 15px;
    }
    .home-container {
        padding: 0 20px 40px;
    }
    .featured-post {
        padding: 24px;
    }
    .featured-post h2 {
        font-size: 22px;
    }
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .article-card .card-content {
        padding: 20px;
    }
    .random-recommend {
        padding: 24px;
    }
    .home-sidebar .widget {
        padding: 24px;
    }
}

/* ==================== 移动端纯CSS菜单（首页） ==================== */
@media (max-width: 768px) {
    .site-header {
        position: relative;
    }
    .menu-toggle {
        display: block;
        width: 36px;
        height: 36px;
        border: none;
        background: transparent;
        cursor: pointer;
        padding: 6px;
        border-radius: 4px;
        position: relative;
    }
    .menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: #333;
        position: absolute;
        left: 6px;
        transition: all 0.3s;
    }
    .menu-toggle span:nth-child(1) { top: 8px; }
    .menu-toggle span:nth-child(2) { top: 15px; }
    .menu-toggle span:nth-child(3) { top: 22px; }
    .site-header .nav {
        display: none;
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }
    .site-header .nav a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    #menuToggle:checked ~ .nav {
        display: block !important;
    }
    #menuToggle:checked ~ .menu-toggle span:nth-child(1) {
        top: 15px;
        transform: rotate(45deg);
    }
    #menuToggle:checked ~ .menu-toggle span:nth-child(2) {
        opacity: 0;
    }
    #menuToggle:checked ~ .menu-toggle span:nth-child(3) {
        top: 15px;
        transform: rotate(-45deg);
    }
}

/* ==================== 平板横屏 (769px-1024px) ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .widget {
        margin-bottom: 0;
    }

    .article-card {
        flex-direction: row;
    }

    .article-card .card-image {
        width: 250px;
        height: 180px;
    }

    /* 平板横屏：导航横向显示 */
    .nav {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        width: auto;
        padding: 0;
        border: none;
        margin: 0;
    }

    .nav.active {
        display: flex !important;
    }

    .menu-toggle {
        display: none !important;
    }

    .floating-menu-btn {
        display: none !important;
    }
}

/* ==================== 图片性能优化 ==================== */

/* 图片加载占位背景（减少视觉抖动） */
.card-image,
.article-featured-image,
.featured-image {
    background: linear-gradient(135deg, #f0ebe4 0%, #e8e0d5 50%, #f5f0e8 100%);
    position: relative;
}

/* 图片加载占位动画 */
.card-image img[loading="lazy"],
.article-featured-image img[loading="lazy"],
.featured-image img[loading="lazy"],
.content-img {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.card-image img[loading="lazy"].loaded,
.article-featured-image img[loading="lazy"].loaded,
.featured-image img[loading="lazy"].loaded,
.content-img.loaded {
    opacity: 1;
}

/* 首屏图片立即加载 */
.card-image img:first-of-type,
.article-featured-image img:first-of-type,
.featured-image img:first-of-type {
    opacity: 1;
}

/* 文章内容图片容器 */
.img-wrapper {
    position: relative;
    background: linear-gradient(135deg, #f0ebe4 0%, #e8e0d5 100%);
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.img-wrapper img {
    display: block;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
}

/* 图片懒加载占位符（渐变背景） */
img[data-src] {
    background: linear-gradient(90deg, #f0ebe4 25%, #e8e0d5 50%, #f0ebe4 75%) !important;
    background-size: 200% 100% !important;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 禁用懒加载时的过渡效果 */
img:not([loading="lazy"]) {
    transition: none !important;
}

/* 图片最大尺寸限制，防止大图加载慢 */
.article-content img {
    max-height: 500px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .article-content img {
        max-height: 300px;
    }
}
