/* 安全学习培训考试系统 — 深藏青 + 消防红 */
:root {
  --navy: #17324d; --navy-deep: #10222f; --steel: #33566f;
  --ink: #22313f; --muted: #5e7186; --faint: #8fa0b2;
  --red: #d9534f; --red-deep: #b03a36; --amber: #de9a3c; --green: #3e8e6e;
  --card: #f2f6fa; --warm: #fbf1ef; --line: #d8e0e8; --white: #fff;
  --radius: 10px; --shadow: 0 2px 10px rgba(10, 22, 34, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: var(--ink); background: #eef1f5; line-height: 1.6; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; }
.hidden { display: none !important; }
.dim { color: var(--muted); }
button { font-family: inherit; cursor: pointer; }

/* 顶栏 */
#topbar { background: var(--navy-deep); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.bar-inner { display: flex; align-items: center; gap: 14px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.brand .logo { font-size: 26px; }
.brand-t b { font-size: 16px; display: block; line-height: 1.25; white-space: nowrap; }
.brand-t i { font-style: normal; font-size: 11px; color: var(--faint); white-space: nowrap; }
#nav { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
#nav::-webkit-scrollbar { height: 0; }
#nav a { flex: 0 0 auto; white-space: nowrap; color: #c9d6e2; text-decoration: none; padding: 8px 13px; border-radius: 6px; font-size: 14px; line-height: 1.2; }
#nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
#nav a.on { background: var(--red); color: #fff; }
#userBox { font-size: 13px; text-align: right; flex-shrink: 0; }
#userBox b { color: #fff; }
#userBox .btn-mini { margin-left: 8px; }
@media (max-width: 1180px) {
  .brand-t i { display: none; }
  .brand-t b { font-size: 14px; }
  #brandLogo { height: 32px; }
  #nav a { padding: 7px 10px; font-size: 13.5px; }
}
@media (max-width: 900px) {
  .brand-t { display: none; }
  .bar-inner { gap: 10px; }
}

/* 通用 */
#view { min-height: calc(100vh - 210px); padding: 22px 16px 40px; }
#foot { background: var(--navy-deep); color: #9aa8b6; font-size: 12px; padding: 18px 0; margin-top: 30px; }
.btn { display: inline-block; border: 0; border-radius: 8px; padding: 10px 22px; font-size: 15px; background: var(--navy); color: #fff; text-decoration: none; transition: .15s; }
.btn:hover { filter: brightness(1.12); }
.btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn-mini { background: transparent; border: 1px solid #6c7f93; color: #c9d6e2; border-radius: 5px; padding: 2px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card h2 { font-size: 19px; color: var(--navy); margin-bottom: 12px; }
.card h3 { font-size: 16px; color: var(--navy); margin: 14px 0 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } #nav { overflow-x: auto; } }
.kicker { color: var(--red); font-weight: 700; font-size: 12px; letter-spacing: 3px; margin-bottom: 4px; }
.page-title { font-size: 24px; color: var(--navy); font-weight: 700; margin-bottom: 16px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--card); color: var(--steel); border: 1px solid var(--line); }
.tag.ok { background: #e8f4ee; color: var(--green); border-color: #c4e0d4; }
.tag.no { background: var(--warm); color: var(--red-deep); border-color: #ecc7c4; }
.tag.red { background: var(--warm); color: var(--red-deep); border-color: #ecc7c4; }

/* 首页横幅 */
.hero { background: linear-gradient(135deg, var(--navy-deep), var(--steel)); color: #fff; border-radius: 14px; padding: 34px 36px; margin-bottom: 20px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(217, 83, 79, .25); }
.hero::before { content: ''; position: absolute; right: 90px; bottom: -80px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.hero h1 { font-size: 26px; margin-bottom: 8px; }
.hero p { color: #c9d6e2; font-size: 14px; max-width: 620px; }
.hero .actions { margin-top: 18px; display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 2; }

/* 统计块 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: center; }
.stat b { display: block; font-size: 30px; color: var(--red); }
.stat.ok b { color: var(--green); }
.stat span { font-size: 12px; color: var(--muted); }

/* 模块卡片 */
.mod { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; gap: 14px; align-items: flex-start; border-left: 4px solid var(--navy); }
.mod.done { border-left-color: var(--green); }
.mod.lock { opacity: .75; }
.mod .num { min-width: 46px; height: 46px; border-radius: 9px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.mod.done .num { background: var(--green); }
.mod h3 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.mod .meta { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.progressbar { height: 8px; background: var(--card); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.progressbar i { display: block; height: 100%; background: var(--red); border-radius: 4px; transition: width .3s; }
.progressbar i.ok { background: var(--green); }

/* 学习页 */
.learn-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.timer { font-size: 14px; background: var(--navy); color: #fff; padding: 6px 14px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.timer.done { background: var(--green); }
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.section-nav a { font-size: 12.5px; padding: 4px 10px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); color: var(--steel); text-decoration: none; }
.section-nav a.cur { background: var(--navy); color: #fff; border-color: var(--navy); }
.learn-content { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 30px; font-size: 15px; }
.learn-content h4 { color: var(--navy); font-size: 18px; margin-bottom: 12px; }
.learn-content p { margin: 8px 0; text-align: justify; }
.learn-content ul, .learn-content ol { margin: 8px 0 8px 22px; }
.learn-content li { margin: 4px 0; }
.learn-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13.5px; }
.learn-content th { background: var(--navy); color: #fff; padding: 7px 10px; text-align: left; }
.learn-content td { border: 1px solid var(--line); padding: 6px 10px; }
.learn-content tr:nth-child(even) td { background: var(--card); }
.tip, .learn-content .tip { background: var(--card); border-left: 4px solid var(--navy); border-radius: 6px; padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.warn, .learn-content .warn { background: var(--warm); border-left: 4px solid var(--red); border-radius: 6px; padding: 10px 14px; margin: 12px 0; font-size: 14px; }
/* 图解 */
.learn-content .fig { margin: 16px auto; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.learn-content .fig svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.learn-content .figcap { font-size: 12.5px; color: var(--muted); margin-top: 8px; text-align: center; }
/* 教学视频 */
.learn-content video { width: 100%; max-width: 860px; aspect-ratio: 16 / 9; background: #0d1a26; border-radius: 10px; display: block; margin: 10px auto; }
.video-note { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 4px; }
.learn-foot { display: flex; justify-content: space-between; margin-top: 16px; }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13.5px; color: var(--steel); margin-bottom: 5px; font-weight: 700; }
.form-row input, .form-row select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff; }
.form-row input:focus, .form-row select:focus { outline: 2px solid rgba(23, 50, 77, .25); border-color: var(--navy); }
.err { color: var(--red-deep); font-size: 13px; margin-top: 4px; }

/* 考试 */
.q-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px; }
.q-card .q-t { font-size: 15.5px; font-weight: 700; margin-bottom: 12px; }
.q-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 9px; cursor: pointer; font-size: 14.5px; transition: .12s; }
.q-opt:hover { border-color: var(--navy); background: var(--card); }
.q-opt.sel { border-color: var(--navy); background: #e8eff7; font-weight: 700; }
.q-opt .key { min-width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.q-opt.sel .key { background: var(--navy); color: #fff; }
.q-opt.right { border-color: var(--green); background: #e8f4ee; }
.q-opt.wrong { border-color: var(--red); background: var(--warm); }
.exam-top { position: sticky; top: 70px; z-index: 40; background: var(--navy-deep); color: #fff; border-radius: 10px; padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.exam-top .clock { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: #ffd9a8; }
.exam-top .clock.urgent { color: #ff8f8a; }
.sheet { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.sheet a { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 7px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--steel); text-decoration: none; }
.sheet a.done { background: var(--navy); color: #fff; border-color: var(--navy); }
.sheet a.cur { outline: 2px solid var(--red); }
.score-hero { text-align: center; padding: 30px 10px 10px; }
.score-hero b { font-size: 64px; display: block; }
.score-hero.pass b { color: var(--green); }
.score-hero.fail b { color: var(--red); }
.explain { font-size: 13px; color: var(--muted); background: var(--card); border-radius: 6px; padding: 8px 12px; margin-top: 8px; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.tbl th { background: var(--navy); color: #fff; padding: 8px 10px; text-align: left; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--line); padding: 7px 10px; }
.tbl tr:nth-child(even) td { background: var(--card); }
.tbl-scroll { overflow-x: auto; border-radius: 8px; box-shadow: var(--shadow); }

/* 资讯 */
.news-item { display: flex; justify-content: space-between; gap: 14px; padding: 10px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.news-item a { text-decoration: none; color: var(--ink); }
.news-item a:hover { color: var(--red); }
.news-item .d { color: var(--faint); font-size: 12.5px; white-space: nowrap; }

/* 证书打印 */
.cert { border: 3px double var(--navy); border-radius: 8px; padding: 30px 40px; text-align: center; background: #fff; }
.cert h2 { font-size: 22px; color: var(--navy); letter-spacing: 6px; margin-bottom: 18px; }
.cert .big { font-size: 20px; margin: 12px 0; }
.cert table { margin: 12px auto; font-size: 15px; border-spacing: 14px 6px; }

/* 模态 */
#modalMask { position: fixed; inset: 0; background: rgba(16, 34, 47, .55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
#modalBox { background: #fff; border-radius: 12px; padding: 24px 26px; max-width: 640px; width: 100%; max-height: 86vh; overflow: auto; }

/* 打印 */
@media print {
  #topbar, #foot, #nav, .no-print { display: none !important; }
  body { background: #fff; }
  #view { padding: 0; max-width: none; }
  .card, .q-card { box-shadow: none; border: 1px solid #ccc; }
}

/* LOGO与品牌 */
#brandLogo { height: 38px; width: auto; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 5px; }
.hero-logo { position: absolute; right: 36px; top: 30px; height: 56px; background: rgba(255, 255, 255, .92); border-radius: 8px; padding: 5px 8px; z-index: 3; }
.tagc { display: inline-block; font-size: 10.5px; padding: 0 7px; border-radius: 9px; background: rgba(217, 83, 79, .25); color: #ffb3b0; border: 1px solid rgba(217, 83, 79, .5); }

/* 台账中心 tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs a { padding: 7px 16px; border-radius: 8px 8px 0 0; background: #e3e9f0; color: var(--steel); text-decoration: none; font-size: 13.5px; }
.tabs a.on { background: var(--navy); color: #fff; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.subtabs a { padding: 5px 13px; border-radius: 15px; background: #fff; border: 1px solid var(--line); color: var(--steel); text-decoration: none; font-size: 12.5px; }
.subtabs a.on { background: var(--red); border-color: var(--red); color: #fff; }

/* 登录页（带LOGO氛围） */
.login-wrap { max-width: 520px; margin: 30px auto; }
.login-card { position: relative; overflow: hidden; }
.login-card::after { content: ''; position: absolute; right: -50px; bottom: -60px; width: 170px; height: 170px; border-radius: 50%; background: var(--card); }
