/* ============================================================
   小游戏页统一版式（/css/games/page.css）
   配合 Blade 组件 <x-game-page> 使用，类名前缀 gp-（Game Page）
   颜色全部取站点主题变量，[data-theme="dark"] 自动适配深色模式
   与游戏套件样式 common.css（gk- 前缀）互不干扰：
   gk- 负责「游戏区控件」，gp- 负责「页面版式」
   ============================================================ */

.gp-page {
    padding: 14px 0 40px;
    --gp-brand: #6366f1;
    --gp-brand-2: #8b5cf6;
    --gp-brand-3: #d946ef;
    --gp-ring: rgba(99, 102, 241, .22);
}

/* ---------- 面包屑 ---------- */
.gp-crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 14px;
    font-size: 13px;
    color: var(--c-text-muted, #8a93a8);
}

.gp-crumb a {
    color: var(--c-text-sub, #5b6478);
    text-decoration: none;
    transition: color .15s;
}

.gp-crumb a:hover { color: var(--gp-brand); }
.gp-crumb .sep { opacity: .45; }
.gp-crumb .current {
    color: var(--c-text, #1a1f36);
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Hero：左文案 + 右信息卡 ---------- */
.gp-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 24px;
    padding: 26px 28px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 22px;
    background:
        radial-gradient(120% 150% at 0 0, rgba(99, 102, 241, .12), transparent 58%),
        radial-gradient(90% 120% at 100% 0, rgba(217, 70, 239, .08), transparent 60%),
        var(--c-surface, #fff);
    box-shadow: var(--shadow-md, 0 4px 16px rgba(16, 24, 40, .06));
    overflow: hidden;
}

.gp-hero-copy { min-width: 0; }

/* 没有 stats 时不渲染右侧信息卡，Hero 单栏铺满 */
.gp-hero.is-solo { grid-template-columns: minmax(0, 1fr); }

.gp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--gp-ring);
    border-radius: 999px;
    background: rgba(99, 102, 241, .10);
    color: #4f46e5;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.gp-hero h1 {
    margin: 14px 0 0;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.02em;
    color: var(--c-text, #1a1f36);
}

.gp-hero h1 em {
    display: block;
    margin-top: 8px;
    font-style: normal;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0;
    color: var(--c-text-sub, #5b6478);
}

.gp-lead {
    margin: 12px 0 0;
    max-width: 64ch;
    font-size: 14.5px;
    line-height: 1.9;
    color: var(--c-text-sub, #5b6478);
}

.gp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.gp-tags li {
    padding: 5px 12px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 999px;
    background: var(--c-surface-soft, #f8fafc);
    color: var(--c-text-sub, #5b6478);
    font-size: 12.5px;
    font-weight: 600;
}

.gp-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 12px;
    background: var(--c-surface, #fff);
    color: var(--c-text, #1a1f36);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}

.gp-btn:hover {
    transform: translateY(-1px);
    border-color: var(--gp-ring);
    box-shadow: 0 8px 18px rgba(99, 102, 241, .14);
    text-decoration: none;
}

.gp-btn:active { transform: translateY(1px); }

.gp-btn.is-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--gp-brand) 0%, var(--gp-brand-2) 55%, var(--gp-brand-3) 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(99, 102, 241, .28);
}

.gp-btn.is-primary:hover {
    box-shadow: 0 16px 32px rgba(99, 102, 241, .34);
}

.gp-btn.is-quiet {
    border-color: transparent;
    background: transparent;
    color: var(--c-text-muted, #8a93a8);
    box-shadow: none;
}

.gp-btn.is-quiet:hover {
    color: var(--gp-brand);
    background: rgba(99, 102, 241, .08);
    box-shadow: none;
}

.gp-btn-arrow { transition: transform .15s; }
.gp-btn:hover .gp-btn-arrow { transform: translateX(3px); }

/* Hero 右侧信息卡 */
.gp-hero-side {
    padding: 16px 18px 18px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 16px;
    background: var(--c-bg-card, #fff);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(16, 24, 40, .04));
}

.gp-side-head {
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px dashed var(--c-border, #eef1f6);
    font-size: 14px;
    font-weight: 800;
    color: var(--c-text, #1a1f36);
}

.gp-stats { margin: 0; }

.gp-stats > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--c-border, #eef1f6);
}

.gp-stats > div:last-child { border-bottom: 0; padding-bottom: 2px; }

.gp-stats dt {
    flex: none;
    font-size: 12.5px;
    color: var(--c-text-muted, #8a93a8);
}

.gp-stats dd {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    color: var(--c-text, #1a1f36);
    word-break: break-word;
}

.gp-side-note {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px dashed var(--c-border, #eef1f6);
    font-size: 11.5px;
    line-height: 1.75;
    color: var(--c-text-muted, #8a93a8);
}

/* ---------- 游戏区（插槽） ---------- */
.gp-stage {
    margin-top: 18px;
    scroll-margin-top: 84px;
}

/* ---------- 内容区块 ---------- */
.gp-section {
    margin-top: 18px;
    padding: 22px 24px 24px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 20px;
    background: var(--c-surface, #fff);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(16, 24, 40, .04));
    scroll-margin-top: 84px;
}

.gp-section-head { margin-bottom: 16px; }

.gp-section-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--c-text, #1a1f36);
}

.gp-section-head p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.75;
    color: var(--c-text-muted, #8a93a8);
}

/* 玩法步骤 */
.gp-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gp-steps > li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 14px;
    background: var(--c-surface-soft, #f8fafc);
}

.gp-step-no {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gp-brand), var(--gp-brand-2));
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 26px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(99, 102, 241, .26);
}

.gp-steps b {
    display: block;
    font-size: 14px;
    color: var(--c-text, #1a1f36);
}

.gp-steps p {
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--c-text-sub, #5b6478);
}

/* 特性小卡 */
.gp-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.gp-feature {
    padding: 14px 16px;
    border: 1px dashed var(--c-border, #eef1f6);
    border-radius: 14px;
}

.gp-feature b {
    display: block;
    font-size: 13.5px;
    color: var(--c-text, #1a1f36);
}

.gp-feature p {
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--c-text-muted, #8a93a8);
}

/* 常见问题 */
.gp-faq {
    display: grid;
    gap: 10px;
}

.gp-faq details {
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 14px;
    background: var(--c-surface-soft, #f8fafc);
    padding: 0 16px;
    transition: background .15s, box-shadow .15s;
}

.gp-faq details[open] {
    background: var(--c-surface, #fff);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(16, 24, 40, .04));
}

.gp-faq summary {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px 13px 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--c-text, #1a1f36);
    cursor: pointer;
    list-style: none;
}

.gp-faq summary::-webkit-details-marker { display: none; }

.gp-faq summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: var(--c-text-muted, #8a93a8);
    transition: transform .18s;
}

.gp-faq details[open] summary::after {
    content: '−';
    color: var(--gp-brand);
}

.gp-faq details p {
    margin: 0 0 14px;
    padding-top: 2px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--c-text-sub, #5b6478);
}

/* 同类推荐 */
.gp-related {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.gp-rel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 14px;
    background: var(--c-surface-soft, #f8fafc);
    text-decoration: none;
    transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
}

.gp-rel:hover {
    transform: translateY(-2px);
    border-color: var(--gp-ring);
    background: var(--c-surface, #fff);
    box-shadow: 0 10px 22px rgba(99, 102, 241, .12);
    text-decoration: none;
}

.gp-rel-icon {
    flex: none;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 12px;
    background: var(--c-bg-card, #fff);
    font-size: 20px;
    line-height: 1;
}

.gp-rel-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.gp-rel-body b {
    font-size: 13.5px;
    color: var(--c-text, #1a1f36);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gp-rel-body small {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--c-text-muted, #8a93a8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gp-rel-go {
    flex: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--gp-brand-2);
    transition: transform .15s;
}

.gp-rel:hover .gp-rel-go { transform: translateX(3px); }

/* ---------- 键盘可见焦点 ---------- */
.gp-btn:focus-visible,
.gp-rel:focus-visible,
.gp-faq summary:focus-visible,
.gp-crumb a:focus-visible {
    outline: 2px solid var(--gp-brand);
    outline-offset: 2px;
    border-radius: 10px;
}

/* ---------- 深色模式 ---------- */
[data-theme="dark"] .gp-page { --gp-ring: rgba(129, 140, 248, .34); }

[data-theme="dark"] .gp-hero {
    background:
        radial-gradient(120% 150% at 0 0, rgba(99, 102, 241, .22), transparent 58%),
        radial-gradient(90% 120% at 100% 0, rgba(217, 70, 239, .14), transparent 60%),
        var(--c-surface, #131c31);
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, .4));
}

[data-theme="dark"] .gp-badge {
    background: rgba(99, 102, 241, .18);
    border-color: rgba(129, 140, 248, .34);
    color: #c7d2fe;
}

[data-theme="dark"] .gp-btn.is-primary { box-shadow: 0 12px 26px rgba(79, 70, 229, .38); }

[data-theme="dark"] .gp-btn.is-quiet:hover { background: rgba(129, 140, 248, .14); }

[data-theme="dark"] .gp-steps > li,
[data-theme="dark"] .gp-faq details,
[data-theme="dark"] .gp-rel {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .09);
}

[data-theme="dark"] .gp-faq details[open],
[data-theme="dark"] .gp-rel:hover {
    background: rgba(255, 255, 255, .07);
}

[data-theme="dark"] .gp-feature { border-color: rgba(255, 255, 255, .12); }

[data-theme="dark"] .gp-rel-icon { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .gp-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 22px 20px;
    }

    .gp-hero-side { max-width: 420px; }
}

@media (max-width: 560px) {
    .gp-page { padding: 8px 0 28px; }

    .gp-crumb { font-size: 12.5px; padding-bottom: 10px; }

    .gp-hero { padding: 18px 16px; border-radius: 18px; }
    .gp-hero h1 { font-size: 22px; }
    .gp-hero h1 em { font-size: 13.5px; }
    .gp-lead { font-size: 13.5px; line-height: 1.85; }
    .gp-tags li { font-size: 12px; }
    .gp-hero-side { max-width: none; padding: 14px; }

    .gp-cta { gap: 8px; }
    .gp-btn { flex: 1 1 140px; height: 42px; padding: 0 14px; font-size: 13.5px; }

    .gp-section { padding: 16px 14px 18px; border-radius: 16px; }
    .gp-section-head h2 { font-size: 16px; }
    .gp-steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .gp-steps > li { padding: 12px 13px; }
    .gp-related { grid-template-columns: minmax(0, 1fr); }
    .gp-faq summary { font-size: 13.5px; padding-right: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .gp-btn,
    .gp-rel,
    .gp-btn-arrow,
    .gp-rel-go { transition: none; }
    .gp-btn:hover,
    .gp-rel:hover { transform: none; }
}
