/* 登录界面样式 */
.login-section {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.login-card h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.login-hints {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.hint-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.login-hints p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

/* 用户信息显示样式 */
.user-info-section {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
}

.user-welcome {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    text-align: center;
}

.user-welcome h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
}

.user-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.user-details p {
    margin: 10px 0;
    color: #555;
    font-size: 16px;
}

.user-details strong {
    color: #333;
    font-weight: 600;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.student-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.student-btn:hover {
    background: linear-gradient(135deg, #1976D2, #2196F3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.teacher-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.teacher-btn:hover {
    background: linear-gradient(135deg, #F57C00, #FF9800);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.logout-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #f44336);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .login-section,
    .user-info-section {
        margin: 20px;
        padding: 10px;
    }
    
    .login-card,
    .user-welcome {
        padding: 20px;
    }
    
    .user-actions {
        gap: 10px;
    }
    
    .action-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

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

.login-card,
.user-welcome {
    animation: fadeIn 0.5s ease-out;
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .login-card,
    .user-welcome {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .login-card h2,
    .user-welcome h2 {
        color: #e0e0e0;
    }
    
    .form-group label {
        color: #b0b0b0;
    }
    
    .form-group input {
        background: #3d3d3d;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .form-group input:focus {
        border-color: #4CAF50;
    }
    
    .login-hints,
    .user-details {
        background: #3d3d3d;
        border-left-color: #4CAF50;
    }
    
    .login-hints p,
    .user-details p {
        color: #b0b0b0;
    }
    
    .user-details strong {
        color: #e0e0e0;
    }
}

/* 验证码样式 */
.captcha-display-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.captcha-display {
    width: 100px;
    height: 40px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    border: 2px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    user-select: none;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.captcha-display:hover {
    border-color: #4CAF50;
    background: linear-gradient(45deg, #e8f5e8, #d4edda);
}

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

.captcha-display:hover::before {
    left: 100%;
}

.refresh-captcha {
    width: auto;
    min-width: 80px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    padding: 0 12px;
}

.refresh-captcha::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;
}

.refresh-captcha:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.refresh-captcha:hover::before {
    left: 100%;
}

.refresh-captcha:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.refresh-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.refresh-captcha:hover .refresh-icon {
    transform: rotate(180deg);
}

.refresh-text {
    font-weight: 500;
    white-space: nowrap;
}

/* 深色主题下的验证码样式 */
body.dark-theme .captcha-display {
    background: linear-gradient(45deg, #3d3d3d, #2d2d2d);
    border-color: #555;
    color: #e0e0e0;
}

body.dark-theme .captcha-display:hover {
    border-color: #4CAF50;
    background: linear-gradient(45deg, #2d4a2d, #1e3a1e);
}

body.dark-theme .refresh-captcha {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    box-shadow: 0 2px 8px rgba(74, 85, 104, 0.3);
}

body.dark-theme .refresh-captcha:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #4a5568 100%);
    box-shadow: 0 4px 12px rgba(90, 111, 216, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .captcha-display-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .captcha-display {
        width: 100%;
        height: 35px;
        font-size: 16px;
    }
    
    .refresh-captcha {
        width: 100%;
        height: 35px;
        font-size: 12px;
        border-radius: 6px;
        gap: 4px;
        padding: 0 8px;
    }
    
    .refresh-icon {
        font-size: 14px;
    }
}

/* 移动端缩放支持 */
@media (max-width: 480px) {
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    .login-container {
        padding: 15px;
        margin: 10px;
    }
    
    .login-form {
        padding: 20px 15px;
    }
    
    .form-group input {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px 15px;
    }
    
    .login-btn {
        font-size: 16px;
        padding: 12px 20px;
    }
    
    .captcha-display {
        font-size: 18px;
        height: 40px;
    }
    
    .refresh-captcha {
        font-size: 16px;
        height: 40px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .login-btn:hover,
    .refresh-captcha:hover {
        transform: none;
    }
    
    .login-btn:active,
    .refresh-captcha:active {
        transform: scale(0.95);
    }
    
    .captcha-display:hover {
        transform: none;
    }
    
    .captcha-display:active {
        transform: scale(0.98);
    }
}
