/* 盛硕学习台 · 手机优先。颜色沿用培训文件（藏青 / 蓝 / 琥珀 / 红 / 绿） */
:root {
  --navy: #0b1f44; --blue: #0d3a8c; --blue-2: #2457b8; --sky: #e8eef9;
  --ink: #0e1a2b; --ink-2: #4e5a6a; --ink-3: #7b8594;
  --paper: #f2f3f5; --card: #ffffff; --rule: #dde2e8;
  --amber: #a86a12; --amber-bg: #fbf3e4; --red: #a3372a; --red-bg: #fbecea; --green: #3d6b47; --green-bg: #eaf3ec;
  --radius: 12px; --tabs-h: 60px;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--paper); }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 22px; } h2 { font-size: 19px; } h3 { font-size: 16.5px; }
p { margin: 0 0 .6em; }
small, .muted { color: var(--ink-3); font-size: 13.5px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 顶栏 */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; letter-spacing: .05em; }
.brand img { height: 22px; width: auto; }
.brand span { font-size: 15px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.35); }
.top-right { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #c9d4ea; }
.top-right a { color: #fff; }

.app { max-width: 880px; margin: 0 auto; padding: 14px 16px calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); min-height: 70vh; }
.app.wide { max-width: 1180px; }
.loading { padding: 40px 0; text-align: center; color: var(--ink-3); }

/* 底部导航 */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: rgba(255,255,255,.96); border-top: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); font-size: 11.5px;
  -webkit-tap-highlight-color: transparent; position: relative; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--blue); font-weight: 600; }
.tabs a.on::before { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--blue); }
@media (min-width: 900px) {
  .tabs a.on::before { top: auto; bottom: 0; border-radius: 3px 3px 0 0; }
  .tabs { top: calc(52px + env(safe-area-inset-top)); bottom: auto; height: 46px; justify-content: center; border-top: 0; border-bottom: 1px solid var(--rule); padding: 0; }
  .tabs a { flex: 0 0 auto; flex-direction: row; gap: 6px; padding: 0 22px; font-size: 14.5px; }
  .tabs svg { width: 19px; height: 19px; }
  .app { padding-top: 64px; padding-bottom: 40px; }
}

/* 卡片和列表 */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.card.flat { box-shadow: none; }
.card h2, .card h3 { margin-bottom: .35em; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 18px 2px 8px; }
.section-title h2 { margin: 0; font-size: 17px; }
.list { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--rule); color: inherit; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .sub { color: var(--ink-3); font-size: 13.5px; }
.row .chev { color: var(--ink-3); font-size: 20px; line-height: 1; }
a.row:active { background: var(--sky); }

