/* =========================================
   性别选择页样式 (Gender Select Page)
   ========================================= */
#gender-select-layer {
    display: none;
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    z-index: 110;
    background-color: var(--c-gray-light);
    overflow: hidden;
}

.gender-container {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    padding-top: calc(var(--vh-unit) * 12);
    display: flex;
    justify-content: center;
}

/* 故障风文字特效 */
.gender-question {
    position: absolute;
    top: calc(var(--vh-unit) * 20);
    left: 50%;
    transform: translateX(-50%);
    font-size: calc(var(--vh-unit) * 12);
    font-weight: 900;
    font-family: var(--font-main);
    color: rgba(0,0,0,0.8);
    z-index: 120;
    pointer-events: none;
    letter-spacing: 0.5em;
    text-indent: 0.5em;
    white-space: nowrap;
    opacity: 0;
    transition: left 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 入场动画类 */
.gender-question.glitch-enter {
    animation: glitch-skew 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite,
               glitch-fade-out 0.7s linear forwards;
    opacity: 1;
}

.gender-question.glitch-enter::before,
.gender-question.glitch-enter::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--c-gray-light);
}

.gender-question.glitch-enter::before {
    left: 2px;
    text-shadow: -1px 0 rgba(0,0,0,0.8);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 1s infinite linear alternate-reverse;
}

.gender-question.glitch-enter::after {
    left: -2px;
    text-shadow: -1px 0 rgba(0,0,0,0.8);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 1s infinite linear alternate-reverse;
}

