* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 头部用户卡片样式 */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px 6px 12px;
    border-radius: 40px;
    backdrop-filter: blur(10px);
}

.user-avatar {
    font-size: 28px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .user-name {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.3;
}

.user-details .user-role {
    font-size: 11px;
    opacity: 0.8;
}

/* 修改密码按钮样式 */
.change-pwd-btn {
    background: rgba(255, 193, 7, 0.8);
    color: #333;
    border: none;
}

.change-pwd-btn:hover {
    background: rgba(255, 193, 7, 1);
}

/* 修改密码模态框样式优化 */
#changePwdModal .modal-content {
    border-radius: 12px;
    overflow: hidden;
}

#changePwdModal .form-group {
    margin-bottom: 18px;
}

#changePwdModal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

#changePwdModal input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#changePwdModal input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

#changePwdModal .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

#changePwdModal .submit-btn,
#changePwdModal .cancel-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

#changePwdModal .submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

#changePwdModal .submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

#changePwdModal .cancel-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

#changePwdModal .cancel-btn:hover {
    background: #e8e8e8;
}






/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: #f0f0f0;
    color: #333;
}

.password-hint {
    display: block;
    color: #999;
    font-size: 11px;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.submit-btn, .cancel-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.cancel-btn {
    background: #f0f0f0;
    color: #666;
    border: none;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.cancel-btn:hover {
    background: #e0e0e0;
}


/* 头部优化样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header-title p {
    font-size: 13px;
    opacity: 0.85;
    margin: 0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 20px;
    border-radius: 40px;
    backdrop-filter: blur(10px);
}

.user-welcome {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.welcome-text {
    font-size: 13px;
    opacity: 0.9;
}

.user-name {
    font-size: 15px;
    font-weight: bold;
}

/* 头部按钮样式 - 防止换行 */
.header-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}

.header-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* 响应式：当屏幕太小时，缩小按钮内边距 */
@media (max-width: 768px) {
    .header-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .header-buttons {
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .header-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .header-buttons {
        gap: 6px;
    }
}


.lessons-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.lessons-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.logout-btn {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-1px);
}

/* 验证码样式优化 */
.captcha-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-wrapper input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.captcha-image {
    cursor: pointer;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    transition: opacity 0.3s;
}

.captcha-image:hover {
    opacity: 0.8;
}

.captcha-image img {
    height: 42px;
    width: 120px;
    display: block;
}

.captcha-refresh {
    width: auto !important;
    padding: 8px 16px !important;
    background: #f0f0f0;
    color: #333;
    font-size: 18px;
    border-radius: 8px;
}

.captcha-refresh:hover {
    background: #e0e0e0;
    transform: none;
}

.captcha-hint {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header-main {
        flex-direction: column;
        text-align: center;
    }
    
    .header-user {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .captcha-wrapper {
        flex-wrap: wrap;
    }
    
    .captcha-image img {
        width: 100px;
        height: 36px;
    }
}

/* 用户信息区域原有样式保留 */
#userInfo {
    text-align: right;
}



body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 0;
    min-height: 70vh;
}

.form-section {
    background: #f8f9fa;
    padding: 30px;
    border-right: 1px solid #e0e0e0;
}

.form-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.result-section {
    padding: 30px;
    background: white;
    overflow-y: auto;
    max-height: 70vh;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.result-header h2 {
    color: #333;
    font-size: 1.5em;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    width: auto;
    font-size: 14px;
}

.action-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.metadata {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.lesson-content {
    line-height: 1.8;
    color: #333;
}

.lesson-content h1,
.lesson-content h2,
.lesson-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #667eea;
}

.lesson-content h1 {
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.lesson-content h2 {
    font-size: 1.4em;
    padding-left: 10px;
    border-left: 4px solid #667eea;
}

.lesson-content p {
    margin-bottom: 12px;
}

.lesson-content ul,
.lesson-content ol {
    margin: 10px 0 10px 30px;
}

.lesson-content li {
    margin-bottom: 5px;
}

.lesson-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.lesson-content th,
.lesson-content td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.lesson-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .form-section {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .result-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-actions {
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
    }
}

/* 在文件末尾添加 */

/* 导出下拉菜单 - 确保可点击 */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 5px;
}

.export-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content button {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: white;
    color: #333;
    border: none;
    border-radius: 0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-content button:hover {
    background-color: #f0f0f0;
}

.dropdown-content button:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-content button:last-child {
    border-radius: 0 0 8px 8px;
}

/* 打印优化 */
@media print {
    .form-section,
    .result-actions,
    .export-dropdown,
    button {
        display: none !important;
    }
    
    .result-section {
        display: block !important;
        padding: 0;
        margin: 0;
    }
    
    .lesson-content {
        color: black;
    }
}

/* 验证码样式 */
#captchaImage {
    cursor: pointer;
    transition: opacity 0.3s;
}

#captchaImage:hover {
    opacity: 0.8;
}

#refreshCaptcha {
    font-size: 18px;
    padding: 8px 12px;
}

#refreshCaptcha:hover {
    background: #e0e0e0;
    transform: none;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.page-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.page-btn.active {
    background: #667eea;
    color: white;
}

.page-dots {
    padding: 8px 4px;
    color: #999;
}

/* 模态框按钮组样式 */
.modal-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-buttons .action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.modal-buttons .action-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* 导出下拉菜单 */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 5px;
}

.dropdown-content button {
    width: 100%;
    padding: 10px 15px;
    text-align: left;
    background: white;
    color: #333;
    border: none;
    border-radius: 0;
    font-size: 14px;
    cursor: pointer;
}

.dropdown-content button:hover {
    background: #f0f0f0;
}

.dropdown-content button:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-content button:last-child {
    border-radius: 0 0 8px 8px;
}

/* 积分显示样式 */
.points-display {
    background: rgba(255, 215, 0, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    text-align: center;
}

.points-btn {
    background: rgba(255, 215, 0, 0.8);
    color: #333;
}

.points-btn:hover {
    background: rgba(255, 215, 0, 1);
}

.user-avatar img {
    cursor: pointer;
    transition: transform 0.3s;
}

.user-avatar img:hover {
    transform: scale(1.05);
}

/* 表单输入框样式 */
.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 个人信息编辑模态框 - 紧凑样式 */
#userInfoModal .modal-content {
    max-width: 550px;
    border-radius: 12px;
}

#userInfoModal .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eef2f6;
}

#userInfoModal .modal-header h2 {
    font-size: 18px;
    margin: 0;
}

#userInfoModal .close-user-modal {
    width: 28px;
    height: 28px;
    font-size: 20px;
}

#userInfoModal .form-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#userInfoModal .form-group label {
    width: 70px;
    margin-bottom: 0;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

#userInfoModal .form-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s;
}

#userInfoModal .form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

#userInfoModal select.form-input {
    width: auto;
    flex: 1;
}

#userInfoModal .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #eef2f6;
}

#userInfoModal .submit-btn,
#userInfoModal .cancel-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

#userInfoModal .submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

#userInfoModal .submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

#userInfoModal .cancel-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

#userInfoModal .cancel-btn:hover {
    background: #e8e8e8;
}

/* 针对生日等特殊输入框 */
#userInfoModal input[type="date"] {
    padding: 7px 10px;
}

/* 积分明细模态框关闭按钮样式 */
.close-points-modal {
    transition: all 0.3s ease;
}

.close-points-modal:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* 积分卡片样式 */
.points-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
}

.points-card-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.points-card-value {
    font-size: 32px;
    font-weight: bold;
}

/* 积分明细表格样式优化 */
.points-table {
    width: 100%;
    border-collapse: collapse;
}

.points-table th {
    text-align: left;
    padding: 12px 10px;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #eef2f6;
}

.points-table td {
    padding: 12px 10px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.points-table tr:hover {
    background: #f8f9fa;
}

.points-increase {
    color: #10b981;
    font-weight: 600;
}

.points-decrease {
    color: #dc2626;
    font-weight: 600;
}

/* 统计消息样式 */
.stats-message {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-left: 4px solid #ffc107;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
    margin-bottom: 5px;
    animation: slideDown 0.5s ease;
}

.stats-message strong {
    font-size: 18px;
    color: #e67e22;
    margin: 0 2px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stats-message {
        font-size: 11px;
        padding: 6px 12px;
    }
    .stats-message strong {
        font-size: 15px;
    }
}

/* 头部样式优化 - 高度减小 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px !important;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-title h1 {
    font-size: 20px;
    margin-bottom: 2px;
}

.header-title p {
    font-size: 11px;
    opacity: 0.85;
    margin: 0;
}

/* 统计消息样式 */
.stats-message {
    background: rgba(255, 249, 230, 0.95);
    border-left: 3px solid #ffc107;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: #856404;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stats-message strong {
    font-size: 14px;
    color: #e67e22;
    margin: 0 2px;
}

/* 用户名显示 */
.user-name-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 24px;
}

.user-name-display img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

/* 按钮组样式 */
.header-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.header-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

/* 响应式：小屏幕时调整 */
@media (max-width: 900px) {
    header {
        padding: 10px 20px !important;
    }
    
    .header-main {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-title {
        text-align: center;
    }
    
    .header-buttons {
        justify-content: center;
    }
}