/* SiXun 员工登录页 v3 — 沉浸式全屏 + 动效交互 */

:root {
    /* 登录页也走低对比：默认偏浅灰舞台，暗色是柔和深灰 */
    --sx-ink: #2b2d30;
    --sx-paper: #f3f3f3;
    --sx-card: rgba(255, 255, 255, .5);
    --sx-card-solid: #fafafa;
    --sx-text: #3c3c3c;
    --sx-text-2: #3c3c3c;
    --sx-muted: #6a6a6a;
    --sx-muted-2: #8b8b8b;
    --sx-line: rgba(0, 0, 0, .06);
    --sx-field: #eeeeee;
    --sx-field-border: rgba(0, 0, 0, .08);
    --sx-accent: #2563eb;
    --sx-accent-2: #3b82f6;
    --sx-danger: #c2410c;
    --sx-danger-bg: rgba(194, 65, 12, .1);
    --sx-ease: cubic-bezier(.22, 1, .36, 1);
    --sx-font: "Segoe UI Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

html.theme-dark {
    --sx-paper: #2b2d30;
    --sx-card-solid: #313338;
    --sx-field: #3c3c3c;
    --sx-field-border: rgba(255, 255, 255, .08);
    --sx-text: #f0f0f0;
    --sx-text-2: #f0f0f0;
    --sx-muted: #c8c8c8;
    --sx-muted-2: #b0b0b0;
    --sx-danger: #f0977a;
    --sx-danger-bg: rgba(240, 151, 122, .12);
    --sx-accent: #60a5fa;
    --sx-accent-2: #93c5fd;
}

html, body { height: 100%; margin: 0; padding: 0; }
html { color-scheme: light; }
html.theme-dark { color-scheme: dark; }

body.sx-login-body {
    font-family: var(--sx-font);
    background: var(--sx-paper);
    color: var(--sx-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.sx-login {
    position: relative;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    align-items: center;
    /* 左右内容往中间靠约 30%：加大两侧内边距 */
    padding: 40px clamp(48px, 15vw, 220px);
    gap: clamp(24px, 4vw, 48px);
    box-sizing: border-box;
    overflow: hidden;
    justify-items: center;
}

.sx-hero {
    position: relative;
    z-index: 1;
    max-width: 560px;
    width: 100%;
    justify-self: end;
    animation: sx-rise .9s var(--sx-ease) both;
}
.sx-canvas {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 520px at 12% 0%, rgba(37, 99, 235, .1), transparent 55%),
        radial-gradient(700px 420px at 90% 100%, rgba(59, 130, 246, .08), transparent 50%),
        var(--sx-paper);
}

html.theme-dark .sx-canvas {
    background:
        radial-gradient(900px 520px at 12% 0%, rgba(96, 165, 250, .08), transparent 55%),
        radial-gradient(700px 420px at 90% 100%, rgba(147, 197, 253, .06), transparent 50%),
        var(--sx-paper);
}

.sx-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(380px 380px at var(--mx, 70%) var(--my, 30%), rgba(37, 99, 235, .12), transparent 60%);
    transition: background .05s linear;
}
html.theme-dark .sx-glow {
    background: radial-gradient(380px 380px at var(--mx, 70%) var(--my, 30%), rgba(96, 165, 250, .12), transparent 60%);
}

.sx-mesh {
    position: absolute;
    inset: -15%;
    background-image:
        linear-gradient(rgba(0, 0, 0, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, .04) 1px, transparent 1px);
    background-size: 64px 64px;
    transform: perspective(700px) rotateX(60deg) scale(1.4);
    transform-origin: center 20%;
    mask-image: linear-gradient(#000 15%, transparent 90%);
    animation: sx-mesh 22s linear infinite;
    opacity: .35;
}
html.theme-dark .sx-mesh {
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
}

.sx-blob {
    position: absolute;
    border-radius: 40% 60% 55% 45%;
    filter: blur(48px);
    opacity: .22;
    animation: sx-blob 12s ease-in-out infinite;
}
.sx-blob-1 { width: 280px; height: 280px; top: -60px; left: 8%; background: #3b82f6; }
.sx-blob-2 { width: 240px; height: 240px; right: 6%; bottom: 4%; background: #64748b; animation-delay: -4s; }
.sx-blob-3 { width: 180px; height: 180px; left: 42%; top: 48%; background: #94a3b8; opacity: .16; animation-delay: -7s; }

.sx-lines { position: absolute; inset: 0; }
.sx-lines i {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15, 118, 110, .25), transparent);
    animation: sx-line 8s var(--sx-ease) infinite;
    opacity: .35;
}
html.theme-dark .sx-lines i {
    background: linear-gradient(90deg, transparent, rgba(78, 201, 176, .25), transparent);
}
.sx-lines i:nth-child(1) { top: 22%; animation-delay: 0s; }
.sx-lines i:nth-child(2) { top: 40%; animation-delay: 1.4s; opacity: .3; }
.sx-lines i:nth-child(3) { top: 62%; animation-delay: 2.6s; }
.sx-lines i:nth-child(4) { top: 78%; animation-delay: 3.8s; opacity: .25; }

/* ---- hero copy ---- */
.sx-brand-xl {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
}

.sx-brand-mark {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 14px;
    display: block;
    object-fit: cover;
    box-shadow: 0 10px 24px -16px rgba(255, 122, 26, .45);
    transition: transform .35s var(--sx-ease);
}
.sx-brand-xl:hover .sx-brand-mark { transform: rotate(-6deg) scale(1.04); }

.sx-brand-name {
    font-size: clamp(18px, 2.1vw, 24px);
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: var(--sx-text);
    max-width: 14em;
}
.sx-brand-tag {
    margin-top: 4px;
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--sx-muted);
}

.sx-hero-title {
    margin: 0 0 14px;
    font-size: clamp(26px, 3.2vw, 40px);
    line-height: 1.18;
    font-weight: 720;
    letter-spacing: -.03em;
    color: var(--sx-text);
}

.sx-hero-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--sx-muted);
    max-width: 26em;
}