/* 动画结束后移除 glitch 保持半透明 */
.gender-question.glitch-finished {
    opacity: 0.4;
    animation: none;
    background: linear-gradient(180deg, #666 0%, #bbb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 渐隐动画 */
@keyframes glitch-fade-out {
    0% { opacity: 0; }
    15% { opacity: 1; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

@keyframes glitch-anim-1 {
    0% { clip: rect(20px, 9999px, 10px, 0); transform: skew(0.3deg); }
    5% { clip: rect(50px, 9999px, 60px, 0); transform: skew(0.3deg); }
    10% { clip: rect(80px, 9999px, 20px, 0); transform: skew(0.1deg); }
    15% { clip: rect(10px, 9999px, 90px, 0); transform: skew(0.8deg); }
    20% { clip: rect(30px, 9999px, 10px, 0); transform: skew(0.3deg); }
    25% { clip: rect(60px, 9999px, 50px, 0); transform: skew(0.2deg); }
    30% { clip: rect(10px, 9999px, 80px, 0); transform: skew(0.6deg); }
    35% { clip: rect(90px, 9999px, 30px, 0); transform: skew(0.3deg); }
    40% { clip: rect(20px, 9999px, 60px, 0); transform: skew(0.1deg); }
    45% { clip: rect(50px, 9999px, 10px, 0); transform: skew(0.5deg); }
    50% { clip: rect(80px, 9999px, 40px, 0); transform: skew(0.3deg); }
    55% { clip: rect(10px, 9999px, 70px, 0); transform: skew(0.2deg); }
    60% { clip: rect(40px, 9999px, 20px, 0); transform: skew(0.7deg); }
    65% { clip: rect(70px, 9999px, 50px, 0); transform: skew(0.3deg); }
    70% { clip: rect(20px, 9999px, 80px, 0); transform: skew(0.1deg); }
    75% { clip: rect(50px, 9999px, 10px, 0); transform: skew(0.4deg); }
    80% { clip: rect(80px, 9999px, 30px, 0); transform: skew(0.3deg); }
    85% { clip: rect(10px, 9999px, 60px, 0); transform: skew(0.2deg); }
    90% { clip: rect(40px, 9999px, 90px, 0); transform: skew(0.6deg); }
    95% { clip: rect(70px, 9999px, 20px, 0); transform: skew(0.3deg); }
    100% { clip: rect(20px, 9999px, 50px, 0); transform: skew(0.1deg); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(60px, 9999px, 10px, 0); transform: skew(0.5deg); }
    5% { clip: rect(20px, 9999px, 80px, 0); transform: skew(0.3deg); }
    10% { clip: rect(90px, 9999px, 30px, 0); transform: skew(0.8deg); }
    15% { clip: rect(10px, 9999px, 50px, 0); transform: skew(0.2deg); }
    20% { clip: rect(50px, 9999px, 20px, 0); transform: skew(0.6deg); }
    25% { clip: rect(80px, 9999px, 60px, 0); transform: skew(0.3deg); }
    30% { clip: rect(30px, 9999px, 90px, 0); transform: skew(0.1deg); }
    35% { clip: rect(70px, 9999px, 10px, 0); transform: skew(0.4deg); }
    40% { clip: rect(20px, 9999px, 50px, 0); transform: skew(0.7deg); }
    45% { clip: rect(60px, 9999px, 80px, 0); transform: skew(0.3deg); }
    50% { clip: rect(10px, 9999px, 30px, 0); transform: skew(0.2deg); }
    55% { clip: rect(50px, 9999px, 70px, 0); transform: skew(0.5deg); }
    60% { clip: rect(90px, 9999px, 20px, 0); transform: skew(0.1deg); }
    65% { clip: rect(30px, 9999px, 60px, 0); transform: skew(0.4deg); }
    70% { clip: rect(80px, 9999px, 10px, 0); transform: skew(0.3deg); }
    75% { clip: rect(20px, 9999px, 50px, 0); transform: skew(0.6deg); }
    80% { clip: rect(60px, 9999px, 90px, 0); transform: skew(0.2deg); }
    85% { clip: rect(10px, 9999px, 30px, 0); transform: skew(0.5deg); }
    90% { clip: rect(50px, 9999px, 70px, 0); transform: skew(0.1deg); }
    95% { clip: rect(90px, 9999px, 20px, 0); transform: skew(0.3deg); }
    100% { clip: rect(30px, 9999px, 60px, 0); transform: skew(0.4deg); }
}

@keyframes glitch-skew {
    0% { transform: translateX(-50%) skew(0deg); }
    10% { transform: translateX(-50%) skew(-5deg); }
    20% { transform: translateX(-50%) skew(3deg); }
    30% { transform: translateX(-50%) skew(0deg); }
    40% { transform: translateX(-50%) skew(2deg); }
    50% { transform: translateX(-50%) skew(-1deg); }
    60% { transform: translateX(-50%) skew(0deg); }
    70% { transform: translateX(-50%) skew(-2deg); }
    80% { transform: translateX(-50%) skew(4deg); }
    90% { transform: translateX(-50%) skew(0deg); }
    100% { transform: translateX(-50%) skew(0deg); }
}

.gender-btn {
    flex: 1; 
    height: 100%; 
    position: relative;
    background: rgba(255,255,255,0.95);
    cursor: pointer; 
    overflow: hidden;
    display: flex; 
    justify-content: center; 
    align-items: center;
    transition: flex 0.5s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s;
}

.gender-btn:hover {
    flex: 1.8;
}

/* 悬浮黄色背景展开动画 */
.gender-btn::before {
    content: ''; 
    position: absolute; 
    top: 50%; 
    left: 0; 
    width: 100%; 
    height: 0%;
    background: var(--c-yellow);
    transform: translateY(-50%);
    transition: height 0.4s cubic-bezier(0.45, 0, 0.55, 1);
    z-index: 0;
}

.gender-btn:hover::before { 
    height: 100%; 
}

/* 角色图片 */
.gender-char-img {
    width: calc(var(--vh-unit) * 30); 
    height: calc(var(--vh-unit) * 30);
    position: absolute;
    z-index: 2;
    object-fit: contain;
    transition: all 0.4s;
    pointer-events: none;
}

.gender-btn:hover .gender-char-img {
    transform: scale(1.05);
}

/* 性别符号 - 放大且半透明，在图片后面 */
.gender-symbol {
    font-size: calc(var(--vh-unit) * 35); 
    font-weight: 900;
    font-family: var(--font-main);
    position: absolute;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0.05));
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    transition: all 0.4s;
}

/* 男性符号在左边 */
.gender-btn.male .gender-symbol {
    left: 20%;
    transform: translateX(-50%);
}

/* 女性符号在右边 */
.gender-btn.female .gender-symbol {
    right: 20%;
    transform: translateX(50%);
}

.gender-btn:hover .gender-symbol {
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.1));
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    transform: scale(1.1) translateX(-50%);
}

.gender-btn.female:hover .gender-symbol {
    transform: scale(1.1) translateX(50%);
}

