/* ========== 全局重置 ========== */
*, *::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;
    max-width: 100%;
}

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

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

.slide.active {
    opacity: 1;
}

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

.slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0,0,0,0.65) 0%,
        rgba(0,0,0,0.3) 50%,
        rgba(0,0,0,0.05) 100%
    );
}

.slide-content {
    position: absolute;
    bottom: 80px;
    left: 80px;
    color: #fff;
    max-width: 520px;
    z-index: 2;
}

.slide-content h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    line-height: 1.3;
}

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

.slider-dots {
    position: absolute;
    bottom: 24px;
    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.45);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

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

/* ========== 通用按钮 ========== */
.btn {
    display: inline-block;
    padding: 11px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: #FF5E7D;
    color: #fff;
}

.btn:hover {
    background: #e04468;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255,94,125,0.4);
}

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

.btn-android:hover {
    background: #2cb96a;
    color: #fff !important;
    transform: translateY(-1px);
}

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

.btn-ios:hover {
    background: #000;
    color: #fff !important;
    transform: translateY(-1px);
}

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

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

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

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

.section-header p {
    color: #888;
    font-size: 13px;
    margin-top: 5px;
    padding-left: 14px;
}

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

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

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

.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.25s, box-shadow 0.25s;
    cursor: pointer;
}

.card > a {
    display: block;
    color: inherit;
}

.card > a:hover {
    color: inherit;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.13);
}

.card-img {
    position: relative;
    padding-top: 145%;
    overflow: hidden;
    background: #eee;
}

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

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

/* 评分遮罩 */
.card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    pointer-events: none;
}

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

.tag {
    background: #FF5E7D;
}

.update-tag {
    background: #ff8c00;
}

.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;
}

.card-meta span:last-child {
    color: #FF5E7D;
    font-weight: 600;
}

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

.category-tabs,
.ranking-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.category-tabs .tab,
.ranking-tabs .tab {
    padding: 9px 22px;
    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;
    user-select: none;
}

.category-tabs .tab:hover,
.ranking-tabs .tab:hover {
    color: #FF5E7D;
    background: #fff5f7;
}

.category-tabs .tab.active,
.ranking-tabs .tab.active {
    color: #FF5E7D;
    border-bottom-color: #FF5E7D;
    background: #fff5f7;
    font-weight: 700;
}

.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, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
}

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

.app-info {
    flex: 1;
}

.app-info h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.4;
}

.app-info > p {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 24px;
}

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

.app-features li {
    font-size: 14px;
    padding: 5px 0;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

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

.app-image img {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    object-fit: cover;
    height: 360px;
}

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

.ranking-content {
    display: none;
}

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

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.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(5px);
    box-shadow: 0 4px 18px rgba(0,0,0,0.1);
}

.rank {
    font-size: 24px;
    font-weight: 900;
    color: #ddd;
    width: 34px;
    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: 54px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eee;
}

.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 h3 a {
    color: #222;
    transition: color 0.2s;
}

.rank-info h3 a:hover {
    color: #FF5E7D;
}

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

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

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

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

.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: 210px;
    height: 135px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eee;
}

.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: 700;
    color: #222;
    margin-bottom: 10px;
    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.8;
    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: 36px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.footer-brand p {
    font-size: 13px;
    color: #999;
    margin-top: 12px;
    line-height: 1.7;
}

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

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

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

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

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

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

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    color: #ccc;
    font-size: 13px;
    font-weight: 700;
    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.07);
}

.footer-links h3 {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    font-weight: 500;
}

.footer-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

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

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

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

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

.footer-bottom p a {
    color: #777;
    transition: color 0.2s;
}

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

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

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

    .slider {
        height: 380px;
    }
}

/* ========== 响应式 768px ========== */
@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: 8px 0 16px;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }

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

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

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

    .hamburger {
        display: flex;
    }

    .slider {
        height: 260px;
    }

    .slide-content {
        left: 24px;
        bottom: 44px;
        max-width: 320px;
    }

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

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

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

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

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

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

    .app-image img {
        height: 280px;
    }

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

    .article-card {
        flex-direction: column;
        gap: 14px;
    }

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

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

    section {
        padding: 36px 0;
    }
}

/* ========== 响应式 480px ========== */
@media (max-width: 480px) {
    .card-container,
    .hot-section .card-container,
    .update-section .card-container,
    .tab-content .card-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

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

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

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

    .slider {
        height: 210px;
    }

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

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

    .category-tabs .tab,
    .ranking-tabs .tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    footer h3 {
        font-size: 14px;
    }
}
