/* ============================================
   熊猫心心念 - 全局样式表
   分离式设计，仅此一个CSS文件
   ============================================ */

/* -------- CSS 变量 -------- */
:root {
    --primary: #8B6F47;
    --primary-dark: #6B5637;
    --primary-light: #FFFFFF;
    --bg-color: #FFFFFF;
    --bg-warm: #FFFFFF;
    --text-main: #3D3229;
    --text-sub: #7A6B5A;
    --text-light: #A89B8C;
    --white: #FFFFFF;
    --shadow: 0 4px 20px rgba(61, 50, 41, 0.08);
    --shadow-hover: 0 8px 30px rgba(61, 50, 41, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s ease;
    --max-width: 1100px;
}

/* -------- 基础重置 -------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", 
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", 
                 Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* -------- 导航栏 -------- */
.navbar {
    background: var(--white);
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.nav-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F3EAD8;
    padding: 6px;
    object-fit: contain;
    box-shadow: 0 2px 6px rgba(139, 111, 71, 0.15);
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    font-size: 0.95rem;
    color: var(--text-sub);
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* 汉堡菜单按钮 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* -------- Hero 主视觉区 -------- */
.hero {
    text-align: center;
    padding: 60px 24px 50px;
    background: white;
}

.hero-panda {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: #F3EAD8;
    padding: 16px;
    box-shadow: 0 8px 30px rgba(139, 111, 71, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.hero-panda img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-sub);
    margin-bottom: 32px;
}

/* 下载按钮 */
.download-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(139, 111, 71, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 111, 71, 0.4);
}

.btn-download:active {
    transform: translateY(0);
}

.ios-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* -------- 为什么选择区 -------- */
.section-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 50px 0 30px;
    position: relative;
}

.section-title::before,
.section-title::after {
    content: "•";
    margin: 0 12px;
    color: var(--primary-light);
}

/* -------- 特色卡片 -------- */
.features-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(139, 111, 71, 0.08);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--primary);
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.feature-desc {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.5;
}

/* -------- 漫画介绍区 -------- */
.comics-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 60px;
}

.comics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.comic-item {
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--white);
}

.comic-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-hover);
}

.comic-item img {
    width: 100%;
    height: 320px;
    object-fit: contain;
    background: #F8F5F0;
    display: block;
}

.comic-label {
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--text-sub);
    font-weight: 500;
    background: var(--white);
}

/* -------- 全屏漫画弹窗 -------- */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 85%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(4px);
    user-select: none;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    background: rgba(0,0,0,0.4);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* -------- 底部 -------- */
.footer {
    background: var(--bg-warm);
    border-top: 1px solid rgba(139, 111, 71, 0.1);
    padding: 30px 24px;
    text-align: center;
}

.footer-beian {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.footer-copyright {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ============================================
   响应式设计 - 手机端 (< 768px)
   ============================================ */
@media (max-width: 768px) {
    /* 导航 */
    .nav-container {
        height: 56px;
        padding: 0 16px;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 14px 24px;
        border-bottom: 1px solid rgba(0,0,0,0.04);
    }

    .nav-menu a::after {
        display: none;
    }

    /* Hero */
    .hero {
        padding: 40px 20px 36px;
    }

    .hero-panda {
        width: 90px;
        height: 90px;
        padding: 12px;
    }

    .hero-title {
        font-size: 1.7rem;
        letter-spacing: 1px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    .btn-download {
        padding: 12px 40px;
        font-size: 0.95rem;
        width: 80%;
        max-width: 280px;
    }

    /* 特色卡片 - 单列 */
    .features-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    .section-title {
        font-size: 1.1rem;
        margin: 40px 0 24px;
    }

    /* 漫画 - 2列 */
    .comics-section {
        padding: 0 16px 40px;
    }

    .comics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .comic-item img {
        height: 200px;
    }

    .comic-label {
        padding: 8px;
        font-size: 0.85rem;
    }

    /* 弹窗 */
    .lightbox-img {
        max-width: 92%;
        max-height: 70vh;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }

    .lightbox-close {
        top: 12px;
        right: 16px;
        width: 40px;
        height: 40px;
    }

    /* 底部 */
    .footer {
        padding: 24px 16px;
    }

    .footer-beian,
    .footer-copyright {
        font-size: 0.8rem;
    }
}

/* 超小屏幕 */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .comics-grid {
        gap: 8px;
    }
}
