/* =========================
   网页背景
========================= */

body {

    margin: 0;

    padding: 0;

    min-height: 100vh;

    font-family:
            "Microsoft YaHei",
            Arial,
            sans-serif;

    background-image:
            url("/static/images/background.png");

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    background-attachment: fixed;

}


/* =========================
   页面整体布局
========================= */

.page-container {

    min-height: 100vh;

    position: relative;

    display: flex;

    justify-content: center;

    align-items: center;

}

/* =========================
   网站标题
========================= */

.site-header {

    position: absolute;

    left: 50%;

    top: 50%;

    transform: translateX(-50%);

    margin-top: -370px;

    text-align: center;

    color: white;

    width: 100%;

}

.site-header h1 {

    font-size: 42px;

    margin-bottom: 15px;

}


.site-header p {

    font-size: 18px;

    opacity: 0.9;

}


/* =========================
   登录卡片
========================= */

.login-card {

    width: 420px;

    padding:

            40px;

    background:

            rgba(
                    255,
                    255,
                    255,
                    0.95
            );

    border-radius: 20px;

    box-shadow:

            0 10px 40px

            rgba(
                    0,
                    0,
                    0,
                    0.2
            );

}


.login-card h2 {

    text-align: center;

    font-size: 28px;

    margin-bottom: 10px;

    color: #333;

}


.welcome-text {

    text-align: center;

    color: #777;

    margin-bottom: 30px;

}


/* =========================
   输入框
========================= */

.input-group {

    margin-bottom: 20px;

}


.input-group label {

    display: block;

    margin-bottom: 8px;

    color: #555;

}


.input-group input,
.input-group select {

    width: 100%;

    padding: 14px;

    border:

            1px solid #ddd;

    border-radius: 8px;

    font-size: 16px;

    box-sizing: border-box;

}


/* 鼠标点击输入框 */

.input-group input:focus,
.input-group select:focus {

    outline: none;

    border-color: #667eea;

}


/* =========================
   登录按钮
========================= */

.login-button {

    width: 100%;

    padding: 15px;

    border: none;

    border-radius: 8px;

    background:

            linear-gradient(
                    90deg,
                    #667eea,
                    #764ba2
            );

    color: white;

    font-size: 18px;

    cursor: pointer;

}


.login-button:hover {

    opacity: 0.9;

}


/* =========================
   分隔线
========================= */

.divider {

    text-align: center;

    margin:

            25px 0;

    color: #999;

}


/* =========================
   注册区域
========================= */

.register-section {

    display: flex;

    justify-content: center;

    gap: 8px;

    margin-top: 30px;

}

.register-section p {

    margin: 0;

    color: #777;

}


.register-section a {

    color: #667eea;

    text-decoration: none;

    font-weight: bold;

}

/* =========================
   密码提示
========================= */
.password-hint {

    display: block;

    margin-top: 8px;

    font-size: 14px;

    color: #C96B5A;

}
/* =========================
   登录成功按钮动态变化
========================= */
/* 登录按钮 */

.login-button {

    position: relative;

    overflow: hidden;

    /* 让按钮中的文字或图标始终居中 */
    display: flex;

    justify-content: center;

    align-items: center;

    /* 正常状态下按钮位于表单中央 */
    margin-left: auto;

    margin-right: auto;

    transition:
        width 0.4s ease,
        transform 0.3s ease,
        background 0.4s ease,
        border-radius 0.4s ease,
        box-shadow 0.4s ease;

}


/* ================================= */
/* 鼠标悬停效果 */
/* ================================= */

.login-button:hover {

    transform: translateY(-2px);

}


/* ================================= */
/* 登录中 */
/* ================================= */

.login-button.loading {

    width: 58px;

    min-width: 58px;

    height: 58px;

    padding: 0;

    border-radius: 50%;

    transform: none;

    background: #5B7FD6;

    /* 保持按钮在原来的中央位置 */
    margin-left: auto;

    margin-right: auto;

}

/* 禁用状态 */

.login-button:disabled {

    cursor: default;

    opacity: 1;

}


/* ================================= */
/* 旋转加载图标 */
/* ================================= */

