/* CSS Variables */
:root {
    --on: rgba(128, 128, 128, 0.3);
    --shade-hue: #87CEEB;
    --bg-dark: #121921;
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: url('/static/img/login_bj.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-primary);
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 25, 33, 0.7);
    z-index: -1;
}

/* Container */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 100px;
    padding: 40px;
    min-height: 100vh;
    padding-top: 180px;
}

/* 页面标题 */
.page-title {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.main-title {
    font-size: 80px;
    font-weight: bold;
    color: var(--shade-hue);
    text-shadow: 0 0 20px var(--on),
                 0 0 40px var(--on),
                 0 0 60px var(--on);
    letter-spacing: 16px;
    margin-bottom: 15px;
    animation: titleGlow 3s ease-in-out infinite;
}

.sub-title {
    font-size: 45px;
    color: var(--sub-shade-hue, var(--shade-hue));
    letter-spacing: 8px;
    text-shadow: 0 0 10px var(--sub-on, var(--on));
    opacity: 0.8;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 0 20px var(--on),
                     0 0 40px var(--on),
                     0 0 60px var(--on);
    }
    50% {
        text-shadow: 0 0 30px var(--on),
                     0 0 60px var(--on),
                     0 0 90px var(--on),
                     0 0 120px var(--on);
    }
}

/* Lamp Container */
.lamp-container {
    width: 200px;
    height: 300px;
    position: relative;
}

.lamp-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Eye Animation - 默认隐藏，交互时显示 */
#eye-left,
#eye-right {
    transform-origin: center;
    transition: opacity 0.3s ease;
    opacity: 0;
}

/* 交互时显示眼睛 */
.lamp-interacting #eye-left,
.lamp-interacting #eye-right {
    opacity: 1;
}

/* Light Beam */
#light-beam {
    transition: opacity 0.4s ease;
}

.lamp-on #light-beam {
    opacity: 1;
}

/* Pull Cord Cursor */
#pull-cord,
#pull-cord-handle {
    cursor: grab;
}

#pull-cord:active,
#pull-cord-handle:active {
    cursor: grabbing;
}

/* Login Form Container */
.login-form-container {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lamp-on .login-form-container {
    opacity: 1;
    transform: scale(1);
}

/* Login Form */
.login-form {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 2px solid var(--on);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 380px;
    box-shadow: 0 8px 32px var(--on),
                0 0 60px rgba(0, 0, 0, 0.3);
    transition: box-shadow var(--transition-speed) ease,
                border-color var(--transition-speed) ease;
}

/* Form Title */
.form-title {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-title .highlight {
    color: var(--shade-hue);
    transition: color var(--transition-speed) ease;
}

.form-subtitle {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1em;
    transition: all var(--transition-speed) ease;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-group input:focus {
    outline: none;
    border-color: var(--shade-hue);
    box-shadow: 0 0 0 3px var(--on),
                0 0 20px var(--on);
    background: rgba(0, 0, 0, 0.5);
}

/* 密码输入框包装器 */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px;
}

/* 显示/隐藏密码眼睛图标 */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-speed) ease;
    color: var(--text-secondary);
}

.toggle-password:hover {
    background: var(--on);
    border-color: var(--shade-hue);
    color: var(--shade-hue);
    box-shadow: 0 0 10px var(--on);
}

.eye-icon {
    width: 18px;
    height: 18px;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.85em;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--shade-hue);
}

.forgot-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.forgot-link:hover {
    color: var(--shade-hue);
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--shade-hue);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px var(--on);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--on);
    filter: brightness(1.1);
}

.login-btn:active {
    transform: translateY(0);
}

.btn-arrow {
    transition: transform var(--transition-speed) ease;
}

.login-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Form Footer */
.form-footer {
    display: flex;
    justify-content: space-around;
    margin: 24px 0;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.secondary-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85em;
    transition: color var(--transition-speed) ease;
}

.secondary-link:hover {
    color: var(--shade-hue);
}

/* Signup Link */
.signup-link {
    text-align: center;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 20px;
}

.signup-link a {
    color: var(--shade-hue);
    text-decoration: none;
    font-weight: 600;
    transition: opacity var(--transition-speed) ease;
}

.signup-link a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Footer Info */
.footer-info {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8em;
}

.footer-info p {
    margin: 4px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 40px;
        padding: 20px;
    }
    
    .lamp-container {
        width: 150px;
        height: 225px;
    }
    
    .login-form {
        width: 100%;
        max-width: 380px;
        padding: 30px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

.lamp-on #light-beam {
    animation: pulse 3s ease-in-out infinite;
}
