/* ==========================================================================
   mobile 模块样式表（活动报名 H5）
   --------------------------------------------------------------------------
   自写轻量样式，不引入 layui / 任何 CDN 资源（AGENTS.md：依赖本地化红线）。
   设计基线：移动端优先、卡片式布局、触控友好（可点区域 ≥ 44px）。
   ========================================================================== */

:root {
    --c-primary: #3b6ef5;
    --c-primary-dark: #2f59cc;
    --c-danger: #f5453b;
    --c-success: #16ba7a;
    --c-warning: #ff9800;
    --c-text: #1f2329;
    --c-text-sub: #8a9099;
    --c-line: #e9ecf0;
    --c-bg: #f4f6f9;
    --c-card: #ffffff;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(20, 30, 60, .06);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
        "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--c-primary);
    text-decoration: none;
}

/* ---------- 布局容器 ---------- */
.page {
    min-height: 100vh;
    padding-bottom: calc(24px + var(--safe-bottom));
}

.page--tabbar {
    padding-bottom: calc(64px + var(--safe-bottom));
}

.wrap {
    padding: 12px;
}

/* ---------- 顶部导航 ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 12px;
    background: var(--c-card);
    border-bottom: 1px solid var(--c-line);
}

.navbar__title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.navbar__back,
.navbar__action {
    min-width: 56px;
    font-size: 14px;
    color: var(--c-text-sub);
}

.navbar__action {
    text-align: right;
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--c-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card + .card {
    margin-top: 12px;
}

.card__body {
    padding: 14px;
}

.card__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ---------- 活动列表 ---------- */
.act-item {
    display: block;
    background: var(--c-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 12px;
    color: inherit;
}

.act-item__cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #eef1f5;
}

.act-item__cover--none {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-sub);
    font-size: 13px;
}

.act-item__body {
    padding: 12px 14px 14px;
}

.act-item__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
}

.act-item__meta {
    font-size: 12.5px;
    color: var(--c-text-sub);
    margin: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.act-item__meta i {
    font-style: normal;
    opacity: .75;
}

.act-item__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--c-line);
}

.fee {
    color: var(--c-danger);
    font-size: 17px;
    font-weight: 700;
}

.fee--free {
    color: var(--c-success);
}

/* ---------- 标签 ---------- */
.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 99px;
    font-size: 12px;
    line-height: 18px;
}

.tag--primary {
    background: rgba(59, 110, 245, .1);
    color: var(--c-primary);
}

.tag--success {
    background: rgba(22, 186, 122, .12);
    color: var(--c-success);
}

.tag--warning {
    background: rgba(255, 152, 0, .12);
    color: var(--c-warning);
}

.tag--danger {
    background: rgba(245, 69, 59, .12);
    color: var(--c-danger);
}

.tag--muted {
    background: #eef1f5;
    color: var(--c-text-sub);
}

/* ---------- 按钮 ---------- */
.btn {
    display: block;
    width: 100%;
    height: 46px;
    line-height: 46px;
    text-align: center;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--c-primary);
    cursor: pointer;
}

.btn:active {
    background: var(--c-primary-dark);
}

.btn[disabled],
.btn--disabled {
    background: #c4ccd8;
    pointer-events: none;
}

.btn--ghost {
    background: #fff;
    color: var(--c-primary);
    border: 1px solid var(--c-primary);
}

.btn--danger {
    background: var(--c-danger);
}

.btn--sm {
    height: 36px;
    line-height: 36px;
    font-size: 14px;
    width: auto;
    display: inline-block;
    padding: 0 16px;
}

.btn-row {
    display: flex;
    gap: 10px;
}

.btn-row .btn {
    flex: 1;
}

/* ---------- 表单 ---------- */
.field {
    margin-bottom: 14px;
}

.field__label {
    display: block;
    font-size: 13.5px;
    color: var(--c-text-sub);
    margin-bottom: 6px;
}

.field__label .req {
    color: var(--c-danger);
    margin-left: 2px;
}

.input,
.textarea,
.select {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    font-size: 15px;
    color: var(--c-text);
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    outline: none;
    font-family: inherit;
}

.textarea {
    height: auto;
    min-height: 84px;
    padding: 10px 12px;
    line-height: 1.6;
    resize: vertical;
}

.input:focus,
.textarea:focus {
    border-color: var(--c-primary);
}

.input[readonly] {
    background: #f7f9fb;
    color: var(--c-text-sub);
}

