/* 全局盒模型：避免 padding / border 撑破固定尺寸布局。 */
* {
    box-sizing: border-box;
}

/* 页面基础布局：背景图、全屏居中、底部预留备案信息空间。 */
html,
body {
    min-height: 100%;
}

body {
    --ink: #fff;
    --ink-rgb: 255, 255, 255;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    margin: 0;
    padding: 24px 16px 64px;
    overflow-x: hidden;
    background: #000 url("../imgs/bg-blue-bubble.webp") center / cover no-repeat fixed;
    color: var(--ink);
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "Microsoft Yahei", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background: url("../imgs/bg-blue-bubble.webp") center / cover no-repeat;
    filter: none;
    transform: none;
}

body::after {
    content: none;
}

/* WebGL 液态玻璃画布：覆盖全屏，仅作为视觉层，不响应鼠标事件。 */
#glcanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

/* 右上角下载类型选择器：桌面端固定，移动端在媒体查询中改为顶部横条。 */
.download-switcher {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 250px;
    padding: 10px 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .54);
    border-radius: 18px;
    background:
        radial-gradient(ellipse at 40% 0%, rgba(255, 255, 255, .28), transparent 58%),
        rgba(255, 255, 255, .1);
    box-shadow:
        0 18px 42px rgba(18, 35, 59, .18),
        0 0 0 1px rgba(255, 255, 255, .12),
        inset 0 1px 0 rgba(255, 255, 255, .7),
        inset 16px 18px 42px rgba(255, 255, 255, .12),
        inset -16px -18px 46px rgba(255, 255, 255, .08);
    backdrop-filter: blur(22px) saturate(1.28);
    -webkit-backdrop-filter: blur(22px) saturate(1.28);
}

.download-switcher::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, .24);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .22), transparent 44%),
        radial-gradient(ellipse at 100% 0%, rgba(255, 255, 255, .18), transparent 48%);
    opacity: .8;
}

.download-switcher label {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .46);
}

.download-switcher select {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
    padding: 0 34px 0 14px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 12px;
    outline: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .76));
    color: #12233b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .88),
        0 8px 18px rgba(18, 35, 59, .12);
}

.download-switcher .language-toggle {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    height: 36px;
    min-width: 48px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 12px;
    outline: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .12));
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .46);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .48),
        0 8px 18px rgba(18, 35, 59, .12);
    transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
}

.download-switcher .language-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .72);
    background-color: rgba(255, 255, 255, .16);
}

.download-switcher .language-toggle:active {
    transform: translateY(1px);
}

/* 页面级返回：固定在屏幕水平中间，和下载卡片保持分离。 */
.page-back-button {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 31;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    min-width: 82px;
    padding: 0 12px 0 9px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .54);
    border-radius: 999px;
    background:
        radial-gradient(ellipse at 36% 0%, rgba(255, 255, 255, .34), transparent 58%),
        rgba(255, 255, 255, .13);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .46);
    box-shadow:
        0 18px 42px rgba(18, 35, 59, .18),
        0 0 0 1px rgba(255, 255, 255, .12),
        inset 0 1px 0 rgba(255, 255, 255, .7),
        inset 16px 18px 42px rgba(255, 255, 255, .12),
        inset -16px -18px 46px rgba(255, 255, 255, .08);
    backdrop-filter: blur(22px) saturate(1.28);
    -webkit-backdrop-filter: blur(22px) saturate(1.28);
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}

.page-back-button::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, .24);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .22), transparent 44%),
        radial-gradient(ellipse at 100% 0%, rgba(255, 255, 255, .18), transparent 48%);
    opacity: .8;
}

.page-back-button > span {
    position: relative;
    z-index: 1;
}

.page-back-button .back-icon {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, .46);
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    font-size: 23px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .42),
        0 8px 18px rgba(18, 35, 59, .12);
}

.page-back-button:hover {
    transform: translate(-50%, -1px);
    border-color: rgba(255, 255, 255, .7);
    background-color: rgba(255, 255, 255, .14);
}

.page-back-button:active {
    transform: translate(-50%, 1px);
    opacity: .9;
}

.page-shell {
    position: fixed;
    inset: 0;
    z-index: 6;
    width: 100%;
    pointer-events: none;
}

/* 下载卡片主体：CSS 退化版玻璃效果。WebGL 成功后会切换为透明卡片。 */
.style2 {
    position: absolute;
    z-index: 6;
    width: clamp(300px, 31vw, 390px);
    min-width: 0;
    min-height: clamp(500px, 72vh, 650px);
    height: auto;
    margin: 0;
    padding: 0 24px clamp(28px, 5vh, 42px);
    overflow: hidden;
    border-radius: 34px;
    color: var(--ink);
    text-align: center;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .16), transparent 46%),
        rgba(255, 255, 255, .025);
    border: 1px solid rgba(var(--ink-rgb), .45);
    box-shadow:
        0 28px 80px rgba(0, 0, 0, .22),
        0 0 0 1px rgba(255, 255, 255, .12),
        inset 0 1px 0 rgba(255, 255, 255, .62),
        inset 22px 28px 70px rgba(255, 255, 255, .11),
        inset -24px -30px 84px rgba(255, 255, 255, .08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.style2.dragging {
    cursor: grabbing;
}

body.liquid-ready .style2 {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

body.liquid-ready .style2::before,
body.liquid-ready .style2::after {
    content: none;
}

/* WebGL 不可用时的卡片高光层。 */
.style2::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        radial-gradient(ellipse 120% 70% at 50% -8%, rgba(255, 255, 255, .18), transparent 52%),
        radial-gradient(ellipse 70% 46% at 18% 68%, rgba(255, 255, 255, .07), transparent 62%);
    opacity: .36;
}

.style2::after {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, .34);
    box-shadow:
        inset 0 0 28px rgba(255, 255, 255, .08),
        inset 0 0 1px rgba(255, 255, 255, .62);
}

