/**
 * ============================================================
 * 德扑圈 - 像素复古风 (Pixel Retro Style)
 * 8-bit/16-bit Gaming Aesthetic
 * ============================================================
 */

/* ===== CSS 变量 ===== */
:root {
    --retro-dark: #0f0f23;
    --retro-darker: #080816;
    --retro-card: #1a1a2e;
    --retro-purple: #7c3aed;
    --retro-darkpurple: #4c1d95;
    --retro-green: #4ade80;
    --retro-green-glow: #4ade80;
    --retro-amber: #fcd34d;
    --retro-red: #ef4444;
    --retro-border: #6d28d9;
    --pixel-size: 4px;
    --font-pixel: 'Press Start 2P', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--retro-darker);
    color: #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===== 扫描线覆盖层 ===== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
}

/* ===== 像素网格背景 ===== */
.pixel-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ===== 像素边框 - box-shadow 技术 ===== */
.pixel-border {
    border: 2px solid var(--retro-border);
    box-shadow:
        4px 0 0 0 var(--retro-darkpurple),
        -4px 0 0 0 var(--retro-darkpurple),
        0 4px 0 0 var(--retro-darkpurple),
        0 -4px 0 0 var(--retro-darkpurple),
        0 0 0 4px var(--retro-dark);
    image-rendering: pixelated;
}

.pixel-border-green {
    border: 2px solid var(--retro-green);
    box-shadow:
        4px 0 0 0 #166534,
        -4px 0 0 0 #166534,
        0 4px 0 0 #166534,
        0 -4px 0 0 #166534,
        0 0 0 4px var(--retro-dark);
}

.pixel-border-amber {
    border: 2px solid var(--retro-amber);
    box-shadow:
        4px 0 0 0 #92400e,
        -4px 0 0 0 #92400e,
        0 4px 0 0 #92400e,
        0 -4px 0 0 #92400e,
        0 0 0 4px var(--retro-dark);
}

.pixel-border-purple {
    border: 2px solid var(--retro-purple);
    box-shadow:
        4px 0 0 0 var(--retro-darkpurple),
        -4px 0 0 0 var(--retro-darkpurple),
        0 4px 0 0 var(--retro-darkpurple),
        0 -4px 0 0 var(--retro-darkpurple),
        0 0 0 4px var(--retro-dark);
}

/* ===== 绿色发光文字 ===== */
.glow-green {
    text-shadow:
        0 0 7px var(--retro-green),
        0 0 10px var(--retro-green),
        0 0 21px var(--retro-green),
        0 0 42px #16a34a;
}

.glow-purple {
    text-shadow:
        0 0 7px var(--retro-purple),
        0 0 10px var(--retro-purple),
        0 0 21px var(--retro-purple);
}

.glow-amber {
    text-shadow:
        0 0 7px var(--retro-amber),
        0 0 10px var(--retro-amber),
        0 0 21px var(--retro-amber);
}

/* ===== 导航栏 ===== */
.retro-nav {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f23 100%);
    border-bottom: 4px solid var(--retro-border);
    box-shadow:
        0 4px 0 0 var(--retro-darkpurple),
        0 8px 24px rgba(124, 58, 237, 0.15);
}

.nav-link {
    color: #c4b5fd;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: inline-block;
}

.nav-link:hover,
.nav-link.active {
    color: var(--retro-green);
    border: 2px solid var(--retro-green);
    box-shadow:
        4px 0 0 0 #166534,
        -4px 0 0 0 #166534;
    background: rgba(74, 222, 128, 0.05);
}

.mobile-nav-link {
    color: #c4b5fd;
    text-decoration: none;
    padding: 10px 16px;
    display: block;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    color: var(--retro-green);
    border: 2px solid var(--retro-green);
    background: rgba(74, 222, 128, 0.05);
    padding-left: 24px;
}

