/* 大运智安 - 学员端H5全局样式 */
:root {
  --primary: #1E6FFF;
  --primary-dark: #0B4FD6;
  --accent: #00C9A7;
  --bg: #F4F7FB;
  --card: #FFFFFF;
  --text: #1A2233;
  --text-light: #6B7A90;
  --border: #E6EBF2;
  --danger: #F44E5A;
  --warn: #FF9500;
  --success: #00C9A7;
  --gradient: linear-gradient(135deg, #1E6FFF 0%, #00C9A7 100%);
  --radius: 12px;
  --shadow: 0 4px 16px rgba(30, 111, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---------- 通用组件 ---------- */
.page { max-width: 480px; margin: 0 auto; padding-bottom: 80px; }

.btn {
  display: block; width: 100%; padding: 14px;
  border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; cursor: pointer;
  background: var(--gradient); color: #fff;
  transition: opacity 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; }
.btn-outline {
  background: #fff; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-lg { padding: 16px; font-size: 17px; }

.input-group { margin-bottom: 18px; }
.input-group label { display: block; font-size: 14px; color: var(--text-light); margin-bottom: 8px; }
.input-group input {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 16px; outline: none; background: #fff;
  transition: border-color 0.2s;
}
.input-group input:focus { border-color: var(--primary); }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--gradient); color: #fff;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: 0.85; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.pill-blue { background: rgba(30,111,255,0.1); color: var(--primary); }
.pill-green { background: rgba(0,201,167,0.12); color: #009B80; }
.pill-orange { background: rgba(255,149,0,0.12); color: var(--warn); }
.pill-red { background: rgba(244,78,90,0.1); color: var(--danger); }

.empty { text-align: center; color: var(--text-light); padding: 60px 0; }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

.loading { text-align: center; color: var(--text-light); padding: 30px 0; }
.spinner {
  width: 28px; height: 28px; margin: 0 auto 10px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}
.tabbar .tab {
  flex: 1; text-align: center; padding: 6px 0;
  color: var(--text-light); font-size: 12px; text-decoration: none;
}
.tabbar .tab.active { color: var(--primary); font-weight: 600; }
.tabbar .tab .t-icon { font-size: 22px; display: block; margin-bottom: 2px; }

/* ---------- 登录页 ---------- */
.login-hero {
  background: var(--gradient);
  padding: 56px 24px 40px; text-align: center; color: #fff;
  border-radius: 0 0 32px 32px;
}
.login-hero .logo {
  width: 72px; height: 72px; margin: 0 auto 16px;
  background: rgba(255,255,255,0.15); border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; backdrop-filter: blur(4px);
}
.login-hero h2 { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.login-hero p { font-size: 13px; opacity: 0.85; margin-top: 6px; }
.login-form { padding: 28px 24px; }
.login-form .tip { font-size: 12px; color: var(--text-light); text-align: center; margin-top: 16px; }

/* ---------- 课程列表 ---------- */
.course-card { display: flex; gap: 12px; cursor: pointer; text-decoration: none; color: inherit; }
.course-cover {
  width: 96px; height: 72px; border-radius: 8px; flex-shrink: 0;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 700;
}
.course-info { flex: 1; min-width: 0; }
.course-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-info .meta { font-size: 12px; color: var(--text-light); display: flex; gap: 12px; flex-wrap: wrap; }

.cat-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; padding: 7px 16px; border-radius: 20px;
  background: #fff; border: 1.5px solid var(--border);
  font-size: 13px; color: var(--text-light); cursor: pointer;
}
.cat-tab.active { background: var(--gradient); color: #fff; border-color: transparent; }

/* ---------- 课程详情 ---------- */
.course-detail-hero {
  background: var(--gradient); color: #fff; padding: 24px 20px 20px;
  border-radius: 0 0 24px 24px;
}
.course-detail-hero h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.course-detail-hero .meta { font-size: 12px; opacity: 0.9; display: flex; gap: 14px; }
.course-detail-hero .desc { font-size: 13px; opacity: 0.85; margin-top: 10px; line-height: 1.6; }
.progress-bar {
  margin-top: 14px; background: rgba(255,255,255,0.25);
  height: 6px; border-radius: 3px; overflow: hidden;
}
.progress-bar .fill { height: 100%; background: #fff; border-radius: 3px; transition: width 0.4s; }

.ware-item { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.ware-item .w-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: rgba(30,111,255,0.08); color: var(--primary);
}
.ware-item .w-info { flex: 1; min-width: 0; }
.ware-item .w-info h4 { font-size: 14px; font-weight: 600; }
.ware-item .w-info .w-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.ware-item .w-status { flex-shrink: 0; }

/* ---------- 播放页 ---------- */
.player-wrap { background: #000; position: sticky; top: 0; z-index: 10; }
.player-wrap video { width: 100%; max-height: 56vh; display: block; background: #000; }
.quiz-tip {
  background: rgba(0,201,167,0.1); border: 1px solid rgba(0,201,167,0.3);
  color: #009B80; border-radius: var(--radius);
  padding: 12px 14px; font-size: 13px; margin: 12px 0;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  width: 86%; max-width: 380px; background: #fff; border-radius: 16px;
  padding: 24px; text-align: center;
}
.modal h3 { font-size: 17px; margin-bottom: 10px; }
.modal p { font-size: 14px; color: var(--text-light); margin-bottom: 20px; }
.modal .btn { margin-bottom: 10px; }

/* 测验 */
.quiz-option {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; margin-bottom: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: #fff; font-size: 15px; cursor: pointer;
  transition: all 0.2s;
}
.quiz-option:active { transform: scale(0.99); }
.quiz-option.correct { border-color: var(--success); background: rgba(0,201,167,0.08); }
.quiz-option.wrong { border-color: var(--danger); background: rgba(244,78,90,0.08); }
.quiz-option.highlight { border-color: var(--success); background: rgba(0,201,167,0.15); font-weight: 600; }
.quiz-hint { font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.quiz-hint.l1 { background: rgba(255,149,0,0.1); color: #C77A00; }
.quiz-hint.l2 { background: rgba(30,111,255,0.08); color: var(--primary); }
.quiz-hint.l3 { background: rgba(0,201,167,0.1); color: #009B80; }

/* 进度条（测验） */
.quiz-progress { display: flex; gap: 4px; margin-bottom: 20px; }
.quiz-progress .dot { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.quiz-progress .dot.done { background: var(--success); }
.quiz-progress .dot.current { background: var(--primary); }
