/***** 
    ANIMATION
 *****/
@keyframes semicircle {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes bounce-glow {

    0%,
    100% {
        transform: translateY(0) scale(0.8);
        text-shadow: 0 0 3px #fff, 0 0 5px #ff4d4d, 0 0 8px #ff4d4d;
    }

    50% {
        transform: translateY(0) scale(1.0);
        text-shadow: 0 0 3px #fff, 0 0 5px #ff4d4d, 0 0 8px #ff4d4d;
    }
}

/***** 
    ANIMATION
 *****/
/***** 
    GLOBAL
 *****/
/* 根字号随视口放大，但 Bootstrap 容器在 1400px 以上就锁定在 1320px，
   所以把根字号封顶在 1440 宽时的值（10.8px），超宽屏上卡片不会撑爆栏位 */
html {
    font-size: min(calc(0.0075 * 100vw), 10.8px);
}

html[device="mobile"] {
    font-size: min(calc(100vw * 0.02), 16px);
}

body {
    font-size: 1.2rem;
    overflow: hidden;
    background-image: var(--bg-desktop, url("../imgs/bg-desktop.webp"));
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    /* 100vw 会把竖向滚动条的宽度也算进去，造成横向滚动，这里用 100% */
    width: 100%;
    height: 100vh;
    margin: 0;
    /* 纵向 flex：顶部 LOGO 的 margin 不会穿透 body 顶到视口外面，避免多出十几像素的滚动 */
    display: flex;
    flex-direction: column;
}

html[device="mobile"] body {
    background-image: var(--bg-mobile, url("../imgs/bg-mobile.webp"));
}

img {
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
}

a {
    text-decoration: none;
}

.main-image {
    width: 85%;
    /* 浏览器窗口很矮时主图按高度缩，底部不会被裁掉 */
    max-height: calc(100vh - 20rem);
    object-fit: contain;
    cursor: pointer;
}

.redirect-link-item {
    /* 宽度不超过所在栏位（100%），宽屏下三张卡片不会挤在一起 */
    width: min(calc(11.66rem * var(--entry-scale, 1)), 100%);
    /* 正方形卡片，高度跟着宽度走；圆形仪表居中 */
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #B15800 0%, #3B1C0E 100%);
    border: 1px solid #FF8000;
    border-radius: 1.04rem;
    margin: .5rem auto;
    position: relative;
}

.main-container .redirect-link .redirect-link-item .redirect-link-no {
    position: absolute;
    background: linear-gradient(360deg, #FCFA16 0%, #B15800 100%);
    width: 2.54rem;
    height: 2.2rem;
    border-top-left-radius: .555rem;
    border-bottom-right-radius: .555rem;
    font-family: Roboto;
    font-weight: 900;
    font-size: 1.72rem;
    line-height: 100%;
    text-align: center;
    color: #FFFFFF;
    padding-top: .2rem;
}

.redirect-link-item .redirect-link-circle {
    position: relative;
    max-width: 100%;
    margin: 0;
    background: #3B1C0E;
    width: calc(6.52rem * var(--entry-scale, 1));
    height: calc(6.52rem * var(--entry-scale, 1));
    border-radius: 50%;
    display: flex;
}

.redirect-link-item .redirect-link-circle .semicircle {
    position: relative;
    width: calc(5.83rem * var(--entry-scale, 1));
    height: calc(5.83rem * var(--entry-scale, 1));
    border-radius: 50%;
    margin: auto;

}

.redirect-link-item .redirect-link-circle .semicircle.active {
    animation: semicircle 2s;
}

.redirect-link-item .redirect-link-circle .semicircle img {
    width: calc(2.91rem * var(--entry-scale, 1));
    height: calc(5.83rem * var(--entry-scale, 1));
    float: right;
}

.redirect-link-item .redirect-link-speed {
    position: absolute;
    color: #FFFFFF;
    left: calc(2rem * var(--entry-scale, 1));
    top: calc(1.6rem * var(--entry-scale, 1));
    z-index: 2;
    cursor: pointer;
}

.redirect-link-item .redirect-link-speed b {
    font-family: Roboto;
    font-weight: 900;
    font-size: calc(2.08rem * var(--entry-scale, 1));
    line-height: 100%;
    text-align: center;
    border-radius: 50%;
}

.redirect-link-item .redirect-link-speed p {
    font-family: Roboto;
    font-weight: 900;
    font-size: calc(1.18rem * var(--entry-scale, 1));
    line-height: 100%;
    text-align: center;
}

.redirect-link-item .backdrop {
    height: calc(5.47rem * var(--entry-scale, 1));
    width: calc(5.47rem * var(--entry-scale, 1));
    position: absolute;
    left: calc(.5rem * var(--entry-scale, 1));
    top: calc(.4rem * var(--entry-scale, 1));
    z-index: 1;
}

.redirect-link-item .redirect-link-button {
    margin: 0 auto;
    background: rgb(125 95 74);
    width: 6.41rem;
    height: 1.8rem;
    border-radius: 1rem;
    display: flex;
}

.redirect-link-item .redirect-link-button:hover {
    transform: scale(1.2);
}

.redirect-link-item .redirect-link-button-inside {
    margin: auto;
    background: radial-gradient(50% 91.59% at 50% 50%, #FFD900 0%, #FF8000 100%);
    border-radius: 1rem;
    width: 6rem;
    height: 1.38rem;
}

.redirect-link-item .redirect-link-button-inside p {
    font-family: Roboto;
    font-weight: 700;
    font-size: .8rem;
    text-align: center;
    text-transform: capitalize;
    color: #FFF;
    margin-top: .15rem;
}

.style_appDownloadBtn__RPvKY {
    background: linear-gradient(90deg, #1f70d2 -.02%, #0050b1 99.98%);
    border: 1.15px solid #fff;
    border-radius: 10px;
    box-shadow: 0 4.61724px 4.61724px #00000040;
    font-size: 1rem;
    font-weight: 700;
}

.links-title {
    width: 100%;
}

.redirect-link {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(1, 1fr);
    column-gap: 1.5rem; /* 三张卡片之间的固定间距 */
}

.redirect-links {
    margin-top: 6rem;
}

/* 竖版布局：手机、平板竖屏、桌面浏览器缩小的窗口（< 992px，与 index.html 的 col-lg-* 对应） */
@media screen and (max-width: 991.98px) {
    /* 统一按手机公式算根字号并设上限，桌面浏览器缩小窗口时入口卡片不会缩成一小块 */
    html {
        font-size: min(calc(100vw * 0.02), 16px);
    }

    /* 竖版下三张卡片已经铺满一行，不再叠加 entryScale，避免第三张被挤出屏幕 */
    .redirect-links {
        --entry-scale: 1;
    }

    /* 竖版只允许上下滚动；overflow: scroll 在 Windows 上会常驻两条滚动条 */
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .top-logo {
        width: 31rem;
    }

    /* 宽度不超过所在格子，三张卡片加间距不会超出屏幕宽度造成横向滚动 */
    .redirect-link-item {
        width: min(calc(15.2rem * var(--entry-scale, 1)), 100%);
    }

    .style_appDownloadBtn__RPvKY {
        font-size: 1.2rem !important;
    }

    /* 主图最高占 33% 视口高度，平板竖屏时整页也能尽量装进一屏 */
    .main-image {
        width: 100%;
        max-height: 33vh;
        object-fit: contain;
    }

    .redirect-link-item .backdrop {
        display: none;
    }

    .main-container {
        flex-direction: column-reverse;
    }

    .redirect-links {
        margin-top: 0;
    }

    .links-title {
        display: none;
    }
}
/***** 
    LOADING BOX / EMERGENCY PANEL (moved from inline <style> in index.html)
 *****/
#loadingBox {
    display: none;
}

.error-panel {
    display: none; /* 平时绝对不显示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.error-box {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.error-box h2 { color: #ff4d4d; margin-bottom: 15px; font-size: 18px; }
.error-box p { color: #ccc; font-size: 13px; line-height: 1.4; margin-bottom: 20px; }
.error-panel .btn { display: block; background: #0088cc; color: #fff; text-decoration: none; padding: 12px; border-radius: 8px; font-weight: bold; margin-top: 12px; font-size: 15px; }
.error-panel .btn-backup2 { background: #28a745; }
.error-panel .btn-backup3 { background: #6c757d; }

/***** 
    SUPPORT FAB (在线客服悬浮按钮，右下角)
    配色由 config.support.colors 写入 --support-* 变量，下面是默认值
 *****/
.support-fab[hidden] {
    display: none;
}

.support-fab {
    --support-bg: #2B1A4D;
    --support-text: #FFD900;
    --support-border: #FFD900;
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 99990; /* 低于应急面板，高于页面内容 */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    font-family: Roboto, Arial, sans-serif;
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 22px 0 18px;
    border: 2px solid var(--support-border);
    border-radius: 999px;
    background: var(--support-bg);
    color: var(--support-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    transition: transform .15s ease, box-shadow .15s ease;
}

.support-btn:hover,
.support-btn:focus-visible {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    color: var(--support-text);
    outline: none;
}

.support-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.support-icon svg {
    width: 100%;
    height: 100%;
}

/* 首次进入的提示气泡 */
.support-hint {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(280px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    color: #2B1A4D;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
}

.support-hint::after {
    /* 指向按钮的小三角 */
    content: "";
    position: absolute;
    right: 24px;
    bottom: -8px;
    border-width: 8px 7px 0 7px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.support-hint.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.support-hint-close {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-left: 2px;
    border: 0;
    border-radius: 50%;
    background: rgba(43, 26, 77, 0.08);
    color: #2B1A4D;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.support-hint-close:hover {
    background: rgba(43, 26, 77, 0.18);
}

.support-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    padding: 8px;
    border: 2px solid var(--support-border);
    border-radius: 14px;
    background: var(--support-bg);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.support-fab.open .support-menu {
    display: flex;
}

.support-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--support-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s ease;
}

.support-menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--support-text);
}

@media (prefers-reduced-motion: reduce) {
    .support-hint { transition: none; }
}

@media screen and (max-width: 768px) {
    /* 移动端：稍微收紧但保留文字，让用户一眼看出能点 */
    .support-btn {
        height: 50px;
        padding: 0 18px 0 14px;
        font-size: 15px;
    }

    .support-icon {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }
}
