* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --ink: #110b0b;
    --night: #170b0b;
    --ember: #f05a24;
    --ember-deep: #9f1114;
    --gold: #f2c66d;
    --paper: #f6f0e8;
    --paper-soft: #fffaf3;
    --muted: #756b62;
}

body {
    min-height: 100vh;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: #0d0808;
    overflow: hidden;
}

button,
input {
    font: inherit;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 55%) minmax(0, 45%);
    position: relative;
    background:
        linear-gradient(90deg, rgba(12, 6, 8, 1) 0%, rgba(25, 8, 8, 1) 53%, rgba(247, 241, 234, 0.98) 57%, rgba(255, 250, 243, 1) 100%),
        #130909;
}

.admin-entry {
    position: fixed;
    top: 26px;
    right: 30px;
    z-index: 20;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid rgba(45, 34, 30, 0.16);
    border-radius: 999px;
    color: rgba(45, 34, 30, 0.72);
    background: rgba(255, 250, 243, 0.54);
    box-shadow: 0 10px 24px rgba(58, 23, 13, 0.06);
    backdrop-filter: blur(14px);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.admin-entry:hover {
    border-color: rgba(240, 90, 36, 0.34);
    color: var(--ember);
    background: rgba(255, 250, 243, 0.82);
    transform: translateY(-1px);
}

.admin-entry-icon {
    position: relative;
    width: 11px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    opacity: 0.82;
}

.admin-entry-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 7px;
    width: 7px;
    height: 6px;
    transform: translateX(-50%);
    border: 1.5px solid currentColor;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
}

.login-shell::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 51%;
    width: 12%;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(14, 6, 8, 0), rgba(14, 6, 8, 0.46) 22%, rgba(247, 241, 234, 0.34) 74%, rgba(247, 241, 234, 0));
    z-index: 3;
}

.brand-visual {
    position: relative;
    min-height: 100vh;
    padding: 54px 62px 50px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff8ef;
}

.brand-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(9, 6, 9, 0.88), rgba(18, 7, 10, 0.62) 38%, rgba(18, 7, 10, 0.26) 100%),
        image-set(
            url("/static/assets/login-bg.v1.webp") type("image/webp"),
            url("/static/assets/login-bg.png") type("image/png")
        ) center center / cover no-repeat;
    opacity: 1;
}

.brand-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 28% 18%, rgba(245, 153, 59, 0.2), transparent 26%),
        linear-gradient(145deg, rgba(255, 132, 39, 0.18), transparent 42%),
        repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.052) 0 1px, transparent 1px 92px);
    mix-blend-mode: screen;
    opacity: 0.58;
}

.brand-overlay,
.panel-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.brand-overlay {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.52)),
        linear-gradient(90deg, rgba(5, 4, 6, 0.4), rgba(5, 4, 6, 0) 52%),
        radial-gradient(ellipse at 22% 18%, rgba(241, 174, 87, 0.16), transparent 34%);
}

.panel-lines {
    background:
        linear-gradient(90deg, transparent 0 12%, rgba(255, 218, 148, 0.16) 12.1% 12.35%, transparent 12.45% 100%),
        linear-gradient(0deg, transparent 0 65%, rgba(255, 218, 148, 0.12) 65.1% 65.35%, transparent 65.45% 100%);
    opacity: 0.45;
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.brand-logo {
    width: clamp(190px, 13.6vw, 244px);
    height: auto;
    display: block;
    margin: 0 0 78px -8px;
    filter:
        saturate(0.84)
        drop-shadow(0 18px 30px rgba(0, 0, 0, 0.36))
        drop-shadow(0 0 24px rgba(242, 198, 109, 0.1));
}

.brand-copy {
    max-width: 560px;
}

.eyebrow,
.auth-kicker {
    font-size: 12px;
    line-height: 1;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0;
}

.brand-copy h1 {
    margin-top: 18px;
    font-size: clamp(38px, 3.8vw, 54px);
    line-height: 1.14;
    font-weight: 900;
}

.brand-subtitle {
    margin-top: 20px;
    font-size: 19px;
    color: #ffe2bf;
    font-weight: 600;
}

.brand-description {
    margin-top: 18px;
    max-width: 480px;
    color: rgba(255, 248, 239, 0.78);
    font-size: 15px;
    line-height: 1.9;
}

.brand-metrics {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.brand-metrics span {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    border: 1px solid rgba(242, 198, 109, 0.28);
    color: rgba(255, 246, 233, 0.82);
    background: rgba(21, 10, 11, 0.44);
    backdrop-filter: blur(12px);
    border-radius: 8px;
    font-size: 13px;
}

.auth-panel {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 64px;
    background:
        radial-gradient(circle at 78% 72%, rgba(240, 90, 36, 0.16), transparent 34%),
        radial-gradient(circle at 14% 20%, rgba(242, 198, 109, 0.16), transparent 30%),
        linear-gradient(145deg, rgba(255, 250, 243, 0.98), rgba(246, 240, 232, 0.97)),
        var(--paper);
    overflow: hidden;
}

.mobile-login-brand {
    display: none;
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(240, 90, 36, 0.075), transparent 44%),
        linear-gradient(45deg, transparent 0 74%, rgba(159, 17, 20, 0.065) 74% 100%),
        repeating-linear-gradient(115deg, rgba(80, 34, 22, 0.04) 0 1px, transparent 1px 92px),
        repeating-linear-gradient(0deg, transparent 0 96px, rgba(128, 75, 41, 0.028) 96px 97px);
    pointer-events: none;
}

.auth-panel::after {
    content: "";
    position: absolute;
    right: -110px;
    bottom: -130px;
    width: 430px;
    height: 430px;
    background: radial-gradient(circle, rgba(240, 90, 36, 0.18), rgba(240, 90, 36, 0.07) 34%, transparent 68%);
    pointer-events: none;
}

.auth-stage {
    position: relative;
    z-index: 2;
    width: min(100%, 620px);
    min-height: 690px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 28px;
}

.auth-card-wrap {
    position: relative;
    z-index: 4;
    width: min(100%, 492px);
    padding-top: 154px;
}

.auth-card {
    position: relative;
    z-index: 4;
    width: 100%;
    padding: 58px 50px 48px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 244, 0.78)),
        rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 38px 96px rgba(58, 23, 13, 0.16),
        0 0 0 1px rgba(242, 198, 109, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
}

