/* ========== 全局变量定义 ========== */
:root {
    --primary: #2c3e50;
    --primary-light: #3498db;
    --accent: #e74c3c;
    --accent-light: #e67e22;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --medium: #bdc3c7;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* ========== 基础重置与全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 24px;
}

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

/* ========== 图片响应式处理 - 核心修复 ========== */
img {
    max-width: 100%; /* 确保图片不会溢出容器 */
    height: auto;    /* 保持原始宽高比 */
    display: block;  /* 消除图片下方间隙 */
}

.post-image, 
.slider-image,
.article-image,
.article-detail .article-image {
    border-radius: var(--radius); /* 统一圆角 */
    box-shadow: var(--shadow-md); /* 统一阴影 */
}

/* ========== 文章详情页图片特殊处理 ========== */
.article-detail .article-image {
    width: 100%;
    max-height: 400px; /* 最大高度限制 */
    object-fit: cover;  /* 图片填充方式 */
    margin-bottom: 30px;
    object-position: center; /* 图片居中显示 */
}

/* ========== 正文内容图片 ========== */
.article-content img {
    margin: 0 auto 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ========== 导航栏样式 ========== */
.navbar {
    position: sticky;
    top: 0;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    transition: var(--transition);
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-link {
    font-weight: 500;
    color: var(--dark);
    position: relative;
    padding: 8px 0;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--accent);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #e74c3c;
}

/* ========== 面包屑导航 ========== */
.breadcrumb-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin: 20px 0 5px;
    padding: 15px 20px;
}

.breadcrumb {
    font-size: 15px;
    color: #666;
}

.breadcrumb a {
    color: var(--primary);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb span {
    color: var(--accent);
    font-weight: 500;
}

/* ========== 推荐文章卡片 ========== */
.featured-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.posts-grid {
    display: grid;
    gap: 20px;
}

.post-item {
    display: flex;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    padding: 12px;
    border-radius: 8px;
    background: #f7feff;
}

.post-item:hover {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.post-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.post-content {
    flex: 1;
}

.post-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    transition: var(--transition);
    color: var(--primary);
}

.post-item:hover .post-title {
    color: var(--accent);
}

.post-date {
    font-size: 13px;
    color: #777777;
}

/* ========== 首页特有样式 ========== */
.hero-section {
    padding: 20px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.slider {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.slider-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(44, 62, 80, 0.8));
    z-index: 2;
}

.slider-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 16px;
}

.slider-title a {
    color: inherit;
    text-decoration: none;
}

.slider-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background-color: var(--accent);
    color: var(--white);
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.slider-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.slider-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.slider-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: var(--transition);
}

.slider-indicator.active {
    background-color: var(--accent);
    transform: scale(1.1);
}

/* ========== 列表页样式 ========== */
.articles-section {
    display: grid;
    gap: 24px;
}

.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.article-image-container {
    padding: 20px;
    flex: 0 0 35%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.article-content {
    padding: 20px 5px;
    flex: 1;
}

.article-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--dark);
}

.article-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.article-title a:hover {
    color: var(--accent);
}

.article-excerpt {
    color: #666;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.7;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #888;
}

.article-tag {
    padding: 4px 12px;
    border-radius: 20px;
    background-color: var(--light);
    color: var(--dark);
    font-size: 13px;
}

.pagination {
    display: flex;
    justify-content: center;
    margin: 40px 0 30px;
    gap: 8px;
    font-size: 15px;
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.page-numbers:hover:not(.dots, .current) {
    background-color: var(--primary-light);
    color: var(--white);
    transform: translateY(-2px);
}

.current {
    background-color: var(--accent);
    color: var(--white);
    font-weight: 600;
}

/* ========== 文章详情页 ========== */
.article-detail {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 30px;
}

.article-header {
    margin-bottom: 30px;
    text-align: center;
}

.article-detail .article-title {
    font-size: 25px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
    line-height: 1.3;
}

.article-detail .article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #777;
    font-size: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.article-detail .article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
}

.article-content p {
    margin-bottom: 25px;
}

.article-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 35px 0 20px;
    color: var(--primary);
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 15px 0 15px;
    color: var(--primary);
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(231, 76, 60, 0.05);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article-detail .article-content {
    padding: 0 0px;  /* 将左右内边距设为1px */
}

/* 上一篇/下一篇导航 */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin: 40px 0 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 45%;
    padding: 15px;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-item:hover {
    background-color: rgba(236, 240, 241, 0.5);
}

.nav-item.prev {
    text-align: left;
}

.nav-item.next {
    text-align: right;
    flex-direction: row-reverse;
    margin-left: auto;
}

.nav-arrow {
    font-size: 24px;
    color: var(--accent);
}

.nav-text {
    font-size: 14px;
    color: #777;
}

.nav-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--dark);
    transition: var(--transition);
}

.nav-item:hover .nav-title {
    color: var(--accent);
}

/* 相关文章 */
.related-articles {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 10px;
    margin-bottom: 20px;
}

.related-articles .section-title {
    font-size: 22px;
}

.related-list {
    display: grid;
    gap: 15px;
}

.related-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    transition: var(--transition);
}

.related-item:hover .related-title {
    color: var(--accent);
}

.related-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    transition: var(--transition);
    flex: 1;
}

