/* style.css - 公共样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部样式 */
header {
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}



.title-container {
    text-align: left;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 内容区域 */
.content {
    padding: 30px;
}

.sections-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.section {
    flex: 1;
    min-width: 250px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* 视频样式 */
.video-section {
    margin-top: 20px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 15px;
    background: white;
    border-radius: 0 0 8px 8px;
}

.video-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    font-size: 1.2rem;
}

.video-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.horizontal-video-item {
    height: 280px; /* 固定高度 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.video-container {
    height: 180px; /* 视频区域固定高度 */
    flex-shrink: 0;
}

.video-info {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.video-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.video-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 15px;
}

.download-link {
    display: inline-block;
    padding: 8px 16px;
    background: #4b6cb7;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.download-link:hover {
    background: #3a5a9c;
}

/* 链接样式 */
.bilibili-link {
    display: inline-block;
    background: #fb7299;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
    margin-right: 10px;
    margin-bottom: 5px;
}

.bilibili-link:hover {
    background: #ff8ab3;
}

.baidu-link {
    display: inline-block;
    background: #3385ff;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
    margin-right: 10px;
    margin-bottom: 5px;
}

.baidu-link:hover {
    background: #4d94ff;
}

.extract-code {
    display: inline-block;
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.download-link {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
      margin-right: 10px;
    margin-bottom: 5px;
}

.download-link:hover {
    background: #34ce57;
}

@media (max-width: 768px) {
    .bilibili-link, .baidu-link, .download-link, .extract-code {
        text-align: center;
        width: 100%;
    }
}


/* 简介样式 */
.life-quote {
    background: #fff9db;
    padding: 10px;
    border-radius: 8px;
    border-left: 5px solid #ffd43b;
    font-style: italic;
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.8;
    text-indent: 2em;
}


  /* 固定4个横排布局样式 */
        .horizontal-videos {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-top: 15px;
        }
        
        .horizontal-video-item {
            cursor: pointer;
        }
        
        .horizontal-video-item .video-container {
            margin-top: 10px;
        }
        
        .horizontal-video-item .video-info {
            padding: 10px;
        }
        
        .horizontal-video-item .video-title {
            font-size: 1rem;
            margin-bottom: 5px;
        }
        
        .horizontal-video-item .video-desc {
            font-size: 0.9rem;
            line-height: 1.4;
        }

        /* 响应式设计 */
        @media (max-width: 1200px) {
            .horizontal-videos {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        
        @media (max-width: 768px) {
            .horizontal-videos {
                grid-template-columns: 1fr;
            }
        }

        /* 查看更多按钮 */
        .view-more {
            text-align: center;
            margin-top: 20px;
        }
        
        .view-more-btn {
            display: inline-block;
            background: #4b6cb7;
            color: white;
            padding: 10px 20px;
            border-radius: 4px;
            text-decoration: none;
            font-weight: bold;
            transition: background 0.3s;
        }
        
        .view-more-btn:hover {
            background: #3a5a9c;
        }
.view-more {
    text-align: center !important;
    margin-top: 20px;
}


  /* 栏目导航样式 */
        .category-nav {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
            margin-bottom: 30px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .category-title {
            font-size: 1.8rem;
            font-weight: bold;
            color: #4b6cb7;
            margin-bottom: 15px;
            border-bottom: 2px solid #eaeaea;
            padding-bottom: 10px;
            text-align: center;  
        }
        
        
        .category-links {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .category-link {
            display: inline-block;
            padding: 8px 20px;
            background: white;
            color: #333;
            text-decoration: none;
            border-radius: 8px;
            border: 2px solid #eaeaea;
            transition: all 0.3s ease;
            font-weight: 500;
        }
        
        .category-link:hover,
        .category-link.active {
            background: #4b6cb7;
            color: white;
            border-color: #4b6cb7;
        }



/* 栏目页视频布局 */
        .videos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 25px;
            margin-top: 20px;
        }
        
        .video-card {
            background: white;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        
        .video-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        }
        
        .video-card .video-container {
            margin: 0;
        }
        
        .video-card .video-info {
            padding: 15px;
        }
        
        .video-card .video-title {
            font-size: 1.1rem;
            margin-bottom: 8px;
            color: #333;
        }
        
        .video-card .video-desc {
            font-size: 0.9rem;
            color: #666;
            line-height: 1.5;
        }
        
        /* 分页样式 */
        .pagination {
             display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px auto;
    gap: 10px;
    flex-wrap: wrap;
  
        }
        
        .page-btn {
            padding: 8px 8px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 88px; /* 固定宽度 */
    text-align: center; /* 文字居中 */
    box-sizing: border-box; /* 包含padding和border在宽度内 */
        }
        
        .page-btn:hover {
            background: #f5f5f5;
        }
        
        .page-btn.active {
            background: #4b6cb7;
            color: white;
            border-color: #4b6cb7;
        }
        
        .page-info {
            margin: 0 15px;
            color: #666;
        }
        
        /* 返回按钮 */
        .back-btn {
            display: inline-block;
            background: #6c757d;
            color: white;
            padding: 10px 20px;
            border-radius: 4px;
            text-decoration: none;
            font-weight: bold;
            transition: background 0.3s;
            margin-bottom: 20px;
        }
        
        .back-btn:hover {
            background: #5a6268;
        }





    /* 代码展示样式 */
        .code-section {
            margin-top: 20px;
        }
        
        .code-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-top: 15px;
        }
        
        .code-card {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            color: #333;
            font-family: 'Courier New', monospace;
            font-size: 0.9rem;
            line-height: 1.4;
            overflow-y: auto;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            border: 1px solid #eaeaea;
            max-height: 150px;
            cursor: pointer;
        }
        
        .code-card:hover {
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }
        
        .code-keyword {
            color: #d73a49;
        }
        
        .code-type {
            color: #6f42c1;
        }
        
        .code-string {
            color: #032f62;
        }
        
      .code-comment {
           color: red;
           font-weight: bold;
		   	font-size: 1.1rem;
		   
        }
        
        .code-number {
            color: #005cc5;
        }
        
        
 .code-card-full {
    background: #f8f9fa;  /* 灰色背景 */
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
    cursor: pointer;
}

.centered-code {
    color: #333;
    margin: 0 auto;
    padding: 0 20px;
    background: transparent; /* 透明背景，继承父级灰色 */
}

 .code-header {
    color: red;
    font-weight: bold;
		font-size: 1.1rem;
}
        
.fullscreen-code {
    width: 100%;
    margin: 20px 0;
}

.code-card-full {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
}

.code-card-full:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.code-card-full pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

        /* 满屏居中样式 */
        .fullscreen-code {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 20px;
        }

        .fullscreen-code .code-grid {
            grid-template-columns: repeat(4, 1fr);
            gap: 30px;
        }

        .fullscreen-code .code-card {
            padding: 25px;
            font-size: 1rem;
            max-height: 200px;
        }

        /* 响应式设计 */
        @media (max-width: 1200px) {
            .fullscreen-code .code-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        
        @media (max-width: 768px) {
            .fullscreen-code .code-grid {
                grid-template-columns: 1fr;
            }
            
            .fullscreen-code {
                padding: 20px 15px;
            }
        }  
     
     
     
     
     
     



/* 脚部样式 */
footer {
    text-align: center;
    padding: 20px;
    background: #f1f3f4;
    color: #666;
    font-size: 0.9rem;
}

footer a {
    color: #666;
    text-decoration: none;
    margin-left: 20px;
}

footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .section {
        min-width: 48%;
    }
}

@media (max-width: 768px) {
    .sections-row {
        flex-direction: column;
    }
    
    .section {
        min-width: 100%;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .title-container {
        text-align: center;
    }
    
    .header-image {
        width: 60px;
        height: 60px;
    }
}