* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: light; background-color: #f8f9fa; }
body { margin: 0; background-color: #f8f9fa; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* ---------- 竖屏 / 窄屏：单栏卡片 ---------- */
.container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

/* 封面：与文字同宽；高度随图片自身比例 */
.visual-wrap {
    width: 100%;
    background-color: #eeeeee;
}
.main-img {
    width: 100%;
    height: auto;
    display: block;
}

.content-box { padding: 24px; text-align: left; }

/* 返回当前语种目录页（../ → /{lang}/） */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 500;
    color: #007aff;
    text-decoration: none;
    line-height: 1.2;
}
.back-link::before {
    content: "‹";
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    margin-top: -1px;
}
.back-link:hover { opacity: 0.75; }
.back-link:active { opacity: 0.55; }

h1 { font-size: 24px; margin: 0 0 8px; color: #1a1a1a; }
.desc { font-size: 16px; color: #666; margin: 0 0 24px; line-height: 1.5; }

/* 主按钮：在 Gamiko 中打开 */
.btn-open {
    width: 100%; background-color: #007aff; color: #fff; border: none;
    padding: 18px; border-radius: 16px; font-size: 18px; font-weight: bold;
    cursor: pointer; transition: transform 0.2s;
    box-shadow: 0 8px 20px rgba(0,122,255,0.2);
}
.btn-open:active { transform: scale(0.98); }

/* 分割提示词 */
.divider { margin: 32px 0 16px; position: relative; text-align: center; }
.divider span {
    font-size: 14px; color: #999; background-color: #ffffff; padding: 0 12px;
    position: relative; z-index: 1;
}
.divider::before {
    content: ""; position: absolute; top: 50%; left: 0; width: 100%;
    height: 1px; background-color: #eeeeee;
}

/* 下载按钮组 */
.dl-group { display: flex; flex-direction: column; gap: 12px; }
.dl-btn {
    text-decoration: none; padding: 14px; border-radius: 12px;
    font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.dl-btn.rec { background-color: #f0f7ff; color: #007aff; border: 1.5px solid #007aff; font-weight: 600; }
.dl-btn.sub { background-color: #f5f5f7; color: #444; border: 1.5px solid #eeeeee; }

.tag { font-style: normal; margin-left: 6px; font-size: 12px; }

.fail-tip {
    font-size: 13px;
    color: #ff9500;
    margin: 12px 0 0;
    line-height: 1.5;
    background-color: #fff9f0;
    padding: 10px;
    border-radius: 8px;
    text-align: left;
}

.btn-open:disabled {
    box-shadow: none;
}

/* 语种目录页 */
.catalog-page .container { max-width: 640px; }
.catalog-page h1 { margin-bottom: 20px; }
.catalog-section { margin-bottom: 28px; }
.catalog-section h2 { scroll-margin-top: 16px; }
html:has(body.catalog-page) { scroll-behavior: smooth; }
.catalog-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.catalog-tags a {
    padding: 6px 12px; border-radius: 999px; font-size: 14px;
    background-color: #eef4ff; color: #007aff; text-decoration: none; border: 1px solid #d6e4ff;
}
.catalog-tags a:hover, .catalog-tags a:active { background-color: #dce9ff; }
.catalog-section h2 {
    font-size: 17px; font-weight: 600; color: #333;
    margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid #eee;
}
.catalog-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.catalog-list a {
    display: block; padding: 12px 14px; border-radius: 10px;
    background-color: #f5f5f7; color: #007aff; text-decoration: none;
    font-size: 15px; line-height: 1.35;
    border: 1px solid #eeeeee;
}
.catalog-list a:active { background-color: #ebebed; }
.catalog-list a:hover { background-color: #ebebed; }

/* ---------- 宽屏：宽 > 高，且有足够横向空间 ---------- */
@media (orientation: landscape) and (min-width: 720px) {
    body.game-page {
        background-color: #ececef;
    }

    body.game-page .container {
        max-width: min(1080px, 96vw);
        min-height: 100vh;
        flex-direction: row;
        align-items: stretch;
        margin: 0 auto;
        box-shadow: 0 0 0 1px rgba(0,0,0,0.04);
    }

    /* 左侧封面：固定栏宽，高度随图比例 */
    body.game-page .visual-wrap {
        flex: 0 0 min(46vw, 520px);
        width: min(46vw, 520px);
        max-width: 46%;
        align-self: center;
        margin: 28px 0 28px 28px;
        border-radius: 20px;
        overflow: hidden;
        background-color: transparent;
    }

    body.game-page .content-box {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 40px 48px 40px 36px;
    }

    body.game-page h1 { font-size: 28px; }
    body.game-page .desc { font-size: 17px; max-width: 40em; }

    body.game-page .dl-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
    body.game-page .dl-btn {
        flex: 1 1 140px;
    }

    /* 目录页：宽屏多列 */
    .catalog-page .container {
        max-width: min(960px, 92vw);
        min-height: auto;
        margin: 32px auto;
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    }
    .catalog-page .catalog-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* 超宽桌面再松一点 */
@media (orientation: landscape) and (min-width: 1100px) {
    body.game-page .container {
        max-width: min(1200px, 92vw);
        margin: 24px auto;
        min-height: calc(100vh - 48px);
        border-radius: 24px;
        overflow: hidden;
        box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    }
    body.game-page .visual-wrap {
        flex-basis: 560px;
        width: 560px;
        max-width: 48%;
        margin: 36px 0 36px 36px;
    }
}
