* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2b7de9; --primary-dark: #1c63c2;
  --bg: #f5f7fa; --card: #fff; --text: #1f2733; --muted: #8a94a6;
  --ok: #12a150; --warn: #d98a00; --danger: #e5484d; --line: #e8ecf3;
}
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2b7de9, #1c3f8f); padding: 20px; }
.login-card { background: #fff; width: 100%; max-width: 360px; padding: 34px 28px; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.2); position: relative; }
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 24px; line-height: 1.4; }
.qr-corner { position: absolute; top: 12px; right: 12px; text-align: center; }
.qr-corner img { width: 64px; height: 64px; border-radius: 4px; }
.qr-corner span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.login-card h1 small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; }
.field input:focus { outline: none; border-color: var(--primary); }
.tip { font-size: 12px; color: var(--muted); margin-top: 14px; text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s; }
.btn.primary { background: var(--primary); color: #fff; width: 100%; }
.btn.primary:active { background: var(--primary-dark); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }
.btn.ghost { background: #eef1f6; color: #33465f; }
.btn.danger { background: var(--danger); color: #fff; }

/* 顶部导航 */
.top-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.top-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.logout-btn { color: var(--danger); cursor: pointer; font-size: 13px; }

/* 底部标签栏 */
.tab-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 10; }
.tab-item { flex: 1; text-align: center; padding: 10px 0; cursor: pointer; }
.tab-item.active { color: var(--primary); }
.tab-icon { font-size: 22px; }
.tab-label { font-size: 11px; margin-top: 2px; }

/* 主内容区 */
.main-content { padding: 20px; padding-bottom: 80px; min-height: calc(100vh - 120px); }
.view h2 { font-size: 20px; margin-bottom: 16px; }

/* 返回栏 */
.back-bar { color: var(--primary); cursor: pointer; font-size: 14px; margin-bottom: 14px; padding: 8px 0; }

/* 课程列表 */
.course-list { display: flex; flex-direction: column; gap: 14px; }
.course-card { background: var(--card); border-radius: 12px; padding: 16px; box-shadow: 0 2px 10px rgba(30,50,90,.05); cursor: pointer; transition: transform .15s; }
.course-card:active { transform: scale(0.98); }
.course-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.course-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.course-progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.course-progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.course-status { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.ok { background: #e3f6ec; color: var(--ok); }
.pill.pending { background: #eef4ff; color: var(--primary); }
.pill.warn { background: #fdf1dc; color: var(--warn); }

/* 视频播放器 */
.video-wrap { position: relative; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.video-wrap video { width: 100%; display: block; }
.video-controls { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.7)); padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.video-controls button { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
.video-time { color: #fff; font-size: 12px; }
.video-progress { flex: 1; height: 4px; background: rgba(255,255,255,.3); border-radius: 2px; cursor: pointer; position: relative; }
.video-progress-bar { height: 100%; background: var(--primary); border-radius: 2px; }

/* 文档预览 */
.doc-viewer { background: var(--card); border-radius: 12px; padding: 20px; min-height: 400px; }
.doc-page { text-align: center; margin-bottom: 16px; }
.doc-page img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }

/* 考试 */
.exam-list { display: flex; flex-direction: column; gap: 14px; }
.exam-card { background: var(--card); border-radius: 12px; padding: 16px; box-shadow: 0 2px 10px rgba(30,50,90,.05); }
.exam-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.exam-info { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.exam-actions { display: flex; gap: 10px; }

/* 考试答题 */
.exam-header { background: var(--card); padding: 14px 18px; border-radius: 12px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.exam-timer { font-size: 18px; font-weight: 700; color: var(--danger); }
.question-card { background: var(--card); border-radius: 12px; padding: 18px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(30,50,90,.05); }
.question-num { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.question-content { font-size: 15px; margin-bottom: 14px; line-height: 1.6; }
.question-options { display: flex; flex-direction: column; gap: 10px; }
.option-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: all .15s; }
.option-item:active { background: #f5f7fa; }
.option-item.selected { border-color: var(--primary); background: #eef4ff; }
.option-item input { display: none; }
.option-label { width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.option-item.selected .option-label { border-color: var(--primary); background: var(--primary); color: #fff; }

/* 考试结果 */
.exam-result { text-align: center; padding: 30px 20px; }
.result-score { font-size: 48px; font-weight: 700; margin: 16px 0; }
.result-score.pass { color: var(--ok); }
.result-score.fail { color: var(--danger); }
.result-info { font-size: 14px; color: var(--muted); margin-bottom: 20px; }

/* 个人中心 */
.profile-card { background: var(--card); border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(30,50,90,.05); }
.profile-info { display: flex; align-items: center; gap: 14px; }
.profile-avatar { width: 50px; height: 50px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.profile-name { font-size: 17px; font-weight: 600; }
.profile-dept { font-size: 13px; color: var(--primary); margin-top: 2px; }
.profile-phone { font-size: 13px; color: var(--muted); margin-top: 2px; }
.profile-note { font-size: 12px; color: var(--muted); margin-bottom: 16px; padding: 0 4px; }

/* 完善信息弹窗 */
.modal-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.menu-list { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(30,50,90,.05); }
.menu-item { padding: 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 15px; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #f5f7fa; }

.form-card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: 0 2px 10px rgba(30,50,90,.05); }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(20,28,45,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal-card { background: #fff; width: 100%; max-width: 340px; padding: 24px; border-radius: 16px; }
.modal-card h3 { font-size: 18px; margin-bottom: 18px; }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* 响应式 */
@media (min-width: 768px) {
  .main-content { max-width: 800px; margin: 0 auto; }
  .course-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}
