/* 基础样式和变量定义 */
:root {
    --bg-color: #0d1117;
    --primary-color: #00e0ff;
    --secondary-color: #39ff14;
    --accent-color: #ff00ff;
    --text-color: #e6e6e6;
    --card-bg: rgba(20, 25, 30, 0.8);
    --border-color: rgba(0, 224, 255, 0.3);
    --glow-color: rgba(0, 224, 255, 0.5);
    --neon-shadow: 0 0 5px var(--primary-color),
    0 0 10px var(--primary-color),
    0 0 15px var(--primary-color);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: color 0.3s, background-color 0.3s, transform 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* 动态粒子背景 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 欢迎动画 */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    animation: fade-out 1.5s forwards 2.5s;
}
.logo-neon {
    width: 100px; /* 根据你的图片大小调整 */
    height: 100px;
    border-radius: 25%; /* 如果是圆形 Logo */
    animation: neon-pulse 1.5s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 5px #00aaff) drop-shadow(0 0 10px #00aaff) drop-shadow(0 0 20px #00aaff);
    transition: transform 0.3s ease;
}

/* 鼠标悬停时的效果 */
.logo-neon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px #00ccff) drop-shadow(0 0 15px #00ccff) drop-shadow(0 0 30px #00ccff);
}

/* 霓虹闪烁动画 */
@keyframes neon-pulse {
    from {
        box-shadow: 0 0 5px #00aaff, 0 0 10px #00aaff;
    }
    to {
        box-shadow: 0 0 10px #00ccff, 0 0 20px #00ccff, 0 0 30px #00ccff;
    }
}
.logo-text {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: var(--neon-shadow);
    animation: text-glow 2s infinite alternate, pulse 2s infinite;
    opacity: 0;
    animation: fade-in 1s forwards, typing 3.5s steps(20) 1s forwards;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

@keyframes text-glow {
    from { text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color); }
    to { text-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--primary-color), 0 0 35px var(--primary-color); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 头部导航 */
header {
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span{
    margin-left: 25px;
}

nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    position: relative;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

nav a:hover::before {
    opacity: 0.2;
}

nav a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

.search-container {
    position: relative;
    margin-left: 20px;
}

.search-container input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px 8px 40px;
    color: var(--text-color);
    width: 200px;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    box-shadow: 0 0 10px var(--primary-color);
    width: 250px;
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

/* 主体内容 */
main {
    padding: 50px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    padding: 100px 0;
    animation: fade-in 1s forwards 3s;
    opacity: 0;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /*width: 300px;*/
    height: 300px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0.1;
    border-radius: 50%;
    animation: pulse 4s infinite alternate;
    z-index: -1;
}

.hero-section h1 {
    font-size: 4rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    text-shadow: var(--neon-shadow);
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 5s infinite alternate;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.hero-section p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: var(--text-color);
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 50px;
    box-shadow: 0 0 15px var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 25px var(--primary-color), 0 0 35px var(--secondary-color);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 60px 0 40px;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 20px 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.game-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    text-align: center;
    padding: 20px;
    position: relative;
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    animation: fade-in-up 0.8s forwards;
    opacity: 0;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--primary-color));
    background-size: 400% 400%;
    z-index: -1;
    border-radius: 16px;
    animation: gradient-border 3s ease infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover::before {
    opacity: 1;
}

@keyframes gradient-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-card:nth-child(1) { animation-delay: 1.5s; }
.game-card:nth-child(2) { animation-delay: 1.7s; }
.game-card:nth-child(3) { animation-delay: 1.9s; }
.game-card:nth-child(4) { animation-delay: 2.1s; }
.game-card:nth-child(5) { animation-delay: 2.3s; }
.game-card:nth-child(6) { animation-delay: 2.5s; }
.game-card:nth-child(7) { animation-delay: 2.7s; }
.game-card:nth-child(8) { animation-delay: 2.9s; }
.game-card:nth-child(9) { animation-delay: 3.1s; }
.game-card:nth-child(10) { animation-delay: 3.3s; }
.game-card:nth-child(11) { animation-delay: 3.5s; }
.game-card:nth-child(12) { animation-delay: 3.7s; }

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(50px) rotateX(10deg); }
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.game-card:hover {
    transform: translateY(-10px) scale(1.03) rotateY(5deg);
    box-shadow: 0 10px 30px rgba(0, 224, 255, 0.3);
}

.game-card img {
    width: 100%;
    /*height: 40%;*/
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.5s ease;
}

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

.game-card h3 {
    margin-top: 15px;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

.game-card p {
    font-size: 0.9rem;
    margin: 10px 0 20px;
    color: #ccc;
}

.game-card .play-button {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-color);
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 0 10px var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-card .play-button:hover {
    box-shadow: 0 0 15px var(--secondary-color);
    transform: translateY(-3px);
}

.game-card .play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.game-card .play-button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% { transform: scale(0, 0); opacity: 0.5; }
    20% { transform: scale(50, 50); opacity: 0.3; }
    100% { transform: scale(100, 100); opacity: 0; }
}

.rating {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    color: #ffcc00;
}

.rating i {
    margin: 0 2px;
}

/* 页脚样式 */
footer {
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    padding: 40px 5%;
    margin-top: 80px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-shadow: 0 0 5px var(--primary-color);
}

.footer-section p, .footer-section a {
    color: #ccc;
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    transform: translateY(-5px);
    box-shadow: 0 0 15px var(--primary-color);
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #888;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 3rem;
    }

    .search-container input {
        width: 150px;
    }

    .search-container input:focus {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 2.5rem;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 5%;
    }

    nav {
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        margin: 5px;
    }

    .search-container {
        margin: 10px 0 0;
        width: 100%;
    }

    .search-container input {
        width: 100%;
    }

    .search-container input:focus {
        width: 100%;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 2rem;
    }

    .hero-section {
        padding: 60px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-card {
        padding: 15px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
    box-shadow: 0 0 5px var(--secondary-color);
}