:root {
    --login-bg: #edf2f0;
    --login-surface: #ffffff;
    --login-brand: #15382f;
    --login-brand-deep: #0f2b25;
    --login-accent: #1b9a78;
    --login-accent-dark: #14775d;
    --login-warm: #e7a34b;
    --login-text: #17231f;
    --login-muted: #68756f;
    --login-border: #d8e1dd;
    --login-soft: #f5f8f7;
    --login-error: #b42318;
    --login-error-bg: #fff3f1;
    --login-shadow: 0 28px 80px rgba(26, 54, 46, 0.16);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    overflow-x: hidden;
    color: var(--login-text);
    background-color: var(--login-bg);
    background-image:
        linear-gradient(rgba(21, 56, 47, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 56, 47, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.login-shell {
    width: min(1120px, calc(100vw - 56px));
    min-height: 680px;
    display: grid;
    grid-template-columns: minmax(360px, 0.92fr) minmax(460px, 1.08fr);
    overflow: hidden;
    background: var(--login-surface);
    border: 1px solid rgba(21, 56, 47, 0.12);
    border-radius: 24px;
    box-shadow: var(--login-shadow);
}

.brand-panel {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 36px 42px 34px;
    overflow: hidden;
    color: #fff;
    background-color: var(--login-brand);
    background-image: url("/pc/ui/images/login-bg-3.jpg");
    background-size: cover;
    background-position: center;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 43, 37, 0.9);
}

.brand-panel::after {
    content: "";
    position: absolute;
    left: 42px;
    right: 42px;
    bottom: 112px;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}

.brand-top,
.brand-copy,
.brand-summary,
.brand-footer {
    position: relative;
    z-index: 1;
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
    padding: 8px;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.brand-name {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
}

.brand-edition {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
}

.brand-copy {
    margin-top: 50px;
}

.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9ee3ca;
    font-size: 12px;
    font-weight: 700;
}

.brand-eyebrow::before {
    content: "";
    width: 24px;
    height: 2px;
    background: var(--login-warm);
}

.brand-title {
    max-width: 360px;
    margin: 15px 0 13px;
    font-size: 35px;
    line-height: 1.24;
    font-weight: 760;
}

.brand-description {
    max-width: 370px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    line-height: 1.7;
}

.brand-features {
    display: grid;
    gap: 10px;
    margin-top: 27px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.brand-feature i {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    color: #b8efdb;
    background: rgba(27, 154, 120, 0.22);
    border-radius: 7px;
    font-size: 17px;
}

.brand-feature strong {
    display: block;
    font-size: 13px;
    line-height: 1.35;
}

.brand-feature span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    line-height: 1.35;
}

.brand-summary {
    margin-top: auto;
    padding-top: 20px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: #55d6a9;
    border: 2px solid rgba(85, 214, 169, 0.25);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(85, 214, 169, 0.12);
}

.brand-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.download-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    font-size: 12px;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.download-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
}

.login-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--login-surface);
}

.panel-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 34px;
    border-bottom: 1px solid var(--login-border);
}

.security-note,
.version-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--login-muted);
    font-size: 12px;
}

.security-note i {
    color: var(--login-accent);
    font-size: 17px;
}

.version-note {
    padding-left: 18px;
    border-left: 1px solid var(--login-border);
}

.login-content {
    width: min(430px, 100%);
    margin: auto;
    padding: 42px 54px 38px;
}

.step-flow {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-step {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #94a09b;
    font-size: 12px;
    font-weight: 650;
}

.step-index {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    color: #7e8b85;
    background: var(--login-soft);
    border: 1px solid var(--login-border);
    border-radius: 7px;
    font-size: 12px;
}

.login-step.active {
    color: var(--login-text);
}

.login-step.active .step-index {
    color: #fff;
    background: var(--login-accent);
    border-color: var(--login-accent);
}

.login-step.done .step-index {
    color: #fff;
    background: var(--login-accent-dark);
    border-color: var(--login-accent-dark);
}

.step-line {
    height: 1px;
    background: var(--login-border);
}

.form-title {
    margin: 0;
    color: var(--login-text);
    font-size: 28px;
    line-height: 1.3;
    font-weight: 760;
}

.form-subtitle {
    margin: 9px 0 26px;
    color: var(--login-muted);
    font-size: 14px;
    line-height: 1.7;
}

.error-msg {
    min-height: 44px;
    display: none;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    padding: 10px 12px;
    color: var(--login-error);
    background: var(--login-error-bg);
    border: 1px solid #f4c7c1;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.error-msg::before {
    content: "\F0026";
    flex: 0 0 auto;
    font-family: "Material Design Icons";
    font-size: 18px;
}

.user-info {
    min-height: 48px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 10px 12px;
    color: #17634d;
    background: #edf8f4;
    border-left: 3px solid var(--login-accent);
    border-radius: 0 7px 7px 0;
    font-size: 13px;
}

.user-info strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.change-btn {
    flex: 0 0 auto;
    padding: 5px 7px;
    color: var(--login-accent-dark);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.field {
    margin-bottom: 18px;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #34423d;
    font-size: 13px;
    font-weight: 680;
}

.field-hint {
    color: #94a09b;
    font-size: 11px;
    font-weight: 500;
}

.input-control {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    background: var(--login-soft);
    border: 1px solid var(--login-border);
    border-radius: 8px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.input-control:focus-within {
    background: #fff;
    border-color: var(--login-accent);
    box-shadow: 0 0 0 3px rgba(27, 154, 120, 0.12);
}

.input-control > i {
    flex: 0 0 auto;
    color: #8b9892;
    font-size: 20px;
}

.input-control input {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0;
    color: var(--login-text);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 15px;
}

.input-control input::placeholder {
    color: #a5b0ab;
}

.password-toggle {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    padding: 0;
    color: #7b8882;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 19px;
}

.password-toggle:hover {
    color: var(--login-accent-dark);
    background: #e8f1ee;
}

.captcha-control {
    gap: 10px;
}

.captcha-control input {
    flex: 1;
}

.captcha-img {
    width: 116px;
    height: 42px;
    flex: 0 0 116px;
    object-fit: cover;
    background: #f2f3f3;
    border: 1px solid var(--login-border);
    border-radius: 7px;
    cursor: pointer;
}

.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 2px 0 22px;
    color: var(--login-muted);
    font-size: 12px;
}

.remember-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--login-accent);
}

