/* 摸鱼小游戏页独立样式 */


/* 用户自定义：游戏页内容区去背景、顶部间距 */
.dh-content {
    background: none;
    margin-top: 40px;
}

.game-page .game-hero {
    padding: 50px 20px 30px;
    text-align: center;
}

.game-page .game-hero-title {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 1px;
}

.game-page .game-hero-desc {
    margin: 0 0 30px;
    font-size: 15px;
    color: #64748b;
}

.game-page .game-search-box {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    margin-top: 20px;
}

.game-page .game-search-box .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #94a3b8;
    pointer-events: none;
}

.game-page .game-search {
    width: 100%;
    height: 54px;
    padding: 0 20px 0 48px;
    border: none;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    font-size: 15px;
    color: #334155;
    outline: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.game-page .game-search::placeholder {
    color: #94a3b8;
}

.game-page .game-search:focus {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.15);
}

.game-page .game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.game-page .game-grid .styled-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    background: #fff;
    border-radius: 8px;
    padding: 10px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
    transition: 0.2s;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-size: 12.5px;
    font-weight: 500;
    color: #475569;
    min-width: 0;
    text-decoration: none;
}

.game-page .game-grid .styled-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
    color: #3b82f6;
}

.game-page .game-grid .styled-button .game-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background: #eff6ff;
    border-radius: 6px;
    color: #3b82f6;
    fill: currentColor;
}

.game-page .game-grid .game-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.modal-open {
    overflow: hidden !important;
    touch-action: none;
}

.game-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.game-modal-content {
    width: 85vw;
    height: 85vh;
    max-width: 1200px;
    background: #000;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-modal-overlay.active .game-modal-content {
    transform: scale(1);
}

.game-modal-header {
    height: 44px;
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.game-modal-title {
    font-size: 14px;
    color: #f8fafc;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.game-modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.game-modal-actions button {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.game-modal-actions button i {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
}

.game-modal-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.game-modal-actions .btn-close {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.game-modal-actions .btn-close:hover {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
}

.game-modal-body {
    flex: 1;
    position: relative;
    width: 100%;
    height: calc(100% - 44px);
    background: #000;
    overflow: hidden;
}

.game-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
}

@media (max-width: 768px) {
    .game-page .game-hero {
        padding: 30px 15px 20px;
    }
    .game-page .game-hero-title {
        font-size: 24px;
    }
    .game-page .game-hero-desc {
        font-size: 13px;
        margin-bottom: 20px;
    }
    .game-page .game-search {
        height: 48px;
        font-size: 14px;
    }
    .game-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        transform: scale(1) translateY(100%);
        transition: transform 0.3s ease-out;
    }
    .game-modal-overlay.active .game-modal-content {
        transform: scale(1) translateY(0);
    }
    .game-modal-actions button span {
        display: none;
    }
    .game-modal-actions button {
        padding: 6px 12px;
        font-size: 16px;
    }
    .game-modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 640px) {
    .game-page .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }
    .game-page .game-grid .styled-button {
        padding: 8px 6px;
        font-size: 11.5px;
    }
    .game-page .game-grid .styled-button .game-icon {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* 加载图标旋转 */
.game-spin {
    display: inline-block;
    animation: gameSpin 1s linear infinite;
}

@keyframes gameSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============ 夜景模式 ============ */
/* 注意：.game-page 类直接加在 body 上，所以夜间选择器必须用 body.night.game-page（无空格） */
body.night .dh-content{
    background:none;
}
body.night.game-page {
    background-color: #18181b;
}

body.night.game-page .game-hero-title {
    color: #e4e4e7;
}

body.night.game-page .game-hero-desc {
    color: #a1a1aa;
}

body.night.game-page .game-search {
    background: #27272a;
    color: #e4e4e7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.night.game-page .game-search::placeholder {
    color: #71717a;
}

body.night.game-page .game-search:focus {
    box-shadow: 0 6px 24px rgba(96, 165, 250, 0.25);
}

body.night.game-page .game-search-box .search-icon {
    color: #71717a;
}

body.night.game-page .game-grid .styled-button {
    background: #27272a;
    border-color: #3f3f46;
    color: #d4d4d8;
    box-shadow: none;
}

body.night.game-page .game-grid .styled-button:hover {
    border-color: #60a5fa;
    color: #60a5fa;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
}

body.night.game-page .game-grid .styled-button .game-icon {
    background: #1e3a5f;
    color: #60a5fa;
}

.game-hero p {
    font-size: 15px;
    color: #898a95;
    line-height: 25px;
}
