:root {
    --auth-primary: #2457e6;
    --auth-primary-dark: #173eb6;
    --auth-accent: #f05a28;
    --auth-ink: #172033;
    --auth-muted: #667085;
    --auth-subtle: #98a2b3;
    --auth-line: #dfe5ee;
    --auth-field: #f5f7fb;
    --auth-surface: #ffffff;
    --auth-success: #15803d;
    --auth-danger: #c93636;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.auth-page {
    min-height: 100dvh;
    margin: 0;
    color: var(--auth-ink);
    font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #eaf1fb 0%, #f8fafc 56%, #f7f1ee 100%);
    overflow-x: hidden;
}

body.auth-page::before {
    content: "";
    position: fixed;
    right: -8%;
    bottom: 0;
    left: -8%;
    z-index: 0;
    height: 48vh;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        rgba(32, 218, 228, 0.32) 0%,
        rgba(36, 87, 230, 0.24) 54%,
        rgba(255, 91, 28, 0.3) 100%
    );
    background-size: 145% 100%;
    background-position: 0% 50%;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.74), transparent 92%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.74), transparent 92%);
    transform-origin: 50% 100%;
    will-change: transform, background-position;
    animation: authBottomFloat 14s ease-in-out infinite alternate;
}

body.auth-page::after {
    content: "";
    position: fixed;
    right: -14%;
    bottom: -9vh;
    left: -14%;
    z-index: 0;
    height: 58vh;
    display: none;
    pointer-events: none;
    opacity: 0.64;
    background: linear-gradient(
        98deg,
        rgba(32, 218, 228, 0.42) 0%,
        rgba(54, 158, 235, 0.22) 24%,
        rgba(36, 87, 230, 0.34) 52%,
        rgba(245, 128, 65, 0.22) 76%,
        rgba(255, 91, 28, 0.38) 100%
    );
    background-size: 165% 120%;
    background-position: 0% 50%;
    clip-path: polygon(
        0 33%,
        8% 26%,
        17% 31%,
        26% 22%,
        36% 29%,
        47% 18%,
        58% 29%,
        68% 23%,
        79% 32%,
        89% 25%,
        100% 33%,
        100% 100%,
        0 100%
    );
    mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.92) 58%, rgba(0, 0, 0, 0.34) 82%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.92) 58%, rgba(0, 0, 0, 0.34) 82%, transparent 100%);
    filter: blur(24px);
    transform-origin: 50% 100%;
    will-change: transform, opacity, background-position;
    animation: authColorBreath 18s ease-in-out infinite alternate;
}

body.auth-page.is-security-dragging::before,
body.auth-page.is-security-dragging::after {
    animation-play-state: paused;
}

@keyframes authBottomFloat {
    0% {
        background-position: 0% 50%;
        transform: translate3d(-2.5%, 7%, 0) scaleY(1.02);
    }

    48% {
        background-position: 55% 50%;
        transform: translate3d(1.5%, 1%, 0) scaleY(1.08);
    }

    100% {
        background-position: 100% 50%;
        transform: translate3d(3%, 5%, 0) scaleY(1.04);
    }
}

@keyframes authColorBreath {
    0% {
        opacity: 0.5;
        background-position: 0% 50%;
        transform: translate3d(-3%, 8%, 0) scaleX(1.03) scaleY(0.94);
    }

    52% {
        opacity: 0.72;
        background-position: 58% 50%;
        transform: translate3d(2%, -2%, 0) scaleX(1.08) scaleY(1.1);
    }

    100% {
        opacity: 0.58;
        background-position: 100% 50%;
        transform: translate3d(-1%, 4%, 0) scaleX(1.04) scaleY(1.02);
    }
}

.auth-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 1;
    pointer-events: none;
}

.auth-success-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-14px);
    z-index: 1080;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 32px);
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(47, 107, 255, 0.32);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(20, 50, 120, 0.18);
    color: #0E2A55;
    font-size: 0.92rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.auth-success-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.auth-success-toast .toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(47, 107, 255, 0.12);
    color: #2F6BFF;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.auth-success-toast .toast-text {
    line-height: 1.3;
}

button,
input {
    font: inherit;
}

.auth-page-shell {
    position: relative;
    z-index: 1;
    min-height: calc(100dvh - 48px);
    display: grid;
    place-items: center;
    padding: 32px 24px 16px;
}