/* ===== Hero 区域 ===== */
.hero-section {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background:
        radial-gradient(ellipse at center, rgba(124, 58, 237, 0.15) 0%, transparent 70%),
        var(--retro-dark);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(74, 222, 128, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 222, 128, 0.04) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: grid-scroll 20s linear infinite;
}

@keyframes grid-scroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.hero-title {
    font-family: var(--font-pixel);
    color: var(--retro-green);
    line-height: 1.6;
}

/* ===== 像素复古按钮 ===== */
.btn-retro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: var(--font-pixel);
    font-size: 13px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 3px solid var(--retro-green);
    background: linear-gradient(180deg, #166534 0%, #14532d 100%);
    color: var(--retro-green);
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    box-shadow:
        0 6px 0 0 #052e16,
        0 8px 16px rgba(0, 0, 0, 0.4);
}

.btn-retro:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 0 0 #052e16,
        0 12px 24px rgba(0, 0, 0, 0.5);
}

.btn-retro:active {
    transform: translateY(4px);
    box-shadow:
        0 2px 0 0 #052e16,
        0 4px 8px rgba(0, 0, 0, 0.4);
}

.btn-retro-amber {
    border-color: var(--retro-amber);
    background: linear-gradient(180deg, #92400e 0%, #78350f 100%);
    color: var(--retro-amber);
    box-shadow:
        0 6px 0 0 #451a03,
        0 8px 16px rgba(0, 0, 0, 0.4);
}

.btn-retro-amber:hover {
    box-shadow:
        0 8px 0 0 #451a03,
        0 12px 24px rgba(0, 0, 0, 0.5);
}

/* 闪烁按钮 */
.btn-flash {
    animation: btn-flash 1.5s ease-in-out infinite;
}

@keyframes btn-flash {
    0%, 100% {
        box-shadow: 0 6px 0 0 #052e16, 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 20px rgba(74, 222, 128, 0.3);
    }
    50% {
        box-shadow: 0 6px 0 0 #052e16, 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 40px rgba(74, 222, 128, 0.7), 0 0 80px rgba(74, 222, 128, 0.3);
    }
}

/* ===== 功能卡片 ===== */
.feature-card {
    background: var(--retro-card);
    border: 2px solid var(--retro-darkpurple);
    padding: 28px 24px;
    position: relative;
    transition: all 0.3s ease;
    /* 像素化边框效果 */
    box-shadow:
        4px 0 0 0 var(--retro-darkpurple),
        -4px 0 0 0 var(--retro-darkpurple),
        0 4px 0 0 var(--retro-darkpurple),
        0 -4px 0 0 var(--retro-darkpurple),
        0 0 0 6px rgba(0, 0, 0, 0.3);
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--retro-green);
    box-shadow:
        6px 0 0 0 #166534,
        -6px 0 0 0 #166534,
        0 6px 0 0 #166534,
        0 -6px 0 0 #166534,
        0 0 0 8px rgba(0, 0, 0, 0.4),
        0 12px 32px rgba(74, 222, 128, 0.1);
}

.feature-card .feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--retro-purple);
    background: rgba(124, 58, 237, 0.1);
    margin-bottom: 16px;
    box-shadow:
        3px 0 0 0 var(--retro-darkpurple),
        -3px 0 0 0 var(--retro-darkpurple),
        0 3px 0 0 var(--retro-darkpurple),
        0 -3px 0 0 var(--retro-darkpurple);
}

.feature-card:hover .feature-icon {
    border-color: var(--retro-green);
    background: rgba(74, 222, 128, 0.1);
    box-shadow:
        3px 0 0 0 #166534,
        -3px 0 0 0 #166534;
}

/* ===== 街机风格统计计数器 ===== */
.arcade-stat {
    background: var(--retro-card);
    border: 3px solid var(--retro-amber);
    text-align: center;
    padding: 24px 16px;
    position: relative;
    box-shadow:
        4px 0 0 0 #92400e,
        -4px 0 0 0 #92400e,
        0 4px 0 0 #92400e,
        0 -4px 0 0 #92400e,
        0 0 0 6px rgba(0, 0, 0, 0.3);
    font-family: var(--font-pixel);
}

