/* 
 * 一条长河网 - 编程博客文章精选经典问答
 * 甜品复古风样式表
 * 配色：浅棕 + 奶白 + 浅黄
 */

/* CSS Reset & 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: #FDF6E3; /* 奶白色背景 */
    color: #5D4E37; /* 深棕色文字 */
    line-height: 1.8;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 左侧固定导航栏 */
.sidebar-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #D4A574 0%, #C9956C 100%); /* 浅棕渐变 */
    padding: 40px 20px;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(93, 78, 55, 0.15);
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #FDF6E3;
    border-radius: 3px;
}

.nav-logo {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #FDF6E3;
}

.nav-logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 3px solid #FDF6E3;
    object-fit: cover;
}

.nav-logo h1 {
    font-size: 22px;
    color: #FDF6E3;
    font-weight: bold;
    letter-spacing: 2px;
}

.nav-logo p {
    font-size: 12px;
    color: #FFF8E7;
    margin-top: 8px;
}

.nav-menu {
    margin-top: 30px;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-menu a {
    display: block;
    padding: 14px 18px;
    color: #FDF6E3;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #FDF6E3;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-menu a:hover::before,
.nav-menu a.active::before {
    transform: scaleY(1);
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(253, 246, 227, 0.2);
    padding-left: 24px;
}

.nav-social {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px dashed #FDF6E3;
    text-align: center;
}

.nav-social p {
    color: #FDF6E3;
    font-size: 13px;
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.social-icons a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FDF6E3;
    color: #D4A574;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(253, 246, 227, 0.4);
}

/* 右侧主内容区 */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
}

/* 顶部汉堡菜单（移动端） */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #D4A574;
    border-radius: 50%;
    z-index: 1001;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(93, 78, 55, 0.2);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.mobile-menu-btn span {
    width: 24px;
    height: 3px;
    background: #FDF6E3;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 首页 Banner */
.home-banner {
    position: relative;
    height: 500px;
    background: linear-gradient(135deg, #F9E4B7 0%, #F5D5A5 50%, #E8C4A0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/banner-bg.jpg') center/cover;
    opacity: 0.15;
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 40px;
}

.banner-content h2 {
    font-size: 52px;
    color: #5D4E37;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(253, 246, 227, 0.5);
    animation: fadeInUp 1s ease;
}

.banner-content p {
    font-size: 20px;
    color: #7A6B52;
    max-width: 700px;
    margin: 0 auto 30px;
    animation: fadeInUp 1s ease 0.3s both;
}

.banner-btn {
    display: inline-block;
    padding: 16px 40px;
    background: #5D4E37;
    color: #FDF6E3;
    font-size: 16px;
    border-radius: 30px;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.6s both;
}

.banner-btn:hover {
    background: #7A6B52;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(93, 78, 55, 0.3);
}

/* 核心优势板块 */
.section {
    padding: 80px 60px;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h3 {
    font-size: 36px;
    color: #5D4E37;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #D4A574, #E8C4A0);
}

.section-title p {
    font-size: 16px;
    color: #7A6B52;
    margin-top: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 卡片网格布局 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: #FFF8E7;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(93, 78, 55, 0.08);
    transition: all 0.4s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(93, 78, 55, 0.15);
}

.card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-img img {
    transform: scale(1.1);
}

.card-content {
    padding: 25px;
}

.card-content h4 {
    font-size: 20px;
    color: #5D4E37;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-content p {
    font-size: 14px;
    color: #7A6B52;
    line-height: 1.8;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #9B8B73;
    padding-top: 15px;
    border-top: 1px dashed #E8D5B7;
}

/* 瀑布流布局 */
.waterfall-container {
    column-count: 3;
    column-gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.waterfall-item {
    break-inside: avoid;
    margin-bottom: 25px;
    background: #FFF8E7;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(93, 78, 55, 0.08);
    transition: all 0.3s ease;
}

.waterfall-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(93, 78, 55, 0.15);
}

.waterfall-item img {
    width: 100%;
    display: block;
}

.waterfall-item-content {
    padding: 20px;
}

.waterfall-item-content h4 {
    font-size: 18px;
    color: #5D4E37;
    margin-bottom: 10px;
}

.waterfall-item-content p {
    font-size: 14px;
    color: #7A6B52;
    line-height: 1.7;
}

/* 快速入口 */
.quick-access {
    background: linear-gradient(135deg, #F9E4B7 0%, #F5D5A5 100%);
    padding: 60px;
    margin: 40px 60px;
    border-radius: 20px;
    text-align: center;
}

.quick-access h3 {
    font-size: 32px;
    color: #5D4E37;
    margin-bottom: 40px;
}

.access-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.access-item {
    background: #FDF6E3;
    padding: 30px 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.access-item:hover {
    background: #FFF8E7;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(93, 78, 55, 0.1);
}

.access-item img {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    object-fit: contain;
}

.access-item h5 {
    font-size: 16px;
    color: #5D4E37;
}

/* 资讯列表区块 */
.news-section {
    padding: 60px;
    background: #FDF6E3;
}

.news-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.news-tab {
    padding: 12px 30px;
    background: #FFF8E7;
    color: #5D4E37;
    border-radius: 25px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.news-tab:hover,
.news-tab.active {
    background: #D4A574;
    color: #FDF6E3;
}

.news-list-container {
    max-width: 1400px;
    margin: 0 auto;
}

.news-category-title {
    font-size: 24px;
    color: #5D4E37;
    margin: 40px 0 25px;
    padding-left: 20px;
    border-left: 4px solid #D4A574;
}

/* 页脚 */
.site-footer {
    background: linear-gradient(180deg, #5D4E37 0%, #4A3F2E 100%);
    color: #FDF6E3;
    padding: 60px 60px 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 40px;
    border-bottom: 1px dashed rgba(253, 246, 227, 0.2);
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #F9E4B7;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: #E8D5B7;
    font-size: 14px;
    transition: all 0.3s ease;
}

.footer-section ul li a:hover {
    color: #F9E4B7;
    padding-left: 5px;
}

.footer-contact p {
    font-size: 14px;
    color: #E8D5B7;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    font-size: 14px;
    color: #C9B896;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .waterfall-container {
        column-count: 2;
    }
    
    .access-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar-nav {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar-nav.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .section {
        padding: 60px 30px;
    }
    
    .quick-access {
        margin: 40px 30px;
        padding: 40px 30px;
    }
    
    .news-section {
        padding: 40px 30px;
    }
    
    .banner-content h2 {
        font-size: 40px;
    }
}

@media (max-width: 768px) {
    .waterfall-container {
        column-count: 1;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .access-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .banner-content h2 {
        font-size: 32px;
    }
    
    .banner-content p {
        font-size: 16px;
    }
    
    .section-title h3 {
        font-size: 28px;
    }
    
    .news-tabs {
        flex-wrap: wrap;
    }
}

/* 内页通用样式 */
.page-header {
    background: linear-gradient(135deg, #F9E4B7 0%, #F5D5A5 100%);
    padding: 80px 60px 60px;
    text-align: center;
}

.page-header h1 {
    font-size: 42px;
    color: #5D4E37;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 18px;
    color: #7A6B52;
    max-width: 600px;
    margin: 0 auto;
}

.page-content {
    padding: 60px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 新闻列表页样式 */
.news-list-page {
    padding: 40px 60px;
}

.news-item {
    display: flex;
    gap: 25px;
    padding: 25px;
    background: #FFF8E7;
    border-radius: 12px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-item:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 25px rgba(93, 78, 55, 0.1);
}

.news-item-img {
    width: 220px;
    height: 150px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.news-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-item-content {
    flex: 1;
}

.news-item-content h3 {
    font-size: 22px;
    color: #5D4E37;
    margin-bottom: 12px;
    line-height: 1.4;
}

.news-item-content p {
    font-size: 15px;
    color: #7A6B52;
    line-height: 1.7;
    margin-bottom: 15px;
}

.news-item-meta {
    font-size: 13px;
    color: #9B8B73;
}

/* 新闻详情页样式 */
.news-detail {
    padding: 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.news-detail-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px dashed #E8D5B7;
}

.news-detail-header h1 {
    font-size: 36px;
    color: #5D4E37;
    margin-bottom: 20px;
    line-height: 1.4;
}

.news-detail-meta {
    display: flex;
    gap: 30px;
    font-size: 14px;
    color: #9B8B73;
}

.news-detail-content {
    font-size: 16px;
    line-height: 2;
    color: #5D4E37;
}

.news-detail-content img {
    max-width: 100%;
    margin: 30px auto;
    border-radius: 10px;
}

.news-detail-content p {
    margin-bottom: 20px;
}

/* 相关新闻区域 */
.related-news {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px dashed #E8D5B7;
}

.related-news h3 {
    font-size: 24px;
    color: #5D4E37;
    margin-bottom: 30px;
}

.related-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* 关于页面 */
.about-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-bottom: 60px;
}

.about-intro img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(93, 78, 55, 0.15);
}

.about-text h3 {
    font-size: 32px;
    color: #5D4E37;
    margin-bottom: 20px;
}

.about-text p {
    font-size: 16px;
    color: #7A6B52;
    line-height: 1.9;
    margin-bottom: 15px;
}

/* 教程分类页面 */
.tutorial-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.tutorial-category {
    background: #FFF8E7;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tutorial-category:hover {
    background: #F9E4B7;
    transform: translateY(-8px);
}

.tutorial-category img {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    object-fit: contain;
}

.tutorial-category h4 {
    font-size: 20px;
    color: #5D4E37;
    margin-bottom: 15px;
}

.tutorial-category p {
    font-size: 14px;
    color: #7A6B52;
    line-height: 1.7;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 20px 60px;
    background: #FFF8E7;
    font-size: 14px;
    color: #9B8B73;
}

.breadcrumb a {
    color: #D4A574;
    transition: all 0.3s ease;
}

.breadcrumb a:hover {
    color: #5D4E37;
}

.breadcrumb span {
    margin: 0 10px;
}