.auth-layout {
    width: min(1120px, 100%);
    min-height: 690px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    overflow: hidden;
    border: 1px solid rgba(205, 216, 230, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(46, 67, 105, 0.14);
}

.auth-brand-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 54px 56px 48px;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(15, 35, 84, 0.95), rgba(28, 75, 181, 0.92)),
        #173b8f;
}

.auth-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(135deg, rgba(92, 151, 255, 0.14), transparent 46%),
        linear-gradient(315deg, rgba(32, 211, 221, 0.1), transparent 44%);
}

.auth-brand-logo-wrap,
.auth-brand-copy,
.auth-feature-list {
    position: relative;
    z-index: 2;
}

.auth-brand-logo-wrap {
    width: 248px;
    max-width: 78%;
    display: block;
}

.auth-brand-logo {
    display: block;
    width: 100%;
    height: auto;
    filter:
        drop-shadow(0 1px 0 rgba(255, 255, 255, 0.92))
        drop-shadow(0 0 8px rgba(113, 221, 255, 0.44));
}

.auth-brand-copy {
    margin: auto 0;
    padding: 52px 0 42px;
}

/* 品牌图片：后台「登录页文案」上传后整幅覆盖左栏面板（继承面板圆角） */
.auth-brand-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* H5 专属品牌图：仅窄屏（≤900px）整幅覆盖，宽屏桌面端隐藏不受影响；
   仅配置 H5 图（无通用图）时左栏仍渲染文字版（文字元素 z-index:2），故窄屏需提升层级盖住文字 */
.auth-brand-image--h5 {
    display: none;
}

@media (max-width: 900px) {
    .auth-brand-image--h5 {
        display: block;
        z-index: 3;
    }
}

.auth-brand-kicker {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 700;
}

.auth-brand-title {
    max-width: 500px;
    margin: 0 0 20px;
    font-size: 46px;
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: 0;
}

.auth-brand-summary {
    max-width: 470px;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 16px;
    line-height: 1.8;
}

.auth-feature-list {
    display: grid;
    gap: 17px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-feature-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 13px;
    align-items: start;
}

.auth-feature-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 9px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    font-size: 17px;
}

.auth-feature-copy,
.auth-feature-copy strong,
.auth-feature-copy span {
    display: block;
}

.auth-feature-copy strong {
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 700;
}

.auth-feature-copy > span {
    color: rgba(255, 255, 255, 0.64);
    font-size: 12px;
    line-height: 1.55;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 50px;
    background: var(--auth-surface);
}

.auth-form-inner {
    width: 100%;
    max-width: 430px;
}

.auth-heading {
    margin-bottom: 22px;
}

.auth-title {
    margin: 0 0 7px;
    color: var(--auth-ink);
    font-size: 27px;
    font-weight: 800;
    line-height: 1.3;
}

.auth-description {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-mode-tabs,
.seg-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-mode-tabs {
    gap: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--auth-line);
}

.auth-mode-tab {
    position: relative;
    min-height: 42px;
    padding: 0 4px 12px;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.auth-mode-tab::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: transparent;
}

.auth-mode-tab.active {
    color: var(--auth-primary);
}

.auth-mode-tab.active::after {
    background: var(--auth-primary);
}

.auth-mode-tab:focus {
    outline: none;
}

.auth-mode-tab:focus-visible {
    border-radius: 6px;
    box-shadow: 0 0 0 3px rgba(36, 87, 230, 0.14);
}

.seg-tabs {
    gap: 4px;
    margin-bottom: 18px;
    padding: 4px;
    border-radius: 10px;
    background: var(--auth-field);
}