/* 装饰线 */
.gender-deco-line {
    position: absolute; 
    top: 0; 
    bottom: 0; 
    width: 1px; 
    background: rgba(0,0,0,0.1); 
    z-index: 10;
    transition: left 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gender-deco-line.center { 
    left: 50%; 
    transform: translateX(-50%); 
}

/* 中间死区 */
.gender-dead-zone {
    position: absolute; 
    top: 0; 
    bottom: 0; 
    left: 50%; 
    width: 200px;
    transform: translateX(-50%); 
    z-index: 100;
}

/* 交互禁用状态 */
.gender-container.interaction-disabled {
    pointer-events: none;
}

/* 联动逻辑：利用兄弟选择器 */
/* 左侧按钮 hover */
.gender-btn.male:hover ~ .gender-deco-line.center { 
    left: 64.28%; 
}

.gender-btn.male:hover ~ .gender-question { 
    left: 64.28%; 
}

/* 右侧按钮 hover */
.gender-btn.female:hover ~ .gender-deco-line.center { 
    left: 35.71%; 
}

.gender-btn.female:hover ~ .gender-question { 
    left: 35.71%; 
}

/* =========================================
   名字输入页样式 (Name Input Page)
   ========================================= */
#name-input-layer {
    display: none;
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    z-index: 120;
    background-color: #050505;
    overflow: hidden;
    font-family: 'Noto Sans SC', sans-serif;
    color: #eeeeee;
}

/* 视觉特效层 (VFX) */
.ni-scanlines {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.3));
    background-size: 100% 4px; 
    pointer-events: none; 
    z-index: 10;
}

.ni-noise {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJnoiPjxmZVR1cmJ1bGVuY2UgdHlwZT0iZnJhY3RhbE5vaXNlIiBiYXNlRnJlcXVlbmN5PSIwLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2cpIiBvcGFjaXR5PSIwLjA1Ii8+PC9zdmc+');
    pointer-events: none; 
    z-index: 9; 
    opacity: 0.5;
}

.ni-vignette {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: radial-gradient(circle at center, transparent 60%, black 100%);
    pointer-events: none; 
    z-index: 8;
}

.ni-screen-curve {
    position: absolute; 
    left: 0; 
    width: 100%; 
    height: 60px; 
    pointer-events: none; 
    z-index: 5;
}

.ni-screen-curve.top { 
    top: 20px; 
}

.ni-screen-curve.bottom { 
    bottom: 20px; 
}

.ni-screen-curve path {
    fill: none; 
    stroke: var(--ni-main-color); 
    stroke-width: 1.5; 
    opacity: 0.8;
    filter: drop-shadow(0 0 5px var(--ni-glow-color));
}

/* UI 布局层 */
.ni-ui-container {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 20; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    animation: ni-breathe 5s infinite ease-in-out;
}

.ni-hud-data {
    position: absolute; 
    top: 20%; 
    left: 10%; 
    font-family: monospace; 
    font-size: 12px; 
    color: var(--ni-main-color); 
    opacity: 0.8;
}