.mascot-peek {
    position: absolute;
    z-index: 6;
    top: -70px;
    left: 50%;
    width: clamp(560px, 78%, 720px);
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.mascot-peek img {
    width: 100%;
    height: auto;
    display: block;
    mix-blend-mode: multiply;
    filter:
        drop-shadow(0 20px 24px rgba(103, 28, 8, 0.14))
        drop-shadow(0 0 18px rgba(240, 90, 36, 0.1));
}

.mascot-greeting {
    position: absolute;
    left: calc(50% + 92px);
    top: 78px;
    width: 178px;
    padding: 12px 14px;
    border: 1px solid rgba(240, 90, 36, 0.17);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 240, 0.82));
    color: #6f3826;
    font-size: 12px;
    line-height: 1.55;
    box-shadow: 0 18px 38px rgba(67, 24, 10, 0.12);
    backdrop-filter: blur(14px);
}

.mascot-greeting::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 24px;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    background: rgba(255, 250, 245, 0.88);
    border-left: 1px solid rgba(240, 90, 36, 0.17);
    border-bottom: 1px solid rgba(240, 90, 36, 0.17);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(242, 198, 109, 0.16), transparent 32%, rgba(240, 90, 36, 0.12));
    opacity: 0.55;
    pointer-events: none;
    mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    padding: 1px;
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.auth-heading h2 {
    margin-top: 12px;
    font-size: 34px;
    line-height: 1.24;
    color: #17100e;
}

.auth-heading p:last-child {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.auth-form {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #342621;
    font-size: 13px;
    font-weight: 700;
}

.field input {
    width: 100%;
    height: 54px;
    padding: 0 17px;
    border: 1px solid rgba(59, 35, 27, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.84);
    color: #1f1512;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input::placeholder {
    color: #b2aaa4;
}

.field input:focus {
    background: #fff;
    border-color: rgba(240, 90, 36, 0.64);
    box-shadow: 0 0 0 4px rgba(240, 90, 36, 0.11);
}

.code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 116px;
    gap: 10px;
}

.code-btn {
    height: 54px;
    border: 1px solid rgba(159, 17, 20, 0.18);
    border-radius: 8px;
    background: #fff7ef;
    color: #a51a15;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.code-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(240, 90, 36, 0.16);
}

.code-btn:disabled {
    cursor: not-allowed;
    color: #b8aaa2;
    background: #f4eee9;
}

.auth-message {
    min-height: 20px;
    color: #9f1114;
    font-size: 13px;
    line-height: 1.5;
}

.auth-message.success {
    color: #8b641f;
}

.primary-btn {
    height: 56px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    background: linear-gradient(135deg, #ff8a2a, #e43b24 48%, #8f0e13);
    box-shadow: 0 18px 38px rgba(201, 50, 29, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 24px 52px rgba(201, 50, 29, 0.34);
    filter: saturate(1.08);
}

.primary-btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.35);
    opacity: 0.72;
}

.auth-terms {
    margin-top: 22px;
    font-size: 12px;
    color: #8b8179;
    line-height: 1.8;
}

.auth-terms a {
    color: #8f0e13;
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 980px) {
    body {
        overflow: auto;
    }

    .admin-entry {
        top: calc(14px + env(safe-area-inset-top, 0px));
        right: 14px;
        min-height: 30px;
        padding: 0 10px;
        color: rgba(45, 34, 30, 0.62);
        background: rgba(255, 250, 243, 0.64);
        font-size: 11px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
    }

    .login-shell::after {
        display: none;
    }

    .brand-visual {
        min-height: 42vh;
        padding: 32px 24px;
    }

    .brand-logo {
        width: 180px;
        margin-bottom: 28px;
    }

    .brand-copy h1 {
        font-size: 34px;
    }

    .auth-panel {
        min-height: 58vh;
        padding: 34px 18px 170px;
    }

    .auth-stage {
        min-height: 640px;
        padding: 0;
    }

    .auth-card-wrap {
        padding-top: 142px;
    }

    .auth-card {
        padding: 30px 22px;
        border-radius: 8px;
    }

    .mascot-peek {
        width: 560px;
        top: -124px;
    }

    .mascot-greeting {
        left: auto;
        right: 2px;
        top: 82px;
        width: 150px;
        font-size: 11px;
    }
}

