/* ========== 全局重置 ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: #333;
    background: #f5f5f5;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: #FF5E7D;
}

ul, ol {
    list-style: none;
}

img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

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

/* ========== 导航栏 ========== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #FF5E7D;
}

.logo svg {
    flex-shrink: 0;
}

/* main-nav */
.main-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav ul li a {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    background: #fff0f3;
    color: #FF5E7D;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    height: 2px;
    background: #444;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========== 轮播图 ========== */
.banner {
    background: #111;
    overflow: hidden;
}

.banner .container {
    position: relative;
    padding: 0;
}

.slider {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 60px;
    left: 60px;
    color: #fff;
    max-width: 500px;
}

.slide-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.slide-content p {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

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

.slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.slider-dots .dot.active {
    background: #FF5E7D;
    transform: scale(1.3);
}

/* ========== 通用按钮 ========== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary,
.btn:not(.btn-android):not(.btn-ios) {
    background: #FF5E7D;
    color: #fff;
}

.btn-primary:hover,
.btn:not(.btn-android):not(.btn-ios):hover {
    background: #e04468;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,94,125,0.35);
}

.btn-android {
    background: #3ddc84;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-android:hover {
    background: #2cb96a;
    color: #fff;
}

.btn-ios {
    background: #333;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-ios:hover {
    background: #111;
    color: #fff;
}

/* ========== 通用 Section ========== */
section {
    padding: 48px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-header h1,
.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    position: relative;
    padding-left: 12px;
}

.section-header h1::before,
.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: #FF5E7D;
    border-radius: 2px;
}

.section-header p {
    color: #888;
    font-size: 14px;
    margin-top: 4px;
}

.more {
    font-size: 13px;
    color: #FF5E7D;
    white-space: nowrap;
    flex-shrink: 0;
}

.more:hover {
    text-decoration: underline;
}

/* ========== 卡片网格 ========== */
.card-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.hot-section .card-container,
.update-section .card-container {
    grid-template-columns: repeat(6, 1fr);
}

.card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

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

.card-img {
    position: relative;
    padding-top: 140%;
    overflow: hidden;
}

.card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.tag, .update-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    z-index: 1;
}

.tag {
    background: #FF5E7D;
}

.update-tag {
    background: #ff9800;
}

.card-content {
    padding: 10px 12px 12px;
}

.card-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-content p {
    font-size: 12px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #aaa;
}

/* ========== 分类推荐 ========== */
.category-section {
    background: #fff;
}

.category-tabs,
.ranking-tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0;
}

.category-tabs .tab,
.ranking-tabs .tab {
    padding: 8px 20px;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.category-tabs .tab.active,
.ranking-tabs .tab.active {
    color: #FF5E7D;
    border-bottom-color: #FF5E7D;
    background: #fff0f3;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content .card-container {
    grid-template-columns: repeat(4, 1fr);
}

/* ========== APP下载 ========== */
.app-section {
    background: linear-gradient(135deg, #FF5E7D 0%, #ff8fa3 100%);
    color: #fff;
}

.app-content {
    display: flex;
    align-items: center;
    gap: 48px;
}

.app-info {
    flex: 1;
}

.app-info h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.app-info > p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.app-features {
    margin-bottom: 28px;
}

.app-features li {
    font-size: 14px;
    padding: 4px 0;
    opacity: 0.92;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-features li::before {
    content: '✅';
    font-size: 13px;
}

.app-download {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.app-image {
    flex-shrink: 0;
    width: 280px;
}

.app-image img {
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

/* ========== 排行榜 ========== */
.ranking-section {
    background: #fafafa;
}

.ranking-content {
    display: none;
}

.ranking-content.active {
    display: block;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.ranking-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.rank {
    font-size: 22px;
    font-weight: 800;
    color: #ddd;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.ranking-item:nth-child(1) .rank { color: #FFD700; }
.ranking-item:nth-child(2) .rank { color: #C0C0C0; }
.ranking-item:nth-child(3) .rank { color: #CD7F32; }

.rank-img {
    width: 56px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.rank-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info p {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.rank-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #aaa;
}

/* ========== 文章模块 ========== */
.article-section {
    background: #fff;
}

.article-container {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 20px;
}

.article-card {
    display: flex;
    gap: 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid #f0f0f0;
}

.article-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.article-img {
    width: 200px;
    height: 130px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.article-content {
    flex: 1;
    min-width: 0;
}

.article-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.5;
}

.article-content h3 a {
    color: #222;
    transition: color 0.2s;
}

.article-content h3 a:hover {
    color: #FF5E7D;
}

.article-content p {
    font-size: 13px;
    color: #666;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 页脚 ========== */
footer {
    background: #1a1a2e;
    color: #ccc;
    padding-top: 48px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-logo p {
    font-size: 13px;
    color: #aaa;
    margin-top: 8px;
    line-height: 1.6;
}

footer h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 14px;
}

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

footer ul li a {
    font-size: 13px;
    color: #aaa;
    transition: color 0.2s;
}

footer ul li a:hover {
    color: #FF5E7D;
}

.footer-contact p {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.social-media {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #ccc;
    font-size: 16px;
    transition: background 0.2s, color 0.2s;
}

.social-icon:hover {
    background: #FF5E7D;
    color: #fff;
}

/* 友情链接 */
.footer-links {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-links h3 {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 10px;
}

.footer-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.footer-links ul li a,
.footer-links a {
    font-size: 12px;
    color: #888;
    transition: color 0.2s;
}

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

/* 版权 */
.footer-bottom {
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: #666;
    line-height: 2;
}

.footer-bottom p a {
    color: #888;
}

.footer-bottom p a:hover {
    color: #FF5E7D;
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
    .card-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .hot-section .card-container,
    .update-section .card-container {
        grid-template-columns: repeat(4, 1fr);
    }

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

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
        z-index: 999;
        padding: 16px 0;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav ul li a {
        padding: 12px 24px;
        border-radius: 0;
        font-size: 15px;
        border-bottom: 1px solid #f5f5f5;
    }

    .hamburger {
        display: flex;
    }

    .slider {
        height: 240px;
    }

    .slide-content {
        left: 20px;
        bottom: 40px;
    }

    .slide-content h2 {
        font-size: 20px;
    }

    .slide-content p {
        font-size: 13px;
        display: none;
    }

    .card-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .hot-section .card-container,
    .update-section .card-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .tab-content .card-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-content {
        flex-direction: column;
        gap: 24px;
    }

    .app-image {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .app-info h2 {
        font-size: 20px;
    }

    .article-card {
        flex-direction: column;
    }

    .article-img {
        width: 100%;
        height: 180px;
    }

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

    .ranking-item {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .card-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .hot-section .card-container,
    .update-section .card-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .tab-content .card-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header h1,
    .section-header h2 {
        font-size: 17px;
    }

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

    .app-download {
        flex-direction: column;
    }

    .slider {
        height: 200px;
    }

    .slide-content {
        left: 16px;
        bottom: 30px;
    }

    .slide-content h2 {
        font-size: 16px;
    }
}
