* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: #333;
    background: #f5f5f5;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
}

img {
    display: block;
    max-width: 100%;
}

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

.site-header {
    position: relative;
    height: 230px;
    overflow: hidden;
    background: #07131e url("../images/top.jpg") center 48% / cover no-repeat;
    border-bottom: 1px solid #172b3b;
}

.site-header::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.02) 56%, rgba(0, 0, 0, 0.12));
    content: "";
}

.header-inner {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.header-title {
    text-align: center;
}

.header-title strong,
.header-title span {
    display: block;
}

.header-title strong {
    color: #fff;
    font-size: 44px;
    font-weight: 700;
    letter-spacing: 8px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.header-title span {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 16px;
    letter-spacing: 2px;
}

.page-shell {
    width: min(1200px, calc(100% - 32px));
    min-height: calc(100vh - 366px);
    margin: 0 auto;
    padding-top: 30px;
}

.catalog-panel,
.detail-panel {
    background: #fff;
    border-top: 3px solid #ff7800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.section-heading {
    height: 72px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.section-heading h1,
.section-heading span {
    margin: 0;
}

.section-heading h1 {
    color: #222;
    font-size: 22px;
    font-weight: 600;
}

.section-heading span {
    color: #999;
    font-size: 13px;
}

.section-heading b {
    color: #f56b00;
    font-weight: 400;
}

.game-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 18px 28px 26px;
    gap: 20px 24px;
}

.game-card {
    min-width: 0;
    min-height: 180px;
    padding: 18px;
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.game-card:hover {
    border-color: #ffb27a;
    box-shadow: 0 2px 12px rgba(255, 120, 0, 0.12);
}

.game-logo {
    width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.game-logo img {
    height: 110px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.game-logo-cover img {
    height: 140px;
}

.game-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.game-name {
    color: #222;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.game-name:hover {
    color: #f36f00;
}

.game-tag {
    display: inline-block;
    width: fit-content;
    padding: 2px 10px;
    color: #f56b00;
    background: #fff3e8;
    border: 1px solid #ffd1a8;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.6;
}

.game-desc {
    margin: 4px 0 0;
    color: #666;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-link {
    flex-shrink: 0;
    width: 88px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f36f00;
    background: #fff;
    border: 1px solid #ff8b32;
    border-radius: 3px;
    font-size: 13px;
    transition: background-color 0.15s, color 0.15s;
}

.detail-link:hover {
    color: #fff;
    background: #ff7800;
}

.back-home {
    padding: 18px 0 6px;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 8px 12px;
    color: #555;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    background: #fafafa;
    transition: all 0.2s;
    line-height: 1;
}

.back-icon {
    width: 14px;
    height: 14px;
}

.back-home-btn:hover {
    color: #fff;
    background: #ff7800;
    border-color: #ff7800;
    transform: translateX(-2px);
}

.detail-hero {
    min-height: 320px;
    padding: 40px 36px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 220px;
    align-items: center;
    gap: 36px;
    border-bottom: 1px solid #eee;
}

.detail-logo {
    width: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
}

.detail-logo img {
    height: 180px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.detail-summary {
    min-width: 0;
}

.detail-summary h1 {
    margin: 0 0 16px;
    color: #222;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.detail-summary ul {
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 9px;
    color: #777;
    list-style: none;
}

.detail-summary p {
    max-width: 650px;
    margin: 16px 0 0;
    color: #666;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.download-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.android-download,
.download-disabled {
    min-height: 48px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.android-download {
    color: #fff;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3);
}

.android-download:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(34, 197, 94, 0.4);
}

.download-disabled {
    color: #999;
    background: #eee;
    cursor: not-allowed;
}

.detail-body {
    padding: 8px 36px 42px;
}

.content-heading {
    height: 70px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.content-heading h2 {
    position: relative;
    margin: 0;
    padding-left: 13px;
    color: #222;
    font-size: 20px;
    font-weight: 600;
}

.content-heading h2::before {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 4px;
    background: #ff7800;
    content: "";
}

.detail-copy {
    padding: 22px 2px 2px;
    color: #555;
    font-size: 15px;
    line-height: 2;
    overflow-wrap: anywhere;
}

.detail-copy p {
    margin: 0 0 12px;
}

.feature-list {
    margin: 0;
    padding: 18px 0 0;
    color: #555;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding: 7px 0 7px 22px;
    font-size: 15px;
    line-height: 1.8;
}

.feature-list li::before {
    position: absolute;
    top: 18px;
    left: 3px;
    width: 6px;
    height: 6px;
    background: #ff7800;
    border-radius: 50%;
    content: "";
}

.screenshot-gallery {
    position: relative;
    width: min(100%, 1080px);
    aspect-ratio: 16 / 9;
    margin: 24px auto 0;
    overflow: hidden;
    background: #222;
    border-radius: 4px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
    isolation: isolate;
}

.carousel-viewport,
.carousel-track {
    width: 100%;
    height: 100%;
}

.carousel-viewport {
    overflow: hidden;
}

.carousel-track {
    position: relative;
}

.carousel-slide {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-50%);
    transition: left 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}

.carousel-slide.is-previous {
    z-index: 1;
    left: calc(50% - 18%);
    opacity: 1;
    transform: translateX(-50%);
    pointer-events: auto;
}

.carousel-slide.is-next {
    z-index: 1;
    left: calc(50% + 18%);
    opacity: 1;
    transform: translateX(-50%);
    pointer-events: auto;
}

.carousel-slide.is-active {
    z-index: 2;
    left: 50%;
    opacity: 1;
    transform: translateX(-50%);
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 9px rgba(0, 0, 0, 0.12));
}

.carousel-button {
    position: absolute;
    z-index: 3;
    top: 50%;
    width: 46px;
    height: 58px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f36f00;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: Arial, sans-serif;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.carousel-button:hover,
.carousel-button:focus-visible {
    color: #fff;
    background: #ff7800;
    border-color: #ff7800;
    outline: none;
}

.carousel-button.previous {
    left: 18px;
}

.carousel-button.next {
    right: 18px;
}

.carousel-dots {
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 17px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.carousel-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    background: #bdbdbd;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: width 0.2s, background-color 0.2s;
}

.carousel-dot.is-active {
    width: 24px;
    background: #ff7800;
    border-radius: 5px;
}

.carousel-counter {
    position: absolute;
    z-index: 3;
    right: 18px;
    top: 16px;
    min-width: 48px;
    padding: 5px 9px;
    color: #555;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .carousel-slide,
    .carousel-dot {
        transition: none;
    }
}

/* Kept as a single large viewport even when a game has only one screenshot. */
.screenshot-gallery.is-single .carousel-counter {
    display: none;
}

.screenshot-gallery.is-single .carousel-slide {
    left: 50%;
    width: 100%;
    opacity: 1;
    filter: none;
    transform: translateX(-50%);
}

/* Legacy direct images remain safe if JavaScript is unavailable mid-render. */
.screenshot-gallery > img {
    padding-top: 24px;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-footer {
    margin-top: 44px;
    background: #1e1e1e;
    color: #aaa;
    font-size: 13px;
    line-height: 1.8;
}

.footer-inner {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 20px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
}

.footer-section h4 {
    margin: 0 0 12px;
    color: #ddd;
    font-size: 15px;
    font-weight: 600;
}

.footer-section p {
    margin: 0;
    color: #999;
    font-size: 13px;
    line-height: 1.9;
}

.footer-bottom {
    border-top: 1px solid #2e2e2e;
    text-align: center;
    padding: 16px 20px;
    color: #777;
    font-size: 12px;
    line-height: 1.8;
}

.footer-bottom p {
    margin: 0;
}

@media (max-width: 860px) {
    .site-header {
        height: 170px;
        background-position: 42% 50%;
    }

    .header-inner,
    .page-shell {
        width: min(100% - 24px, 1200px);
    }

    .header-title strong {
        font-size: 30px;
        letter-spacing: 5px;
    }

    .header-title span {
        font-size: 13px;
        letter-spacing: 1px;
    }

    .page-shell {
        min-height: calc(100vh - 302px);
        padding-top: 22px;
    }

    .game-list {
        grid-template-columns: 1fr;
    }

    .detail-hero {
        grid-template-columns: 160px minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 24px;
        padding: 30px 28px;
    }

    .detail-logo {
        width: 160px;
    }

    .detail-logo img {
        height: 130px;
    }

    .download-wrap {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: row;
        padding: 16px 24px;
        gap: 16px;
        text-align: left;
    }

    .android-download,
    .download-disabled {
        width: auto;
        padding: 0 32px;
    }
}

@media (max-width: 560px) {
    .site-header {
        height: 138px;
        background-position: 38% 50%;
    }

    .header-inner,
    .page-shell {
        width: min(100% - 20px, 1200px);
    }

    .header-title strong {
        font-size: 24px;
        letter-spacing: 3px;
    }

    .header-title span {
        font-size: 12px;
        letter-spacing: 0;
        margin-top: 8px;
    }

    .page-shell {
        padding-top: 16px;
    }

    .section-heading {
        height: 60px;
        padding: 0 16px;
    }

    .section-heading h1 {
        font-size: 19px;
    }

    .game-list {
        padding: 0 16px 18px;
    }

    .game-card {
        min-height: 140px;
        padding: 14px;
        grid-template-columns: 90px minmax(0, 1fr);
        gap: 14px;
    }

    .game-logo {
        width: 90px;
        border-radius: 6px;
    }

    .game-logo img {
        height: 70px;
    }

    .game-logo-cover img {
        height: 88px;
    }

    .game-title-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .game-name {
        font-size: 16px;
        white-space: normal;
    }

    .game-tag {
        font-size: 11px;
        padding: 1px 8px;
    }

    .game-desc {
        font-size: 12px;
        line-height: 1.6;
    }

    .detail-link {
        width: 72px;
        height: 28px;
        font-size: 12px;
    }

    .detail-hero {
        padding: 22px 18px 24px;
        grid-template-columns: 100px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        align-items: start;
        gap: 14px;
    }

    .detail-logo {
        grid-column: 1;
        grid-row: 1;
        width: 100px;
        border-radius: 7px;
    }

    .detail-logo img {
        height: 80px;
    }

    .detail-summary {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .detail-summary h1 {
        font-size: 19px;
        margin-bottom: 10px;
    }

    .download-wrap {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: row;
        padding: 14px 18px;
        gap: 12px;
        text-align: left;
    }

    .android-download,
    .download-disabled {
        width: auto;
        min-height: 40px;
        padding: 0 20px;
        font-size: 14px;
    }

    .detail-summary ul {
        margin-top: 0;
        grid-template-columns: 1fr;
        row-gap: 4px;
        font-size: 12px;
    }

    .detail-summary ul li:nth-child(2),
    .detail-summary ul li:nth-child(4) {
        display: none;
    }

    .detail-summary p {
        grid-column: 1 / -1;
        grid-row: 2;
        margin: 12px 0 0;
        font-size: 13px;
        line-height: 1.75;
    }

    .detail-body {
        padding: 4px 18px 28px;
    }

    .content-heading {
        height: 58px;
    }

    .content-heading h2 {
        font-size: 18px;
    }

    .detail-copy,
    .feature-list li {
        font-size: 14px;
    }

    .screenshot-gallery {
        margin-top: 18px;
        border-radius: 2px;
    }

    .carousel-button {
        width: 38px;
        height: 48px;
        font-size: 34px;
    }

    .carousel-button.previous {
        left: 8px;
    }

    .carousel-button.next {
        right: 8px;
    }

    .carousel-dots {
        bottom: 10px;
    }

    .carousel-counter {
        top: 9px;
        right: 9px;
    }

    .site-footer {
        margin-top: 28px;
        font-size: 12px;
    }

    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
        padding: 24px 0 16px;
    }

    .footer-section h4 {
        font-size: 14px;
    }

    .footer-bottom {
        font-size: 11px;
        padding: 12px 16px;
    }
}
