﻿/* ===========================================================================
   数字爱科 登录页样式（v20260918erp10）
   - 中间登录卡片保持原样
   - 图2浅蓝色调；场景沉底托起登录卡；左侧 MES / ERP / 生产管理
   =========================================================================== */

:root {
    --lg-accent: #2b6cf6;
    --lg-accent-soft: #e8f0ff;
    --lg-accent-grad: linear-gradient(135deg, #2b6cf6 0%, #5b8dff 100%);
    --lg-bg: #EAF4FF;
    --lg-card: #ffffff;
    --lg-card-shadow: 0 18px 50px rgba(30, 50, 90, .12), 0 2px 8px rgba(30, 50, 90, .04);
    --lg-aside-bg: linear-gradient(150deg, #1f4fd6 0%, #2b6cf6 50%, #5b8dff 100%);
    --lg-aside-text: #ffffff;
    --lg-aside-sub: rgba(255, 255, 255, .82);
    --lg-aside-point: rgba(255, 255, 255, .9);
    --lg-aside-dot: #9bd2ff;
    --lg-ink: #1d1f24;
    --lg-ink-soft: #5a6273;
    --lg-muted: #8a93a4;
    --lg-line: #e6e9f0;
    --lg-field-bg: #f4f6fa;
    --lg-field-bg-focus: #ffffff;
    --lg-field-border: transparent;
    --lg-field-border-focus: #2b6cf6;
    --lg-topbar-text: #1D1D1F;
    --lg-topbar-bg: transparent;
    --lg-topbar-line: rgba(60, 60, 67, .16);
    --lg-btn-ghost: #E8E8ED;
    --lg-btn-ghost-hover: #DEDEE3;
    --lg-btn-ghost-text: #6E6E73;
    --lg-btn-ghost-text-active: #2b6cf6;
}

html[data-theme="dark"] {
    --lg-accent: #5b8dff;
    --lg-accent-soft: #1d2a44;
    --lg-accent-grad: linear-gradient(135deg, #3a72f5 0%, #6ea0ff 100%);
    --lg-bg: #071422;
    --lg-card: #1a2236;
    --lg-card-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .25);
    --lg-aside-bg: linear-gradient(150deg, #1a3a8f 0%, #2b53c9 50%, #3f6fd8 100%);
    --lg-aside-text: #ffffff;
    --lg-aside-sub: rgba(255, 255, 255, .75);
    --lg-aside-point: rgba(255, 255, 255, .85);
    --lg-aside-dot: #9bd2ff;
    --lg-ink: #e8ecf5;
    --lg-ink-soft: #aab3c5;
    --lg-muted: #7a8499;
    --lg-line: #2a3450;
    --lg-field-bg: #232c44;
    --lg-field-bg-focus: #2a3450;
    --lg-field-border: transparent;
    --lg-field-border-focus: #5b8dff;
    --lg-topbar-text: #e8ecf5;
    --lg-topbar-bg: transparent;
    --lg-topbar-line: rgba(255, 255, 255, .14);
    --lg-btn-ghost: rgba(58, 58, 60, .72);
    --lg-btn-ghost-hover: rgba(72, 72, 74, .9);
    --lg-btn-ghost-text: #aab3c5;
    --lg-btn-ghost-text-active: #5b8dff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    background: var(--lg-bg);
    color: var(--lg-ink);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- 卡片外：底部工厂图，顶部淡出 ---------- */
.lg-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: var(--lg-bg);
}

.lg-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../images/login-bg-factory.png?v=20260918erp10") no-repeat center bottom;
    background-size: cover;
}

.lg-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        var(--lg-bg) 0,
        color-mix(in srgb, var(--lg-bg) 55%, transparent) 18%,
        transparent 42%
    );
}

html[data-theme="dark"] .lg-bg::after {
    background-image: url("../images/login-bg-factory-dark.png?v=20260918erp10");
}

/* ---------- 顶栏 ---------- */
.lg-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--lg-bg) 55%, transparent) 0%,
        transparent 100%
    );
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--lg-topbar-line);
    z-index: 20;
}

.lg-brand-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--lg-topbar-text);
    font-weight: 600;
}

.lg-brand-mark { display: inline-flex; color: var(--lg-accent); }

.lg-brand-name {
    font-size: 16px;
    letter-spacing: .2px;
    color: var(--lg-topbar-text);
}

.lg-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border-radius: 999px;
    background: var(--lg-btn-ghost);
    font-size: 13px;
    color: var(--lg-btn-ghost-text);
}

.lang-switch button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    transition: color .2s ease, background .2s ease;
}

.lang-switch button:hover { color: var(--lg-btn-ghost-text-active); }

.lang-switch button.on {
    color: #fff;
    background: var(--lg-accent);
    font-weight: 600;
}

