/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #111827;
}

.hidden {
    display: none !important;
}

/* 登录页面布局 */
.login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.left-section {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to bottom right, #9ca3af, #6b7280, #4b5563);
    padding: 3rem;
    color: white;
}

.logo-section {
    position: relative;
    z-index: 20;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.logo-image {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.characters-section {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 500px;
}

.footer-links {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.footer-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #1f2937;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.blur-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(96px);
}

.blur-circle-1 {
    top: 25%;
    right: 25%;
    width: 16rem;
    height: 16rem;
    background: rgba(156, 163, 175, 0.2);
}

.blur-circle-2 {
    bottom: 25%;
    left: 25%;
    width: 24rem;
    height: 24rem;
    background: rgba(209, 213, 219, 0.2);
}

.right-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: white;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
}

.mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 3rem;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    color: #111827;
}

.form-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    height: 3rem;
    padding: 0 1rem;
    background: white;
    border: 1.5px solid rgba(229, 231, 235, 0.6);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: #6366f1;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #111827;
}

.icon {
    width: 20px;
    height: 20px;
}

.error-message {
    font-size: 0.875rem;
    color: #dc2626;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.checkbox {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.forgot-link {
    font-size: 0.875rem;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.error-alert {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 0.5rem;
}

.submit-button {
    position: relative;
    width: 100%;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
    background: #111827;
    color: white;
    border: none;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-text {
    transition: transform 0.3s;
}

.button-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

.submit-button:hover:not(:disabled) .button-text {
    transform: translateX(-8px);
}

.submit-button:hover:not(:disabled) .button-icon {
    transform: translateX(8px);
}

.signup-link {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.signup-link a {
    color: #111827;
    text-decoration: none;
    font-weight: 500;
}

.signup-link a:hover {
    text-decoration: underline;
}

/* 动画角色样式 */
.animated-characters-container {
    position: relative;
    width: 550px;
    height: 400px;
}

.character {
    position: absolute;
    bottom: 0;
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom center;
    will-change: transform;
}

/* 紫色角色 */
.purple-character {
    left: 70px;
    width: 180px;
    height: 400px;
    background-color: #6C3FF5;
    border-radius: 0;
    z-index: 1;
    animation: purple-entrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.purple-character.entrance-complete {
    animation: none;
}

/* 黑色角色 */
.black-character {
    left: 240px;
    width: 120px;
    height: 310px;
    background-color: #2D2D2D;
    border-radius: 0;
    z-index: 2;
    animation: black-entrance 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

.black-character.entrance-complete {
    animation: none;
}

/* 橙色角色 */
.orange-character {
    left: 0px;
    width: 240px;
    height: 150px;
    z-index: 3;
    background-color: #FF9B6B;
    border-radius: 120px 120px 0 0;
    animation: orange-entrance 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

.orange-character.entrance-complete {
    animation: none;
}

/* 黄色角色 */
.yellow-character {
    left: 310px;
    width: 140px;
    height: 230px;
    background-color: #E8D754;
    border-radius: 70px 70px 0 0;
    z-index: 4;
    animation: yellow-entrance 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

.yellow-character.entrance-complete {
    animation: none;
}

/* 眼睛样式 */
.eyes {
    position: absolute;
    display: flex;
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: left, top;
}

.purple-eyes {
    left: 75px;
    top: 25px;
    gap: 32px;
}

.black-eyes {
    left: 26px;
    top: 32px;
    gap: 24px;
}

.orange-eyes {
    left: 112px;
    top: 60px;
    gap: 32px;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
}

.yellow-eyes {
    left: 52px;
    top: 40px;
    gap: 24px;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
}

/* 眼球样式 */
.eyeball {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    will-change: height, border-radius, transform;
}

.black-character .eyeball {
    width: 16px;
    height: 16px;
}

.eyeball--sad {
    height: 8px;
    border-radius: 0 0 16px 16px;
}

/* 瞳孔样式 */
.pupil {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #2D2D2D;
    transition: transform 0.1s ease-out, height 0.15s ease-out;
    will-change: transform, height;
}

.black-character .pupil {
    width: 6px;
    height: 6px;
}

.orange-character .pupil,
.yellow-character .pupil {
    width: 12px;
    height: 12px;
}

/* 嘴巴样式 */
.purple-mouth-shape {
    position: absolute;
    left: 97px;
    top: 57px;
    width: 24px;
    height: 8px;
    background-color: #2D2D2D;
    border-radius: 0 0 12px 12px;
    transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1), top 0.7s cubic-bezier(0.4, 0, 0.2, 1), width 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.orange-mouth-shape {
    position: absolute;
    left: 126px;
    top: 92px;
    width: 26px;
    height: 13px;
    background-color: #2D2D2D;
    border-radius: 0 0 13px 13px;
    transition: left 0.2s cubic-bezier(0, 0, 0.2, 1), top 0.2s cubic-bezier(0, 0, 0.2, 1), width 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.yellow-mouth-wrapper {
    position: absolute;
    left: 40px;
    top: 88px;
    transition: all 0.2s cubic-bezier(0, 0, 0.2, 1);
}

.yellow-mouth-path {
    d: path('M0 10 Q10 10, 20 10 Q30 10, 40 10 Q50 10, 60 10 Q70 10, 80 10');
    transition: d 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 动画效果 */
@keyframes purple-entrance {
    0% {
        transform: translateX(-150px) translateY(50px) rotate(-15deg) scale(0.3);
        opacity: 0;
    }
    60% {
        transform: translateX(10px) translateY(-10px) rotate(3deg) scale(1.05);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes black-entrance {
    0% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
    70% {
        transform: translateY(10px) scale(1.08);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes orange-entrance {
    0% {
        transform: translateX(-200px) translateY(80px) rotate(-25deg) scale(0.2);
        opacity: 0;
    }
    65% {
        transform: translateX(15px) translateY(-8px) rotate(5deg) scale(1.1);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes yellow-entrance {
    0% {
        transform: translateX(200px) translateY(60px) rotate(20deg) scale(0.3);
        opacity: 0;
    }
    65% {
        transform: translateX(-12px) translateY(-5px) rotate(-4deg) scale(1.06);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* 表情变化 */
.purple-mouth-shape--typing {
    width: 7px;
    height: 32px;
    border-radius: 0;
    transform: translateX(13.5px) translateY(-28px);
}

.orange-mouth-shape--typing {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translateX(6px);
}

/* 悲伤表情 */
.purple-mouth-shape--sad {
    width: 24px;
    height: 8px;
    border-radius: 12px 12px 0 0;
}

.orange-mouth-shape--sad {
    width: 26px;
    height: 13px;
    border-radius: 13px 13px 0 0;
}

.yellow-mouth-path--wavy {
    d: path('M0 10 Q10 2, 20 10 Q30 18, 40 10 Q50 2, 60 10 Q70 18, 80 10');
}

/* 开心表情 */
.purple-mouth-shape--happy {
    width: 30px;
    height: 16px;
    border-radius: 0 0 15px 15px;
}

.orange-mouth-shape--happy {
    width: 32px;
    height: 18px;
    border-radius: 0 0 16px 16px;
}

.yellow-mouth-path--happy {
    d: path('M0 2 Q10 10, 20 14 Q30 18, 40 18 Q50 18, 60 14 Q70 10, 80 2');
}

/* 庆祝效果 */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: visible;
    pointer-events: none;
    z-index: 10;
}

.confetti-piece {
    position: absolute;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        translate: 0 0;
        opacity: 1;
    }
    100% {
        translate: 30px 200vh;
        opacity: 1;
        rotate: 720deg;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .left-section {
        display: none;
    }

    .mobile-logo {
        display: flex;
    }
}

/* 眨眼动画 */
@keyframes blink {
    0%, 100% {
        height: 18px;
    }
    50% {
        height: 2px;
    }
}

.purple-character .eyeball.blinking,
.black-character .eyeball.blinking,
.orange-character .pupil.blinking,
.yellow-character .pupil.blinking {
    animation: blink 0.15s ease-in-out;
}

/* 输入时的动画 */
.purple-character.typing {
    height: 440px;
    transform: skewX(-12deg) translateX(40px);
}

.black-character.typing {
    transform: skewX(10deg) translateX(20px);
}

/* 密码可见时的动画 */
.purple-character.password-visible,
.black-character.password-visible,
.orange-character.password-visible,
.yellow-character.password-visible {
    transform: skewX(0deg);
}

.purple-character.password-visible .eyes {
    left: 50px;
    top: 20px;
}

.purple-character.password-visible .purple-mouth-shape {
    left: 72px;
    top: 57px;
}

.black-character.password-visible .eyes {
    left: 10px;
    top: 28px;
}

.orange-character.password-visible .eyes {
    left: 80px;
    top: 55px;
}

.orange-character.password-visible .orange-mouth-shape {
    left: 94px;
    top: 87px;
}

.yellow-character.password-visible .eyes {
    left: 20px;
    top: 35px;
}

.yellow-character.password-visible .yellow-mouth-wrapper {
    left: 10px;
    top: 88px;
}