.field__tip {
    font-size: 12px;
    color: var(--c-text-sub);
    margin-top: 5px;
}

.field__error {
    font-size: 12px;
    color: var(--c-danger);
    margin-top: 5px;
}

/* ---------- 底部固定操作条 ---------- */
.footbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--c-line);
}

/* ---------- 底部 Tabbar ---------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    height: calc(56px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #fff;
    border-top: 1px solid var(--c-line);
}

.tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    color: var(--c-text-sub);
}

.tabbar__item.is-active {
    color: var(--c-primary);
}

.tabbar__icon {
    font-size: 18px;
    line-height: 1;
}

/* ---------- 空状态 / 加载 ---------- */
.empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--c-text-sub);
    font-size: 13.5px;
}

.empty__icon {
    font-size: 40px;
    opacity: .35;
    margin-bottom: 10px;
}

.loading {
    padding: 24px;
    text-align: center;
    color: var(--c-text-sub);
    font-size: 13px;
}

/* ---------- 提示条 ---------- */
.toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    max-width: 76%;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}

.toast.is-show {
    opacity: 1;
}

/* ---------- 弹层 ---------- */
.mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .2s;
}

.mask.is-show {
    opacity: 1;
}

.dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    width: 78%;
    max-width: 320px;
    padding: 20px 18px 16px;
    border-radius: 12px;
    background: #fff;
    text-align: center;
}

.dialog__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dialog__text {
    font-size: 14px;
    color: var(--c-text-sub);
    margin-bottom: 18px;
}

.dialog__actions {
    display: flex;
    gap: 10px;
}

.dialog__actions .btn {
    height: 40px;
    line-height: 40px;
    font-size: 15px;
}

/* ---------- 二维码票夹 ---------- */
.ticket {
    text-align: center;
    padding: 20px 16px;
}

.ticket__qr {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.ticket__qr canvas,
.ticket__qr img {
    display: block;
    /*
     * 不固定宽高。
     * 二维码由 qrcode-generator 按「模块数 × cellSize + margin×2」生成
     * （当前 33×6 + 4×2 = 206px），强行拉伸到固定尺寸属于**非整数倍缩放**，
     * 会让模块边缘产生灰阶毛刺、降低扫码识别率。按自然尺寸显示最清晰。
     */
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.ticket__no {
    margin-top: 14px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
}

.ticket__tip {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--c-text-sub);
}

.ticket__countdown {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--c-primary);
}

/* ---------- 状态步骤条 ---------- */
.steps {
    display: flex;
    align-items: center;
    padding: 14px 6px;
}

.steps__item {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--c-text-sub);
}

.steps__dot {
    width: 22px;
    height: 22px;
    line-height: 22px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: #e3e8ef;
    color: #fff;
    font-size: 12px;
}

.steps__item.is-done .steps__dot,
.steps__item.is-active .steps__dot {
    background: var(--c-primary);
}

.steps__item.is-done,
.steps__item.is-active {
    color: var(--c-primary);
}

/* ---------- 详情页 ---------- */
.detail__cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #eef1f5;
}

.detail__title {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 12px;
}

.info-row {
    display: flex;
    padding: 7px 0;
    font-size: 14px;
    border-bottom: 1px solid #f3f5f8;
}

.info-row:last-child {
    border-bottom: 0;
}

.info-row__label {
    width: 76px;
    flex: none;
    color: var(--c-text-sub);
}

.info-row__value {
    flex: 1;
    word-break: break-all;
}

.rich {
    font-size: 14.5px;
    line-height: 1.8;
    word-break: break-word;
}

.rich img {
    border-radius: 8px;
    margin: 8px 0;
}

/* ---------- 工具类 ---------- */
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }
.tc { text-align: center; }
.sub { color: var(--c-text-sub); font-size: 12.5px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }

/* ---------- 提示条 ----------
   用于展示服务端下发的一次性提示（如授权失败原因、配置未就绪说明）。
   与 MB.toast() 的分工：toast 是即时的前端反馈，本类是**页面级**说明，
   刷新后仍应可见（例如「授权登录尚未配置完成」需要用户看清后改用账号密码）。 */
.notice {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    background: var(--c-bg);
    color: var(--c-text);
    border-left: 3px solid var(--c-line);
}
.notice--warn {
    background: #fff8ec;
    border-left-color: var(--c-warning);
    color: #8a5a00;
}
