/* 消防主题：上红下蓝 · 政企风格 */
:root {
    --red: #c8161d;
    --red-dark: #9e0f15;
    --red-light: #fdecec;
    --blue: #0b3a8c;
    --blue-dark: #062a6a;
    --gold: #ffd34d;
    --text: #1f2633;
    --muted: #6b7484;
    --line: #e6e9ef;
    --bg: #eef2f8;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--blue-dark);
}
button { font: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; }
.hidden { display: none !important; }

.page {
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--red) 0, var(--red) 180px, var(--bg) 180px, var(--bg) 70%, #dfe7f4 100%);
}

/* 顶部红色横幅 */
.hero { position: relative; color: #fff; }
.hero-img { display: block; width: 100%; }
.hero-default {
    position: relative;
    overflow: hidden;
    padding: 30px 20px 64px;
    text-align: center;
    background:
        radial-gradient(circle at 85% 10%, rgba(255, 211, 77, .25), transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, .12), transparent 45%),
        linear-gradient(160deg, #e0262d 0%, var(--red) 45%, var(--red-dark) 100%);
}
.hero-default::after {
    content: "119";
    position: absolute;
    right: -10px;
    bottom: -30px;
    font: 900 120px/1 Arial, sans-serif;
    color: rgba(255, 255, 255, .07);
    letter-spacing: -6px;
}
.hero-emblem { display: block; margin: 0 auto; width: 56px; height: 63px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .25)); }
.hero-tag {
    display: inline-block;
    margin: 10px 0 8px;
    padding: 2px 14px;
    border: 1px solid rgba(255, 211, 77, .7);
    border-radius: 20px;
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 3px;
}
.hero-title {
    font-size: 23px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.hero-sub { margin-top: 8px; color: var(--gold); font-size: 14px; letter-spacing: 4px; }

.main { flex: 1; padding: 0 14px 20px; margin-top: -44px; position: relative; z-index: 1; }
.page.has-img { background: linear-gradient(180deg, var(--bg) 0, var(--bg) 70%, #dfe7f4 100%); }
.page.has-img .hero { border-bottom: 3px solid var(--red); }
.page.has-img .main { margin-top: 14px; }

.card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 16px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(11, 58, 140, .08);
    border-top: 3px solid var(--red);
}
.card-title { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; }
.card-title span { position: relative; padding-left: 12px; }
.card-title span::before {
    content: "";
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(var(--red), var(--blue));
}
.info-list { list-style: none; }
.info-list li { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.info-list li:last-child { border-bottom: 0; }
.info-list b { flex: 0 0 76px; color: var(--muted); font-weight: normal; }
.info-list span { flex: 1; }
.rules { font-size: 14px; color: #3b4352; line-height: 1.9; }

.action-bar { padding: 6px 0 4px; text-align: center; }
.home-tip { font-size: 13px; color: var(--red); margin-bottom: 10px; min-height: 1em; }
.btn-main, .btn-sub {
    display: block;
    width: 100%;
    height: 48px;
    border-radius: 24px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 2px;
}
.btn-main {
    color: #fff;
    background: linear-gradient(90deg, #e0262d, var(--red-dark));
    box-shadow: 0 6px 14px rgba(200, 22, 29, .3);
}
.btn-main:disabled { background: #b8bec9; box-shadow: none; }
.btn-sub { color: var(--blue); background: #fff; border: 1px solid #c8d3e8; }
.btn-link { margin-top: 12px; color: var(--muted); font-size: 14px; padding: 6px 10px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: #3b4352; margin-bottom: 6px; }
.field label i { color: var(--red); font-style: normal; margin-left: 2px; }
.field input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d5dbe6;
    border-radius: 8px;
    background: #f8fafd;
    outline: none;
    font-size: 16px;
}
.field input:focus { border-color: var(--blue); background: #fff; }
.form-note { font-size: 12px; color: var(--muted); line-height: 1.9; }

/* 答题 */
.quiz-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 10px 10px 0 0;
    padding: 12px 14px 10px;
    box-shadow: 0 4px 16px rgba(11, 58, 140, .08);
}
.quiz-progress { font-size: 14px; color: var(--muted); }
.quiz-progress #q-index { font-size: 22px; font-weight: 800; color: var(--red); }
.quiz-progress em {
    font-style: normal;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 12px;
    color: #fff;
    background: var(--blue);
    border-radius: 3px;
    vertical-align: 3px;
}
.quiz-timer { font-size: 14px; color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; }
.quiz-timer.warn { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.quiz-cardbtn { color: var(--blue); font-size: 14px; border: 1px solid #c8d3e8; border-radius: 14px; padding: 2px 12px; }
.bar { height: 4px; background: #dbe2ee; margin-bottom: 12px; border-radius: 0 0 4px 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--blue)); transition: width .25s; }
.q-card { min-height: 300px; }
.q-title { font-size: 17px; line-height: 1.7; font-weight: 600; margin-bottom: 14px; word-break: break-all; }
.q-img { display: block; max-width: 100%; margin: 0 auto 14px; border-radius: 6px; }
.q-opts { display: flex; flex-direction: column; gap: 10px; }
.q-opt {
    display: flex;
    align-items: flex-start;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    background: #fafbfd;
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
    transition: all .15s;
}
.q-opt b {
    flex: 0 0 26px;
    height: 26px;
    margin-right: 10px;
    border-radius: 50%;
    border: 1px solid #c3cbd8;
    background: #fff;
    text-align: center;
    line-height: 24px;
    font-size: 13px;
    color: var(--muted);
}
.q-opt.multi b { border-radius: 5px; }
.q-opt span { flex: 1; padding-top: 1px; }
.q-opt.on { border-color: var(--blue); background: #eef3fc; color: var(--blue-dark); }
.q-opt.on b { background: var(--blue); border-color: var(--blue); color: #fff; }
.q-hint { margin-top: 10px; font-size: 12px; color: var(--muted); }
.quiz-nav { display: flex; gap: 12px; }
.quiz-nav button { flex: 1; }

/* 完成页 */
.done-card { text-align: center; padding: 36px 20px 28px; margin-top: 20px; }
.done-icon svg { width: 72px; height: 72px; }
.done-card h2 { font-size: 20px; margin: 14px 0 10px; }
.done-text { color: #4a5262; font-size: 15px; line-height: 1.9; text-align: left; }
.done-safe {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
    color: var(--red);
    font-weight: 600;
    letter-spacing: 2px;
    font-size: 14px;
}

/* 底部蓝色区域 */
.foot {
    background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: rgba(255, 255, 255, .78);
    text-align: center;
    padding: 22px 14px calc(18px + env(safe-area-inset-bottom));
    font-size: 13px;
    line-height: 1.9;
    position: relative;
}
.foot::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}
.foot-safe { letter-spacing: 4px; color: #fff; }
.foot-tech { display: inline-block; margin-top: 6px; font-size: 11px; color: rgba(255, 255, 255, .5); text-decoration: none; }

/* 答题卡 */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.sheet-body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-width: 640px;
    margin: 0 auto;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px 14px 0 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; align-items: center; margin-bottom: 12px; }
.sheet-head b { font-size: 16px; }
.sheet-legend { flex: 1; margin-left: 12px; font-size: 12px; color: var(--muted); }
.sheet-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 3px 0 8px; vertical-align: -1px; }
.lg-done { background: var(--blue); }
.lg-none { border: 1px solid #c3cbd8; }
.sheet-x { font-size: 26px; line-height: 1; color: var(--muted); padding: 0 4px; }
.sheet-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding-bottom: 14px; }
.sheet-type { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin-top: 4px; }
.sheet-grid button { height: 38px; border-radius: 6px; border: 1px solid #c3cbd8; color: var(--text); font-size: 14px; }
.sheet-grid button.done { background: var(--blue); border-color: var(--blue); color: #fff; }
.sheet-grid button.cur { box-shadow: 0 0 0 2px var(--red); }

/* 弹窗 / 加载 / 轻提示 */
.dialog { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; padding: 30px; }
.dialog-box { width: 100%; max-width: 330px; background: #fff; border-radius: 12px; padding: 22px 18px 16px; text-align: center; }
.dialog-box h3 { font-size: 17px; margin-bottom: 10px; }
.dialog-box p { font-size: 15px; color: #4a5262; margin-bottom: 18px; text-align: left; }
.dialog-btns { display: flex; gap: 10px; }
.dialog-btns button { flex: 1; height: 42px; font-size: 15px; }
.loading { position: fixed; inset: 0; z-index: 70; background: rgba(255, 255, 255, .6); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.loading p { margin-top: 12px; color: var(--muted); font-size: 14px; }
.spinner { width: 36px; height: 36px; border: 3px solid #d5dbe6; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; top: 45%; transform: translateX(-50%); z-index: 80; background: rgba(0, 0, 0, .78); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; max-width: 80%; text-align: center; }
