/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
}

/* Header and Navigation */
.site-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 32px;
    width: auto;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #2575fc;
}

.nav-links a.active {
    color: #2575fc;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 180px;
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.login-btn, .signup-btn {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 0.9rem;
}

.login-btn {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
}

.signup-btn {
    background: #2575fc;
    color: #fff;
}

.login-btn:hover, .signup-btn:hover {
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.games-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #fff, #2575fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.more-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.more-link:hover {
    color: #2575fc;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* 平板和桌面端布局 */
@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* 移动端优化 */
@media (max-width: 767px) {
    .site-header {
        padding: 0.5rem 1rem;
    }

    .main-nav {
        padding: 0;
    }

    .nav-links {
        display: none;
    }

    .main-content {
        padding: 1rem;
    }

    .section-header {
        padding: 0;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .game-card {
        width: 100%;
    }

    .game-card img {
        height: 100px;
    }

    .game-title {
        font-size: 0.8rem;
    }

    .search-input {
        width: 140px;
    }
}

.game-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s;
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-card a {
    text-decoration: none;
    color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card img {
    width: 100%;
    height: 70%;
    object-fit: cover;
}

.game-info {
    padding: 0.5rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    width: 100%;
}

/* Game Detail Page */
.game-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    width: 100%;
    height: 100vh;
}

.game-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
}

.game-title-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.game-title-container h1 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
}

.game-frame-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.game-frame {
    width: 100%;
    border: none;
    background: #000;
}

/* 全屏按钮样式 */
.fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1.5rem;
    padding: 0.3em 0.6em;
    cursor: pointer;
    transition: background 0.2s;
}

.fullscreen-btn:hover {
    background: rgba(37, 117, 252, 0.8);
}

/* PC端iframe自适应内容大小 */
@media (min-width: 768px) {
    .game-frame-container {
        position: relative;
        justify-content: center;
        align-items: center;
        display: flex;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 10px;
        padding: 0;
    }

    .game-frame {
        border-radius: 10px;
        background: #000;
        display: block;
    }
}

/* 移动端全屏，隐藏按钮 */
@media (max-width: 767px) {
    .fullscreen-btn {
        display: none;
    }

    .game-frame-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        max-width: 100vw;
        margin: 0;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 100;
        padding: 0;
    }

    .game-frame {
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        max-width: 100vw;
        border-radius: 0;
        background: #000;
        display: block;
    }
}

/* 移动端游戏页面优化 */
@media (max-width: 767px) {
    body.game-page {
        overflow: hidden;
    }

    .game-page .site-header {
        display: none;
    }

    .game-page .game-container {
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .game-page .game-header {
        display: none;
    }

    .game-page .game-frame-container {
        padding: 0;
    }

    .game-page .game-frame {
        border-radius: 0;
    }
}

/* Game Info Page Styles */
.game-info-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.game-info-main {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 2rem 2.5rem;
    box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.08);
    max-width: 900px;
    width: 100%;
}

.game-info-thumb {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.10);
    background: #fff;
}

.game-info-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-info-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.game-info-desc {
    font-size: 1rem;
    color: #f0f0f0;
    margin: 0 0 0.5rem 0;
    line-height: 1.6;
}

.play-btn {
    display: inline-block;
    background: linear-gradient(90deg, #2575fc 0%, #6a11cb 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 24px;
    padding: 0.7rem 2.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px 0 rgba(37, 117, 252, 0.10);
    transition: background 0.2s, transform 0.2s;
    margin-top: 0.5rem;
}

.play-btn:hover {
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    transform: scale(1.05);
}

@media (max-width: 900px) {
    .game-info-main {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.2rem 1rem;
        gap: 1.2rem;
    }

    .game-info-thumb {
        width: 90px;
        height: 90px;
    }

    .game-info-title {
        font-size: 1.3rem;
    }
}

.site-footer {
    background-color: #f5f5f5;
    color: #666;
    font-size: 14px;
    padding: 20px 0;
    border-top: 1px solid #ddd;
    text-align: center;
    margin-top: 40px;
}

.site-footer a {
    color: #666;
    text-decoration: none;
    margin: 0 8px;
}

.site-footer a:hover {
    color: #000;
    text-decoration: underline;
}

.footer-content p {
    margin: 6px 0;
}

.logo svg text {
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
