html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #eef3f9;
    color: #17325c;
}

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

button,
input {
    font-family: inherit;
}

.login-page {
    min-height: 100vh;
    position: relative;
    padding: 0 0 0 32px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(193, 213, 237, 0.45), transparent 30%),
        linear-gradient(135deg, #f5f8fc 0%, #edf3f9 42%, #f7f9fc 100%);
}

.brand-bar {
    position: absolute;
    top: 40px;
    left: 60px;
    z-index: 2;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #14345B;
}

.brand-image {
    max-height: 30px;
    max-width: 175px;
}

.brand-text {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
}

.login-layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    padding-left: max(0px, calc((100vw - 1440px) / 2));
}

.login-left {
    flex: 0 0 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 72px 0 20px 72px;
}

.login-card {
    width: 480px;
    max-width: 480px;
    height: 464px;
    max-height: 464px;
    padding: 40px;
    border: 1px solid rgba(25, 55, 99, 0.12);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(23, 50, 92, 0.08);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 40px;
}

.card-title {
    margin: 0;
    font-size: 40px;
    line-height: 1.15;
    font-weight: 600;
    color: #14345B;
}

.language-switch {
    position: relative;
    padding-top: 6px;
}

.language-toggle {
    min-width: 92px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 8px;
    background: #fff;
    color: #4d668d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-toggle:hover,
.language-switch.is-open .language-toggle {
    color: #14345B;
    border-color: rgba(20, 60, 114, 0.25);
    background: #eaf2fc;
}

.language-toggle .language-current-flag,
.language-menu .lang-flag {
    width: 22px;
    height: 16px;
    min-width: 22px;
    max-width: 22px;
    min-height: 16px;
    max-height: 16px;
    display: block;
    flex: 0 0 22px;
    object-fit: cover;
    border-radius: 0px;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(20, 60, 114, 0.08);
}

.language-current-code,
.lang-code {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.language-toggle-arrow {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.2s ease;
}

.language-switch.is-open .language-toggle-arrow {
    transform: rotate(-135deg) translateY(-1px);
}

.language-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 156px;
    padding: 8px;
    display: none;
    border: 1px solid rgba(20, 60, 114, 0.12);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(23, 50, 92, 0.12);
    z-index: 10;
}

.language-switch.is-open .language-menu {
    display: block;
}

.lang-item {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    color: #4d668d;
    transition: all 0.2s ease;
}

.lang-item:hover,
.lang-item.is-active {
    color: #14345B;
    background: #eaf2fc;
}

.lang-name {
    font-size: 13px;
    color: #6a7f9e;
}

.lang-item.is-active .lang-name,
.lang-item:hover .lang-name {
    color: #4d668d;
}

.login-tabs {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.mode-tab {
    position: relative;
    margin: 0;
    padding: 0 0 12px;
    border: 0;
    background: none;
    color: #14345B;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.mode-tab.is-active {
    color: #14345B;
}

.mode-tab.is-active:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 999px;
    background: #214f8a;
}

.login-mode {
    display: none;
}

.login-mode.is-active {
    display: block;
}

.form-field {
    margin-bottom: 8px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    color: #4E5969;
}

.form-field input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #EAEAEA;
    border-radius: 6px;
    background: #fff;
    color: #86909C;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus {
    border-color: #356aaa;
    box-shadow: 0 0 0 4px rgba(53, 106, 170, 0.12);
}

.login-submit {
    width: 100%;
    height: 48px;
    margin-top: 32px;
    border: 0;
    border-radius: 6px;
    background: #14345B;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(20, 60, 114, 0.18);
}

.login-submit:hover {
    opacity: 0.96;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.qr-box {
    position: relative;
    min-height: 190px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8e3f0;
    border-radius: 12px;
    background: #f8fbff;
    overflow: hidden;
}

.qr-box img {
    width: 100%;
    max-width: 170px;
    display: block;
}

.qr-box.is-empty {
    background:
        linear-gradient(135deg, rgba(229, 237, 248, 0.9), rgba(245, 249, 255, 0.9)),
        linear-gradient(90deg, #dbe6f3 25%, transparent 25%, transparent 75%, #dbe6f3 75%),
        linear-gradient(#dbe6f3 25%, transparent 25%, transparent 75%, #dbe6f3 75%);
    background-size: auto, 24px 24px, 24px 24px;
    background-position: center, center, center;
}

.qr-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    color: #567093;
    font-size: 14px;
    font-weight: 600;
}

.qr-box.is-empty .qr-fallback {
    display: flex;
}

.qr-tip {
    margin: 20px 0 0;
    text-align: center;
    color: #4E5969;
    font-size: 14px;
}

.panel-action {
    width: 100%;
    max-width: 480px;
    margin-top: 18px;
    text-align: center;
}

.online-demo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4d668d;
    font-size: 13px;
}

.online-demo-link:hover {
    color: #14345B;
}

.online-demo-icon {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
}

.login-right {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    min-height: 100vh;
    padding: 0;
}

.login-right-image {
    display: block;
    width: auto;
    max-width: none;
    height: 100vh;
    max-height: none;
}

.demo-form {
    display: none;
}

@media (max-width: 1180px) {
    .login-page {
        padding: 28px 32px;
        overflow: visible;
    }

    .brand-bar {
        position: static;
        top: auto;
        left: auto;
        z-index: auto;
    }

    .login-layout {
        padding-left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
        min-height: auto;
    }

    .login-left {
        flex-basis: auto;
        min-height: auto;
        padding: 24px 0 0;
        align-items: center;
    }

    .login-card,
    .panel-action {
        max-width: none;
    }

    .login-right {
        min-height: auto;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .login-right-image {
        height: auto;
        max-width: 100%;
        max-height: 420px;
    }
}

@media (max-width: 640px) {
    .login-page {
        padding: 18px;
    }

    .card-title {
        font-size: 40px;
    }

    .login-card {
        padding: 28px 20px 22px;
    }

    .qr-grid {
        grid-template-columns: 1fr;
    }
}