.arcade-stat .stat-number {
    font-size: 2.5rem;
    color: var(--retro-amber);
    text-shadow:
        0 0 10px var(--retro-amber),
        0 0 20px var(--retro-amber);
    line-height: 1.2;
}

.arcade-stat .stat-label {
    font-size: 10px;
    color: #fbbf24;
    margin-top: 8px;
    letter-spacing: 0.1em;
}

.arcade-stat::after {
    content: 'SCORE';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--retro-amber);
    background: var(--retro-darker);
    padding: 2px 8px;
    border: 1px solid var(--retro-amber);
}

/* ===== 评价气泡 ===== */
.testimonial-bubble {
    background: var(--retro-card);
    border: 3px solid var(--retro-purple);
    position: relative;
    padding: 24px;
    box-shadow:
        4px 0 0 0 var(--retro-darkpurple),
        -4px 0 0 0 var(--retro-darkpurple),
        0 4px 0 0 var(--retro-darkpurple),
        0 -4px 0 0 var(--retro-darkpurple);
}

.testimonial-bubble::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 18px solid var(--retro-card);
}

.testimonial-bubble::before {
    content: '';
    position: absolute;
    bottom: -24px;
    left: 26px;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 20px solid var(--retro-purple);
    z-index: -1;
}

.testimonial-avatar {
    width: 64px;
    height: 64px;
    border: 3px solid var(--retro-green);
    box-shadow:
        3px 0 0 0 #166534,
        -3px 0 0 0 #166534;
    image-rendering: pixelated;
    object-fit: cover;
}

/* ===== FAQ 像素风格手风琴 ===== */
.faq-item {
    border: 2px solid var(--retro-darkpurple);
    margin-bottom: 8px;
    background: var(--retro-card);
    transition: all 0.3s ease;
    box-shadow:
        3px 0 0 0 var(--retro-darkpurple),
        -3px 0 0 0 var(--retro-darkpurple);
}

.faq-item.active {
    border-color: var(--retro-green);
    box-shadow:
        3px 0 0 0 #166534,
        -3px 0 0 0 #166534;
}

.faq-question {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-pixel);
    font-size: 11px;
    color: var(--retro-green);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(74, 222, 128, 0.05);
}

.faq-question i {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 20px 16px;
}

/* ===== 下载页面样式 ===== */
.download-card {
    background: var(--retro-card);
    border: 3px solid var(--retro-purple);
    box-shadow:
        4px 0 0 0 var(--retro-darkpurple),
        -4px 0 0 0 var(--retro-darkpurple),
        0 4px 0 0 var(--retro-darkpurple),
        0 -4px 0 0 var(--retro-darkpurple),
        0 0 0 8px rgba(0, 0, 0, 0.3);
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-pixel);
    font-size: 10px;
    padding: 6px 14px;
    border: 2px solid;
}

.platform-badge.ios {
    border-color: #a5b4fc;
    color: #a5b4fc;
    box-shadow: 3px 0 0 0 #4338ca;
}

.platform-badge.android {
    border-color: var(--retro-green);
    color: var(--retro-green);
    box-shadow: 3px 0 0 0 #166534;
}

.download-qr {
    width: 160px;
    height: 160px;
    border: 4px solid var(--retro-green);
    box-shadow:
        5px 0 0 0 #166534,
        -5px 0 0 0 #166534,
        0 5px 0 0 #166534,
        0 -5px 0 0 #166534;
    background: #fff;
    padding: 8px;
    image-rendering: pixelated;
}