.lang-switch .lang-current { display: none; }

.lang-sep {
    opacity: .5;
    padding: 0 2px;
}

.theme-toggle,
.erp-switch {
    height: 30px;
    padding: 0 12px 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(60, 60, 67, .14);
    background: #fff;
    color: #1D1D1F;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.theme-toggle:hover,
.erp-switch:hover {
    background: #E8F1FC;
    color: var(--lg-accent);
    border-color: rgba(43, 108, 246, .28);
}

.theme-toggle-text,
.erp-switch-text {
    font-size: 13px;
    font-weight: 500;
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle.is-dark .icon-sun { display: none; }
.theme-toggle.is-dark .icon-moon { display: inline-flex; }

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .erp-switch {
    background: #3A3A3C;
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, .14);
}

html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .erp-switch:hover {
    background: #48484A;
    color: #fff;
    border-color: rgba(255, 255, 255, .22);
}


.erp-switch {
    text-decoration: none;
}

.erp-switch svg {
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .erp-switch-text { display: none; }
}

/* ---------- 舞台：居中卡片 ---------- */
.lg-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
}

.lg-card {
    width: 880px;
    max-width: 100%;
    min-height: 480px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--lg-card);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--lg-card-shadow);
    transition: background-color .3s ease, box-shadow .3s ease;
}

/* ---------- 左侧品牌区 ---------- */
.lg-aside {
    background: var(--lg-aside-bg);
    color: var(--lg-aside-text);
    position: relative;
    overflow: hidden;
}

.lg-aside::before {
    content: "";
    position: absolute;
    inset: -40% -40% auto auto;
    width: 320px; height: 320px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, .18), transparent 70%);
    pointer-events: none;
}

.lg-aside::after {
    content: "";
    position: absolute;
    inset: auto auto -30% -30%;
    width: 260px; height: 260px;
    background: radial-gradient(circle at center, rgba(155, 210, 255, .25), transparent 70%);
    pointer-events: none;
}

.lg-aside-inner {
    position: relative;
    z-index: 1;
    padding: 48px 44px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.lg-aside-logo {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .16);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    flex: 0 0 auto;
    padding: 10px;
    box-sizing: border-box;
}

.lg-aside-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.lg-aside-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
}

.lg-aside-sub {
    margin: 0;
    font-size: 14px;
    color: var(--lg-aside-sub);
    line-height: 1.6;
}

.lg-aside-points {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lg-aside-points li {
    position: relative;
    padding-left: 22px;
    font-size: 14px;
    color: var(--lg-aside-point);
}

.lg-aside-points li::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--lg-aside-dot);
    transform: translateY(-50%);
    box-shadow: 0 0 0 4px rgba(155, 210, 255, .25);
}

/* ---------- 右侧表单区 ---------- */
.lg-form {
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.lg-form-head h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: var(--lg-ink);
    letter-spacing: .3px;
}

.lg-form-head p {
    margin: 0;
    font-size: 13px;
    color: var(--lg-muted);
}

.lg-field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--lg-field-bg);
    border: 1.5px solid var(--lg-field-border);
    border-radius: 12px;
    padding: 0 14px;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.lg-field:focus-within {
    background: var(--lg-field-bg-focus);
    border-color: var(--lg-field-border-focus);
    box-shadow: 0 0 0 4px var(--lg-accent-soft);
}

.lg-field-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 6px 4px 6px 0;
    border-radius: 9px;
    background: var(--lg-accent-soft);
    color: var(--lg-accent);
    flex: 0 0 auto;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.lg-field-icon svg { width: 19px; height: 19px; }

.lg-field:focus-within .lg-field-icon {
    background: var(--lg-accent);
    color: #fff;
    transform: scale(1.05);
}

.lg-input {
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 14px 12px;
    font-size: 14px;
    color: var(--lg-ink);
    font-family: inherit;
}

.lg-input::placeholder { color: var(--lg-muted); }

.lg-submit {
    margin-top: 6px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: var(--lg-accent-grad);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
    box-shadow: 0 8px 20px rgba(43, 108, 246, .3);
}

.lg-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(43, 108, 246, .4);
}

.lg-submit:active { transform: translateY(0); }

.lg-submit[disabled] { opacity: .7; cursor: not-allowed; }

.lg-foot {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--lg-muted);
    text-align: center;
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
    .lg-card {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 420px;
    }
    .lg-aside { min-height: 180px; }
    .lg-aside-inner {
        padding: 28px 28px;
        gap: 10px;
    }
    .lg-aside-title { font-size: 24px; }
    .lg-aside-points { display: none; }
    .lg-form { padding: 36px 28px; }
}

@media (max-width: 480px) {
    .lg-topbar { padding: 0 16px; }
    .lg-brand-name { display: none; }
    .lg-stage { padding: 70px 12px 24px; }
}
