body {
    font-family: "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;   /* 深色背景 */
    color: #e8d8dc;              /* 浅粉灰文字 */
}

.loading {
    background-image: url("data:image/gif;base64,R0lGODlhJQAlAJECAL3L2AYrTv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgACACwAAAAAJQAlAAACi5SPqcvtDyGYIFpF690i8xUw3qJBwUlSadmcLqYmGQu6KDIeM13beGzYWWy3DlB4IYaMk+Dso2RWkFCfLPcRvFbZxFLUDTt21BW56TyjRep1e20+i+eYMR145W2eefj+6VFmgTQi+ECVY8iGxcg35phGo/iDFwlTyXWphwlm1imGRdcnuqhHeop6UAAAIfkEBQoAAgAsEAACAAQACwAAAgWMj6nLXAAh+QQFCgACACwVAAUACgALAAACFZQvgRi92dyJcVJlLobUdi8x4bIhBQAh+QQFCgACACwXABEADAADAAACBYyPqcsFACH5BAUKAAIALBUAFQAKAAsAAAITlGKZwWoMHYxqtmplxlNT7ixGAQAh+QQFCgACACwQABgABAALAAACBYyPqctcACH5BAUKAAIALAUAFQAKAAsAAAIVlC+BGL3Z3IlxUmUuhtR2LzHhsiEFACH5BAUKAAIALAEAEQAMAAMAAAIFjI+pywUAIfkEBQoAAgAsBQAFAAoACwAAAhOUYJnAagwdjGq2amXGU1PuLEYBACH5BAUKAAIALBAAAgAEAAsAAAIFhI+py1wAIfkEBQoAAgAsFQAFAAoACwAAAhWUL4AIvdnciXFSZS6G1HYvMeGyIQUAIfkEBQoAAgAsFwARAAwAAwAAAgWEj6nLBQAh+QQFCgACACwVABUACgALAAACE5RgmcBqDB2MarZqZcZTU+4sRgEAIfkEBQoAAgAsEAAYAAQACwAAAgWEj6nLXAAh+QQFCgACACwFABUACgALAAACFZQvgAi92dyJcVJlLobUdi8x4bIhBQAh+QQFCgACACwBABEADAADAAACBYSPqcsFADs=");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: auto 60%;
}

.start_btn{
    display:inline-block;
    margin:0 auto;
    width:8em;
    height:1.7em;
    line-height:1.7em;
    font-size:2.2em;
    color:#f0d8dc;           /* 浅粉白 */
}

.SHADE {
    top: 0;
    left: 0;
    width: 100%;
    bottom: 0;
    z-index: 11;
}

.BOX-V {
    box-orient: vertical;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    -ms-flex-direction: column;
}

.BOX-D {
    box-align: end;
    box-pack: center;
    -webkit-box-align: end;
    -webkit-box-pack: center;
    -ms-flex-align: end;
    -ms-flex-pack: center;
}

.BOX-M {
    box-align: center;
    box-pack: center;
    -webkit-box-align: center;
    -webkit-box-pack: center;
    -ms-flex-align: center;
    -ms-flex-pack: center;
}

.BOX-S {
    display: block;
    box-flex: 1;
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
}

.BOX,
.BOX-V,
.BOX-D,
.BOX-M,
.FOOTER {
    display: box;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
}

.BBOX,
.BOX,
.APP-STAGE,
.INSET-STAGE,
.STAGE,
.PAGE-STAGE,
.PAGE,
.PAGE-BOX,
.INSET-PAGE,
.FOOTER {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}


#welcome {
    background-color: rgba(20, 20, 20, 0.92);  /* 更深色半透明 */
    text-align: center;
    font-weight: bold;
    overflow: hidden;
}

.welcome-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 100% 100%;
    opacity: .4;
    overflow: hidden;
}

#GameTimeLayer {
    top: 1em;
    left: 0;
    width: 100%;
    text-align: center;
    color: #f0b8c8;        /* 亮粉红，暗色下醒目 */
    font-size: 4em;
    text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 3px #000;  /* 加深阴影 */
    overflow: hidden;
}

#GameLayerBG {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: #1a1a1a;   /* 深紫灰底 */
}

.GameLayer {
    position: absolute;
    bottom: 0;
    left: 0;
}

.block {
    position: absolute;
    border-top: 1px solid #1a1a1a;
    background-repeat: no-repeat;
    background-position: center;
}

