:root {
    --login-blue: #3c8dbc;
    --login-ink: #263c50;
    --login-muted: #8795a3;
    --login-border: #e1e7ee;
}
* { box-sizing: border-box; }
html, body.login-modern-page { min-height: 100%; }
body.login-modern-page {
    margin: 0;
    background: #102638;
    color: var(--login-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.login-shell {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    isolation: isolate;
}
.login-shell::before {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse at 50% 38%, rgba(62, 133, 164, .28), transparent 55%),
        radial-gradient(ellipse at 95% 100%, rgba(30, 100, 119, .22), transparent 50%),
        linear-gradient(135deg, #203e53 0%, #142e43 48%, #0c2031 100%);
    content: "";
}
.login-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .45;
    background-image:
        linear-gradient(rgba(163, 201, 222, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(163, 201, 222, .045) 1px, transparent 1px),
        linear-gradient(120deg, transparent 66%, rgba(163, 201, 222, .045) 66%, rgba(163, 201, 222, .045) 81%, transparent 81%);
    background-size: 72px 72px, 72px 72px, 100% 100%;
    pointer-events: none;
}
.login-header {
    width: min(1120px, calc(100% - 64px));
    margin: 0 auto;
    padding: 28px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 18px; letter-spacing: 1px; min-width: 0; }
.brand strong { font-weight: 500; overflow-wrap: anywhere; }
.brand-mark { position: relative; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 8px; background: var(--login-blue); }
.brand-shape { position: absolute; width: 7px; border-radius: 1px; background: #fff; transform: skewY(-25deg); }
.brand-shape-one { height: 14px; top: 12px; left: 8px; opacity: .7; }
.brand-shape-two { height: 20px; top: 6px; right: 8px; }
.system-health { display: flex; align-items: center; gap: 7px; color: #a8bac9; font-size: 12px; flex-shrink: 0; }
.health-dot { width: 6px; height: 6px; border-radius: 50%; background: #82b8c0; }
.login-main { width: min(440px, calc(100% - 32px)); margin: auto; padding: 35px 0 48px; }
.login-card {
    position: relative;
    width: 100%;
    padding: 36px 38px 28px;
    border: 1px solid rgba(209, 228, 238, .85);
    border-top: 3px solid var(--login-blue);
    border-radius: 8px;
    background: linear-gradient(150deg, #f2f7fa, #e9f1f6);
    box-shadow: 0 28px 80px rgba(0, 10, 22, .3), 0 4px 16px rgba(0, 10, 22, .12);
}
.card-access-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; color: #9caab7; font-size: 10px; letter-spacing: 2px; }
.access-lock { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border: 1px solid #dfebf3; border-radius: 10px; background: #f0f7fb; color: var(--login-blue); font-size: 19px; letter-spacing: 0; }
.login-card h2 { margin: 0; color: var(--login-ink); font-size: 26px; font-weight: 600; line-height: 1.4; letter-spacing: 1px; }
.login-welcome { margin: 8px 0 30px; color: var(--login-muted); font-size: 12px; line-height: 1.7; }
.login-field { margin-bottom: 21px; }
.login-field > label, .field-label-row label { display: inline-block; margin: 0 0 9px; color: #45596b; font-size: 12px; font-weight: 500; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-label-row span { margin-bottom: 9px; color: #9ba7b2; font-size: 10px; }
.field-label-row span i { color: #79a2bd; margin-right: 3px; }
.login-input-wrap { position: relative; display: flex; min-height: 48px; align-items: center; flex-wrap: wrap; border: 1px solid var(--login-border); border-radius: 5px; background: #fafbfd; transition: border-color .2s, box-shadow .2s; }
.login-input-wrap:focus-within { border-color: var(--login-blue); background: #fff; box-shadow: 0 0 0 3px rgba(60,141,188,.10); }
.login-input-wrap > i { width: 40px; flex: 0 0 40px; color: #99a9b7; text-align: center; font-size: 14px; }
.login-modern-page .login-input-wrap .form-control { width: 0; min-width: 0; flex: 1 1 0; height: 46px !important; margin: 0; padding: 0 40px 0 0 !important; border: 0; border-radius: 5px !important; outline: 0; background: transparent !important; color: var(--login-ink); font-size: 13px; box-shadow: none !important; }
.login-modern-page .login-input-wrap .form-control::placeholder { color: #acb6c1; }
.password-toggle { position: absolute; top: 5px; right: 5px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #95a5b3; cursor: pointer; }
.password-toggle:hover { color: var(--login-blue); background: #edf4f9; }
.password-toggle:focus-visible { outline: 2px solid var(--login-blue); outline-offset: 1px; }
.login-modern-page .login-input-wrap label.error { position: static; flex: 0 0 100%; padding: 6px 10px; margin: 0; border-top: 1px solid #f5dede; background: #fff6f6; color: #c95353; font-size: 11px; font-weight: 400; line-height: 1.5; }
.login-submit { display: flex; width: 100%; min-height: 48px; margin-top: 28px; padding: 12px 18px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #3583b1; border-radius: 5px; background: var(--login-blue); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s; }
.login-submit:hover, .login-submit:focus { color: #fff; background: #337fae; }
.login-submit:focus-visible { outline: 3px solid #a4cbe2; outline-offset: 3px; }
.login-submit:disabled { opacity: .65; cursor: wait; }
.login-notice { display: flex; gap: 7px; align-items: baseline; margin-top: 28px; padding-top: 20px; border-top: 1px solid #edf0f3; color: #98a4af; font-size: 10px; line-height: 1.8; }
.login-notice i { color: #7e9db3; flex-shrink: 0; }
.login-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0 20px 24px; color: #9bb0bf; font-size: 11px; }
.footer-separator { color: #526e82; }
@media (max-width: 480px) {
    .login-header { width: calc(100% - 40px); padding: 24px 0; }
    .brand { font-size: 16px; }
    .system-health { font-size: 10px; }
    .login-main { margin: auto; padding: 12px 0 28px; }
    .login-card { padding: 24px 22px 22px; }
    .field-label-row span { display: none; }
    .login-footer { font-size: 10px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
    .login-header { padding-top: max(20px, env(safe-area-inset-top)); }
    .login-card h2 { font-size: 24px; }
    .card-access-row { margin-bottom: 18px; }
    .login-welcome { margin-bottom: 24px; }
    .login-field { margin-bottom: 18px; }
    .login-modern-page .login-input-wrap .form-control { font-size: 16px; height: 50px !important; }
    .password-toggle { width: 44px; height: 44px; top: 3px; right: 3px; }
    .login-submit { min-height: 50px; font-size: 16px; margin-top: 24px; }
    .login-notice { font-size: 11px; margin-top: 24px; padding-top: 16px; }
    .login-modern-page .layui-layer-page { max-width: calc(100vw - 24px); }
    .login-modern-page .layui-layer-page .layui-layer-content { overflow-x: auto; }
}
@media (max-width: 359px) {
    .login-header { width: calc(100% - 32px); gap: 10px; }
    .system-health { display: none; }
    .login-card { padding-right: 18px; padding-left: 18px; }
}
@media (max-height: 600px) and (min-width: 481px) {
    .login-header { padding-top: 16px; padding-bottom: 16px; }
    .login-main { padding-top: 12px; padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
