/* ===== 学习平台 H5 样式 v2 =====
 * 包含员工端 + 管理员端全部样式
 */

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F5F7FA;
  -webkit-overflow-scrolling: touch;
}
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #F5F7FA;
  position: relative;
  overflow: hidden;
}

/* ===== Top Role Switch ===== */
.role-switch {
  display: flex;
  background: #1A1A2E;
  padding: 6px 12px;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.role-switch .brand {
  color: #fff; font-size: 13px; font-weight: 600;
  margin-right: auto; display: flex; align-items: center; gap: 4px;
}
.role-switch .brand svg { width: 18px; height: 18px; }
.role-tab {
  padding: 5px 14px; border-radius: 6px; font-size: 12px;
  cursor: pointer; color: #999; transition: .2s; border: none;
  background: transparent; font-weight: 500;
}
.role-tab.active { background: #3370FF; color: #fff; }
.role-tab:hover:not(.active) { color: #ccc; }
.role-hint {
  font-size: 11px; color: #8B6914; text-align: center;
  padding: 6px 12px; background: #FFF3CD; flex-shrink: 0;
  line-height: 1.4; border-bottom: 1px solid #FFE69C;
}

/* ===== Page Container ===== */
.page-container {
  flex: 1; overflow-y: auto; position: relative;
  -webkit-overflow-scrolling: touch;
}
.page { display: none; min-height: 100%; }
.page.active { display: block; }

/* ===== Bottom TabBar ===== */
.tabbar {
  display: flex; background: #fff; border-top: 1px solid #E5E8EC;
  flex-shrink: 0; height: 56px;
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; cursor: pointer; gap: 2px;
  color: #999; font-size: 10px; transition: .2s; border: none; background: none;
}
.tabbar-item.active { color: #3370FF; }
.tabbar-item svg { width: 22px; height: 22px; }
.tabbar-item.admin-only { display: none; }
.tabbar-item.admin-only.show { display: flex; }

/* ===== Header ===== */
.page-header {
  background: #3370FF; color: #fff; padding: 16px 16px 20px;
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.page-header h2 { font-size: 18px; font-weight: 600; }
.page-header .back-btn {
  width: 28px; height: 28px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; border-radius: 6px;
  border: none; background: rgba(255,255,255,.2); color: #fff;
  font-size: 14px;
}
.page-header .back-btn:hover { background: rgba(255,255,255,.35); }
.page-header .header-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.header-right .btn { font-size: 11px; padding: 6px 12px; border-radius: 6px; }
.header-right .btn-white {
  background: rgba(255,255,255,.2); color: #fff; border: none;
  cursor: pointer; font-weight: 500;
}
.header-right .btn-white:hover { background: rgba(255,255,255,.35); }

/* ===== Cards ===== */
.card {
  background: #fff; border-radius: 12px; padding: 16px; margin: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card-title { font-size: 15px; font-weight: 600; color: #1A1A2E; margin-bottom: 8px; }
.card-subtitle { font-size: 12px; color: #999; }

/* ===== Course Card ===== */
.course-card {
  display: flex; gap: 12px; cursor: pointer; transition: transform .15s;
}
.course-card:active { transform: translateY(-1px); }
.course-thumb {
  width: 100px; height: 68px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 600;
}
.course-thumb.blue { background: linear-gradient(135deg, #3370FF, #5B8DFF); }
.course-thumb.green { background: linear-gradient(135deg, #00B578, #33D68A); }
.course-thumb.orange { background: linear-gradient(135deg, #FF8C00, #FFA940); }
.course-thumb.purple { background: linear-gradient(135deg, #7B61FF, #A08CFF); }
.course-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.course-info h4 { font-size: 14px; font-weight: 600; color: #1A1A2E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-info .meta { font-size: 11px; color: #999; display: flex; gap: 10px; }
.course-info .progress-bar-wrap { margin-top: 4px; }
.progress-bar-wrap { height: 6px; background: #EEF0F4; border-radius: 3px; overflow: hidden; }
.progress-bar-wrap .fill { height: 100%; border-radius: 3px; background: #3370FF; transition: width .3s; }
.progress-bar-wrap .fill.done { background: #00B578; }
.progress-text { font-size: 11px; color: #999; margin-top: 2px; }

/* ===== Category Tabs ===== */
.cat-tabs {
  display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: 6px 16px; border-radius: 20px; font-size: 12px; white-space: nowrap;
  cursor: pointer; border: 1px solid #D9DDE3; background: #fff; color: #666;
  transition: .2s; flex-shrink: 0;
}
.cat-tab.active { background: #3370FF; color: #fff; border-color: #3370FF; }

/* ===== Video Play Area ===== */
.video-placeholder {
  width: 100%; height: 210px; background: #1A1A2E;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #fff; gap: 8px;
  position: relative; border-radius: 0; cursor: pointer;
}
.video-placeholder .play-icon,
.video-small .video-overlay .play-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.2); display: flex;
  align-items: center; justify-content: center;
}
.video-placeholder .play-icon::after,
.video-small .video-overlay .play-icon::after {
  content: ''; width: 0; height: 0;
  border-left: 18px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 3px;
}
/* 暂停图标：两根竖条，用 ::before 避免和 play-icon::after 的三角形冲突 */
.video-small .video-overlay .pause-icon {
  background: rgba(255,255,255,0.2);
}
.video-small .video-overlay .pause-icon::after {
  content: none; /* 清除 play-icon 的三角形 */
}
.video-small .video-overlay .pause-icon::before {
  content: '';
  display: block;
  width: 4px;
  height: 22px;
  background: #fff;
  box-shadow: 8px 0 0 #fff;
  border-radius: 2px;
  margin: 0;
}
.video-small {
  width: 100%; height: 190px; background: #1A1A2E;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.video-small video {
  width: 100%; height: 100%; object-fit: contain;
  display: block; background: #000;
}
.video-small .video-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3);
  cursor: pointer;
}

/* ===== Locked Progress Bar ===== */
.locked-bar-wrap {
  padding: 16px 20px; background: #fff;
}
.locked-bar-label {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: #FF6B6B; margin-bottom: 8px;
}
.locked-bar-label svg { width: 14px; height: 14px; }
.locked-bar {
  height: 6px; background: #EEF0F4; border-radius: 3px;
  position: relative; overflow: visible;
}
.locked-bar .fill {
  height: 100%; border-radius: 3px; background: #3370FF;
  position: relative; transition: width .5s linear;
}
.locked-bar .lock-dot {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 14px; height: 14px; background: #fff;
  border: 2px solid #3370FF; border-radius: 50%;
  right: 0; margin-left: -7px; z-index: 1;
}

/* ===== Buttons ===== */
.btn {
  padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: .2s; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: #3370FF; color: #fff; width: 100%; }
.btn-primary:hover { background: #2B5FDF; }
.btn-primary:disabled { background: #A0BDFF; cursor: not-allowed; }
.btn-outline { background: #fff; color: #3370FF; border: 1px solid #3370FF; }
.btn-outline:hover { background: #F0F4FF; }
.btn-outline:disabled { background: #D9DDE3; color: #FFFFFF; cursor: not-allowed; border-color: #D9DDE3; }
.btn-danger { background: #FF4D4F; color: #fff; }
.btn-danger:hover { background: #E04345; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 10px; font-size: 11px; border-radius: 4px; }
.btn-ghost { background: transparent; color: #999; border: none; }
.btn-play {
  width: 100%; justify-content: center; gap: 6px; margin-top: 12px; color: #fff;
}
.btn-play.paused { color: #fff; }
.btn-exam-locked {
  width: 100%; background: #D9DDE3; color: #FFFFFF; cursor: not-allowed;
}
.btn-exam-locked:hover { background: #D9DDE3; }

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 16px;
}
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 6px;
}
.form-label .required { color: #FF4D4F; margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #D9DDE3;
  border-radius: 8px; font-size: 14px; color: #333;
  background: #fff; transition: border-color .2s;
  font-family: inherit; outline: none;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #3370FF; box-shadow: 0 0 0 2px rgba(51,112,255,.1);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
.form-textarea {
  min-height: 80px; resize: vertical;
}
.form-hint {
  font-size: 11px; color: #999; margin-top: 4px;
}
.form-error {
  font-size: 11px; color: #FF4D4F; margin-top: 4px;
}

/* Option editor (for question editing) */
.option-editor {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.option-editor .option-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: #F0F4FF; color: #3370FF; display: flex;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.option-editor .form-input { flex: 1; margin-bottom: 0; }
.option-editor .btn-remove-opt {
  width: 28px; height: 28px; border-radius: 50%;
  background: #FFF0F0; color: #FF4D4F; border: none;
  cursor: pointer; font-size: 14px; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1;
}
.option-editor .btn-remove-opt:hover { background: #FFE0E0; }

/* ===== Exam ===== */
.exam-notice {
  background: #FFF7E6; border: 1px solid #FFE4B5; border-radius: 8px;
  padding: 12px; font-size: 12px; color: #D48806; line-height: 1.6;
  margin: 12px 16px;
}
.question-block { margin: 0 16px 12px; }
.question-title { font-size: 14px; font-weight: 600; color: #1A1A2E; margin-bottom: 8px; }
.question-type {
  font-size: 10px; color: #3370FF; background: #F0F4FF;
  padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 6px;
}
.question-type.single { color: #3370FF; background: #F0F4FF; }
.question-type.multiple { color: #FF8C00; background: #FFF7E6; }
.question-type.judge { color: #00B578; background: #E6F7EE; }
.option {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 8px; border: 1px solid #E5E8EC; margin-bottom: 6px;
  cursor: pointer; transition: .2s; font-size: 13px; color: #333;
  background: #fff;
}
.option:hover { border-color: #3370FF; background: #FAFBFF; }
.option.selected { border-color: #3370FF; background: #F0F4FF; color: #3370FF; }
.option.correct { border-color: #00B578; background: #E6F7EE; color: #00B578; }
.option.wrong { border-color: #FF4D4F; background: #FFF0F0; color: #FF4D4F; }
.option .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #D9DDE3; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: .2s; }
.option.selected .radio { border-color: #3370FF; }
.option.selected .radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3370FF; }
.option .checkbox { width: 18px; height: 18px; border-radius: 4px; border: 2px solid #D9DDE3; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: .2s; }
.option.selected .checkbox { background: #3370FF; border-color: #3370FF; }
.option.selected .checkbox::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }

/* ===== Exam Result ===== */
.result-score {
  text-align: center; padding: 30px 20px;
}
.result-score .score-num { font-size: 56px; font-weight: 700; color: #3370FF; }
.result-score .score-num.fail { color: #FF6B6B; }
.result-score .score-label { font-size: 14px; color: #666; margin-top: 4px; }
.result-summary {
  background: #F0F4FF; border-radius: 10px; padding: 16px;
  margin: 0 16px 12px; text-align: center;
  font-size: 14px; color: #1A1A2E; font-weight: 500;
  line-height: 1.8;
}
.result-fail-title { font-size: 28px; font-weight: 700; color: #FF4D4F; margin-bottom: 4px; }
.result-pass-title { font-size: 28px; font-weight: 700; color: #00B578; margin-bottom: 4px; }
.result-attempt { font-size: 13px; color: #666; margin-top: 4px; }
.result-note { font-size: 12px; color: #999; text-align: center; padding: 8px 16px; line-height: 1.6; }

/* ===== Review (错题回顾) ===== */
.review-item {
  padding: 10px 0; border-bottom: 1px solid #F0F0F0;
}
.review-item:last-child { border-bottom: none; }
.review-q { font-size: 13px; color: #1A1A2E; font-weight: 500; margin-bottom: 6px; }
.review-detail { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.review-detail .your-answer { color: #FF4D4F; }
.review-detail .your-answer::before { content: '你的答案：'; color: #999; }
.review-detail .correct-answer { color: #00B578; }
.review-detail .correct-answer::before { content: '正确答案：'; color: #999; }

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 0 16px; margin-bottom: 12px;
}
.stats-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 14px 10px;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stat-card .num { font-size: 24px; font-weight: 700; color: #3370FF; }
.stat-card .num.green { color: #00B578; }
.stat-card .num.orange { color: #FF8C00; }
.stat-card .lbl { font-size: 11px; color: #999; margin-top: 4px; }

/* ===== Record List ===== */
.record-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid #F0F0F0; margin: 0 16px;
}
.record-item:last-child { border-bottom: none; }
.record-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; flex-shrink: 0;
}
.record-info { flex: 1; min-width: 0; }
.record-info h4 { font-size: 13px; color: #1A1A2E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-info p { font-size: 11px; color: #999; margin-top: 2px; }
.record-status { font-size: 11px; padding: 2px 8px; border-radius: 4px; flex-shrink: 0; }
.record-status.done { background: #E6F7EE; color: #00B578; }
.record-status.studying { background: #F0F4FF; color: #3370FF; }
.record-status.new { background: #F5F5F5; color: #999; }
.record-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.exam-status { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.exam-status.exam-done { background: #E6F7EE; color: #00B578; }
.exam-status.exam-none { background: #F5F5F5; color: #999; }
.exam-status.exam-fail { background: #FFF7E6; color: #D48806; }

/* ===== Admin ===== */
.admin-stat-card {
  background: #fff; border-radius: 10px; padding: 14px 10px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.admin-stat-card .val { font-size: 24px; font-weight: 700; color: #3370FF; }
.admin-stat-card .val.green { color: #00B578; }
.admin-stat-card .val.orange { color: #FF8C00; }
.admin-stat-card .lbl { font-size: 11px; color: #999; margin-top: 4px; }

/* Chapter completion */
.chapter-bar-item { margin-bottom: 10px; }
.chapter-bar-item:last-child { margin-bottom: 0; }
.chapter-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: #333; margin-bottom: 4px; }
.chapter-bar-label span:last-child { color: #3370FF; font-weight: 600; }
.chapter-bar { height: 8px; background: #EEF0F4; border-radius: 4px; overflow: hidden; }
.chapter-bar .fill { height: 100%; border-radius: 4px; background: #3370FF; transition: width .3s; }

/* Dept progress */
.dept-progress-item { margin-bottom: 16px; }
.dept-progress-item:last-child { margin-bottom: 0; }
.dept-progress-header { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.dept-progress-header .dept-name { font-weight: 600; color: #1A1A2E; min-width: 60px; }
.dept-progress-header .dept-count { font-size: 11px; color: #999; }
.dept-progress-header .dept-percent { font-weight: 600; color: #3370FF; margin-left: auto; font-size: 14px; }
.dept-progress-bar { height: 10px; background: #EEF0F4; border-radius: 5px; overflow: hidden; }
.dept-progress-bar .fill { height: 100%; border-radius: 5px; background: #3370FF; transition: width .5s; }

/* Admin table */
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.admin-table th, .admin-table td {
  padding: 10px 6px; text-align: left; border-bottom: 1px solid #F0F0F0;
}
.admin-table th { color: #999; font-weight: 500; white-space: nowrap; }
.admin-table td { color: #333; }

/* Admin course row */
.admin-course-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid #F0F0F0; flex-wrap: wrap;
}
.admin-course-info { flex: 1; min-width: 0; }
.admin-course-info h4 { font-size: 13px; color: #1A1A2E; }
.admin-course-info p { font-size: 11px; color: #999; margin-top: 2px; }
.admin-course-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Admin question row */
.admin-question-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid #F0F0F0;
}
.admin-question-info { flex: 1; min-width: 0; }
.admin-question-info h4 { font-size: 13px; color: #1A1A2E; line-height: 1.5; }
.admin-question-info p { font-size: 11px; color: #999; margin-top: 4px; }
.admin-question-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Badges */
.badge { font-size: 10px; padding: 2px 8px; border-radius: 4px; }
.badge-on { background: #E6F7EE; color: #00B578; }
.badge-off { background: #F5F5F5; color: #999; }
.badge-blue { background: #F0F4FF; color: #3370FF; }
.badge-orange { background: #FFF7E6; color: #FF8C00; }

/* Admin sub tabs */
.admin-sub-tabs {
  display: flex; gap: 0; background: #fff;
  border-bottom: 1px solid #E5E8EC;
}
.admin-sub-tab {
  flex: 1; padding: 10px 0; text-align: center; font-size: 13px;
  color: #999; cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; transition: .2s;
}
.admin-sub-tab.active { color: #3370FF; border-bottom-color: #3370FF; font-weight: 600; }

/* ===== Profile Page ===== */
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #3370FF, #5B8DFF);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 600;
  margin: 0 auto 8px;
}
.profile-name { font-size: 16px; font-weight: 600; color: #1A1A2E; text-align: center; }
.profile-dept { font-size: 12px; color: #999; text-align: center; margin-top: 2px; }

/* ===== Settings list ===== */
.settings-list {
  list-style: none; padding: 0;
}
.settings-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; font-size: 13px; color: #333;
  border-bottom: 1px solid #F0F0F0; cursor: pointer;
}
.settings-list li:last-child { border-bottom: none; }
.settings-list li .setting-val { color: #999; font-size: 12px; }

/* ===== Misc ===== */
.section-title {
  font-size: 14px; font-weight: 600; color: #1A1A2E;
  padding: 12px 16px 6px;
}
.empty-state {
  text-align: center; padding: 40px 20px; color: #999;
}
.empty-state svg { margin-bottom: 8px; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; margin-right: 4px;
}
.tag-blue { background: #F0F4FF; color: #3370FF; }
.tag-red { background: #FFF0F0; color: #FF6B6B; }

/* Scrollbar */
.page-container::-webkit-scrollbar { width: 3px; }
.page-container::-webkit-scrollbar-thumb { background: #D9DDE3; border-radius: 3px; }

/* ===== Toast ===== */
.toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: 420px; width: 90%;
}
.toast-item {
  background: #1A1A2E; color: #fff; padding: 12px 16px;
  border-radius: 8px; font-size: 13px; text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  pointer-events: auto;
}
.toast-item.error { background: #FF4D4F; }
.toast-item.success { background: #00B578; }
.toast-item.warning { background: #FF8C00; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===== Loading ===== */
.loading-spinner {
  text-align: center; padding: 40px 20px; color: #999;
}
.loading-spinner::before {
  content: ''; display: inline-block; width: 24px; height: 24px;
  border: 2px solid #E5E8EC; border-top-color: #3370FF; border-radius: 50%;
  animation: spin .6s linear infinite; margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Confirm Dialog ===== */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998; animation: fadeIn .2s ease;
}
.confirm-dialog {
  background: #fff; border-radius: 12px; padding: 24px; width: 280px;
  text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.confirm-dialog .confirm-title { font-size: 16px; font-weight: 600; color: #1A1A2E; margin-bottom: 8px; }
.confirm-dialog .confirm-body { font-size: 13px; color: #666; margin-bottom: 20px; line-height: 1.6; }
.confirm-dialog .confirm-buttons { display: flex; gap: 10px; }
.confirm-dialog .confirm-buttons .btn { flex: 1; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Filter bar for admin ===== */
.filter-bar {
  display: flex; gap: 8px; padding: 12px 16px; align-items: center;
}
.filter-bar .filter-input {
  flex: 1; padding: 8px 12px; border: 1px solid #D9DDE3;
  border-radius: 8px; font-size: 13px; color: #333; outline: none;
}
.filter-bar .filter-input:focus { border-color: #3370FF; }

/* ===== Question Preview in admin ===== */
.question-preview-block {
  border: 1px solid #E5E8EC; border-radius: 8px; padding: 14px;
  margin-bottom: 10px; background: #FAFBFF;
}
.question-preview-block .qp-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}


/* skeleton pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}


/* ===== 全屏按钮 ===== */
.landscape-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  pointer-events: auto;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.landscape-btn svg {
  width: 18px;
  height: 18px;
}
.landscape-btn:active {
  background: rgba(255,255,255,0.5);
}
/* 全屏模式 */
.video-small.landscape-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #000;
}
.video-small.landscape-mode video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.video-small.landscape-mode .landscape-btn {
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
}
/* 系统横屏自适应 */
@media (orientation: landscape) and (max-height: 500px) {
  .video-small {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    background: #000;
  }
  .video-small video {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
