/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", sans-serif; background: #f5f7fa; padding-bottom: 70px; }

.page { padding: 15px; max-width: 500px; margin: 0 auto; }

.header { background: #165DFF; color: #fff; padding: 15px; text-align: center; font-size: 18px; border-radius: 8px; margin-bottom: 15px; }
.btn { background: #165DFF; color: #fff; border: none; padding: 10px 20px; border-radius: 6px; font-size: 16px; width: 100%; cursor: pointer; }
.btn:active { opacity: 0.8; }
.btn-gray { background: #999; }
.btn-danger { background: #ff4d4f; }
.btn-sm { width: auto; padding: 5px 15px; font-size: 14px; }

.input-group { margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #333; }
.input-group input, .input-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 15px; }
.input-group select { background: #fff; }

.card { background: #fff; border-radius: 8px; padding: 15px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.card h3 { color: #165DFF; margin-bottom: 8px; }

.course-item { padding: 12px 0; border-bottom: 1px solid #eee; cursor: pointer; }
.course-item:last-child { border-bottom: none; }
.course-item .title { font-weight: bold; padding-left: 10px; }
.course-item .desc { color: #666; font-size: 14px; padding-left: 10px; }

.section-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.section-item:last-child { border-bottom: none; }
.section-item .btn { width: auto; padding: 4px 16px; font-size: 14px; }

/* ===== 文件列表样式 ===== */
.file-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 5px;
    min-height: 40px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    padding: 10px;
    background: #fafafa;
}
.file-list-placeholder {
    color: #999;
    font-size: 14px;
    width: 100%;
    text-align: center;
    padding: 10px 0;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    width: 100%;
    transition: background 0.2s;
    box-sizing: border-box;
}
.file-item:hover {
    background: #f0f4ff;
}
.file-item .file-index {
    font-weight: bold;
    color: #165DFF;
    font-size: 14px;
    min-width: 32px;
    flex-shrink: 0;
}
.file-item .file-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.file-item .file-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    word-break: break-all;
    font-family: "Consolas", "Microsoft YaHei", monospace;
}
.file-item .file-delete {
    background: #fee;
    border: 1px solid #fcc;
    color: #e74c3c;
    border-radius: 4px;
    padding: 2px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.file-item .file-delete:hover {
    background: #fcc;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    border-top: 1px solid #e5e7eb;
    z-index: 100;
    justify-content: space-around;
}
.bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    cursor: pointer;
    color: #999;
    user-select: none;
    text-decoration: none;
}
.bottom-nav .nav-item.active {
    color: #165DFF;
    font-weight: bold;
    border-top: 2px solid #165DFF;
}
.bottom-nav .nav-item .icon {
    font-size: 22px;
    display: block;
}

/* ===== 个人中心 ===== */
.profile-header { background: linear-gradient(135deg, #165DFF, #3b7cff); color: #fff; border-radius: 12px; padding: 20px; display: flex; align-items: center; margin-bottom: 15px; }
.profile-avatar { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; margin-right: 15px; flex-shrink: 0; overflow: hidden; cursor: pointer; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; }
.profile-name { font-size: 18px; font-weight: bold; }
.profile-id { font-size: 13px; opacity: 0.8; margin-top: 2px; }
.profile-edit-link { color: #fff; font-size: 14px; cursor: pointer; opacity: 0.8; text-decoration: none; }

.menu-list { background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.menu-list .menu-item { display: flex; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid #f0f0f0; font-size: 15px; color: #333; cursor: pointer; }
.menu-list .menu-item:last-child { border-bottom: none; }
.menu-list .menu-item .arrow { color: #ccc; }

.error-msg { color: red; margin-top: 10px; }
.placeholder { text-align: center; color: #999; padding: 50px 0; }

.avatar-preview { text-align: center; padding: 20px 0; }
.avatar-preview img { width: 120px; height: 120px; border-radius: 50%; border: 3px solid #165DFF; object-fit: cover; }
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; margin-top: 20px; }
.avatar-grid .avatar-option { width: 100%; aspect-ratio: 1/1; border-radius: 50%; border: 3px solid #ddd; cursor: pointer; overflow: hidden; }
.avatar-grid .avatar-option img { width: 100%; height: 100%; object-fit: cover; }
.avatar-grid .avatar-option.selected { border-color: #165DFF; box-shadow: 0 0 0 3px rgba(22,93,255,0.3); }

.info-row { display: flex; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.info-row .label { width: 80px; color: #666; font-size: 15px; }
.info-row .value { flex: 1; color: #333; font-size: 15px; }
.info-row .value input { width: 100%; border: none; outline: none; background: transparent; font-size: 15px; padding: 0; }
.info-row .value input:focus { border-bottom: 1px solid #165DFF; }
.info-row .value select { width: 100%; border: none; background: transparent; font-size: 15px; outline: none; }

.tab-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 6px 6px 0 0;
    font-size: 16px;
    cursor: pointer;
    background: #999;
    color: #fff;
}
.tab-btn.active { background: #165DFF; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: normal;
    cursor: pointer;
    background: #f0f4ff;
    padding: 2px 10px;
    border-radius: 14px;
    font-size: 14px;
}
.checkbox-group label input { margin: 0; width: 16px; height: 16px; cursor: pointer; }

.learning-image img { max-width: 100%; max-height: 70vh; border-radius: 8px; }
.learning-video video { max-width: 100%; max-height: 70vh; border-radius: 8px; background: #000; }

#page-learning { padding-top: 50px; padding-bottom: 60px; }
.learning-topbar {
    position: fixed; top: 0; left: 0; right: 0; background: #fff; z-index: 999;
    border-bottom: 1px solid #eee; display: flex; align-items: center; height: 50px; padding: 0 10px;
}
.learning-topbar .back-btn { font-size: 20px; cursor: pointer; background: none; border: none; }
.learning-topbar .title { margin-left: 15px; font-weight: bold; flex: 1; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.learning-progress-bar { position: fixed; top: 50px; left: 0; height: 3px; background: #165DFF; width: 0%; z-index: 999; transition: width 0.3s; }
.learning-bottom { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; padding: 10px; border-top: 1px solid #eee; z-index: 999; }
.learning-content { padding: 15px; padding-top: 60px; padding-bottom: 80px; }

.exam-question { background: #fafafa; padding: 12px; border-radius: 6px; margin-bottom: 12px; }
.exam-question .q-title { font-weight: bold; margin-bottom: 8px; }
.exam-question .options label { display: block; padding: 6px 0; }
.exam-question .options input { margin-right: 8px; }

.back-link { display: inline-block; margin-bottom: 10px; color: #165DFF; text-decoration: none; font-size: 14px; }
.back-link:hover { text-decoration: underline; }

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.gap-10 { display: flex; gap: 10px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }