/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo img {
    height: 40px;
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav ul li {
    margin-left: 30px;
}

.nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav ul li a:hover {
    color: #1890ff;
}

.search-box {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 5px 10px;
    background-color: #f5f5f5;
}

.search-box input {
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    width: 200px;
}

.search-box button {
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
}

.search-box button:hover {
    color: #1890ff;
}

/* 主要内容样式 */
.main {
    margin-top: 120px;
    margin-bottom: 80px;
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 40px 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.page-header h1 {
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 700;
}

.page-header p {
    font-size: 18px;
    color: #7f8c8d;
    max-width: 800px;
    margin: 0 auto;
}

/* 教程列表 */
.tutorial-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
}

/* 教程卡片 */
.tutorial-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* 教程缩略图 */
.tutorial-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.tutorial-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.tutorial-card:hover .tutorial-thumbnail img {
    transform: scale(1.05);
}

.video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #1890ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.tutorial-card:hover .video-icon {
    transform: translate(-50%, -50%) scale(1.1);
}

/* 教程内容 */
.tutorial-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tutorial-category {
    display: inline-block;
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.tutorial-title {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
    flex-shrink: 0;
}

.tutorial-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tutorial-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.tutorial-date {
    font-size: 13px;
    color: #999;
}

.tutorial-readmore {
    text-decoration: none;
    color: #1890ff;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.tutorial-readmore:hover {
    color: #40a9ff;
}

/* 页脚样式 */
.footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-info p {
    color: #bdc3c7;
    line-height: 1.8;
    font-size: 14px;
}

.footer-links h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #ecf0f1;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links ul li a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .tutorial-list {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 992px) {
    .header .container {
        flex-wrap: wrap;
        height: auto;
        padding: 20px 0;
        gap: 20px;
    }

    .nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav ul li {
        margin: 10px 15px;
    }

    .search-box {
        order: 3;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .search-box input {
        width: 100%;
    }

    .main {
        margin-top: 180px;
    }

    .tutorial-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 30px 20px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 16px;
    }

    .tutorial-list {
        grid-template-columns: 1fr;
    }

    .tutorial-card {
        max-width: 500px;
        margin: 0 auto;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

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

    .page-header h1 {
        font-size: 24px;
    }

    .tutorial-content {
        padding: 20px;
    }

    .tutorial-title {
        font-size: 18px;
    }

    .tutorial-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}