/* ===== 街机页面样式 ===== */
.arcade-screen {
    background: #0a0a1a;
    border: 6px solid #1a1a3e;
    box-shadow:
        inset 0 0 60px rgba(74, 222, 128, 0.05),
        8px 0 0 0 var(--retro-darkpurple),
        -8px 0 0 0 var(--retro-darkpurple),
        0 8px 0 0 var(--retro-darkpurple),
        0 -8px 0 0 var(--retro-darkpurple),
        0 0 0 12px rgba(0, 0, 0, 0.5);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.arcade-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.04) 3px,
        rgba(0, 0, 0, 0.04) 6px
    );
    pointer-events: none;
    z-index: 2;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
    font-family: var(--font-pixel);
    font-size: 10px;
}

.leaderboard-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.rank-1 { color: var(--retro-amber); text-shadow: 0 0 8px var(--retro-amber); }
.rank-2 { color: #c0c0c0; text-shadow: 0 0 8px #c0c0c0; }
.rank-3 { color: #cd7f32; text-shadow: 0 0 8px #cd7f32; }

/* ===== 页脚 ===== */
.retro-footer {
    background: linear-gradient(180deg, #0f0f23 0%, #080816 100%);
}

.footer-link {
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    padding: 2px 0;
}

.footer-link:hover {
    color: var(--retro-green);
    padding-left: 6px;
}

.footer-social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--retro-darkpurple);
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow:
        2px 0 0 0 var(--retro-darkpurple),
        -2px 0 0 0 var(--retro-darkpurple);
}

.footer-social-icon:hover {
    border-color: var(--retro-green);
    color: var(--retro-green);
    box-shadow:
        2px 0 0 0 #166534,
        -2px 0 0 0 #166534;
}

/* ===== 客服浮动按钮 ===== */
.cs-float-btn {
    width: 50px;
    height: 50px;
    border-radius: 0;
    border: 3px solid var(--retro-green);
    background: var(--retro-dark);
    color: var(--retro-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow:
        3px 0 0 0 #166534,
        -3px 0 0 0 #166534,
        0 3px 0 0 #166534,
        0 -3px 0 0 #166534,
        0 4px 12px rgba(0, 0, 0, 0.4);
}

.cs-float-btn:hover {
    transform: scale(1.1);
    box-shadow:
        3px 0 0 0 #166534,
        -3px 0 0 0 #166534,
        0 3px 0 0 #166534,
        0 -3px 0 0 #166534,
        0 0 20px rgba(74, 222, 128, 0.4);
}

.cs-tooltip {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--retro-card);
    color: var(--retro-green);
    padding: 6px 10px;
    border: 2px solid var(--retro-green);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: 2px 0 0 0 #166534, -2px 0 0 0 #166534;
}

.cs-float-btn:hover .cs-tooltip {
    opacity: 1;
}

/* 客服弹窗 */
.cs-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-modal.hidden {
    display: none;
}

.cs-modal-content {
    background: var(--retro-card);
    border: 4px solid var(--retro-green);
    box-shadow:
        6px 0 0 0 #166534,
        -6px 0 0 0 #166534,
        0 6px 0 0 #166534,
        0 -6px 0 0 #166534,
        0 0 0 10px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.cs-modal-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(22, 101, 52, 0.3);
    border-bottom: 2px solid #166534;
}

.cs-modal-body {
    font-size: 14px;
}

/* ===== 工具类 ===== */
.text-retro-green { color: var(--retro-green); }
.text-retro-amber { color: var(--retro-amber); }
.text-retro-purple { color: var(--retro-purple); }
.bg-retro-card { background: var(--retro-card); }
.bg-retro-dark { background: var(--retro-dark); }

/* ===== 动画 ===== */
@keyframes pixel-fade-in {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.animate-pixel-in {
    animation: pixel-fade-in 0.5s ease-out forwards;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.blink {
    animation: blink 1s step-end infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.2rem !important;
    }

    .arcade-stat .stat-number {
        font-size: 1.8rem;
    }

    .arcade-stat .stat-label {
        font-size: 8px;
    }

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

    .btn-retro {
        padding: 10px 20px;
        font-size: 10px;
    }

    .testimonial-avatar {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 0.9rem !important;
    }

    .arcade-stat .stat-number {
        font-size: 1.4rem;
    }
}