.loading-spinner {

    display: inline-block;

    width: 22px;

    height: 22px;

    border: 3px solid
        rgba(255, 255, 255, 0.35);

    border-top-color: white;

    border-radius: 50%;

    animation:
        spin 0.8s linear infinite;

}


/* 旋转动画 */

@keyframes spin {

    from {

        transform:
            rotate(0deg);

    }


    to {

        transform:
            rotate(360deg);

    }

}


/* ================================= */
/* 登录成功 */
/* ================================= */

.login-button.login-success {

    width: 58px;

    min-width: 58px;

    height: 58px;

    padding: 0;

    border-radius: 50%;

    background: #45B878;

    /* 保持成功按钮居中 */
    margin-left: auto;

    margin-right: auto;

    /* 让 ✓ 在按钮内部居中 */
    display: flex;

    justify-content: center;

    align-items: center;

    box-shadow:
        0 6px 20px
        rgba(69, 184, 120, 0.4);

}

/* 成功打勾 */

.success-check {

    display: inline-block;

    color: white;

    font-size: 30px;

    font-weight: bold;

    line-height: 1;

    animation:
        check-pop 0.45s
        cubic-bezier(
            0.175,
            0.885,
            0.32,
            1.275
        );

}


/* ================================= */
/* 打勾弹出动画 */
/* ================================= */

@keyframes check-pop {

    0% {

        transform:
            scale(0)
            rotate(-30deg);

        opacity: 0;

    }


    60% {

        transform:
            scale(1.3)
            rotate(5deg);

    }


    100% {

        transform:
            scale(1)
            rotate(0deg);

        opacity: 1;

    }

}

.password-field {
    position: relative;
}

.input-group .password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 28px;
    height: 28px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #8a8f98;
    cursor: pointer;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: #656b75;
}

.password-toggle:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

.password-toggle-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle-icon[hidden] {
    display: none;
}

.profile-card { width: 520px; }
.profile-page .page-container { min-height: calc(100vh - 82px); padding: 28px 0; }
.profile-header { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 4vw, 58px); border-bottom: 1px solid #e5eaf2; background: rgba(255, 255, 255, .98); }
.profile-account { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.profile-account img { width: 46px; height: 46px; object-fit: cover; border-radius: 50%; background: #e9eef7; }
.profile-points-pill { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 17px; border-radius: 24px; color: #9b6705; background: #fff5d9; }
.profile-points-pill svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.profile-points-pill b { min-width: 1ch; font-size: 18px; text-align: center; }
.profile-points-pill b.points-highlight { animation: points-highlight .65s ease; }
.profile-save-toast { position: fixed; z-index: 30; top: 98px; right: clamp(18px, 4vw, 58px); display: flex; align-items: center; justify-content: center; padding: 13px 20px; border: 1px solid #f2dfac; border-radius: 12px; color: #94620a; background: #fff5d9; box-shadow: 0 9px 24px rgba(86, 65, 20, .12); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.profile-save-toast.is-visible { opacity: 1; transform: translateY(0); }
.profile-save-toast.is-hiding { opacity: 0; transform: translateY(-6px); }
@keyframes points-highlight { 0%, 100% { color: inherit; transform: scale(1); } 45% { color: #e39a12; transform: scale(1.28); } }
.profile-description { line-height: 1.7; }
.radio-options { display: flex; gap: 28px; padding: 8px 0; }
.radio-options label { display: flex; align-items: center; gap: 7px; margin: 0; }
.radio-options input { width: auto; }
.form-message { min-height: 24px; color: #c43d3d; text-align: center; }
.intro-actions { margin-top: 28px; }
.intro-actions a { box-sizing: border-box; text-decoration: none; }

@media (max-width: 700px) {
    .login-card, .profile-card { width: calc(100% - 40px); padding: 28px 24px; }
    .site-header { display: none; }
    .profile-header { height: 68px; padding: 0 16px; }
    .profile-page .page-container { min-height: calc(100vh - 68px); }
    .profile-account { gap: 10px; }
    .profile-account img { width: 39px; height: 39px; }
    .profile-points-pill { min-height: 38px; padding: 0 12px; font-size: 14px; }
    .profile-points-pill svg { display: none; }
    .profile-save-toast { top: 80px; right: 12px; padding: 11px 15px; font-size: 14px; }
}