.ni-hud-bar {
    width: 80px; 
    height: 4px; 
    background: repeating-linear-gradient(90deg, #fff, #fff 2px, transparent 2px, transparent 4px); 
    margin-bottom: 5px;
}

.ni-system-icon {
    width: 40px; 
    height: 40px; 
    border: 2px solid var(--ni-main-color); 
    margin-bottom: 20px; 
    position: relative;
    box-shadow: 0 0 10px var(--ni-glow-color); 
    transform: rotate(45deg);
}

.ni-system-icon::after {
    content: ''; 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    width: 10px; 
    height: 10px; 
    background: var(--ni-main-color); 
    transform: translate(-50%, -50%);
}

.ni-title {
    font-size: 2.5rem; 
    font-weight: 400; 
    letter-spacing: 0.2em; 
    margin: 0 0 10px 0; 
    text-shadow: 0 0 10px var(--ni-glow-color); 
    color: var(--ni-main-color);
}

.ni-dots {
    font-size: 1.5rem; 
    letter-spacing: 0.5em; 
    margin-bottom: 30px; 
    opacity: 0.8; 
    color: var(--ni-main-color);
}

.ni-input-wrapper {
    position: relative; 
    width: 400px; 
    height: 50px; 
    background: var(--ni-input-bg); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 15px;
}

.ni-input {
    width: 100%; 
    height: 100%; 
    background: transparent; 
    border: none; 
    outline: none;
    color: var(--ni-main-color); 
    font-family: 'Noto Sans SC', sans-serif; 
    font-size: 1.2rem; 
    text-align: center;
    letter-spacing: 0.1em; 
    caret-color: transparent; 
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.ni-input:focus { 
    caret-color: var(--ni-main-color); 
}

.ni-input-line {
    position: absolute; 
    width: 2px; 
    height: 20px; 
    background: var(--ni-dim-color); 
    opacity: 0.5; 
    pointer-events: none;
}

.ni-hint {
    font-size: 0.9rem; 
    color: var(--ni-dim-color); 
    margin-bottom: 40px; 
    letter-spacing: 0.05em;
}

.ni-btn-confirm {
    background: transparent; 
    border: 1px solid var(--ni-dim-color); 
    color: var(--ni-dim-color);
    padding: 10px 60px; 
    font-size: 1rem; 
    font-family: 'Noto Sans SC', sans-serif; 
    cursor: pointer;
    transition: all 0.3s ease; 
    position: relative; 
    overflow: hidden;
}

.ni-btn-confirm:hover {
    border-color: var(--ni-main-color); 
    color: var(--ni-main-color);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); 
    text-shadow: 0 0 5px white;
}

.ni-bottom-scale {
    position: absolute; 
    bottom: 15%; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

.ni-scale-lines { 
    display: flex; 
    align-items: flex-end; 
    gap: 5px; 
    height: 10px; 
}

.ni-line { 
    width: 1px; 
    background: var(--ni-main-color); 
    opacity: 0.7; 
}

.ni-line.long { 
    height: 10px; 
}

.ni-line.short { 
    height: 5px; 
}

.ni-scale-num { 
    margin-top: 5px; 
    font-size: 10px; 
    color: var(--ni-main-color); 
}

@keyframes ni-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { opacity: 0.95; }
}

/* 名字输入页移动端适配 */
@media screen and (max-width: 950px) {
    .ni-hud-data {
        top: 12%; 
        left: 8%; 
        transform: scale(0.8);
        transform-origin: top left;
    }
    
    .ni-hud-bar { 
        width: 50px; 
    }

    .ni-system-icon {
        width: 28px; 
        height: 28px; 
        margin-bottom: 8px;
        border-width: 1.5px;
    }
    
    .ni-system-icon::after { 
        width: 6px; 
        height: 6px; 
    }

    .ni-title {
        font-size: 24px;
        margin-bottom: 4px;
        letter-spacing: 0.1em;
    }

    .ni-dots {
        font-size: 16px; 
        margin-bottom: 15px;
    }

    .ni-input-wrapper {
        width: 260px;
        height: 36px;
        margin-bottom: 8px;
    }
    
    .ni-input {
        font-size: 16px;
    }
    
    .ni-input-line { 
        height: 16px; 
    }

    .ni-hint {
        font-size: 11px;
        margin-bottom: 20px;
    }

    .ni-btn-confirm {
        padding: 6px 40px;
        font-size: 13px;
        border-width: 1px;
    }

    .ni-bottom-scale {
        bottom: 8%;
        transform: scale(0.8);
    }
    
    .ni-screen-curve { 
        height: 40px; 
    }
    
    .ni-screen-curve.top { 
        top: 10px; 
    }
    
    .ni-screen-curve.bottom { 
        bottom: 10px; 
    }
}

/* =========================================
   移动端全屏引导蒙版样式
   ========================================= */
#mobile-fullscreen-mask {
    display: none;
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center; 
    align-items: center;
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    font-family: var(--font-tech), sans-serif;
}

.mfm-content {
    display: flex; 
    flex-direction: column; 
    align-items: center;
    color: var(--c-white); 
    text-align: center;
    animation: mfm-pulse 2s infinite ease-in-out;
    pointer-events: none;
}

.mfm-icon {
    width: 60px; 
    height: 60px; 
    margin-bottom: 20px;
    fill: var(--c-yellow);
}

.mfm-title {
    font-size: 14px; 
    color: var(--c-yellow); 
    letter-spacing: 2px;
    margin-bottom: 10px; 
    font-weight: bold;
}

.mfm-text {
    font-size: 20px; 
    font-weight: bold; 
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.mfm-hint {
    font-size: 12px; 
    color: #888; 
    margin-bottom: 20px;
}

.mfm-deco-line {
    width: 2px; 
    height: 40px; 
    background: linear-gradient(to bottom, var(--c-yellow), transparent);
}

@keyframes mfm-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

/* =========================================
   游戏iframe容器样式
   ========================================= */
#game-iframe-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: #262626;
}

#game-iframe-container.active {
    display: block;
}

#game-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 游戏加载遮罩 */
#game-loading-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 201;
    background: #000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#game-loading-mask.active {
    display: flex;
    opacity: 1;
}

#game-loading-mask.fade-out {
    opacity: 0;
}

.loading-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    animation: loading-pulse 2s ease-in-out infinite;
}

.loading-text {
    position: relative;
    z-index: 1;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    margin-top: 20vh;
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

#back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(40, 40, 40, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 201;
    transition: all 0.3s ease;
}

#back-btn.active {
    display: flex;
}

#back-btn:hover {
    background: rgba(138, 43, 226, 0.8);
    border-color: rgba(138, 43, 226, 1);
    transform: scale(1.1);
}

#back-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* =========================================
   底部操作按钮组 (Action Buttons Container)
   ========================================= */
