:root {
    color-scheme: light;
    --bg-main: #a6dfa0;
    --bg-soft: #d7f1d2;
    --card-bg: rgba(255, 255, 255, 0.96);
    --card-shadow: 0 18px 42px rgba(67, 134, 72, 0.16);
    --primary: #2f8d3f;
    --primary-deep: #267836;
    --primary-soft: #62bf6e;
    --input-border: #d8efda;
    --input-bg: #fbfffb;
    --text-main: #3f4b42;
    --text-muted: #8a8f90;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.65), transparent 22%),
        radial-gradient(circle at 82% 80%, rgba(118, 210, 120, 0.34), transparent 24%),
        linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-main) 100%);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.login-card {
    width: min(488px, 100%);
    padding: 36px 38px 30px;
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    position: relative;
}

.login-header {
    text-align: center;
}

.login-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--primary);
}

.title-icon,
.button-icon,
.input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.title-icon svg {
    width: 31px;
    height: 31px;
}

.login-subtitle {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

.login-form {
    margin-top: 28px;
}

.login-alert-slot {
    position: absolute;
    left: 38px;
    right: 38px;
    top: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 3;
}

.login-alert {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff2f2;
    border: 1px solid #ffd2d2;
    color: #c24d4d;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    opacity: 1;
    border-width: 1px;
    border-style: solid;
    box-shadow: 0 8px 18px rgba(194, 77, 77, 0.08);
    transition: opacity 0.28s ease, background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
    will-change: opacity;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    pointer-events: auto;
    transform: translateY(calc(-100% - 14px));
}

.login-alert-text {
    min-width: 0;
}

.login-alert-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: #cf5b5b;
}

.login-alert-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.login-alert.success {
    background: #f1fbf2;
    border-color: #cfe9d2;
    color: #3c8d4e;
    box-shadow: 0 8px 18px rgba(60, 141, 78, 0.08);
}

.login-alert.success .login-alert-icon {
    color: #4aa45d;
}

.login-alert.info {
    background: #eef6ff;
    border-color: #cfe0fb;
    color: #2e73c5;
    box-shadow: 0 8px 18px rgba(46, 115, 197, 0.08);
}

.login-alert.info .login-alert-icon {
    color: #2e73c5;
}

.login-alert.is-entering {
    opacity: 0;
}

.login-alert.is-fading {
    opacity: 0;
}

.login-alert.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

@media (max-width: 640px) {
    .login-page {
        padding: 28px 18px;
    }

    .login-alert-slot {
        left: 18px;
        right: 18px;
    }
}

.field-group + .field-group {
    margin-top: 22px;
}

.field-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.input-wrap {
    position: relative;
}

.input-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 51px;
    width: 1px;
    height: 24px;
    background: rgba(88, 180, 103, 0.28);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap.no-divider::after {
    display: none;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    color: #58b467;
    pointer-events: none;
}

.input-icon svg {
    width: 24px;
    height: 24px;
}

.input-wrap input {
    width: 100%;
    height: 58px;
    padding: 0 54px 0 58px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    background: var(--input-bg);
    outline: none;
    font-size: 16px;
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap input:focus {
    border-color: #b9e4bd;
    box-shadow: 0 0 0 4px rgba(98, 191, 110, 0.10);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    z-index: 2;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #9aa5b5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    cursor: pointer;
    overflow: hidden;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.password-toggle:hover {
    color: #5f6d83;
    transform: translateY(-50%) scale(1.02);
    opacity: 0.92;
}

.password-toggle:focus-visible {
    outline: 0;
    color: #1d8f66;
    opacity: 1;
}

.password-toggle-icon {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.22s ease;
}

.password-toggle-icon svg {
    width: 18px;
    height: 18px;
    overflow: visible;
}

.password-toggle .closed {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.password-toggle .open {
    opacity: 0;
    transform: scale(0.82) rotate(-8deg);
}

.password-toggle.is-visible {
    color: #1d8f66;
}

.password-toggle.is-visible .closed {
    opacity: 0;
    transform: scale(0.82) rotate(8deg);
}

.password-toggle.is-visible .open {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.password-toggle.is-visible:hover {
    color: #167553;
    opacity: 0.96;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.98);
}

.submit-button {
    width: 100%;
    height: 61px;
    margin-top: 34px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #48b44a 0%, #338f36 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.submit-button:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
}

.submit-button:disabled,
.submit-button.is-loading {
    cursor: wait;
    filter: saturate(0.94);
    opacity: 0.88;
    transform: none;
}

.submit-button.is-loading .button-icon {
    animation: loginButtonPulse 0.9s ease-in-out infinite;
}

@keyframes loginButtonPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.92);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 12px;
    align-items: stretch;
}

.captcha-input-wrap::after {
    display: none;
}

.captcha-input-wrap input {
    padding-left: 18px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.captcha-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 58px;
    border-radius: 12px;
    border: 2px dashed #b7ddb9;
    background: linear-gradient(135deg, #f7fff7 0%, #ebf9ec 100%);
    color: var(--primary-deep);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.22em;
    user-select: none;
    overflow: hidden;
}

.captcha-box::before,
.captcha-box::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.captcha-box::before {
    background:
        linear-gradient(115deg, transparent 16%, rgba(47, 141, 63, 0.16) 18%, transparent 20%, transparent 44%, rgba(47, 141, 63, 0.14) 46%, transparent 48%),
        linear-gradient(75deg, transparent 28%, rgba(98, 191, 110, 0.16) 30%, transparent 32%, transparent 68%, rgba(38, 120, 54, 0.14) 70%, transparent 72%);
}

.captcha-box::after {
    background-image: radial-gradient(rgba(47, 141, 63, 0.18) 1px, transparent 1px);
    background-size: 11px 11px;
    opacity: 0.65;
}

.captcha-char {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin: 0 2px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.captcha-char.tilt-left {
    transform: rotate(-12deg) translateY(1px);
}

.captcha-char.tilt-right {
    transform: rotate(11deg) translateY(-1px);
}

.captcha-char.lift {
    transform: rotate(-4deg) translateY(-3px);
}

.captcha-char.drop {
    transform: rotate(6deg) translateY(3px);
}

.captcha-help {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
}

.button-icon svg {
    width: 23px;
    height: 23px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: #a5a8ad;
}

.footer-copy,
.footer-version {
    color: inherit;
    font-size: inherit;
    font-weight: 400;
}

.footer-version {
    margin-left: 8px;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #b4b8be;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.88), 0 -1px 0 rgba(164, 169, 177, 0.16);
}

@media (max-width: 640px) {
    .login-page {
        padding: 16px;
    }

    .login-card {
        padding: 28px 22px 24px;
        border-radius: 18px;
    }

    .login-title {
        font-size: 24px;
    }

    .title-icon svg {
        width: 28px;
        height: 28px;
    }

    .field-group label {
        font-size: 15px;
    }

    .input-wrap input {
        height: 54px;
        padding-left: 56px;
    }

    .input-icon {
        left: 11px;
        width: 36px;
        height: 36px;
    }

    .input-wrap::after {
        left: 48px;
        height: 22px;
    }

    .input-icon svg {
        width: 22px;
        height: 22px;
    }

    .submit-button {
        height: 56px;
        margin-top: 28px;
    }

    .captcha-row {
        grid-template-columns: 1fr;
    }

    .captcha-box {
        height: 52px;
        font-size: 22px;
    }

    .login-footer {
        line-height: 1.8;
    }

    .footer-version {
        display: block;
        margin-left: 0;
    }
}