.hero { background: var(--navy); color: #e9eef7; border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  background-image: linear-gradient(#132c5c 1px, transparent 1px), linear-gradient(90deg, #132c5c 1px, transparent 1px); background-size: 22px 22px; }
.hero h1 { color: #fff; margin-bottom: 4px; }
.hero p { color: #b9c6df; margin: 0; font-size: 14px; }
.hero .btn { margin-top: 12px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--blue); background: var(--blue); color: #fff; font-weight: 600; cursor: pointer; text-align: center; }
.btn.ghost { background: #fff; color: var(--blue); }
.btn.light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btns .btn { flex: 1 1 auto; }
.linkbtn { background: none; border: 0; color: var(--blue); padding: 0; cursor: pointer; font-size: inherit; }

/* 标签 */
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--sky); color: var(--blue); white-space: nowrap; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.gray { background: #eceef1; color: var(--ink-2); }
.grade { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; font-weight: 800; font-size: 18px; color: #fff; background: var(--ink-3); }
.grade.A { background: var(--green); } .grade.B { background: var(--blue); } .grade.C { background: var(--amber); } .grade.D { background: var(--red); }

/* 进度条 */
.bar { height: 6px; border-radius: 3px; background: #e3e7ec; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue-2); border-radius: 3px; }
.bar.done > i { background: var(--green); }

/* 提示框 */
.note { border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14.5px; background: var(--sky); color: var(--navy); }
.note.amber { background: var(--amber-bg); color: #6f470c; }
.note.red { background: var(--red-bg); color: #7d2a20; }
.note.green { background: var(--green-bg); color: #2c5034; }
.ai-off { display: flex; gap: 10px; align-items: flex-start; border: 1px dashed #c9a46a; background: var(--amber-bg); color: #6f470c; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14.5px; }
.ai-off b { white-space: nowrap; }

/* 表单 */
label.f { display: block; margin: 0 0 12px; }
label.f > span { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #c5ccd6; border-radius: 10px; background: #fff; font-size: 16px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db7e6; border-color: var(--blue-2); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--blue); }

/* 选择题 */
.q { margin: 0 0 16px; }
.q .stem { font-weight: 600; margin-bottom: 8px; }
.q .stem .no { color: var(--blue); margin-right: 4px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid #c9d0da; border-radius: 10px; background: #fff; cursor: pointer; text-align: left; width: 100%; line-height: 1.5; }
.opt .k { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1.5px solid #9aa5b4; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.opt.sel { border-color: var(--blue); background: var(--sky); }
.opt.sel .k { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt.right { border-color: var(--green); background: var(--green-bg); }
.opt.right .k { background: var(--green); border-color: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-bg); }
.opt.wrong .k { background: var(--red); border-color: var(--red); color: #fff; }
.opt[disabled] { cursor: default; }
.explain { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--blue); background: #f6f8fb; border-radius: 0 8px 8px 0; font-size: 14.5px; }
.explain .cite { display: block; margin-top: 4px; color: var(--ink-3); font-size: 13px; }

/* 视频 */
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; margin: 0 -16px 10px; }
@media (min-width: 700px) { .player { margin: 0 0 12px; } }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.vbar .speed { display: inline-flex; border: 1px solid #c9d0da; border-radius: 8px; overflow: hidden; }
.vbar .speed button { border: 0; background: #fff; padding: 6px 10px; min-height: 34px; font-size: 14px; cursor: pointer; }
.vbar .speed button.on { background: var(--blue); color: #fff; }
.pop { position: absolute; inset: 0; z-index: 5; background: rgba(11,31,68,.94); color: #fff; overflow: auto; padding: 14px; display: flex; flex-direction: column; }
.pop .card { color: var(--ink); margin: auto 0; }
.popq { position: fixed; inset: 0; z-index: 50; background: rgba(11,31,68,.6); display: flex; align-items: flex-end; justify-content: center; }
.popq .sheet { width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .popq { align-items: center; } .popq .sheet { border-radius: 16px; } }
.marks { position: relative; height: 10px; margin: -4px 0 10px; }
.marks i { position: absolute; top: 0; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--amber); }
.marks i.ok { background: var(--green); }

/* 考试 */
.timer { position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; margin: -4px -4px 12px;
  background: #fff; border: 1px solid var(--rule); border-radius: 10px; font-weight: 600; }
@media (min-width: 900px) { .timer { top: calc(100px + env(safe-area-inset-top)); } }
.timer .left { font-variant-numeric: tabular-nums; font-size: 18px; color: var(--blue); }
.timer .left.hurry { color: var(--red); }
.score-big { font-size: 44px; font-weight: 800; line-height: 1; }

/* 文章 / 资料包 */
.doc { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; }
.doc h1 { font-size: 20px; } .doc h2 { font-size: 17.5px; margin-top: 1em; } .doc h3 { font-size: 16px; margin-top: 1em; }
.doc blockquote { margin: 0 0 .8em; padding: 6px 12px; border-left: 3px solid var(--rule); color: var(--ink-2); background: #f7f8fa; }
.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 1em 0; }
.doc code { background: #f0f2f5; padding: 0 4px; border-radius: 4px; font-size: .92em; }
.doc ul, .doc ol { padding-left: 1.4em; margin: 0 0 .8em; }
.tbl-wrap { overflow-x: auto; margin: 0 0 12px; -webkit-overflow-scrolling: touch; }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; background: #fff; }
table.t th, table.t td { border: 1px solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
table.t th { background: #eef1f5; font-weight: 600; white-space: nowrap; }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.bad td { background: var(--red-bg); }
table.t tr.ok td { background: var(--green-bg); }
.iframe-doc { width: 100%; height: 75vh; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }

/* 聊天 */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bubble { max-width: 88%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.bubble.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: #fff; border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
.bubble.sys { align-self: center; background: transparent; color: var(--ink-3); font-size: 13px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 48px; height: 48px; }
.iconbtn { flex: 0 0 44px; height: 44px; border-radius: 10px; border: 1px solid #c5ccd6; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn.rec { background: var(--red); border-color: var(--red); }
.iconbtn.rec svg { stroke: #fff; }
.src { font-size: 13.5px; border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 8px; }
.src details { margin: 4px 0; }
.src summary { cursor: pointer; color: var(--blue); }
.src .ex { color: var(--ink-2); white-space: pre-wrap; padding: 4px 0 4px 10px; border-left: 2px solid var(--rule); }

/* 时钟 */
.clock { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.clock > div { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; }
.clock b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.clock .over b { color: var(--red); }
.step { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--rule); }
.step:first-child { border-top: 0; }
.step .when { flex: 0 0 52px; font-size: 12.5px; color: var(--ink-3); padding-top: 2px; }
.step.done .t { text-decoration: line-through; color: var(--ink-3); }

/* 后台 */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; color: inherit; }
.kpi b { display: block; font-size: 24px; line-height: 1.2; }
.kpi span { font-size: 13px; color: var(--ink-3); }
.subtabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 0 12px; -webkit-overflow-scrolling: touch; }
.subtabs a { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--rule); color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.subtabs a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cell-done { color: var(--green); font-weight: 700; }
.chart { width: 100%; height: auto; display: block; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 99; background: rgba(14,26,43,.92); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14.5px; max-width: 90vw; }
.empty { text-align: center; color: var(--ink-3); padding: 24px 0; }
.pre { white-space: pre-wrap; word-break: break-word; }
.right { text-align: right; } .center { text-align: center; }
.mt { margin-top: 12px; } .mb0 { margin-bottom: 0; }
.flex { display: flex; gap: 8px; align-items: center; } .flex.wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.hide-sm { display: none; } @media (min-width: 700px) { .hide-sm { display: initial; } }
[hidden] { display: none !important; }

/* App 化：微信里的提示条、装到桌面 */
.wx-tip { position: sticky; top: 0; z-index: 40; display: flex; align-items: flex-start; gap: 10px; padding: 10px 44px 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: #fff7e0; color: #5c3d06; font-size: 14.5px; line-height: 1.5; border-bottom: 1px solid #ecd9a6; }
.wx-tip b { font-weight: 700; } .wx-tip > div > b:first-child { display: block; }
.wx-tip button { position: absolute; right: 8px; top: calc(6px + env(safe-area-inset-top)); width: 32px; height: 32px; border: 0; background: none; font-size: 22px; color: #8a6a2a; cursor: pointer; }
.wx-arrow { position: absolute; right: 14px; top: -2px; width: 0; height: 0; border: 9px solid transparent; border-bottom-color: #e7b33a; transform: translateY(-50%); display: none; }
body.has-wx .top { top: auto; position: relative; }
.install-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.install-hint a { color: var(--navy); flex: 1; }
.install-hint .linkbtn { font-size: 20px; color: var(--ink-3); padding: 0 4px; }
.install-steps ol { margin: 0 0 10px; padding-left: 1.3em; } .install-steps li { margin-bottom: 8px; }
.ico-share { display: inline-block; width: 16px; height: 18px; vertical-align: -3px; border: 1.6px solid var(--blue); border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 2px; }
.ico-share::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1.6px; height: 13px; margin-left: -.8px; background: var(--blue); }
.ico-share::after { content: ""; position: absolute; left: 50%; top: -7px; width: 6px; height: 6px; margin-left: -4px; border-left: 1.6px solid var(--blue); border-top: 1.6px solid var(--blue); transform: rotate(45deg); }
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }
