:root {
    --simhub-vh: 100vh;
    --bg-primary: #0a1628;
    --bg-secondary: #0f2140;
    --bg-card: #0f2140;
    --text-primary: #FC8416;
    --text-secondary: #ffaa55;
    --accent: #FC8416;
    --accent-light: #FC8416;
    --accent-glow: rgba(252, 132, 22, 0.3);
    --border: rgba(255, 255, 255, 0.15);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 12px 100px;
}

.header {
    padding: 20px 0 16px;
    text-align: center;
}

.header-logo {
    width: 140px;
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
}

.header-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--accent);
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.search-box {
    position: relative;
    margin: 14px 0 16px;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 48px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: #fff;
    font-size: 15px;
    outline: none;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input:focus ~ .search-icon {
    color: var(--accent);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.search-clear.show {
    display: flex;
}

.notice-banner {
    background: var(--accent);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notice-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notice-text {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.section-count {
    color: var(--text-secondary);
    font-size: 13px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.game-card {
    display: block;
    min-width: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.game-card:active {
    transform: scale(0.95);
}

.game-thumb {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-card);
}

.game-thumb img {
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.simhub-seq-image {
    opacity: 0.35;
    transition: opacity 0.24s ease;
}

.simhub-seq-image.is-loaded {
    opacity: 1;
}

.game-name {
    display: block;
    min-width: 0;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 100;
}

.domain-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.domain-url {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-btn {
    flex-shrink: 0;
    padding: 12px 22px;
    border-radius: 22px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--accent-glow);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.domain-btn:active {
    transform: scale(0.96);
}

.simhub-player-page {
    height: var(--simhub-vh);
    overflow: hidden;
    background: var(--bg-primary);
}

.simhub-player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 58px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.simhub-player-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 88px;
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 19px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.simhub-player-btn.home {
    text-decoration: none;
}

.simhub-player-frame {
    display: block;
    width: 100%;
    height: calc(var(--simhub-vh) - 58px);
    border: 0;
    background: #fff;
}

@media (min-width: 768px) {
    .page-container {
        max-width: 960px;
        padding: 0 20px 80px;
    }

    .game-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 16px;
    }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .domain-bar {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

.back-to-top {
    position: fixed;
    right: 16px;
    bottom: 90px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    -webkit-tap-highlight-color: transparent;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:active {
    transform: scale(0.9);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .back-to-top {
        bottom: calc(90px + env(safe-area-inset-bottom));
    }
}