@media (max-width: 520px) {
    .brand-metrics {
        display: none;
    }

    .code-row {
        grid-template-columns: 1fr;
    }

    .code-btn {
        width: 100%;
    }

    .mascot-peek {
        width: 500px;
        top: -110px;
    }

    .auth-card-wrap {
        padding-top: 128px;
    }

    .mascot-greeting {
        display: none;
    }
}

@media (max-width: 980px) {
    body {
        min-height: 100vh;
        min-height: 100dvh;
        overflow: auto;
        background: #fbf7f1;
    }

    .login-shell {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
        background:
            radial-gradient(circle at 50% -10%, rgba(240, 90, 36, 0.16), transparent 36%),
            radial-gradient(circle at 88% 8%, rgba(242, 198, 109, 0.16), transparent 28%),
            linear-gradient(180deg, #fffaf5 0%, #fbf7f1 46%, #f7f0e8 100%);
    }

    .login-shell::after,
    .brand-visual {
        display: none;
    }

    .auth-panel {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0 0 calc(26px + env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow: visible;
        background:
            radial-gradient(circle at 50% -10%, rgba(240, 90, 36, 0.16), transparent 36%),
            radial-gradient(circle at 88% 8%, rgba(242, 198, 109, 0.16), transparent 28%),
            linear-gradient(180deg, #fffaf5 0%, #fbf7f1 46%, #f7f0e8 100%);
    }

    .auth-panel::before {
        display: none;
    }

    .auth-panel::after {
        display: none;
    }

    .mobile-login-brand {
        position: relative;
        z-index: 3;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        margin: 0 auto;
        padding: calc(18px + env(safe-area-inset-top, 0px)) 24px 16px;
        text-align: center;
    }

    .mobile-login-brand img {
        width: 84px;
        height: auto;
        display: block;
        filter: drop-shadow(0 10px 22px rgba(138, 50, 18, 0.12));
    }

    .mobile-login-brand p {
        color: #251814;
        font-size: 23px;
        font-weight: 800;
        line-height: 1.22;
    }

    .auth-stage {
        flex: 0 0 auto;
        width: 100%;
        min-height: 0;
        display: block;
        padding: 0;
    }

    .auth-card-wrap {
        width: 100%;
        max-width: 384px;
        margin: 0 auto;
        padding: 0 24px;
    }

    .mascot-peek {
        display: none;
    }

    .auth-card {
        padding: 0;
        border-radius: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    .auth-card::before {
        display: none;
    }

    .auth-heading h2 {
        display: none;
        line-height: 1.22;
    }

    .auth-kicker,
    .auth-heading p:last-child {
        display: none;
    }

    .auth-form {
        margin-top: 0;
        gap: 12px;
    }

    .field {
        gap: 0;
    }

    .field > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .field input,
    .code-btn {
        height: 52px;
        border-radius: 16px;
    }

    .field input {
        padding: 0 17px;
        border-color: rgba(84, 54, 42, 0.1);
        background: rgba(255, 255, 255, 0.94);
        box-shadow:
            0 12px 26px rgba(66, 35, 20, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.86);
    }

    .code-row {
        grid-template-columns: minmax(0, 1fr) 96px;
        gap: 8px;
    }

    .code-btn {
        width: auto;
        border: 0;
        background: rgba(240, 90, 36, 0.08);
        color: #c63b23;
        font-size: 12px;
        box-shadow: none;
    }

    .code-btn:hover:not(:disabled) {
        transform: none;
        box-shadow: none;
        background: rgba(240, 90, 36, 0.12);
    }

    .auth-message {
        min-height: 0;
        font-size: 12px;
    }

    .auth-message:empty {
        display: none;
    }

    .primary-btn {
        height: 52px;
        border-radius: 999px;
        margin-top: 6px;
        box-shadow: 0 16px 34px rgba(201, 50, 29, 0.22);
    }

    .auth-terms {
        margin-top: 18px;
        font-size: 11px;
        line-height: 1.6;
        text-align: center;
        color: #9b9189;
    }
}

@media (max-width: 374px) {
    .auth-panel {
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-login-brand {
        padding-bottom: 12px;
    }

    .mobile-login-brand img {
        width: 76px;
    }

    .mobile-login-brand p {
        font-size: 21px;
    }

    .auth-card-wrap {
        padding: 0 20px;
    }

    .code-row {
        grid-template-columns: minmax(0, 1fr) 88px;
        gap: 7px;
    }

    .code-btn {
        width: auto;
        font-size: 11px;
    }
}
