/* 道路运输安全学习系统 - 手机端 H5 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f3f5f9; color: #1f2329; font-size: 15px; line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app { max-width: 640px; margin: 0 auto; min-height: 100vh; background: #f3f5f9; padding-bottom: 66px; }
.app.nobar { padding-bottom: 0; }

/* 顶部 */
.nav { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid #eceff4; height: 50px; display: flex; align-items: center; padding: 0 16px; gap: 10px; }
.nav .back { font-size: 19px; color: #5b6473; }
.nav .title { font-size: 16.5px; font-weight: 600; flex: 1; text-align: center; padding-right: 22px; }
.nav .right { font-size: 13px; color: #8a9099; }

/* 首页头图 */
.hero { background: linear-gradient(135deg, #2f6bff, #1b47b5); color: #fff; padding: 20px 18px 46px; border-radius: 0 0 18px 18px; }
.hero .hi { font-size: 13px; opacity: .85; }
.hero h1 { font-size: 20px; font-weight: 700; margin-top: 4px; }
.hero .meta { font-size: 12.5px; opacity: .85; margin-top: 6px; }

/* 卡片 */
.card { background: #fff; border-radius: 14px; margin: 12px 14px; padding: 15px 16px; box-shadow: 0 2px 10px rgba(20,38,66,.05); }
.card h2 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card h2::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: #2f6bff; }
.card h2 .more { margin-left: auto; font-size: 12.5px; font-weight: 400; color: #8a9099; }

/* 任务卡 */
.task { border: 1px solid #eceff4; border-radius: 12px; padding: 13px; margin-bottom: 12px; }
.task:last-child { margin-bottom: 0; }
.task-head { display: flex; align-items: flex-start; gap: 8px; }
.task-head .t { flex: 1; min-width: 0; }
.task-head .pct { flex: none; font-size: 12.5px; color: #8a9099; white-space: nowrap; padding-top: 1px; }
.task-head .pct b { font-size: 14px; color: #2f6bff; font-weight: 600; }
.task .t { font-weight: 600; font-size: 15px; }
.task .sub { font-size: 12.5px; color: #8a9099; margin-top: 4px; }
.task .bar { height: 7px; border-radius: 4px; background: #eff2f7; margin: 11px 0 8px; overflow: hidden; }
.task .bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f6bff, #5b8bff); border-radius: 4px; }
.task .foot { display: flex; align-items: center; gap: 10px; }
.task .foot .muted { color: #8a9099; font-size: 12.5px; margin-right: auto; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 10px; border: 0; background: #2f6bff; color: #fff; font-size: 15px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn:active { background: #245ae6; }
.btn.block { display: flex; width: 100%; height: 46px; font-size: 16px; }
.btn.ghost { background: #fff; color: #2f6bff; border: 1px solid #cfdcff; }
.btn.gray { background: #f2f4f8; color: #5b6473; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: #e5484d; }
.btn:disabled, .btn.disabled { opacity: .5; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: #5b6473; margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%; height: 46px; border: 1px solid #e2e5ea; border-radius: 10px; padding: 0 14px; font-size: 15px; font-family: inherit; background: #fff; color: #1f2329; outline: none;
}
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #2f6bff; box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.field .hint { font-size: 12px; color: #8a9099; margin-top: 5px; }

/* 列表行 */
.list .row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f2f4f8; }
.list .row:last-child { border-bottom: 0; }
.list .row .ico { width: 36px; height: 36px; border-radius: 10px; background: #eef3ff; color: #2f6bff; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.list .row .txt { flex: 1; }
.list .row .txt .t { font-size: 14.5px; font-weight: 600; }
.list .row .txt .s { font-size: 12.5px; color: #8a9099; }
.list .row .arrow { color: #c4ccd8; font-size: 15px; }

/* 标签 */
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 11px; line-height: 1.6; }
.badge.ok { background: #eaf7ee; color: #14a44d; }
.badge.warn { background: #fff3e6; color: #e8730c; }
.badge.bad { background: #fdeef0; color: #e5484d; }
.badge.gray { background: #eff1f5; color: #5b6473; }
.badge.blue { background: #eef3ff; color: #2f6bff; }

/* 证件 */
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cert { border: 1px solid #eceff4; border-radius: 12px; padding: 10px; text-align: center; position: relative; overflow: hidden; }
.cert img { width: 100%; height: 108px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.cert .ph { height: 108px; border-radius: 8px; background: #f6f8fb; color: #9aa1ad; display: flex; align-items: center; justify-content: center; font-size: 13px; margin-bottom: 8px; }
.cert .n { font-size: 13.5px; font-weight: 600; }
.cert .d { font-size: 12px; color: #8a9099; margin-top: 2px; }
.cert .tag { position: absolute; left: 8px; top: 8px; }

/* 学习流程 */
.steps { display: flex; align-items: center; gap: 6px; padding: 12px 14px; background: #fff; border-bottom: 1px solid #eceff4; font-size: 12px; overflow-x: auto; }
.steps span { color: #9aa1ad; white-space: nowrap; }
.steps span.on { color: #2f6bff; font-weight: 700; }
.steps span.done { color: #14a44d; }

.video-wrap { background: #000; position: relative; }
.video-wrap video { width: 100%; max-height: 46vh; display: block; background: #000; }
.video-bar { background: #fff; padding: 12px 16px; border-bottom: 1px solid #f2f4f8; }
.video-bar .t { font-weight: 600; font-size: 15px; }
.video-bar .s { font-size: 12.5px; color: #8a9099; margin-top: 3px; }

/* 题目 */
.q { border-bottom: 1px solid #f2f4f8; padding: 14px 0; }
.q .idx { font-size: 12.5px; color: #8a9099; }
.q .text { font-size: 15px; font-weight: 600; margin: 5px 0 10px; }
.opt { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #e2e5ea; border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; font-size: 14.5px; }
.opt.on { border-color: #2f6bff; background: #f4f8ff; }
.opt b { color: #2f6bff; flex: none; }

/* 底部导航 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid #eceff4; display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; text-align: center; font-size: 12px; color: #8a9099; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabbar a i { font-size: 19px; font-style: normal; line-height: 1; }
.tabbar a.on { color: #2f6bff; font-weight: 600; }

/* 通用 */
.muted { color: #8a9099; font-size: 12.5px; }
.btn, .btn.sm { min-height: 44px; }
.btn.sm { height: 44px; padding: 0 14px; font-size: 14px; }
.btn.block { min-height: 48px; }
.nav .back { width: 44px; height: 44px; margin-left: -10px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.tabbar a { min-height: 54px; justify-content: center; padding: 5px 0; }
.tap-expand { position: relative; }
.tap-expand::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 100%; min-width: 44px; height: 100%; min-height: 44px; }
.toast { pointer-events: none; }
.empty { text-align: center; color: #9aa1ad; padding: 40px 0; font-size: 14px; }
.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(20,26,36,.88); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; z-index: 99; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 80%; text-align: center; }
.toast.show { opacity: 1; }
.mask { position: fixed; inset: 0; background: rgba(16,24,40,.55); z-index: 50; display: none; }
.mask.open { display: block; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; transform: translateY(100%); transition: transform .25s; }
.sheet.open { transform: translateY(0); }
.sheet h3 { font-size: 16px; margin-bottom: 12px; text-align: center; }

/* 签名板 */
.sign-pad { border: 1px dashed #d5dae3; border-radius: 12px; background: #fbfcfe; }
.sign-pad canvas { width: 100%; height: 210px; display: block; touch-action: none; border-radius: 12px; }

/* ============ 分步学习流程 ============ */
.stepbar { display: flex; gap: 4px; background: #fff; padding: 12px 10px; margin: 10px 14px 0; border-radius: 14px; box-shadow: 0 2px 10px rgba(20,38,66,.05); }
.stepbar .st { flex: 1; text-align: center; position: relative; font-size: 11.5px; color: #9aa1ad; line-height: 1.5; }
.stepbar .st i { display: flex; width: 26px; height: 26px; margin: 0 auto 5px; border-radius: 50%; background: #f1f4f9; color: #9aa1ad; align-items: center; justify-content: center; font-style: normal; font-size: 13px; border: 1px solid #e6eaf1; }
.stepbar .st.on { color: #2f6bff; font-weight: 600; }
.stepbar .st.on i { background: #2f6bff; color: #fff; border-color: #2f6bff; box-shadow: 0 4px 12px rgba(47,107,255,.3); }
.stepbar .st.done { color: #14a44d; }
.stepbar .st.done i { background: #eaf7ee; color: #14a44d; border-color: #c9ecd5; }

.step-pane { display: none; }
.step-pane.on { display: block; animation: paneIn .28s ease; }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.step-head .no { width: 28px; height: 28px; border-radius: 9px; background: #eef3ff; color: #2f6bff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.step-head .tt { flex: 1; }
.step-head .tt .t { font-size: 15px; font-weight: 700; }
.step-head .tt .s { font-size: 12px; color: #8a9099; }

.step-note { background: #f7f9fc; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #6b7482; line-height: 1.7; margin: 10px 0 4px; }

/* ============ 参考件风格弹窗 ============ */
.h5mask { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; padding: 22px; }
.h5mask.open { display: flex; }
.h5dlg { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 26px 20px 20px; text-align: center; box-shadow: 0 20px 55px rgba(10,20,40,.25); animation: dlgIn .22s ease; }
@keyframes dlgIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.h5dlg h3 { font-size: 20px; font-weight: 700; line-height: 1.5; color: #1f2329; margin-bottom: 18px; }
.h5dlg .pbox { border: 1px solid #e9ecf1; border-radius: 12px; min-height: 168px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #bcc3ce; font-size: 15px; margin-bottom: 18px; overflow: hidden; }
.h5dlg .pbox img { width: 100%; height: 168px; object-fit: cover; }
.h5dlg .pbox svg { opacity: .55; }
.btn.green { background: #22c55e; }
.btn.green:active { background: #16a34a; }
.btn.ghost-green { background: #fff; color: #16a34a; border: 1px solid #b7ecc8; }
.h5dlg .extra { margin-top: 12px; font-size: 13px; color: #8a9099; }

/* 未学完退出确认 */
.exit-mask { position: fixed; inset: 0; z-index: 75; background: rgba(0, 0, 0, .48); display: none; align-items: center; justify-content: center; padding: 24px; }
.exit-mask.open { display: flex; }
.exit-dlg { width: 100%; max-width: 360px; background: #fff; border-radius: 18px; padding: 24px 20px 20px; text-align: center; box-shadow: 0 20px 55px rgba(10, 20, 40, .28); animation: dlgIn .22s ease; }
.exit-dlg h3 { font-size: 20px; font-weight: 700; line-height: 1.5; color: #1f2329; }
.exit-dlg p { margin-top: 10px; font-size: 14px; line-height: 1.7; color: #6b7482; }
.exit-dlg p b { color: #2f6bff; font-weight: 600; }
.exit-actions { display: flex; gap: 10px; margin-top: 20px; }
.exit-actions .exit-btn { flex: 1; min-height: 46px; border: 0; border-radius: 10px; font-size: 15px; font-family: inherit; cursor: pointer; }
.exit-actions .exit-btn.cancel { background: #f1f4f9; color: #4b5563; }
.exit-actions .exit-btn.danger { background: #2f6bff; color: #fff; }
.h5dlg .extra a { color: #2f6bff; }

/* 全屏签名（参考件：左侧竖排 清除 / 提交签名 / 取消） */
.signfull { position: fixed; inset: 0; z-index: 80; background: #fff; display: none; }
.signfull.open { display: block; }
.signfull .top { height: 50px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; color: #1f2329; border-bottom: 1px solid #f0f2f6; }
.signfull .tools { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 12px; }
.signfull .tools button { width: 46px; height: 96px; border: 1px solid #e3e7ee; background: #fafbfc; border-radius: 10px; color: #5b6473; font-size: 15px; font-family: inherit; writing-mode: vertical-rl; letter-spacing: 2px; padding: 8px 0; }
.signfull .tools button.primary { color: #1f2329; font-weight: 600; }
.signfull .padwrap { position: absolute; left: 66px; right: 14px; top: 66px; bottom: 20px; border: 1px solid #dfe4ec; border-radius: 4px; overflow: hidden; background: #fff; }
.signfull .padwrap canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.signfull .hint { position: absolute; left: 66px; right: 14px; bottom: 4px; text-align: center; font-size: 11.5px; color: #c1c7d2; }

/* 公司提示条（前台沿用后台风格） */
.tipbar { display: flex; gap: 10px; align-items: flex-start; background: #f4f6fa; border-radius: 12px; padding: 11px 13px; margin: 10px 14px 0; font-size: 13px; color: #4a5666; }
.tipbar .dot { width: 24px; height: 24px; border-radius: 50%; background: #e6eaf2; color: #8a93a3; display: flex; align-items: center; justify-content: center; flex: none; font-size: 12px; }
.tipbar b { color: #1f2937; }
.tipbar .s { font-size: 12px; color: #8a93a3; margin-top: 2px; }

/* 进度环 */
.circle { display: flex; gap: 14px; }
.circle .item { flex: 1; text-align: center; background: #f7f9fc; border-radius: 12px; padding: 12px 6px; }
.circle .item .n { font-size: 22px; font-weight: 700; color: #2f6bff; }
.circle .item .l { font-size: 12px; color: #8a9099; }

@media (max-width: 360px) {
    .hero h1 { font-size: 18px; }
    .cert-grid { grid-template-columns: 1fr; }
}

/* ===== 手机端 H5 可读性增强（正文 16px 起） ===== */
html { -webkit-text-size-adjust: 100%; }
body { font-size: 16px; line-height: 1.65; }
.nav { height: 54px; }
.nav .title { font-size: 17.5px; }
.nav .right { font-size: 14px; }
.hero { padding: 22px 18px 48px; }
.hero .hi { font-size: 14px; }
.hero h1 { font-size: 22px; }
.hero .meta { font-size: 13.5px; }
.card { padding: 16px 17px; }
.card h2 { font-size: 17px; margin-bottom: 14px; }
.card h2 .more { font-size: 13px; }
.task { padding: 14px; }
.task .t { font-size: 16px; }
.task-head .pct { font-size: 13.5px; }
.task-head .pct b { font-size: 15px; }
.task .sub { font-size: 13.5px; }
.task .foot .muted { font-size: 13.5px; }
.btn { height: 44px; padding: 0 19px; font-size: 16px; }
.btn.block { height: 50px; font-size: 17px; }
.btn.sm { height: 44px; padding: 0 14px; font-size: 14.5px; }
.btn.block { min-height: 50px; }
.field { margin-bottom: 16px; }
.field label { font-size: 14.5px; margin-bottom: 7px; }
.field input, .field select, .field textarea { height: 48px; padding: 0 15px; font-size: 16px; }
.field textarea { padding: 13px 15px; }
.field .hint { font-size: 13px; line-height: 1.6; }
.list .row { padding: 13px 0; }
.list .row .txt .t { font-size: 15.5px; }
.list .row .txt .s { font-size: 13.5px; }
.list .row .arrow { font-size: 16px; }
.badge { font-size: 12.5px; padding: 2px 9px; }
.cert .ph { font-size: 13.5px; }
.cert .n { font-size: 14px; }
.cert .d { font-size: 13px; }
.steps { font-size: 13px; padding: 12px 14px; }
.video-bar .t { font-size: 16px; }
.video-bar .s { font-size: 13.5px; }
.q .idx { font-size: 13px; }
.q .text { font-size: 16.5px; line-height: 1.6; }
.opt { font-size: 15.5px; padding: 12px 13px; line-height: 1.6; }
.tabbar a { font-size: 13px; }
.tabbar a i { font-size: 20px; }
.muted { font-size: 13.5px; }
.empty { font-size: 15px; }
.toast { font-size: 15px; padding: 12px 18px; }
.sheet h3 { font-size: 17px; }
.stepbar .st { font-size: 12.5px; }
.step-head .no { font-size: 15px; }
.step-head .tt .t { font-size: 16px; }
.step-head .tt .s { font-size: 13px; }
.step-note { font-size: 13px; }
.h5dlg h3 { font-size: 21px; }
.h5dlg .pbox { font-size: 16px; }
.h5dlg .extra { font-size: 14px; }
.signfull .top { font-size: 17px; }
.signfull .tools button { font-size: 16px; }
.signfull .hint { font-size: 12.5px; }
.tipbar { font-size: 14px; }
.tipbar .s { font-size: 13px; }
.circle .item .n { font-size: 23px; }
.circle .item .l { font-size: 13px; }

/* 前台学习视频：隐藏原生控制条，只保留顺序播放 */
.video-wrap video::-webkit-media-controls,
.video-wrap video::-webkit-media-controls-enclosure,
.video-wrap video::-webkit-media-controls-panel { display: none !important; }
.video-cover { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(0, 0, 0, .18); color: #fff; transition: opacity .2s ease; cursor: pointer; }
.video-cover:not(.show) { opacity: 0; pointer-events: none; }
.video-cover .play-circle { width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding-left: 4px; background: rgba(0, 150, 136, .92); box-shadow: 0 6px 20px rgba(0, 0, 0, .28); font-size: 24px; line-height: 1; }
.video-cover .cover-text { font-size: 14px; letter-spacing: .5px; text-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.video-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 22px 14px 10px; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .72) 55%, rgba(0, 0, 0, .86) 100%); }
.video-controls .vc-play { height: 32px; padding: 0 13px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 13.5px; font-family: inherit; cursor: pointer; }
.video-controls .vc-time { color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.video-controls .vc-lock { margin-left: auto; padding: 4px 8px; border-radius: 3px; background: rgba(0, 150, 136, .38); color: #d5f7ef; font-size: 11.5px; white-space: nowrap; }
