/* ==========================
   防御小宝 - 主页样式 v2
   已整合实际图片资源
   ========================== */

/* 基础重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
    color: #3e2c1c;
    line-height: 1.6;
    overflow-x: hidden;
    /* 全页面背景图 */
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #2a1508;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.25s ease;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.15);
}

.btn-header {
    background: linear-gradient(180deg, #d4a85a 0%, #b8832f 100%);
    color: #3e2c1c;
    border: 2px solid #7a5a1e;
    font-size: 0.95rem;
}

.btn-download-hero {
    background: linear-gradient(180deg, #7bc44a 0%, #4a9a2a 100%);
    color: #fff;
    border: 2px solid #2d6a12;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    padding: 14px 48px;
    font-size: 1.2rem;
    border-radius: 12px;
    margin: 20px 0;
}

/* 顶部导航 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(180deg, #5c3a1e 0%, #3d2412 100%);
    border-bottom: 4px solid #2a1508;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.main-nav {
    display: flex;
    gap: 32px;
}

.main-nav a {
    color: #e8d5b0;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.main-nav a:hover {
    color: #fff;
}

.main-nav a::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 3px;
    background: #d4a85a;
    border-radius: 2px;
    transition: width 0.25s;
}

.main-nav a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #e8d5b0;
    border-radius: 2px;
}

/* ==================== Hero 首屏 ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    padding-top: 70px;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* 背景由 body 的 background.jpg 提供，此处透明 */
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding: 60px 20px 80px;
    min-height: calc(100vh - 70px);
}

.hero-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 10vh;
}

.hero-title-img {
    width: 70%;
    max-width: 500px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
}

