:root {
    --bg-page: #f0f4f9;
    --text-main: #020f30;
    --text-sub: #475569;
    --input-bg: #f5f6f9;
    --btn-gradient-start: #03a1ea;
    --btn-gradient-end: #205baf;
    --card-shadow: 0 34px 44px -20px rgba(185, 206, 234, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background-color: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #000;
    background-image: url("../images/bg.png");
    background-size: cover;
    background-position: center 51px;
    /* background-repeat: no-repeat; */

}

.page {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0;
}

.page-bg {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* background-image: url("../images/bg.png"); */
    background-size: auto;
    background-position: top left;
    background-repeat: repeat;
    z-index: 0;
}

.content-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    padding-bottom: 40px;
    padding-left: 0;
    padding-right: 0;
}

.login-card {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    /* 阴影效果 */
    padding: 40px 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    width: 549px;
    max-width: 100%;
    min-height: 508px;

}

.login-title {
    font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800 !important;
    font-size: 36px !important;
    line-height: 1.364 !important;
    color: var(--text-main);
    width: 100%;
    text-align: center;

}

.form-v2 {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.field-label {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.21;
    color: #000000;
}

.field-label .required-mark {
    color: #ea5939;
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    width: 100%;
    height: 48px;
    border-radius: 8px;
    position: relative;
    background: var(--input-bg);
}

.input-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(164deg, rgba(226, 230, 255, 1) 24%, rgba(255, 234, 227, 1) 95%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.input-shell input {
    flex: 1;
    width: 100%;
    height: 22px;
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 14px;
    line-height: 22px;
    font-family: "PingFang SC", system-ui, sans-serif;
    color: #000;
}

.input-shell input::placeholder {
    color: #7d91a1;
    opacity: 1;
}

/* Fix for browser autofill background color */
.input-shell input:-webkit-autofill,
.input-shell input:-webkit-autofill:hover,
.input-shell input:-webkit-autofill:focus,
.input-shell input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
    -webkit-text-fill-color: #000 !important;
    transition: background-color 5000s ease-in-out 0s;
}

.links-row {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 140px;
    padding: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.21;
    color: rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

.links-row a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.links-row a:hover {
    color: var(--btn-gradient-start);
}

.actions-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-top: 8px;
}

.btn-primary-v2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    width: 180px;
    height: 48px;
    border-radius: 32px;
    border: none;
    background-image: linear-gradient(90deg, #03a1ea 0%, #205baf 100%);
    color: #ffffff;
    font-family: "Noto Sans SC", system-ui, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.43;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-primary-v2:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "PingFang SC", system-ui, sans-serif;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.9);
}

.checkbox-shell {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.checkbox-shell img {
    display: block;
    width: 16px;
    height: 16px;
}

.help-text {
    margin-top: 24px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.21 !important;
    text-align: center !important;
    color: var(--text-sub) !important;
}

.footer-v2 {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 16px 24px;
}

.footer-line {
    width: 100%;
    max-width: 1040px;
    height: 0;
    border-top: 1px solid #475569;
    margin: 0 auto 12px;
}

.footer-text-v2 {
    max-width: 1040px;
    margin: 0 auto;
    text-align: center;
    font-family: "Inter", system-ui, sans-serif;
    font-weight: 500;
    font-size: 12px !important;
    line-height: 1.21;
    color: var(--text-sub);
    white-space: nowrap;
}

.u-error-message {
    color: #ea5939;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    display: none;
}

/* Toast styles (Reverted to original UI) */
#toast-container {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 250px;
    max-width: 350px;
    padding: 15px 20px;
    border-radius: 50px;
    color: #fff;
    font-family: Arial, sans-serif;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 居中文本 */
    text-align: center;
    /* 居中文本 */
    pointer-events: auto;
    /* 允许 Toast 接收事件 */
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #f44336;
}

.toast.info {
    background-color: #2196F3;
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}


@media (max-width: 1024px) {
    .content-wrap {
        padding-top: 80px;
    }

    .links-row {
        padding: 0 40px;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .page-bg {
        inset: 0px 0 0px;
    }

    .content-wrap {
        padding-top: 60px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .login-title {
        font-size: 28px;
    }

    .links-row {
        flex-direction: column;
        align-items: center;
        padding: 0;
        gap: 12px;
    }

    .footer-text-v2 {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .content-wrap {
        padding-top: 40px;
    }

    .login-card {
        padding: 24px 16px;
        gap: 24px;
    }

    .help-text {
        font-size: 14px;
    }
}

/* Modal v2 Styles */
.modal-v2-password {
    width: 450px;
    max-width: calc(100vw - 48px);
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0px 34px 44px -20px rgba(185, 206, 234, 0.25);
    padding: 32px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    margin: auto;
    position: relative;
}

.modal-v2-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-v2-title {
    flex: 1;
    font-family: Nunito, system-ui, sans-serif;
    font-weight: 800;
    font-size: 32px;
    text-align: center;
    color: #020F30;
}

.modal-v2-close {
    position: absolute !important;
    top: 0px !important;
    right: 0px !important;
    width: 32px !important;
    height: 32px !important;
    border: 0 !important;
    background: transparent !important;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-v2-close img {
    width: 24px;
    height: 24px;
}

.modal-v2-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-v2-field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-v2-label {
    font-family: Inter, system-ui, sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #000000;
}

.modal-v2-input-wrap {
    width: 100%;
    border-radius: 8px;
    padding: 1px;
    background: linear-gradient(164deg, rgba(226, 230, 255, 1) 24%, rgba(255, 234, 227, 1) 95%);
}

.modal-v2-input {
    width: 100%;
    height: 44px;
    border-radius: 7px;
    border: 0;
    padding: 0 12px;
    background: #F5F6F9;
    font-family: "PingFang SC", system-ui, sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #0F172A;
    outline: none;
}

.modal-v2-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-get-code {
    background: linear-gradient(90deg, #52c41a 0%, #389e0d 100%) !important;
}

@media (max-width: 768px) {
    .modal-v2-password {
        padding: 24px 16px;
        gap: 24px;
    }

    .modal-v2-title {
        font-size: 24px;
    }
}