.related-date {
    font-size: 14px;
    color: #777;
    margin-left: 15px;
    min-width: 90px;
    text-align: right;
}

/* ========== 内容布局 ========== */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding-top: 20px;
    padding-bottom: 40px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ========== 页脚 ========== */
footer {
    background: linear-gradient(to right, var(--primary), #34495e);
    color: var(--white);
    padding: 28px 0;
    text-align: center;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--accent-light));
}

/* ========== 友情链接样式 ========== */
.links-section {
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0 auto;  /* 居中对齐 */
    max-width: 1380px; /* 与网站容器一致 */
    margin-bottom: 20px;
}

.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    justify-content: flex-start; /* 左对齐 */
}

.link-item {
    padding: 6px 16px;
    color: var(--primary);
    border-radius: 4px;
    font-size: 15px;
    background: #f5f7fa;
    transition: var(--transition);
    border: 1px solid #e0e6ed;
    display: inline-block;
    height: auto;
    line-height: 1.6;
    flex-grow: 0;
}

.link-item:hover {
    background: #edf2f7;
    border-color: var(--primary-light);
    transform: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}


.copyright {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .hero-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .slider {
        height: 350px;
    }
    
    .article-card {
        flex-direction: column;
    }
    
    .article-image-container {
        flex: 0 0 auto;
        padding: 15px 15px 0;
    }
    
    .article-content {
        padding: 0 15px 15px;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 75px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        box-shadow: var(--shadow-md);
        padding: 16px 0;
    }
}

@media (max-width: 768px) {
    .nav-links.active {
        display: flex;
    }
    
    .nav-link {
        padding: 15px 24px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .menu-toggle {
        display: block;
    }
    
    .slider {
        height: 280px;
    }
    
    .article-detail .article-image {
        max-height: 250px; /* 移动端调整最大高度 */
    }
    
    .article-content img {
        margin: 0 auto 15px;
    }
    
    .pagination .prev, .pagination .next {
        padding: 0 10px;
        font-size: 14px;
    }
    
    .pagination .page-numbers {
        font-size: 14px;
    }
    
    .article-image-container {
        padding: 10px 10px 0;
    }
    
    .article-content {
        padding: 0 10px 10px;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-item, .nav-item.next {
        max-width: 100%;
        text-align: left;
        flex-direction: row;
        margin-left: 0;
    }
    
    .nav-item.next {
        text-align: left !important;
        margin-left: 0 !important;
    }
    
    .article-detail .article-meta {
        gap: 10px;
    }
    
    .related-item {
        background: transparent;
        padding: 12px 0;
    }
}

/* 唯一容器类名，防止样式冲突 */
.wp-resource-download-frame {
    width: 100%; /* 关键：占满父容器宽度 */
    max-width: 100%; /* 防止超出父容器 */
    margin: 30px auto 0; /* 底部留空，居中显示 */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    padding: clamp(20px, 3vw, 25px); /* 响应式内边距（手机20px，电脑25px） */
    border: 1px solid #e1e8ed;
    transition: transform 0.3s ease;
}

/* 鼠标悬停时轻微上浮 */
.wp-resource-download-frame:hover {
    transform: translateY(-5px);
}

/* 标题区域 */
.wp-download-header {
    margin-bottom: clamp(15px, 2vw, 20px); /* 响应式间距 */
}

.wp-download-title {
    font-size: clamp(18px, 2.5vw, 20px); /* 响应式字体大小（手机18px，电脑20px） */
    color: #2c3e50;
    font-weight: 600;
    padding-bottom: clamp(12px, 1.5vw, 15px); /* 响应式下内边距 */
    position: relative;
    margin: 0;
}

/* 标题下划线（渐变双线） */
.wp-download-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, rgba(52, 152, 219, 0.3), rgba(155, 89, 182, 0.3));
}

.wp-download-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #3388FF, #5F35B2);
    border-radius: 2px;
    z-index: 2;
}

/* 网盘按钮网格布局 */
.wp-pan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(100px, 15vw, 120px), 1fr)); /* 按钮最小宽度自适应 */
    gap: clamp(12px, 1.5vw, 15px); /* 按钮间距自适应 */
    justify-content: center;
}

/* 单个网盘按钮 */
.wp-pan-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(40px, 5vw, 45px); /* 按钮高度自适应 */
    text-decoration: none !important;
    border-radius: 8px;
    font-size: clamp(14px, 1.8vw, 16px); /* 字体大小自适应 */
    color: #fff;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    padding: 0 clamp(8px, 1vw, 10px); /* 内边距自适应 */
}

/* 按钮悬停光效 */
.wp-pan-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transform: translateX(-100%) skew(-15deg);
    transition: all 0.4s ease;
}

.wp-pan-btn:hover::before {
    opacity: 1;
    transform: translateX(250%) skew(-15deg);
}

/* 悬停时按钮上浮+阴影加深 */
.wp-pan-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 点击时按钮下沉 */
.wp-pan-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

/* 各网盘品牌色（渐变背景） */
.wp-pan-baidu { background: linear-gradient(135deg, #3388FF, #2962FF); }
.wp-pan-quark { background: linear-gradient(135deg, #5F35B2, #7B1FA2); }
.wp-pan-tianyi { background: linear-gradient(135deg, #0085D0, #0288D1); }
.wp-pan-ali { background: linear-gradient(135deg, #FF6A00, #F57C00); }