/* 51吃瓜 全局样式 - 外部CSS文件 */
:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #e55555;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== 布局 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 头部导航 ===== */
header {
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 36px;
    width: auto;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ===== 搜索框 ===== */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    padding: 4px 4px 4px 15px;
    margin-bottom: 12px;
    max-width: 600px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    padding: 8px;
    width: 100%;
    font-size: 14px;
    color: var(--text-color);
}

.search-box input::placeholder {
    color: #aaa;
}

.search-box button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
}

.search-box button:hover {
    background: #e55555;
}

/* ===== 视频卡片 ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.video-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

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

.video-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #eee;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: rgba(0,0,0,0.65);
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 22px;
    transition: background 0.3s;
}

.video-card:hover .play-btn {
    display: flex;
}

.play-btn:hover {
    background: var(--primary-color);
}

.video-info {
    padding: 14px;
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    color: var(--text-color);
}

.video-stats {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 12px;
    gap: 5px;
    flex-wrap: wrap;
}

/* ===== 模块通用 ===== */
.section-title {
    text-align: center;
    font-size: 28px;
    margin: 50px 0 20px;
    color: var(--text-color);
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ===== FAQ ===== */
.faq-item {
    background: var(--card-bg);
    margin-bottom: 15px;
    padding: 22px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.faq-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.faq-q {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

/* ===== 用户评价 ===== */
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.review-card {
    background: var(--card-bg);
    padding: 22px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.review-card:hover {
    transform: translateY(-3px);
}

.review-user {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 12px;
}

.review-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

/* ===== 页脚 ===== */
footer {
    background: #2c3e50;
    color: #ccc;
    padding: 50px 0 20px;
    margin-top: 60px;
}

footer h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 16px;
}

footer p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 8px;
}

footer ul li {
    margin-bottom: 8px;
}

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

footer ul li a:hover {
    color: var(--primary-color);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: #888;
    line-height: 1.8;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .nav-container {
        height: auto;
        padding: 12px 0;
    }

    .nav-links {
        gap: 10px;
        font-size: 13px;
    }

    .nav-links a {
        font-size: 13px;
    }

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

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .video-thumbnail {
        height: 110px;
    }

    .video-title {
        font-size: 13px;
    }

    .review-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .logo {
        font-size: 18px;
    }

    .nav-links {
        display: none;
    }

    .section-title {
        font-size: 20px;
        margin: 30px 0 15px;
    }
}

/* ===== 通用工具类 ===== */
.text-center { text-align: center; }
.text-red { color: var(--primary-color); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }
