:root {
    --gate-ink: #141a16;
    --gate-paper: #ede6d3;
    --gate-muted: #77796e;
    --gate-orange: #df6038;
    --gate-amber: #d6a750;
    --gate-line: rgba(27, 35, 28, .2);
    --gate-serif: "STKaiti", "KaiTi", "FangSong", serif;
    --gate-sans: "Microsoft YaHei", "PingFang SC", sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #080d0a;
    font-family: var(--gate-sans);
    -ms-touch-action: none;
}

*, *::before, *::after { box-sizing: border-box; }

#_game_loading_ {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

body.login-active #_game_loading_ {
    left: 0 !important;
    right: 480px !important;
    width: calc(100% - 480px) !important;
    height: 100% !important;
}

#_game_loading_::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(5, 10, 7, .18), rgba(5, 10, 7, .03) 58%, rgba(5, 10, 7, .42));
}

#_loading_bg_ {
    width: 100%;
    height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

#_game_progress_ {
    position: absolute;
    bottom: 5%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

#_loading_pro_bg_ {
    position: absolute;
    top: 38%;
    width: 90%;
    height: 31%;
    margin-left: 5.3%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

#_loading_pro_text_ {
    width: 100%;
    color: #f0d59e;
    font: 12px var(--gate-sans);
    letter-spacing: .14em;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
}

#gateIntro {
    position: fixed;
    z-index: 9998;
    left: clamp(34px, 6vw, 96px);
    bottom: clamp(38px, 8vh, 92px);
    width: min(470px, calc(100vw - 560px));
    display: none;
    color: #f6ead0;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,.35));
}

body.login-active #gateIntro { display: block; animation: gate-copy-in .55s ease-out both; }

.gate-case {
    display: inline-block;
    margin-bottom: 18px;
    padding: 7px 10px;
    color: var(--gate-ink);
    background: var(--gate-amber);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .2em;
}

#gateIntro img {
    width: min(440px, 100%);
    filter: brightness(1.35) drop-shadow(0 9px 16px rgba(0,0,0,.45));
}

#gateIntro > p {
    margin: 14px 0 25px;
    padding-left: 4px;
    color: rgba(255, 241, 207, .72);
    font: 17px var(--gate-serif);
    letter-spacing: .34em;
}

.gate-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 360px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.5);
    font-size: 10px;
    letter-spacing: .15em;
}

.gate-status b { color: #9bd08f; font-size: 9px; }
.gate-status b::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #78bf69; box-shadow: 0 0 0 3px rgba(120,191,105,.14); }

#loginContainer {
    position: fixed;
    z-index: 9999;
    inset: 0 0 0 auto;
    width: min(480px, 100%);
    max-width: none;
    height: 100svh;
    max-height: none;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    padding: clamp(68px, 10vh, 112px) 62px 46px;
    color: var(--gate-ink);
    background:
        linear-gradient(rgba(238, 231, 213, .975), rgba(238, 231, 213, .985)),
        repeating-linear-gradient(0deg, transparent 0 4px, rgba(21,26,22,.04) 5px);
    border: 0;
    border-left: 1px solid rgba(218, 173, 90, .55);
    border-radius: 0;
    box-shadow: -24px 0 70px rgba(0, 0, 0, .35);
    transform: none;
    animation: gate-panel-in .38s cubic-bezier(.2,.7,.2,1) both;
    scrollbar-width: thin;
    scrollbar-color: rgba(30,37,30,.35) transparent;
}

#loginContainer::before {
    content: "身份核验 / IDENTITY CHECK";
    position: absolute;
    top: 26px;
    right: 62px;
    left: 62px;
    height: auto;
    padding-bottom: 13px;
    color: #77786c;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--gate-line);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
}

#loginContainer::after {
    content: "SD";
    position: absolute;
    top: 23px;
    right: 62px;
    left: auto;
    color: var(--gate-orange);
    font: 700 13px var(--gate-sans);
    transform: none;
}

.form-title {
    margin: 0 0 6px;
    color: var(--gate-ink);
    font: 700 46px/1 var(--gate-serif);
    letter-spacing: .12em;
    text-align: left;
    text-indent: 0;
}

.form-subtitle {
    display: block;
    margin: 0 0 52px;
    color: var(--gate-orange);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .22em;
    text-align: left;
}

.form-subtitle::before, .form-subtitle::after { display: none; }

.input-group { position: relative; margin: 0 0 30px; }

.input-group label {
    display: block;
    margin: 0 0 5px;
    color: var(--gate-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
}

.input-group input {
    width: 100%;
    height: 48px;
    padding: 0 34px 0 0;
    border: 0;
    border-bottom: 1px solid rgba(25, 32, 26, .42);
    border-radius: 0;
    outline: none;
    color: var(--gate-ink);
    background: transparent;
    box-shadow: none;
    caret-color: var(--gate-orange);
    font-size: 17px;
    transition: border-color .2s;
    -webkit-appearance: none;
    appearance: none;
}

.input-group::after {
    content: "◆";
    position: absolute;
    right: 1px;
    bottom: 16px;
    color: var(--gate-amber);
    font-size: 7px;
    transform: rotate(45deg);
}

.input-group input::placeholder { color: rgba(45, 50, 45, .28); }
.input-group input:focus { border-color: var(--gate-orange); background: transparent; box-shadow: none; }

#login_btn, #register_btn {
    width: 100%;
    height: 54px;
    margin: 16px 0 15px;
    border: 0;
    border-radius: 0;
    color: #f5ecd7;
    background: var(--gate-ink);
    box-shadow: 7px 7px 0 var(--gate-amber);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2em;
    text-indent: .2em;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}

#login_btn:hover, #register_btn:hover { background: #262e27; transform: translate(3px, 3px); box-shadow: 4px 4px 0 var(--gate-amber); }
#login_btn:active, #register_btn:active { transform: translate(5px, 5px); box-shadow: 2px 2px 0 var(--gate-amber); }

.switch-btn {
    width: 100%;
    height: 42px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--gate-line);
    border-radius: 0;
    color: #666a61;
    background: transparent;
    font-size: 12px;
    letter-spacing: .08em;
    cursor: pointer;
    transition: color .2s, border-color .2s;
    -webkit-appearance: none;
    appearance: none;
}

.switch-btn:hover { color: var(--gate-orange); border-color: var(--gate-orange); background: transparent; }

.back-home {
    position: static;
    display: block;
    width: max-content;
    margin: 36px 0 0 auto;
    color: #777a70;
    font-size: 10px;
    letter-spacing: .12em;
    text-decoration: none;
    transition: color .2s;
}

.back-home:hover { color: var(--gate-orange); }

@keyframes gate-panel-in { from { opacity: 0; transform: translateX(45px); } to { opacity: 1; transform: none; } }
@keyframes gate-copy-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
    body.login-active #_game_loading_ {
        right: 0 !important;
        width: 100% !important;
    }

    #gateIntro {
        top: 24px;
        right: 22px;
        bottom: auto;
        left: 22px;
        width: auto;
        text-align: center;
    }
    .gate-case, .gate-status, #gateIntro > p { display: none; }
    #gateIntro img { width: min(250px, 66vw); margin: auto; }
    #loginContainer {
        inset: auto 0 0;
        width: 100%;
        height: 73svh;
        min-height: 540px;
        padding: 61px 28px 34px;
        border-top: 1px solid rgba(218, 173, 90, .6);
        border-left: 0;
        box-shadow: 0 -24px 60px rgba(0,0,0,.32);
        animation-name: gate-sheet-in;
    }
    #loginContainer::before { top: 19px; right: 28px; left: 28px; }
    #loginContainer::after { top: 16px; right: 28px; }
    .form-title { font-size: 36px; }
    .form-subtitle { margin-bottom: 33px; }
    .input-group { margin-bottom: 22px; }
    .back-home { margin-top: 27px; }
    @keyframes gate-sheet-in { from { opacity: 0; transform: translateY(45px); } to { opacity: 1; transform: none; } }
}

@media (max-height: 680px) and (min-width: 761px) {
    #loginContainer { padding-top: 65px; padding-bottom: 28px; }
    .form-title { font-size: 36px; }
    .form-subtitle { margin-bottom: 28px; }
    .input-group { margin-bottom: 20px; }
    .back-home { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    #loginContainer, body.login-active #gateIntro { animation: none; }
}
