/* ============ 置恒卓能 · 培训平台 H5 ============ */
:root {
  --brand: #12508F;
  --brand-2: #1E7FC2;
  --brand-3: #0C3A6B;
  --accent: #F0A32C;
  --ok: #159B6B;
  --warn: #D97706;
  --danger: #D64545;
  --text: #16283C;
  --muted: #6B7A8C;
  --line: #E6EBF1;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(18, 48, 79, .07);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hide { display: none !important; }

#phone { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
@media (min-width: 700px) {
  body { background: #E9EEF5; }
  #phone { box-shadow: 0 0 40px rgba(15, 42, 71, .12); }
}

/* ---------- 顶部 ---------- */
.hero {
  background: linear-gradient(135deg, #0C3A6B 0%, #12508F 45%, #1E7FC2 100%);
  color: #fff; padding: 18px 18px 62px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0) 70%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-logo { height: 30px; width: auto; }
.hero-user { display: flex; align-items: center; gap: 10px; margin-top: 22px; position: relative; z-index: 1; }
.avatar {
  width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-weight: 700; font-size: 17px; color: #fff;
  border: 1px solid rgba(255,255,255,.3); overflow: hidden; flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-user h1 { font-size: 19px; margin: 0 0 3px; font-weight: 650; letter-spacing: .3px; }
.hero-user p { margin: 0; font-size: 12px; color: rgba(255,255,255,.75); }
.badge-dept {
  display: inline-block; margin-top: 5px; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); color: #fff;
}

/* ---------- 卡片 ---------- */
.wrap { padding: 0 14px 96px; margin-top: -46px; position: relative; z-index: 2; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 15px 6px; }
.stat { text-align: center; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 12%; height: 76%; width: 1px; background: var(--line); }
.stat b { display: block; font-size: 21px; font-weight: 700; color: var(--brand); letter-spacing: .5px; }
.stat span { font-size: 11.5px; color: var(--muted); }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; }
.section-title h2 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.section-title .more { font-size: 12px; color: var(--muted); }

/* ---------- 搜索 & 标签 ---------- */
.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px;
  padding: 9px 12px; margin-top: 14px; box-shadow: var(--shadow); border: 1px solid transparent;
}
.search input { border: 0; outline: 0; flex: 1; font-size: 14px; background: transparent; color: var(--text); }
.search svg { flex: 0 0 auto; opacity: .5; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 999px; background: #fff; color: var(--muted);
  font-size: 13px; border: 1px solid var(--line); cursor: pointer; transition: .18s;
}
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(18,80,143,.24); }

/* ---------- 课程卡 ---------- */
.course-list { display: grid; gap: 12px; }
.course {
  display: flex; gap: 12px; padding: 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  border: 1px solid rgba(230,235,241,.9); cursor: pointer; transition: transform .15s;
}
.course:active { transform: scale(.985); }
.course-cover {
  width: 86px; height: 86px; border-radius: 12px; flex: 0 0 auto; overflow: hidden;
  background: linear-gradient(135deg, #E8F1FA, #D3E5F6); position: relative;
  display: grid; place-items: center;
}
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-cover .cv-txt {
  font-size: 12px; font-weight: 700; color: var(--brand); text-align: center; padding: 6px; line-height: 1.3;
  letter-spacing: .5px;
}
.course-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.course h3 { font-size: 15px; margin: 0 0 4px; font-weight: 620; line-height: 1.35; }
.course .sub { font-size: 12px; color: var(--muted); margin: 0 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { font-size: 10.5px; padding: 2px 7px; border-radius: 5px; background: #EEF3F9; color: #4A6076; }
.chip.dept { background: #FFF3E0; color: #B26B00; }
.chip.public { background: #E8F5EE; color: #157A54; }
.chip.exam { background: #EAF1FB; color: var(--brand); }
.chip.ok { background: #E8F5EE; color: #157A54; }
.bar { height: 5px; border-radius: 999px; background: #EDF1F6; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 999px; transition: width .4s; }
.course-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.course-foot .pct { color: var(--brand); font-weight: 650; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ico { font-size: 34px; margin-bottom: 8px; opacity: .55; }
.empty p { margin: 4px 0; font-size: 13px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 0 calc(6px + var(--safe-bottom)); z-index: 40;
}
.tabbar button {
  border: 0; background: none; padding: 6px 0; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 10.5px; color: #94A3B4; cursor: pointer;
}
.tabbar button.on { color: var(--brand); font-weight: 650; }
.tabbar svg { width: 22px; height: 22px; }

/* ---------- 课程详情 ---------- */
.detail-hero {
  background: linear-gradient(150deg, #0C3A6B, #1E7FC2); color: #fff; padding: 16px 18px 56px; position: relative;
}
.back-btn {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.16); border: 0;
  display: grid; place-items: center; color: #fff; cursor: pointer; margin-bottom: 12px;
}
.detail-hero h1 { font-size: 20px; margin: 0 0 8px; line-height: 1.35; }
.detail-hero .meta { font-size: 12px; color: rgba(255,255,255,.78); display: flex; gap: 12px; flex-wrap: wrap; }
.detail-body { margin-top: -44px; }
.intro { padding: 14px 15px; font-size: 13.5px; color: #43566B; line-height: 1.7; }
.continue {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border-top: 1px solid var(--line); background: linear-gradient(90deg, rgba(30,127,194,.06), transparent);
}
.continue .txt { font-size: 13px; color: #43566B; }
.continue .txt b { display: block; font-size: 14.5px; color: var(--text); }
.btn {
  border: 0; border-radius: 999px; padding: 9px 18px; font-size: 13.5px; font-weight: 620; cursor: pointer;
  background: var(--brand); color: #fff; box-shadow: 0 5px 14px rgba(18,80,143,.24); transition: .18s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid #C9DCF0; box-shadow: none; }
.btn.accent { background: linear-gradient(135deg, #F0A32C, #E08A12); box-shadow: 0 5px 14px rgba(224,138,18,.28); }
.btn.block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }

.chapter-list { padding: 4px 6px 10px; }
.chapter {
  display: flex; align-items: center; gap: 11px; padding: 12px 10px; border-radius: 12px; cursor: pointer;
}
.chapter + .chapter { border-top: 1px solid #F0F3F7; }
.chapter.on { background: #F2F7FD; }
.chapter .idx {
  width: 28px; height: 28px; border-radius: 9px; background: #EDF2F8; color: #5C738C; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; font-weight: 650;
}
.chapter.done .idx { background: #E6F5EE; color: var(--ok); }
.chapter .c-body { flex: 1; min-width: 0; }
.chapter .c-body strong { font-size: 13.8px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter .c-body span { font-size: 11.5px; color: var(--muted); }
.chapter .c-state { font-size: 11px; color: var(--muted); flex: 0 0 auto; }

/* ---------- 播放器 / 阅读 ---------- */
.player-shell { background: #0B1B2B; }
.player-shell video { width: 100%; display: block; background: #000; max-height: 56vh; }
.reader { background: #fff; padding: 18px 17px 28px; min-height: 50vh; font-size: 14.5px; line-height: 1.85; color: #2C3E50; }
.reader h3 { font-size: 15.5px; margin: 18px 0 8px; color: var(--brand-3); padding-left: 9px; border-left: 3px solid var(--brand-2); line-height: 1.3; }
.reader h3:first-child { margin-top: 0; }
.reader p { margin: 8px 0; }
.reader ul, .reader ol { padding-left: 20px; margin: 8px 0; }
.reader li { margin: 4px 0; }
.reader strong { color: #0C3A6B; }
.pdf-frame { width: 100%; height: 68vh; border: 0; background: #525659; }
.file-tip { padding: 34px 20px; text-align: center; }
.file-tip .ico { font-size: 40px; }
.file-tip p { color: var(--muted); font-size: 13px; }

.study-bar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto; background: #fff;
  border-top: 1px solid var(--line); padding: 10px 14px calc(10px + var(--safe-bottom));
  display: flex; gap: 10px; align-items: center; z-index: 30;
}
.study-bar .info { flex: 1; font-size: 12px; color: var(--muted); }
.study-bar .info b { display: block; color: var(--text); font-size: 13.5px; }

/* ---------- 考试 ---------- */
.exam-head {
  position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
}
.exam-head h1 { font-size: 15px; margin: 0; font-weight: 650; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand); font-size: 15px; }
.timer.low { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.q-wrap { padding: 14px 14px 120px; }
.q-card { background: #fff; border-radius: 14px; padding: 15px 15px 8px; box-shadow: var(--shadow); margin-bottom: 12px; }
.q-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.q-no { font-size: 12px; color: var(--brand); font-weight: 700; background: #EAF2FA; padding: 2px 7px; border-radius: 6px; flex: 0 0 auto; }
.q-title { font-size: 14.5px; font-weight: 560; line-height: 1.55; }
.q-type { font-size: 11px; color: var(--muted); margin-left: auto; flex: 0 0 auto; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 11px; margin-bottom: 8px; cursor: pointer; transition: .15s; background: #FCFDFE;
}
.opt .key {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #C9D4E0; display: grid; place-items: center;
  font-size: 11.5px; color: #6B7A8C; flex: 0 0 auto; font-weight: 650;
}
.opt .txt { font-size: 13.8px; line-height: 1.5; }
.opt.on { border-color: var(--brand-2); background: #F1F8FE; }
.opt.on .key { background: var(--brand); border-color: var(--brand); color: #fff; }
.exam-foot {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto; background: #fff;
  border-top: 1px solid var(--line); padding: 10px 14px calc(10px + var(--safe-bottom));
  display: flex; gap: 10px; align-items: center; z-index: 30;
}
.exam-foot .count { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.exam-foot .count b { color: var(--brand); font-size: 15px; }

/* ---------- 成绩 ---------- */
.result-hero { background: linear-gradient(160deg, #0C3A6B, #1E7FC2); padding: 26px 20px 60px; color: #fff; text-align: center; }
.ring { width: 132px; height: 132px; margin: 0 auto 10px; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; }
.ring .val b { font-size: 34px; font-weight: 700; letter-spacing: -1px; }
.ring .val span { font-size: 11px; opacity: .8; display: block; margin-top: -4px; }
.result-hero h1 { font-size: 19px; margin: 6px 0 4px; }
.result-hero p { margin: 0; font-size: 13px; color: rgba(255,255,255,.8); }
.result-wrap { padding: 0 14px 96px; margin-top: -40px; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 14px 6px; text-align: center; }
.result-grid div b { display: block; font-size: 16px; color: var(--brand); }
.result-grid div span { font-size: 11px; color: var(--muted); }
.review { padding: 4px 15px 12px; }
.review .r-q { padding: 12px 0; border-bottom: 1px dashed #E9EEF4; }
.review .r-q:last-child { border: 0; }
.review .r-t { font-size: 13.8px; font-weight: 560; margin-bottom: 6px; line-height: 1.5; }
.review .r-a { font-size: 12.5px; color: var(--muted); }
.review .r-a .good { color: var(--ok); font-weight: 650; }
.review .r-a .bad { color: var(--danger); font-weight: 650; }
.review .r-an { font-size: 12.5px; background: #F7F9FC; border-radius: 8px; padding: 8px 10px; margin-top: 6px; color: #4A6076; }

/* ---------- 我的 ---------- */
.profile-card { padding: 16px; display: flex; align-items: center; gap: 14px; }
.profile-card .avatar { background: linear-gradient(135deg, #1E7FC2, #12508F); width: 56px; height: 56px; font-size: 20px; border: 0; }
.profile-card h2 { margin: 0 0 4px; font-size: 17px; }
.profile-card p { margin: 0; font-size: 12.5px; color: var(--muted); }
.list-card { margin-top: 12px; overflow: hidden; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; }
.row-item + .row-item { border-top: 1px solid #F0F3F7; }
.row-item .ri-ico { width: 30px; height: 30px; border-radius: 9px; background: #EDF3FA; display: grid; place-items: center; font-size: 14px; }
.row-item .ri-body { flex: 1; min-width: 0; }
.row-item .ri-body strong { font-size: 13.8px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .ri-body span { font-size: 11.5px; color: var(--muted); }
.row-item .ri-right { text-align: right; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.row-item .ri-right b { display: block; font-size: 15px; color: var(--brand); }
.pill { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; }
.pill.ok { background: #E8F5EE; color: #157A54; }
.pill.no { background: #FDECEC; color: #C43A3A; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px; background: linear-gradient(165deg, #0C3A6B, #12508F 60%, #1E7FC2); }
.login-box { background: #fff; border-radius: 20px; padding: 24px 20px; box-shadow: 0 20px 50px rgba(4,20,38,.3); }
.login-box h1 { font-size: 19px; margin: 0 0 4px; }
.login-box p { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; font-size: 14px;
  outline: 0; background: #FBFCFE; transition: .15s;
}
.field input:focus, .field select:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(30,127,194,.1); }
.split { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; color: #A7B4C2; font-size: 11.5px; }
.split::before, .split::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.user-pick { display: grid; gap: 8px; max-height: 40vh; overflow: auto; }
.user-pick button {
  text-align: left; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 13.5px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.user-pick button span { font-size: 11.5px; color: var(--muted); }

/* ---------- Toast / 加载 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 12px); background: rgba(16,38,60,.92);
  color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none;
  transition: .25s; z-index: 99; max-width: 88vw; text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.loading { display: grid; place-items: center; padding: 60px 0; color: var(--muted); font-size: 13px; }
.spinner {
  width: 26px; height: 26px; border: 2.5px solid #E3EAF2; border-top-color: var(--brand-2);
  border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #EEF2F7 25%, #F6F8FB 50%, #EEF2F7 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