.sx-chips { display: none; }

/* ---- dock / card ---- */
.sx-dock {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    justify-self: start;
    animation: sx-rise .95s .08s var(--sx-ease) both;
}

.sx-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    padding: 22px 22px 16px;
    border-radius: 12px;
    background: var(--sx-card-solid);
    color: var(--sx-text-2);
    border: 0;
    box-shadow: 0 12px 32px -20px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.sx-card-shine { display: none; }

.sx-card:hover { box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .3); }

.sx-eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: none;
    color: var(--sx-accent);
}

.sx-card-head h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.02em;
    font-weight: 700;
}

.sx-sub {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--sx-muted-2);
}

.sx-error, .dialog {
    display: none;
    margin: 10px 0;
    padding: 7px 9px;
    border-radius: 8px;
    background: var(--sx-danger-bg);
    color: var(--sx-danger);
    font-size: 12px;
}
.sx-error:not(:empty), .dialog:not(:empty) { display: block; }

.sx-label {
    display: block;
    margin: 10px 0 5px;
    font-size: 11px;
    font-weight: 650;
    color: var(--sx-muted-2);
}

.sx-form .row { margin: 0 0 2px !important; float: none; width: auto; }
.sx-form .row.cl:before, .sx-form .row.cl:after { display: none !important; content: none !important; }

.sx-field {
    position: relative;
    display: flex;
    align-items: center;
    height: 34px;
    padding: 0 10px 0 34px;
    background: var(--sx-field);
    border: 1px solid var(--sx-field-border);
    border-radius: 8px;
    transition: border-color .2s var(--sx-ease), box-shadow .2s var(--sx-ease);
}
.sx-field:hover { border-color: rgba(37, 99, 235, .4); }
.sx-field:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .14);
}

.sx-ico {
    position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
    color: var(--sx-muted-2); pointer-events: none;
}
.sx-field:focus-within .sx-ico { color: #2563eb; }

.sx-field .input-text, .sx-login .input-text {
    width: 100%; height: 32px; margin: 0; padding: 0;
    border: 0 !important; background: transparent !important; box-shadow: none !important;
    outline: none; font-size: 12px; color: var(--sx-text-2); font-family: inherit;
}

.sx-cap { display: flex; gap: 8px; align-items: stretch; }
.sx-cap .sx-field { flex: 1; min-width: 0; }

.sx-code {
    position: relative;
    flex: 0 0 96px;
    height: 34px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--sx-field-border);
    background: var(--sx-field);
    cursor: pointer;
    transition: border-color .2s var(--sx-ease);
}
.sx-code:hover { border-color: var(--sx-accent); }
.sx-code:active { opacity: .9; }
.sx-code img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-code-tip {
    position: absolute; left: 0; right: 0; bottom: 0;
    font-size: 9px; text-align: center; color: #f5f5f5;
    background: rgba(60, 60, 60, .55); padding: 1px 0;
    opacity: 0; transition: opacity .2s var(--sx-ease);
}
.sx-code:hover .sx-code-tip { opacity: 1; }