.t1,
.t2,
.t3,
.t4,
.t5 {
    background-size: auto 100%;
    background-image: url(./image/ClickBefore.png);
}

.tt1,
.tt2,
.tt3,
.tt4,
.tt5 {
    background-size: auto 86%;
    background-image: url(./image/ClickAfter.png);
}

.bl {
    border-left: 1px solid #1a1a1a;
}

@-ms-keyframes flash {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@-webkit-keyframes flash {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.flash {
    -webkit-animation: flash .2s 3;
    animation: flash .2s 3;
}

.bad {
    background-color: #8a5a5a;   /* 暗红粉，闪烁错误 */
    -webkit-animation: flash .2s 3;
    animation: flash .2s 3;
}

* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -ms-tap-highlight-color: rgba(0, 0, 0, 0);
    -ms-user-select: none;
}

#GameScoreLayer {
    padding-top: 2em;
    font-size: 2em;
    font-weight: bold;
    color: #e8d0d4;          /* 浅粉灰 */
    text-align: center;
    overflow: hidden;
}

.share-icon {
    width: 1.7em;
    background-repeat: no-repeat;
    background-size: auto 100%;
}



#GameScoreLayer-btn .btn,
#GameScoreLayer-share .btn {
    text-align: center;
    font-size: 1.1em;
    color: rgba(200, 180, 180, 0.4);  /* 低饱和度粉灰 */
    height: 2em;
    line-height: 2em;
}

.btn:active {
    opacity: 0.2;
}

#landscape {
    display: none;
}

#gameBody {
    position: relative;
    width: 640px;
    margin: 0 auto;
}

#share-wx {
    background: rgba(0, 0, 0, 0.85);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    display: none;
}

#btn_group {
    width: 37.5%;
    max-width: 200px;
}

@media (max-width: 450px) {
    #btn_group {
        max-width: 110px !important;
    }
}

@media (max-width: 600px) {
    #btn_group {
        max-width: 125px;
    }
}

@media (max-width: 800px) {
    #btn_group {
        max-width: 150px;
    }
}

#setting {
    width: 50%;
}

@media (max-width: 1200px) {
    #setting {
        width: 80%;
    }
}

#GameScoreLayer .col-3, #GameScoreLayer .col-2 {
    max-width: 144px;
}

.dropdown-item {
    cursor: pointer;
}

/* ============================================================
   设置面板 - 卡片分组布局
   ============================================================ */

/* 设置面板整体容器 */
#setting {
    background: rgba(12, 12, 16, 0.70) !important;
    backdrop-filter: blur(28px) saturate(1.6);
    -webkit-backdrop-filter: blur(28px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 28px;
    padding: 20px 16px 16px !important;   /* 底部内边距减小 */
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    margin-top: 12px;
    max-width: 420px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-height: 60vh;          /* 固定最大高度 */
    overflow-y: auto;          /* 内容滚动 */
}

/* ===== 卡片分组 ===== */
.setting-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 14px 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.setting-card:last-of-type {
    margin-bottom: 0;
}

.setting-card-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.20);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.setting-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

/* ===== 通用按钮（毛玻璃风格） ===== */
.btn-setting {
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.75) !important;
    border-radius: 30px !important;
    font-weight: 500;
    font-size: 13px;
    padding: 6px 16px !important;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    height: auto !important;
    line-height: 1.6 !important;
}

.btn-setting:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 138, 174, 0.25) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* ===== 键型预设按钮（更紧凑） ===== */
.btn-pattern {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    color: rgba(255, 255, 255, 0.55) !important;
    border-radius: 20px !important;
    font-weight: 400;
    font-size: 12px;
    padding: 4px 14px !important;
    transition: all 0.25s ease;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    height: auto !important;
    line-height: 1.8 !important;
}

.btn-pattern:hover {
    background: rgba(255, 138, 174, 0.10) !important;
    border-color: rgba(255, 138, 174, 0.20) !important;
    color: #ff8aae !important;
    transform: translateY(-1px);
}

/* ===== 主按钮（粉色渐变） ===== */
.btn-primary-setting {
    background: linear-gradient(135deg, #ff8aae, #e87090) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 30px !important;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 28px !important;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    height: auto !important;
    line-height: 1.6 !important;
    box-shadow: 0 4px 16px rgba(255, 138, 174, 0.2);
}

.btn-primary-setting:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 138, 174, 0.35);
}