.btn-login,
.btn-back {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 720;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn-login {
    color: #fff;
    background: var(--login-accent);
    border: 1px solid var(--login-accent);
    box-shadow: 0 12px 26px rgba(27, 154, 120, 0.2);
}

.btn-login:hover {
    background: var(--login-accent-dark);
    border-color: var(--login-accent-dark);
    transform: translateY(-1px);
}

.btn-login:disabled {
    color: rgba(255, 255, 255, 0.82);
    background: #9abfb4;
    border-color: #9abfb4;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-back {
    margin-top: 10px;
    color: #53615b;
    background: #fff;
    border: 1px solid var(--login-border);
}

.btn-back:hover {
    color: var(--login-text);
    background: var(--login-soft);
    border-color: #bbc8c2;
}

.company-select-wrap {
    position: relative;
    width: 100%;
}

.company-select-wrap .input-control {
    padding-right: 42px;
}

.company-select-wrap::after {
    content: "\F0140";
    position: absolute;
    right: 15px;
    top: 16px;
    color: #7d8a84;
    font-family: "Material Design Icons";
    font-size: 18px;
    pointer-events: none;
}

.company-dropdown {
    display: none;
    position: absolute;
    z-index: 30;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(26, 54, 46, 0.16);
}

.company-dropdown .cd-item {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid #edf1ef;
}

.company-dropdown .cd-item:last-child {
    border-bottom: 0;
}

.company-dropdown .cd-item:hover {
    background: #eef7f4;
}

.company-dropdown .cd-code {
    min-width: 52px;
    color: var(--login-accent-dark);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    font-weight: 720;
}

.company-dropdown .cd-name {
    min-width: 0;
    overflow: hidden;
    color: #34423d;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.company-dropdown .cd-empty {
    padding: 22px 14px;
    color: var(--login-muted);
    text-align: center;
    font-size: 13px;
}

.selected-info {
    min-height: 44px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 18px;
    padding: 8px 10px 8px 12px;
    color: var(--login-accent-dark);
    background: #edf8f4;
    border-left: 3px solid var(--login-accent);
    border-radius: 0 7px 7px 0;
    font-size: 12px;
}

.selected-info span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clear-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    padding: 0;
    color: #87938e;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
}

.clear-btn:hover {
    color: var(--login-error);
    background: #fff0ed;
}

.footer-text {
    margin-top: 26px;
    color: #a0aba6;
    text-align: center;
    font-size: 11px;
}

.step2 {
    display: none;
}

@media (max-width: 960px) {
    .login-shell {
        grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
    }

    .brand-panel {
        padding-right: 32px;
        padding-left: 32px;
    }

    .brand-panel::after {
        right: 32px;
        left: 32px;
    }

    .brand-title {
        font-size: 33px;
    }

    .brand-feature {
        padding-right: 9px;
        padding-left: 9px;
    }

    .login-content {
        padding-right: 38px;
        padding-left: 38px;
    }
}

@media (max-width: 760px) {
    body {
        display: block;
        padding: 0;
        background: #fff;
    }

    .login-shell {
        width: 100%;
        min-height: 100vh;
        display: block;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .brand-panel {
        min-height: 246px;
        padding: 24px;
    }

    .brand-panel::after {
        display: none;
    }

    .brand-copy {
        margin-top: 38px;
    }

    .brand-title {
        margin: 12px 0 8px;
        font-size: 27px;
        line-height: 1.25;
    }

    .brand-description {
        font-size: 13px;
        line-height: 1.65;
    }

    .brand-features,
    .brand-summary {
        display: none;
    }

    .panel-header {
        min-height: 56px;
        padding: 0 22px;
    }

    .version-note {
        display: none;
    }

    .login-content {
        width: 100%;
        margin: 0;
        padding: 32px 24px 38px;
    }

    .step-flow {
        margin-bottom: 26px;
    }

    .form-title {
        font-size: 25px;
    }
}

@media (max-width: 390px) {
    .brand-panel {
        min-height: 226px;
    }

    .brand-copy {
        margin-top: 30px;
    }

    .brand-title {
        font-size: 24px;
    }

    .brand-description {
        max-width: 290px;
    }

    .login-content {
        padding-right: 18px;
        padding-left: 18px;
    }

    .step-flow {
        gap: 8px;
    }

    .login-step {
        gap: 6px;
        font-size: 11px;
    }

    .captcha-img {
        width: 102px;
        flex-basis: 102px;
    }
}