.sx-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 34px;
    margin-top: 14px;
    border: 0;
    border-radius: 8px;
    background: var(--sx-accent);
    color: #f5f5f5;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .06em;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: background .2s var(--sx-ease), opacity .2s var(--sx-ease);
}
html.theme-dark .sx-submit { color: #1e1e1e; }
.sx-submit span { position: relative; z-index: 1; }
.sx-submit:hover { background: var(--sx-accent-2); }
.sx-submit:active { opacity: .9; transform: scale(.99); }

a.sx-submit {
    text-decoration: none;
    box-sizing: border-box;
}
.sx-submit-secondary {
    margin-top: 8px !important;
    background: transparent !important;
    color: var(--sx-text) !important;
    border: 1px solid var(--sx-field-border) !important;
}
.sx-submit-secondary:hover {
    background: var(--sx-field) !important;
    color: var(--sx-accent) !important;
    border-color: rgba(37, 99, 235, .35) !important;
}
html.theme-dark .sx-submit-secondary {
    color: var(--sx-text) !important;
}
.sx-btn-ripple {
    position: absolute; border-radius: 50%;
    background: rgba(255, 255, 255, .28);
    transform: scale(0); animation: sx-ripple .45s ease-out;
    pointer-events: none;
}

.sx-hint { margin: 12px 0 0; text-align: center; font-size: 11px; color: var(--sx-muted-2); }
.sx-foot { margin: 4px 0 0; text-align: center; font-size: 11px; color: var(--sx-muted-2); opacity: .85; }

.sx-back-home {
    position: fixed;
    top: 16px;
    left: 18px;
    z-index: 20;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .12em;
    color: var(--sx-text, #1c1917);
    text-decoration: none;
}

.sx-theme-toggle {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 9999 !important;
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    border: 1px solid rgba(15, 23, 42, .12) !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, .88) !important;
    color: var(--sx-text) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 8px 20px -14px rgba(15, 23, 42, .45) !important;
    transition: background .2s var(--sx-ease), color .2s var(--sx-ease);
}
html.theme-dark .sx-theme-toggle {
    background: rgba(40, 44, 52, .92) !important;
    border-color: rgba(255, 255, 255, .12) !important;
    color: #e5e7eb !important;
}
.sx-theme-toggle:hover { background: rgba(15, 118, 110, .12); color: var(--sx-accent); }
.sx-theme-toggle:active { opacity: .9; }
.sx-theme-toggle .sx-sun, .sx-theme-toggle .sx-moon {
    position: absolute; width: 16px; height: 16px;
    transition: opacity .25s var(--sx-ease);
}
.sx-theme-toggle .sx-sun { opacity: 1; }
.sx-theme-toggle .sx-moon { opacity: 0; }
html.theme-dark .sx-theme-toggle .sx-sun { opacity: 0; }
html.theme-dark .sx-theme-toggle .sx-moon { opacity: 1; }

.footer { display: none; }

@keyframes sx-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes sx-mesh { from { background-position: 0 0; } to { background-position: 64px 64px; } }
@keyframes sx-blob {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(18px, -22px) rotate(12deg); }
}
@keyframes sx-line {
    0%, 100% { transform: translateX(-6%); opacity: .15; }
    50% { transform: translateX(6%); opacity: .55; }
}
@keyframes sx-shake {
    0%, 100% { transform: none; }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}
@keyframes sx-ripple { to { transform: scale(2.4); opacity: 0; } }

@media (max-width: 980px) {
    .sx-login {
        grid-template-columns: 1fr;
        padding: 28px 18px 40px;
        align-items: stretch;
    }
    .sx-hero { margin-top: 24px; }
    .sx-hero-title { font-size: 32px; }
    .sx-dock { justify-content: center; }
    .sx-card { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.sx-qr-wrap { text-align: center; }
.sx-qr-frame {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 8px auto 14px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.sx-qr-img { width: 100%; height: 100%; display: block; object-fit: contain; }
.sx-qr-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.88);
    color: #555;
    font-size: 13px;
    padding: 16px;
    text-align: center;
}
.sx-qr-tip { color: var(--sx-muted); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.sx-merchant-pick { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.sx-merchant-pick .sx-submit { margin: 0; }
.dialog.sx-ok { color: var(--sx-accent); }