.hero-subtitle-img {
    width: 60%;
    max-width: 400px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.download-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-link {
    display: block;
    transition: transform 0.2s;
}

.badge-link:hover {
    transform: translateY(-3px);
}

.badge-link img {
    height: 50px;
    width: auto;
}

.hero-character {
    flex: 0 0 220px;
    max-width: 280px;
    align-self: flex-end;
}

.hero-character img {
    width: 100%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
}

/* ==================== 游戏介绍分隔栏 ==================== */
.game-intro {
    padding: 40px 0;
    text-align: center;
}

.intro-img {
    max-width: 800px;
    margin: 0 auto;
}

/* ==================== 藤型分隔条 ==================== */
.section-divider {
    text-align: center;
    padding: 10px 0;
}

.section-divider img {
    max-width: 500px;
    margin: 0 auto;
}

/* ==================== 游戏特色 ==================== */
.features {
    padding: 60px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 16px;
    background: rgba(248,233,200,0.85);
    border: 4px solid #8b5a2b;
    border-radius: 16px;
    box-shadow: 0 4px 0 #5c3a1e, 0 8px 16px rgba(0,0,0,0.2);
    transition: transform 0.25s;
}

.feature-item:hover {
    transform: translateY(-6px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
}

.feature-item h3 {
    font-size: 1.1rem;
    color: #5c3a1e;
}

.feature-item p {
    font-size: 0.85rem;
    color: #6b4a2a;
    line-height: 1.4;
}

/* ==================== 招募英雄 ==================== */
.heroes {
    padding: 60px 0;
}

.heroes-title {
    text-align: center;
    margin-bottom: 40px;
}

.heroes-title img {
    max-width: 500px;
    margin: 0 auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.heroes-carousel {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    justify-content: center;
}

.heroes-track {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 16px 8px;
    scrollbar-width: none;
    justify-content: center;
}

.heroes-track::-webkit-scrollbar {
    display: none;
}

.hero-card {
    flex: 0 0 160px;
    text-align: center;
    scroll-snap-align: center;
}

.hero-card img {
    width: 140px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 12px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.hero-card h3 {
    color: #f8e9b8;
    font-size: 1rem;
    padding: 8px 16px;
    background: rgba(0,0,0,0.4);
    border-radius: 20px;
    display: inline-block;
}

.hero-card.coming-soon img {
    filter: brightness(0.5) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(212,168,90,0.9);
    color: #3d2412;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.carousel-btn:hover {
    background: #f8e9b8;
    transform: scale(1.1);
}

/* ==================== 精彩游戏画面 ==================== */
.screenshots {
    padding: 60px 0;
}

.text-section-title {
    text-align: center;
    font-size: 2rem;
    color: #f8e9b8;
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.screenshot-card {
    border: 4px solid #8b5a2b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 0 #5c3a1e, 0 6px 16px rgba(0,0,0,0.3);
    transition: transform 0.25s;
}

.screenshot-card:hover {
    transform: translateY(-6px);
}

.screenshot-card img {
    width: 100%;
    object-fit: cover;
    background-color: #2a1508;
}

/* ==================== 最新动态 ==================== */
.updates {
    padding: 40px 0;
}

.updates-title {
    text-align: center;
    margin-bottom: 30px;
}

.updates-title img {
    max-width: 500px;
    margin: 0 auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.update-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background-image: url('../images/updates-background.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border-radius: 12px;
    box-shadow: 0 4px 0 #5c3a1e, 0 6px 16px rgba(0,0,0,0.3);
    overflow: hidden;
    transition: transform 0.25s;
    min-height: 200px;
}

.update-card:hover {
    transform: translateY(-4px);
}

.update-card-bg {
    flex: 0 0 35%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.update-card-img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
}

.update-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 8px;
}

.update-card-text h3 {
    font-size: 1.1rem;
    color: #5c3a1e;
    font-weight: 700;
}

.update-date {
    font-size: 0.8rem;
    color: #9a8660;
}

.update-card-text p {
    font-size: 0.85rem;
    color: #6b4a2a;
    line-height: 1.5;
}

/* ==================== 立即下载 ==================== */
.download-cta {
    padding: 60px 0;
}

.download-title {
    text-align: center;
    margin-bottom: 36px;
}

.download-title img {
    max-width: 500px;
    margin: 0 auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.download-badges.large {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.download-badges.large .badge-link img {
    height: 60px;
    width: auto;
}

.download-decorations {
    text-align: center;
}

.deco-chest {
    width: 140px;
    margin: 0 auto;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

/* ==================== 页脚 ==================== */
.site-footer {
    background: linear-gradient(180deg, #3d2412 0%, #2a1508 100%);
    color: #e8d5b0;
    padding: 48px 0 24px;
    border-top: 4px solid #5c3a1e;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.footer-brand {
    max-width: 280px;
}

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-brand .logo-img {
    height: 48px;
    width: auto;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 16px;
    color: #c9b58a;
}

.footer-links {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.footer-col h4 {
    color: #f8e9b8;
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    color: #c9b58a;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: #9a8660;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .hero-character {
        flex: 0 0 180px;
    }

    .hero-title-img {
        width: 80%;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .updates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: linear-gradient(180deg, #3d2412 0%, #2a1508 100%);
        padding: 16px 0;
        border-bottom: 4px solid #2a1508;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .btn-header {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        padding: 40px 20px 60px;
        min-height: auto;
    }

    .hero-center {
        padding-top: 5vh;
    }

    .hero-character {
        flex: 0 0 180px;
        max-width: 200px;
    }

    .hero-title-img {
        width: 90%;
    }

    .hero-subtitle-img {
        width: 80%;
    }

    .badge-link img {
        height: 40px;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .screenshots-grid {
        grid-template-columns: 1fr 1fr;
    }

    .heroes-track {
        gap: 16px;
    }

    .hero-card {
        flex: 0 0 140px;
    }

    .updates-grid {
        grid-template-columns: 1fr;
    }

    .update-card {
        flex-direction: row;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }

    .footer-links {
        justify-content: center;
        gap: 40px;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .screenshots-grid {
        grid-template-columns: 1fr;
    }

    .hero-title-img {
        width: 95%;
    }

    .hero-subtitle-img {
        width: 90%;
    }

    .badge-link img {
        height: 36px;
    }

    .text-section-title {
        font-size: 1.5rem;
    }

    .download-badges.large .badge-link img {
        height: 44px;
    }
}

/* ==================== 通用信息对话框 ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #f8e9c8;
    border: 4px solid #8b5a2b;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    padding: 28px 36px 24px;
    max-width: 380px;
    width: 90%;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.25s;
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #8b5a2b;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #3e2c1c;
}

.modal-content {
    text-align: center;
    color: #5c3a1e;
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 600;
}