.style2.theme1 {
    --theme-color: #fff;
}

/* 确保卡片内部内容浮在玻璃视觉层之上。 */
.style2 > * {
    position: relative;
    z-index: 1;
}

/* logo：使用背景图居中展示，圆形外框避免图片边缘不齐。 */
.style2 .logo {
    position: absolute;
    top: clamp(62px, 12vh, 92px);
    left: 50%;
    transform: translateX(-50%);
    width: 132px;
    height: 132px;
    margin: 0;
    overflow: visible;
    border: 3px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    background-color: #f1f5f9;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 86% auto;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}

.style2 .container {
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding-top: clamp(210px, 34vh, 250px);
}

.container > div {
    margin-bottom: clamp(16px, 2.8vh, 24px);
}

/* 版本标题和产品说明。说明文字按用户要求保留首行缩进。 */
.style2 .version {
    margin: 0;
    color: var(--ink);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.18;
    text-align: center;
    text-shadow:
        0 2px 3px rgba(0, 0, 0, .62),
        0 10px 24px rgba(0, 0, 0, .48);
}

.style2 .tips {
    max-width: 280px;
    margin: 12px auto clamp(22px, 3.4vh, 34px);
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
    text-align: left;
    text-indent: 2em;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, .7),
        0 7px 18px rgba(0, 0, 0, .48);
}

.style2 .btn-group {
    width: 100%;
    margin: 0 0 clamp(18px, 3vh, 26px);
}

/* 下载按钮：当前页面只有一个按钮，点击地址由 js/app.js 按类型动态切换。 */
.style2 .btn {
    width: 100%;
    height: 50px;
    line-height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: #12233b;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
    transition: transform .12s ease;
}

.style2 .download-button {
    display: flex;
}

.style2 .download-file-name {
    margin-top: 10px;
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, .62),
        0 7px 18px rgba(0, 0, 0, .42);
}

.style2 .btn span {
    color: #12233b;
}

.style2 .btn:hover {
    transform: translateY(-1px);
}

.style2 .btn:active {
    transform: translateY(1px);
    opacity: .9;
}

.style2 .btn.is-unavailable {
    opacity: .72;
    cursor: not-allowed;
}

.style2 .btn svg {
    position: relative;
    left: auto;
    margin-right: 10px;
}

/* 开发者信息：普通文字区，不做按钮或卡片化处理。 */
.style2 .developer-info {
    display: block;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, .72),
        0 7px 18px rgba(0, 0, 0, .48);
}

.style2 .copyright {
    width: auto;
    margin: 0;
    color: #fff;
    font-size: inherit;
    font-weight: inherit;
    text-align: center;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.style2 .copyright:hover {
    color: #fff;
    text-decoration-thickness: 2px;
}

.style2 .company-name {
    margin-top: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.4;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, .72),
        0 7px 18px rgba(0, 0, 0, .5);
}

/* 底部备案号：固定一整行，和下载卡片互不影响。 */
.site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    transform: none;
    padding: 12px 16px 14px;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .26);
    border-radius: 0;
    background: rgba(255, 255, 255, .1);
    text-align: center;
    color: rgba(255, 255, 255, .86);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-footer a {
    color: rgba(255, 255, 255, .92);
}

/* 移动端：下拉框占据顶部，卡片改为自然流布局，避免拖拽和滚动冲突。 */
@media (max-width: 720px) {
    html,
    body {
        overflow-y: auto;
    }

    body {
        justify-content: flex-start;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 24px 12px 76px;
    }

    .style2 {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: min(calc(100vw - 32px), 340px);
        min-height: clamp(500px, calc(100dvh - 214px), 680px);
        margin: 140px auto 72px;
        padding-top: 0;
        padding-bottom: 34px;
        cursor: default;
        touch-action: auto;
    }

    .style2 .logo {
        top: clamp(86px, 17vh, 128px);
        width: 132px;
        height: 132px;
    }

    .style2 .container {
        padding-top: clamp(242px, 42vh, 286px);
    }

    .page-shell {
        position: relative;
        inset: auto;
        width: 100vw;
        max-width: 100vw;
        overflow: visible;
        pointer-events: auto;
    }

    .download-switcher {
        top: 70px;
        left: 12px;
        right: 12px;
        width: auto;
        min-width: 0;
        justify-content: center;
        flex-wrap: wrap;
        padding: 8px 10px;
    }

    .download-switcher select {
        max-width: 190px;
    }

    .download-switcher .language-toggle {
        min-width: 52px;
    }

    .page-back-button {
        top: 14px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: auto;
        height: 38px;
        min-width: 0;
        padding: 0 12px 0 9px;
    }

    .page-back-button:hover {
        transform: translate(-50%, -1px);
    }

    .page-back-button:active {
        transform: translate(-50%, 1px);
    }

    .page-back-button .back-icon {
        width: 24px;
        height: 24px;
        font-size: 23px;
        line-height: 20px;
    }
}
