/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
}

/* 动态背景 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.animated-bg {
    position: relative;
    width: 100%;
    height: 100%;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(0, 255, 255, 0.1), rgba(255, 0, 255, 0.1));
    animation: float 20s infinite linear;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 15%;
    animation-delay: -7s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(50px, -50px) rotate(120deg); }
    66% { transform: translate(-30px, 30px) rotate(240deg); }
}

/* 主容器 */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 登录卡片 */
.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: cardGlow 3s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes cardGlow {
    0% { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
    100% { 
        box-shadow: 
            0 20px 40px rgba(0, 255, 255, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            0 0 30px rgba(0, 255, 255, 0.05);
    }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 卡片头部 */
.card-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 3rem;
    color: #00ffff;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    animation: logoGlow 2s ease-in-out infinite alternate;
}

.logo h1 {
    font-size: 1.6rem;
    color: #ffffff;
    margin: 10px 0 0 0;
    font-weight: 300;
    letter-spacing: 1px;
}

@keyframes logoGlow {
    0% { text-shadow: 0 0 20px rgba(0, 255, 255, 0.5); }
    100% { text-shadow: 0 0 30px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.3); }
}

.title {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 300;
}

/* 表单样式 */
.login-form {
    position: relative;
    z-index: 2;
}

.input-group {
    margin-bottom: 25px;
}

/* 用户信息显示样式 */
.user-info-display {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.user-info-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 255, 255, 0.1), rgba(255, 0, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-info-display:hover::before {
    opacity: 1;
}

.user-info-display i {
    margin-right: 12px;
    color: #00ffff;
    font-size: 1.1rem;
}

.user-stu-id {
    font-weight: 600;
    color: #00ffff;
    margin-left: 8px;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    z-index: 2;
}

input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    position: relative;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    transform: translateY(-2px);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    transition: width 0.3s ease;
    border-radius: 1px;
}

input:focus + .input-line {
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s ease;
    z-index: 2;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle::before,
.password-toggle::after {
    display: none !important;
}

.password-toggle i {
    pointer-events: none;
}

.password-toggle:hover {
    color: #00ffff;
}

/* 错误消息 */
.error-message {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    color: #ff6b6b;
    font-size: 0.9rem;
    animation: shake 0.5s ease-in-out;
}

.error-message i {
    margin-right: 8px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.3);
}

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

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.btn-loader {
    display: inline-block;
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 额外选项 */
.extra-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    border-color: #00ffff;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* 卡片底部 */
.card-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 系统信息 */
.system-info {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.info-item {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item i {
    color: #00ffff;
}

.status-online {
    color: #00ff88;
    font-weight: 600;
}

/* 粒子效果画布 */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        justify-content: flex-start;
        padding-top: 10vh;
    }
    
    .login-card {
        padding: 35px 25px;
        margin: 0;
        max-width: 400px;
        border-radius: 16px;
    }
    
    .card-header {
        margin-bottom: 30px;
    }
    
    .title {
        font-size: 1.6rem;
    }
    
    .logo {
        font-size: 2.8rem;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    input {
        padding: 16px 16px 16px 48px;
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 12px;
    }
    
    .input-icon {
        left: 16px;
    }
    
    .login-btn {
        padding: 16px;
        font-size: 1rem;
        border-radius: 12px;
        min-height: 50px; /* 触摸友好 */
    }
    
    .system-info {
        bottom: 15px;
        left: 15px;
        font-size: 0.8rem;
    }
    
    .background-effects {
        opacity: 0.3; /* 减少移动端背景动画干扰 */
    }
}

@media (max-width: 480px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 10px;
        padding-top: 5vh;
    }
    
    .login-card {
        padding: 25px 20px;
        margin: 0;
        width: calc(100% - 20px);
        max-width: none;
    }
    
    .card-header {
        margin-bottom: 25px;
    }
    
    .title {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .logo {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .logo h1 {
        font-size: 1.2rem;
        margin: 5px 0 0 0;
    }
    
    input {
        padding: 14px 14px 14px 44px;
        font-size: 16px;
    }
    
    .input-icon {
        left: 14px;
        font-size: 1rem;
    }
    
    .input-group {
        margin-bottom: 20px;
    }
    
    .login-btn {
        padding: 14px;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    .system-info {
        position: relative;
        text-align: center;
        margin-top: 20px;
        bottom: auto;
        left: auto;
        font-size: 0.7rem;
        background: rgba(0, 0, 0, 0.2);
        padding: 8px 12px;
        border-radius: 8px;
    }
    
    /* 优化动态背景 */
    .circle-1 {
        width: 200px;
        height: 200px;
    }
    
    .circle-2 {
        width: 120px;
        height: 120px;
    }
    
    .circle-3 {
        width: 80px;
        height: 80px;
    }
    
    .background {
        opacity: 0.5;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeInUp 0.8s ease-out;
}

.input-group {
    animation: fadeInUp 0.8s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.login-btn {
    animation: fadeInUp 0.8s ease-out;
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

/* 注册页面额外样式 */
.success-message {
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: shake 0.5s ease-in-out;
}

.success-message i {
    font-size: 18px;
}

.back-to-login {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.back-to-login a {
    color: #00ffff;
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.back-to-login a:hover {
    color: #00ff88;
    text-decoration: underline;
}

/* 注册表单输入框适配 */
#registerForm .input-group {
    margin-bottom: 15px;
}

/* 同意条款复选框样式优化 */
.checkbox-wrapper {
    font-size: 13px;
}