.seg-tab {
    min-height: 38px;
    padding: 7px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.seg-tab:hover {
    color: var(--auth-primary);
}

.seg-tab.active {
    color: var(--auth-ink);
    background: #fff;
    box-shadow: 0 2px 7px rgba(28, 43, 75, 0.1);
}

.auth-panel,
.login-form-section {
    display: none;
}

.auth-panel.active,
.login-form-section.active {
    display: block;
    animation: authPanelIn 0.2s ease-out;
}

@keyframes authPanelIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-stack {
    display: grid;
    gap: 13px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field-label {
    color: #475467;
    font-size: 13px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--auth-line);
    border-radius: 9px;
    color: var(--auth-ink);
    background: var(--auth-field);
    font-size: 14px;
    box-shadow: none;
}

.form-control::placeholder {
    color: var(--auth-subtle);
}

.form-control:focus {
    border-color: var(--auth-primary);
    outline: none;
    color: var(--auth-ink);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(36, 87, 230, 0.11);
}

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

.btn-send-code {
    height: 48px;
    padding: 0 12px;
    border: 1px solid #cbd6eb;
    border-radius: 9px;
    color: var(--auth-primary);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.btn-send-code:hover:not(:disabled) {
    border-color: var(--auth-primary);
    background: #f6f8ff;
}

.btn-send-code:disabled {
    color: var(--auth-subtle);
    background: #f4f5f7;
    cursor: not-allowed;
}

.password-tip {
    margin: -7px 0 0;
    color: var(--auth-subtle);
    font-size: 12px;
}

.agreement {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    margin: 13px 0;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.6;
}

.agreement input {
    width: 15px;
    height: 15px;
    margin-top: 1px;
    accent-color: var(--auth-primary);
}

.agreement a {
    color: var(--auth-accent);
    font-weight: 700;
    text-decoration: none;
}

.agreement a:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    min-height: 48px;
    margin-top: 13px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(36, 87, 230, 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-login:hover:not(:disabled) {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 13px 24px rgba(36, 87, 230, 0.25);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-switch {
    margin-top: 16px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-switch a {
    color: var(--auth-accent);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.alert {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 13px;
}

.inline-security {
    display: none;
    margin-top: 14px;
    padding: 12px;
    border: 1.5px solid #c7d2e0;
    border-radius: 10px;
    background: #f8fafc;
}

.inline-security.is-visible {
    display: block;
    animation: authPanelIn 0.18s ease-out;
}

@keyframes securitySliderPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(36, 87, 230, 0); }
    50% { box-shadow: 0 0 0 6px rgba(36, 87, 230, 0.12); }
}

.inline-security.is-visible {
    animation: authPanelIn 0.18s ease-out, securitySliderPulse 1.5s ease-in-out 2;
}

.inline-security-head {
    min-height: 22px;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.inline-security-head > i {
    margin-right: 6px;
    color: var(--auth-primary);
    font-size: 14px;
}

.inline-security-label {
    flex: 1;
    min-width: 0;
}

.inline-security-reset {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: #7c8798;
    background: transparent;
    line-height: 1;
}

.inline-security-reset,
.inline-security-thumb {
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.inline-security-reset:hover:not(:disabled) {
    color: var(--auth-primary);
    background: #edf1f8;
}

.inline-security-track {
    position: relative;
    width: 100%;
    height: 48px;
    overflow: hidden;
    contain: layout paint;
    border: 1.5px solid #b0bec5;
    border-radius: 10px;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.58) 0 7px, transparent 7px 14px),
        #e8edf3;
    user-select: none;
    touch-action: none;
}

.inline-security-progress {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-right: 1.5px solid rgba(36, 87, 230, 0.4);
    background: rgba(36, 87, 230, 0.18);
    pointer-events: none;
}

.inline-security-copy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 48px;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
}

@keyframes securitySliderCopyBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.inline-security.is-visible .inline-security-copy {
    animation: securitySliderCopyBlink 2s ease-in-out 1.5;
}

.inline-security-thumb {
    position: absolute;
    inset: -1px auto -1px -1px;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: auto;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-right: 1px solid #b0bec5;
    border-radius: 9px;
    color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 2px 8px rgba(20, 34, 60, 0.18);
    cursor: grab;
    touch-action: none;
    will-change: transform;
}

.inline-security-thumb > i,
.inline-security-reset > i {
    display: block;
    margin: 0;
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}

.inline-security-thumb:active {
    cursor: grabbing;
}

.inline-security.is-checking .inline-security-thumb {
    cursor: wait;
}

.inline-security.is-success .inline-security-track {
    border-color: #78c995;
    background: #edf9f1;
}

.inline-security.is-success .inline-security-progress {
    background: rgba(21, 128, 61, 0.18);
}

.inline-security.is-success .inline-security-copy {
    padding-right: 52px;
    padding-left: 52px;
    text-align: center;
    color: #15803d;
    font-weight: 600;
}

.inline-security.is-success .inline-security-head > i,
.inline-security.is-success .inline-security-copy,
.inline-security.is-success .inline-security-thumb {
    color: var(--auth-success);
}

.inline-security-error {
    min-height: 18px;
    margin-top: 6px;
    color: var(--auth-danger);
    font-size: 12px;
    line-height: 1.4;
}

.auth-login-footer {
    position: relative;
    z-index: 1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px 16px;
    color: #778195;
    font-size: 12px;
    text-align: center;
}

.auth-login-footer p {
    margin: 0;
}

.legal-modal-body {
    color: #333;
    line-height: 1.8;
}

.legal-modal-body h2 {
    margin: 28px 0 14px;
    font-size: 18px;
    font-weight: 600;
}

.legal-modal-body h3 {
    margin: 22px 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.legal-modal-body p,
.legal-modal-body ul,
.legal-modal-body ol {
    margin-bottom: 14px;
}

.legal-modal-body ul,
.legal-modal-body ol {
    padding-left: 24px;
}

.auto-register-dialog {
    max-width: 400px;
}

.auto-register-content {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
}

.auto-register-icon {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 12px;
    color: #fff;
    background: var(--auth-primary);
    font-size: 24px;
}

.auto-register-title {
    margin-bottom: 8px;
    color: var(--auth-ink);
    font-weight: 700;
}

.auto-register-copy {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.7;
}

.auto-register-actions {
    gap: 10px;
}

.auto-register-actions .btn {
    min-height: 42px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
}

.auto-register-confirm {
    color: #fff;
    background: var(--auth-primary);
}

@media (min-width: 1600px) and (min-height: 1000px) {
    body.auth-page::before {
        height: 56vh;
    }

    body.auth-page::after {
        display: block;
    }

    .auth-layout {
        width: min(1280px, calc(100vw - 160px));
        min-height: min(840px, calc(100dvh - 180px));
        grid-template-columns: minmax(0, 1.08fr) minmax(470px, 0.92fr);
    }

    .auth-brand-panel {
        padding: 64px 68px 56px;
    }

    .auth-form-panel {
        padding: 48px 64px;
    }
}

@media (min-width: 2200px) and (min-height: 1300px) {
    .auth-layout {
        width: min(1400px, calc(100vw - 240px));
        min-height: min(900px, calc(100dvh - 180px));
        grid-template-columns: minmax(0, 1.1fr) minmax(500px, 0.9fr);
    }

    .auth-brand-panel {
        padding: 72px 76px 64px;
    }

    .auth-form-panel {
        padding: 56px 72px;
    }
}

@media (max-width: 900px) {
    .auth-page-shell {
        padding: 18px 16px 10px;
    }

    .auth-layout {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: 220px;
        padding: 26px 30px;
    }

    .auth-brand-logo-wrap {
        width: 190px;
    }

    .auth-brand-copy {
        padding: 30px 0 0;
    }

    .auth-brand-title {
        max-width: 620px;
        margin-bottom: 10px;
        font-size: 30px;
    }

    .auth-brand-summary {
        max-width: 620px;
        font-size: 14px;
    }

    .auth-feature-list,
    .auth-brand-kicker {
        display: none;
    }

    .auth-form-panel {
        padding: 30px;
    }
}

@media (max-width: 560px) {
    .auth-particles {
        opacity: 0.72;
    }

    .auth-page-shell {
        display: block;
        padding: 0;
    }

    .auth-layout {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-brand-panel {
        min-height: 158px;
        padding: 20px 20px 24px;
    }

    .auth-brand-logo-wrap {
        width: 178px;
    }

    .auth-brand-copy {
        padding: 22px 0 0;
    }

    .auth-brand-title {
        margin: 0;
        font-size: 25px;
        line-height: 1.3;
    }

    .auth-brand-summary {
        display: none;
    }

    .auth-form-panel {
        align-items: flex-start;
        padding: 26px 18px 32px;
    }

    .auth-heading {
        margin-bottom: 18px;
    }

    .auth-title {
        font-size: 23px;
    }

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

    .btn-send-code {
        padding: 0 8px;
        font-size: 12px;
    }

    .inline-security-copy {
        font-size: 12px;
        padding-left: 44px;
    }

    .auth-login-footer {
        padding: 16px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