/* ===== 输入行 ===== */
.setting-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 2px;
}

.setting-input-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.setting-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    color: #f0e8ec !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    min-width: 0;
    width: 100%;
}

.setting-input:focus {
    border-color: rgba(255, 138, 174, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(255, 138, 174, 0.08) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.setting-input::placeholder {
    color: rgba(255, 255, 255, 0.20);
    font-size: 13px;
}

/* ===== 自定义开关（垂直判定） ===== */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.60);
    user-select: none;
}

.toggle-text {
    font-weight: 400;
}

.toggle-switch {
    display: none;
}

.toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    transition: background 0.3s;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.30);
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
}

.toggle-switch:checked + .toggle-track {
    background: rgba(255, 138, 174, 0.30);
    border-color: rgba(255, 138, 174, 0.20);
}

.toggle-switch:checked + .toggle-track::after {
    transform: translateX(16px);
    background: #ff8aae;
}

/* ===== 窄屏适配 ===== */
@media (max-width: 480px) {
    #setting {
        padding: 14px 10px 12px !important;
        border-radius: 20px !important;
        max-width: 100% !important;
        max-height: 55vh;      /* 手机屏幕更小，降低高度 */
    }

    .setting-card {
        padding: 10px 8px;
    }
    .setting-card-title {
        font-size: 10px;
        letter-spacing: 1.5px;
    }
    .setting-input-label {
        font-size: 13px;
        min-width: 34px;
    }
    .setting-input {
        font-size: 13px !important;
        padding: 6px 10px !important;
    }
    .btn-setting {
        font-size: 12px !important;
        padding: 4px 12px !important;
    }
    .btn-pattern {
        font-size: 11px !important;
        padding: 3px 10px !important;
    }
    .toggle-label {
        font-size: 13px;
    }
    .toggle-track {
        width: 32px;
        height: 18px;
    }
    .toggle-track::after {
        width: 12px;
        height: 12px;
        top: 2px;
        left: 2px;
    }
    .toggle-switch:checked + .toggle-track::after {
        transform: translateX(14px);
    }
}

#setting-footer {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}

/* 修复下拉菜单选项文字颜色（暗色主题适配） */
#welcome .dropdown-item {
    color: #f0f6fc !important;
    background: transparent !important;
    transition: all 0.2s ease;
}

#welcome .dropdown-item:hover,
#welcome .dropdown-item:focus {
    background: rgba(255, 138, 174, 0.15) !important;
    color: #ff8aae !important;
}

#welcome .dropdown-item:active {
    background: rgba(255, 138, 174, 0.25) !important;
    color: #fff !important;
}

/* ============================================================
   横竖屏切换
   ============================================================ */

/* 横屏模式：旋转整个 body */
body.landscape {
    position: fixed !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* 横屏时，游戏相关层改为 absolute，随 body 一起旋转 */
body.landscape #welcome,
body.landscape #GameTimeLayer,
body.landscape #GameLayerBG,
body.landscape #GameScoreLayer.SHADE {
    position: absolute !important;
}

/* ============================================================
   横屏模式下设置面板适配（修复底部按钮不可见）
   ============================================================ */

/* 横屏时欢迎层允许滚动，避免内容被裁掉 */
body.landscape #welcome {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* 横屏时顶部留一点内边距，内容从顶部开始排 */
body.landscape .FILL.BOX-M {
    padding: 16px 0;
    box-sizing: border-box;
}

/* 横屏时设置面板最大高度按"可视高度"算
   横屏下 100vw = 原屏幕宽度 = 可视高度
   减去 160px 留给标题、间距、底部按钮 */
body.landscape #setting {
    max-height: calc(100vw - 160px) !important;
    padding: 12px 14px !important;
}

/* 横屏时容器宽度稍微收窄一点，避免溢出 */
body.landscape #welcome .container {
    max-width: 94% !important;
    width: 94% !important;
}

/* 横屏下卡片更紧凑 */
body.landscape .setting-card {
    padding: 8px 10px;
    margin-bottom: 8px;
}

body.landscape .setting-card-title {
    margin-bottom: 6px;
    font-size: 10px;
}

/* 横屏下底部按钮距离稍小 */
body.landscape #setting-footer {
    margin-top: 8px;
    padding-bottom: 4px;
}