.action-buttons-container {
    position: absolute;
    bottom: 30px;
    right: 40px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* =========================================
   干员寻访按钮 (Gacha Entry)
   ========================================= */
.gacha-entry-pos {
    position: relative;
    min-width: 160px;
    flex-shrink: 0;
    /* order: 3; Removed: HTML order is correct */
}

/* =========================================
   分享战绩按钮 (Share Stats)
   ========================================= */
.share-stats-pos {
    position: relative;
    min-width: 160px;
    flex-shrink: 0;
    /* order: 2; Removed: HTML order is correct */
}

/* =========================================
   干员选择入口按钮 (Character Select Entry)
   ========================================= */
.char-select-entry-pos {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
    /* order: 1; Removed: HTML order is correct */
    display: flex;
    align-items: center;
}

.char-select-entry-pos:hover {
    transform: scale(1.08);
}

.char-select-diamond {
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transform: rotate(45deg);
    overflow: hidden;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: all 0.3s ease;
}

.char-select-entry-pos:hover .char-select-diamond {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.3);
}

.char-select-diamond img {
    width: 140%;
    height: 140%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    object-fit: cover;
}

/* =========================================
   干员选择页样式 (Character Select Page)
   ========================================= */
#character-select-layer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 150; /* 高于关卡选择页 */
    background-color: var(--c-gray-light);
    overflow: hidden;
}

#char-list-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 18vh 40px 40px;
    box-sizing: border-box;
    /* 隐藏滚动条但保留功能 */
    scrollbar-width: none; 
    -ms-overflow-style: none;
    z-index: 20;
}

#char-list-wrapper::-webkit-scrollbar { 
    display: none; 
}

.char-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(60px, 6vw, 120px);
    padding-bottom: 100px;
    max-width: 90vw;
    margin: 0 auto;
}

.char-card-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    cursor: pointer;
    transition: transform 0.3s;
}

.char-card-wrapper:hover {
    transform: scale(1.05);
}

.char-card-diamond {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.char-card-diamond img {
    width: 140%;
    height: 140%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    object-fit: cover;
    filter: grayscale(0.5);
    transition: filter 0.3s;
}

/* 选中状态 */
.char-card-wrapper.selected .char-card-diamond {
    border-color: var(--c-yellow);
    box-shadow: 0 0 20px rgba(253, 208, 0, 0.4);
}

.char-card-wrapper.selected .char-card-diamond img {
    filter: grayscale(0);
}

/* 勾选标记 */
.char-check-mark {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: var(--c-yellow);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.char-card-wrapper.selected .char-check-mark {
    opacity: 1;
    transform: scale(1);
}

.char-check-mark::after {
    content: '';
    width: 14px;
    height: 8px;
    border-left: 3px solid #000;
    border-bottom: 3px solid #000;
    transform: rotate(-45deg) translate(2px, -2px);
}

/* 移动端适配 */
@media screen and (max-width: 950px) {
    /* 调整按钮容器位置和间距 */
    .action-buttons-container {
        right: 20px;
        bottom: 20px;
        gap: 12px;
    }

    /* 缩小矩形按钮 - 使用真实尺寸调整而非缩放 */
    .gacha-entry-pos,
    .share-stats-pos {
        min-width: 130px;
        height: 40px;
        font-size: 13px;
    }
    
    .gacha-entry-pos .enf-deco-line,
    .share-stats-pos .enf-deco-line {
        flex: 0 0 40px; /* 缩短装饰线 */
    }
    
    .gacha-entry-pos .enf-icon,
    .share-stats-pos .enf-icon {
        width: 28px;
        height: 28px;
    }
    
    .gacha-entry-pos .enf-icon svg,
    .share-stats-pos .enf-icon svg {
        width: 12px;
        height: 12px;
    }

    /* 缩小菱形按钮 */
    .char-select-diamond {
        width: 48px;
        height: 48px;
        border-width: 1.5px;
    }
    
    .char-card-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .char-check-mark {
        width: 30px;
        height: 30px;
        bottom: -5px;
        right: -5px;
    }
}

/* 超小屏幕适配 */
@media screen and (max-width: 600px) {
    .action-buttons-container {
        right: 15px;
        bottom: 15px;
        gap: 8px;
    }

    .gacha-entry-pos,
    .share-stats-pos {
        min-width: 110px;
        height: 36px;
        font-size: 12px;
        padding: 0 4px 0 12px;
    }
    
    .gacha-entry-pos .enf-deco-line,
    .share-stats-pos .enf-deco-line {
        flex: 0 0 25px; /* 进一步缩短装饰线 */
    }

    .char-select-diamond {
        width: 42px;
        height: 42px;
    }
}