* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 10px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #fff;
    font-size: 2.2em;
    margin-bottom: 8px;
    background: linear-gradient(45deg, #00fff2, #0080ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95em;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group input {
    width: 100%;
    padding: 15px 0 10px 0;
    font-size: 16px;
    color: #fff;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    outline: none;
    background: transparent;
    transition: 0.3s;
}

.input-group label {
    position: absolute;
    top: 15px;
    left: 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transition: 0.3s;
}

.input-group input:focus ~ label,
.input-group input:valid ~ label {
    top: -5px;
    font-size: 12px;
    color: #00fff2;
}

.input-highlight {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #00fff2, #0080ff);
    transition: 0.4s;
}

.input-group input:focus ~ .input-highlight {
    width: 100%;
}

/* 错误消息样式 */
.error-message {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    text-align: center;
    font-size: 14px;
    backdrop-filter: blur(10px);
    color: #ff4757;
    transition: all 0.3s ease;
}

.error-message.success {
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid rgba(46, 213, 115, 0.3);
    color: #2ed573;
}

/* 输入框错误状态 */
.input-group.error input {
    border-bottom-color: #ff4757;
}

.input-group.error label {
    color: #ff4757;
}

.input-group.error .input-highlight {
    background: linear-gradient(45deg, #ff4757, #ff3742);
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: 0.3s;
}

.remember-me input:checked + .checkmark {
    background: #00fff2;
    border-color: #00fff2;
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: #000;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.forgot-password {
    color: #00fff2;
    text-decoration: none;
    transition: 0.3s;
}

.forgot-password:hover {
    color: #0080ff;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #00fff2, #0080ff);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 242, 0.3);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.register-link {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.register-link a {
    color: #00fff2;
    text-decoration: none;
    transition: 0.3s;
}

.register-link a:hover {
    color: #0080ff;
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 15px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .glass-card {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .forgot-password {
        align-self: flex-end;
    }
}

/* 竖屏优化 */
@media (max-height: 700px) {
    body {
        align-items: flex-start;
        padding-top: 30px;
        padding-bottom: 30px;
    }
    
    .glass-card {
        padding: 30px 25px;
    }
}

@media (max-height: 600px) {
    body {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .glass-card {
        padding: 25px 20px;
    }
    
    .header {
        margin-bottom: 20px;
    }
    
    .input-group {
        margin-bottom: 20px;
    }
}

/* 登录成功动画 */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.login-success {
    animation: successPulse 0.5s ease-in-out;
}

/* 输入框聚焦增强效果 */
.input-group input:focus {
    border-bottom-color: transparent;
}

/* 按钮文字过渡 */
.login-btn span {
    transition: opacity 0.3s ease;
}

.login-btn:disabled span {
    opacity: 0;
}

/* 粒子画布优化 */
#particle-canvas {
    pointer-events: none;
}

/* 玻璃态卡片悬停效果 */
.glass-card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

/* 忘记密码链接焦点状态 */
.forgot-password:focus {
    outline: 2px solid #00fff2;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 输入框占位符样式 */
.input-group input::placeholder {
    color: transparent;
}

.input-group input:focus::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .glass-card {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #00fff2;
    }
    
    .input-group input {
        border-bottom: 2px solid #00fff2;
    }
    
    .error-message {
        background: rgba(255, 0, 0, 0.2);
        border: 2px solid #ff0000;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .glass-card {
        animation: none;
    }
}