/* ========== 国防教育答题活动 样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: #8c1216;
}

body {
    background:
        radial-gradient(circle at 15% 8%, rgba(255, 214, 132, .18), transparent 42%),
        radial-gradient(circle at 85% 90%, rgba(255, 214, 132, .12), transparent 45%),
        linear-gradient(180deg, #a0181d 0%, #7d0f13 100%);
    background-attachment: fixed;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

.page { padding-bottom: 40px; }

/* ========== 首页 ========== */
.hero {
    position: relative;
    width: 100%;
    line-height: 0;
}

.hero-bg {
    width: 100%;
    height: auto;
    display: block;
}

.hero-star {
    font-size: 40px;
    line-height: 1;
    color: #ffd75e;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    animation: starGlow 2.6s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% { transform: scale(1); text-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
    50% { transform: scale(1.12); text-shadow: 0 2px 18px rgba(255, 215, 94, .85); }
}

.hero-sub {
    margin-top: 14px;
    font-size: 14px;
    letter-spacing: 3px;
    color: #ffd9a8;
}

.hero-title {
    margin-top: 12px;
    font-size: 27px;
    line-height: 1.45;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}

.hero-ribbon {
    display: inline-block;
    margin-top: 18px;
    padding: 6px 18px;
    font-size: 12.5px;
    letter-spacing: 2px;
    color: #8c1216;
    background: linear-gradient(90deg, #ffe9ad, #ffd05f);
    border-radius: 20px;
}

.card {
    margin: 14px 16px 0;
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px;
    box-shadow: 0 8px 24px rgba(60, 0, 0, .18);
}

.card-title {
    position: relative;
    font-size: 17px;
    color: #b32024;
    padding-left: 12px;
    margin-bottom: 12px;
}

.card-title .bar {
    position: absolute;
    left: 0; top: 2px;
    width: 4px; height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, #e23a3a, #b32024);
}

.info-list li {
    list-style: none;
    display: flex;
    padding: 9px 0;
    border-bottom: 1px dashed #f0e0e0;
    font-size: 14.5px;
    line-height: 1.5;
}

.info-list li:last-child { border-bottom: none; }

.info-label {
    flex: 0 0 72px;
    color: #999;
}

.info-value { color: #333; font-weight: 600; }
.info-value.highlight { color: #d9302b; }

.rule-list {
    padding-left: 20px;
    color: #555;
    font-size: 13.5px;
    line-height: 1.9;
}

.rule-list b { color: #d9302b; }

.organizer {
    margin-top: 14px;
    text-align: right;
    font-size: 13px;
    color: #b32024;
    font-weight: 600;
}

.start-wrap {
    text-align: center;
    padding: 34px 16px 10px;
}

.btn-start {
    width: 78%;
    height: 54px;
    border: none;
    border-radius: 27px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 6px;
    text-indent: 6px;
    color: #8c1216;
    background: linear-gradient(180deg, #ffeaa6 0%, #ffc53d 55%, #f5a623 100%);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .7);
    cursor: pointer;
    transition: transform .15s;
}

.btn-start:active { transform: scale(.97); }

.start-tip {
    margin-top: 14px;
    font-size: 12px;
    color: #ffe2c2;
}

.page-footer {
    text-align: center;
    color: rgba(255, 255, 255, .75);
    font-size: 12px;
    padding: 10px 0 24px;
}

/* ========== 答题页 ========== */
.quiz-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 14px 16px 12px;
    background: linear-gradient(180deg, #a0181d, #91141a);
    box-shadow: 0 4px 12px rgba(60, 0, 0, .2);
}

.quiz-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffe9c8;
    font-size: 14px;
    margin-bottom: 10px;
}

.quiz-progress-text { font-weight: 700; color: #ffd75e; }

.progress-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .22);
    overflow: hidden;
}

.progress-bar i {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #ffd75e, #ffb733);
    transition: width .3s;
}

.quiz-body { padding: 14px 16px 100px; }

.question-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 14px;
    box-shadow: 0 6px 18px rgba(60, 0, 0, .14);
}

.question-card.wrong { border: 1px solid #ffd2d2; }

.q-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.q-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 6px;
    background: #b32024;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-style: normal;
}

.q-type {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.q-type.radio { color: #b32024; background: #fdeaea; }
.q-type.checkbox { color: #b5740a; background: #fff4dd; }

.q-title {
    font-size: 16px;
    line-height: 1.7;
    color: #2b2b2b;
    font-weight: 600;
    margin-bottom: 14px;
}

.option-list li {
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px;
    border: 1.5px solid #ececec;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 14.5px;
    line-height: 1.55;
    cursor: pointer;
    transition: all .15s;
}

.option-list li:active { background: #fff8f0; }

.option-list li.active {
    border-color: #d9302b;
    background: #fdf3f2;
}

.opt-mark {
    flex: 0 0 24px;
    width: 24px; height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f2f2f2;
    color: #888;
    font-size: 13px;
    font-weight: 700;
    margin-top: 1px;
}

.option-list li.active .opt-mark {
    background: #d9302b;
    color: #fff;
}

.option-list li.is-right {
    border-color: #2ea84f;
    background: #f0fbf3;
}

.option-list li.is-right .opt-mark { background: #2ea84f; color: #fff; }

.option-list li.is-wrong {
    border-color: #e54848;
    background: #fdf1f1;
}

.option-list li.is-wrong .opt-mark { background: #e54848; color: #fff; }

.answer-line {
    margin-top: 6px;
    font-size: 13.5px;
    color: #666;
    line-height: 1.8;
}

.wrong-text { color: #e54848; }
.right-text { color: #2ea84f; }

.quiz-footer {
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    max-width: 500px;
    margin: 0 auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 38%);
}

.btn-submit {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 4px;
    text-indent: 4px;
    color: #fff;
    background: linear-gradient(180deg, #e8473f, #c32020);
    box-shadow: 0 8px 18px rgba(195, 32, 32, .35);
    cursor: pointer;
}

.btn-submit:disabled { opacity: .6; }

/* ========== 结果页 ========== */
.result-summary {
    margin: 22px 16px 0;
    background: #fff;
    border-radius: 14px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(60, 0, 0, .18);
}

.result-summary.fail { background: #fff; }

.result-icon {
    width: 64px; height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
}

.result-icon.success { background: linear-gradient(180deg, #3fc15f, #239a43); box-shadow: 0 8px 20px rgba(35,154,67,.35); }
.result-icon.fail { background: linear-gradient(180deg, #f2a93b, #e07d13); box-shadow: 0 8px 20px rgba(224,125,19,.35); }

.result-title { font-size: 21px; color: #b32024; }
.result-summary.fail .result-title { color: #c0680f; }
.result-desc { margin-top: 8px; font-size: 14px; color: #777; line-height: 1.7; }

.result-actions { padding: 6px 0 20px; }

.success-actions { margin-top: 22px; }

.btn-redpacket {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    text-indent: 3px;
    color: #8c1216;
    background: linear-gradient(180deg, #ffeaa6, #f5a623);
    box-shadow: 0 8px 18px rgba(160, 90, 10, .3);
    cursor: pointer;
}

.btn-text {
    width: 100%;
    margin-top: 12px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 14px;
    padding: 8px;
    cursor: pointer;
}

.btn-retry {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    text-indent: 3px;
    color: #8c1216;
    background: linear-gradient(180deg, #ffeaa6, #f5a623);
    box-shadow: 0 8px 18px rgba(160, 90, 10, .3);
    cursor: pointer;
}

/* ========== 弹窗通用 ========== */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(40, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn .2s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 26px 22px 22px;
    animation: popIn .25s;
}

@keyframes popIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-close {
    position: absolute;
    top: 10px; right: 12px;
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #bbb;
    cursor: pointer;
}

.modal-title { text-align: center; font-size: 20px; color: #b32024; }
.modal-sub { text-align: center; font-size: 13px; color: #999; margin: 8px 0 18px; }

.form-item { margin-bottom: 16px; }

.form-item label {
    display: block;
    font-size: 13.5px;
    color: #666;
    margin-bottom: 7px;
}

.form-item input {
    width: 100%;
    height: 44px;
    border: 1.5px solid #e6e6e6;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 15px;
    outline: none;
    background: #fafafa;
}

.form-item input:focus { border-color: #d9302b; background: #fff; }

.radio-group { display: flex; gap: 12px; }

.radio-group span {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e6e6e6;
    border-radius: 10px;
    background: #fafafa;
    font-size: 15px;
    cursor: pointer;
}

.radio-group span.on {
    border-color: #d9302b;
    background: #fdf3f2;
    color: #d9302b;
    font-weight: 700;
}

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }

.captcha-img {
    width: 118px;
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid #e6e6e6;
    cursor: pointer;
    object-fit: cover;
}

.btn-sms {
    flex: 0 0 118px;
    border: none;
    border-radius: 10px;
    background: #fdeaea;
    color: #d9302b;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-sms:disabled { color: #aaa; background: #f3f3f3; cursor: not-allowed; }

.btn-primary {
    width: 100%;
    height: 48px;
    margin-top: 6px;
    border: none;
    border-radius: 24px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
    text-indent: 2px;
    color: #fff;
    background: linear-gradient(180deg, #e8473f, #c32020);
    box-shadow: 0 6px 16px rgba(195, 32, 32, .3);
    cursor: pointer;
}

.btn-primary:disabled { opacity: .65; }

.btn-back {
    width: 100%;
    margin-top: 10px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 14px;
    padding: 8px;
    cursor: pointer;
}

/* ========== 红包弹窗 ========== */
.reward-mask { background: rgba(80, 5, 8, .72); }

/* ========== 非微信环境强制遮罩 ========== */
.block-mask { background: rgba(0, 0, 0, .72); z-index: 9999; }

.block-modal {
    max-width: 300px;
    padding: 40px 24px;
    text-align: center;
}

.block-icon {
    width: 60px;
    height: 60px;
    line-height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e03232;
    color: #fff;
    font-size: 36px;
    font-weight: 700;
}

.block-text {
    margin: 0;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.modal-reward {
    max-width: 330px;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.envelope {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .4);
}

.envelope-top {
    background: linear-gradient(180deg, #e03232, #b81f1f);
    padding: 26px 20px 22px;
    text-align: center;
    color: #ffe9b0;
}

.envelope-star { font-size: 34px; color: #ffd75e; }
.envelope-title { margin-top: 6px; font-size: 18px; letter-spacing: 4px; font-weight: 700; }

.envelope-body {
    background: linear-gradient(180deg, #fff6e3, #ffeecb);
    padding: 28px 22px 24px;
    text-align: center;
    min-height: 190px;
}

.reward-amount {
    font-size: 40px;
    font-weight: 800;
    color: #e03232;
    line-height: 1.2;
}

.reward-tip { margin-top: 10px; font-size: 14px; color: #8a6a3a; line-height: 1.7; }
.reward-tip.fail { color: #d9302b; }

.mock-tag {
    display: inline-block;
    margin-top: 8px;
    font-size: 11.5px;
    color: #b5740a;
    background: #fff0cf;
    border-radius: 4px;
    padding: 2px 8px;
}

.reward-btn { margin-top: 18px; }

.spinner {
    width: 38px; height: 38px;
    margin: 6px auto 14px;
    border: 3px solid rgba(224, 50, 50, .2);
    border-top-color: #e03232;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.spinner.light { border-color: rgba(255,255,255,.3); border-top-color: #ffd75e; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== toast / loading ========== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 18%;
    transform: translateX(-50%);
    max-width: 80%;
    z-index: 300;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    padding: 10px 18px;
    border-radius: 10px;
    text-align: center;
    pointer-events: none;
}

.page-loading {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(60, 0, 0, .3);
}
