/* ==========================================================
   freegift 前台 - 简洁干净版（移动端优先）
   保留 fg-* 类名，与 index/my/winners 完全兼容。
   设计原则：单色强调、细边框代替阴影、小圆角、
             无渐变无装饰无悬浮效果，信息层级靠留白和字重。
   ========================================================== */
:root {
    --brand: #e8452c;
    --brand-dark: #cf3a23;
    --brand-soft: #fff1ee;

    --gold: #d97706;
    --gold-soft: #fffbeb;

    --success: #059669;
    --success-soft: #ecfdf5;
    --warn: #b45309;
    --warn-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --info: #e8452c;
    --info-soft: #fff1ee;

    --text: #1f2937;
    --text-sub: #6b7280;
    --text-mute: #9ca3af;
    --line: #eceff3;
    --line-strong: #e2e6ec;
    --bg: #f7f8fa;
    --card: #ffffff;

    --radius: 10px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --shadow: 0 1px 2px rgba(16, 24, 40, .04);

    --safe-b: 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, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(64px + var(--safe-b));
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.fg-wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.fg-center { text-align: center; }

/* ---------- 顶部栏 ---------- */
.fg-topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.fg-topbar-inner {
    max-width: 720px; margin: 0 auto;
    padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.fg-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--text); }
.fg-logo-badge {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: var(--radius-xs);
    background: var(--brand);
    color: #fff; font-size: 14px;
}
.fg-topbar-links { display: flex; gap: 8px; align-items: center; }
.fg-link-btn {
    font-size: 13px; color: var(--text-sub);
    border: 1px solid var(--line-strong);
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    background: #fff;
}
.fg-link-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- Hero（纯色，无装饰） ---------- */
.fg-hero {
    margin: 12px 0 14px;
    padding: 20px 18px;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
}
.fg-hero-title {
    font-size: 20px; font-weight: 600;
    margin: 0 0 6px; line-height: 1.4;
}
.fg-hero-sub { font-size: 13.5px; opacity: .9; margin: 0; line-height: 1.6; }
.fg-hero-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* Hero 媒体区：产品图完整显示（不裁切），下方接赠品信息 */
.fg-hero-shot {
    margin-top: 14px;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}
.fg-hero-shot img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background: #fff;
}
/* Hero 赠品信息条（图片下方，红底上的白字） */
.fg-hero-gift {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.fg-hero-gift .fg-gift-label { color: rgba(255, 255, 255, .82); font-size: 12px; margin-bottom: 2px; }
.fg-hero-gift .fg-gift-name { color: #fff; font-size: 15px; font-weight: 600; }
.fg-hero-gift .fg-gift-value {
    margin-left: auto;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 12.5px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
}
.fg-hero-shot-empty {
    padding: 34px 14px;
    text-align: center;
    font-size: 36px;
    color: var(--text-mute);
}

/* Hero 引导条（首页无主图时使用） */
.fg-hero-note {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .16);
    display: flex;
    align-items: center;
    gap: 10px;
}
.fg-hero-note-ico { font-size: 22px; line-height: 1; flex: none; }
.fg-hero-note .fg-gift-label { color: rgba(255, 255, 255, .82); margin-bottom: 2px; }
.fg-hero-note .fg-gift-name { color: #fff; font-weight: 600; }

/* ---------- 卡片 ---------- */
.fg-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.fg-card-title {
    font-size: 15px; font-weight: 600; color: var(--text);
    margin: 0 0 12px;
    display: flex; align-items: center; gap: 6px;
}
.fg-card-title .fg-emo { font-size: 15px; }
.fg-card-title .fg-more { margin-left: auto; font-size: 12.5px; color: var(--text-mute); font-weight: 400; }

/* ---------- 表单 ---------- */
.fg-form { display: block; }
.fg-field { margin-bottom: 12px; }
.fg-label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 5px; }
.fg-input, .fg-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff; color: var(--text);
    font-size: 15px; line-height: 1.5;
}
.fg-input:focus, .fg-textarea:focus {
    outline: none;
    border-color: var(--brand);
}
.fg-textarea { resize: vertical; min-height: 76px; }
.fg-hint { font-size: 12px; color: var(--text-mute); margin-top: 4px; }

/* ---------- 按钮 ---------- */
.fg-btn {
    display: inline-block;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 14px; font-weight: 500;
    background: #fff; color: var(--text);
    cursor: pointer; line-height: 1.4;
}
.fg-btn-block { display: block; width: 100%; padding: 11px 16px; font-size: 15px; }
.fg-btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.fg-btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
/* 描边次级按钮：深色 Hero 与白底卡片里都要看得见 */
.fg-btn-ghost {
    background: #fff;
    color: var(--brand);
    border-color: var(--brand);
}
.fg-btn-ghost:hover { background: var(--brand-soft); }
.fg-btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
}
.fg-btn-gold:hover { background: #b45309; border-color: #b45309; }
.fg-mini-btn {
    display: inline-block;
    font-size: 12.5px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line-strong);
    background: #fff; color: var(--text-sub);
}
.fg-mini-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- 提示 / 空 / 链接 ---------- */
.fg-alert { border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; margin-bottom: 12px; border: 1px solid transparent; line-height: 1.6; }
/* 提示条四种语义：info 中性灰 / success 绿 / warn 琥珀 / error 红
   （info 不能用品牌红，否则和 error 撞色分不清） */
.fg-alert-info    { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.fg-alert-success { background: var(--success-soft); border-color: #a7f3d0; color: #047857; }
.fg-alert-warn    { background: var(--warn-soft);    border-color: #fde68a; color: #b45309; }
.fg-alert-error   { background: var(--danger-soft);  border-color: #fecaca; color: #991b1b; }
.fg-tip { font-size: 12px; color: var(--text-mute); margin-top: 5px; }
.fg-strong { font-weight: 600; color: var(--text); }
.fg-link { color: var(--brand); }
.fg-empty { text-align: center; padding: 32px 20px; color: var(--text-mute); font-size: 13.5px; }
.fg-empty-emo { font-size: 32px; margin-bottom: 8px; opacity: .55; }

/* ---------- Chip / Tag ---------- */
.fg-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fg-chip {
    display: inline-flex; align-items: center;
    font-size: 12px;
    padding: 3px 9px;
    border-radius: var(--radius-xs);
    background: var(--brand-soft);
    color: var(--brand-dark);
    line-height: 1.5;
}
.fg-chip.gold { background: #fff7ed; color: #b45309; }
.fg-chip.gray { background: #f3f4f6; color: var(--text-sub); }
.fg-tag {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    line-height: 1.6;
}
.fg-tag-pending   { background: var(--warn-soft);    color: var(--warn); }
.fg-tag-approved  { background: var(--success-soft); color: var(--success); }
.fg-tag-rejected  { background: var(--danger-soft);  color: var(--danger); }
.fg-tag-win       { background: var(--gold-soft);    color: var(--gold); font-weight: 600; }
.fg-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand);
    vertical-align: middle;
    margin-right: 6px;
}

/* ---------- 活动卡片 ---------- */
.fg-act-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 12px;
}
.fg-act-thumb {
    width: 84px; height: 84px;
    border-radius: var(--radius-sm);
    background: #f3f4f6;
    overflow: hidden;
    display: grid; place-items: center;
    color: var(--text-mute); font-size: 26px;
}
.fg-act-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fg-act-name { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 3px; line-height: 1.45; }
.fg-act-meta { font-size: 12.5px; color: var(--text-mute); line-height: 1.6; }

/* ---------- 信息块 / KV ---------- */
.fg-info { background: #f9fafb; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.fg-info-list { display: flex; flex-direction: column; gap: 7px; }
.fg-info-list > * { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.fg-info-label { color: var(--text-sub); flex: none; }
.fg-info-val { color: var(--text); font-weight: 500; }
.fg-info-ico {
    width: 22px; height: 22px;
    border-radius: var(--radius-xs);
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: grid; place-items: center;
    font-size: 12px; flex: none;
}
/* 信息行内容多行时，图标改为顶部对齐更整齐 */
.fg-info-list > .fg-info { align-items: flex-start; }
.fg-info-list > .fg-info .fg-info-ico { margin-top: 1px; }

/* 商品广告位：缩略图 + 简短标题 + 价格 + 购买按钮，点击跳转后台配置的来源 */
.fg-prod {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.fg-prod-thumb {
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    background: #f3f4f6;
    overflow: hidden;
    display: grid; place-items: center;
    font-size: 24px;
    color: var(--text-mute);
    flex: none;
}
.fg-prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fg-prod-main { flex: 1; min-width: 0; }
.fg-prod-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fg-prod-price { font-size: 13px; color: var(--brand); font-weight: 600; margin-top: 3px; }
.fg-prod-buy {
    flex: none;
    display: inline-block;
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--brand);
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
}
.fg-prod-buy:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
/* 键值列表：.fg-kv 是容器，每行是 <div><span>标签</span><b>值</b></div> */
.fg-kv { display: flex; flex-direction: column; }
.fg-kv > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}
.fg-kv > div:last-child { border-bottom: 0; }
.fg-kv > div > span { color: var(--text-sub); flex: none; }
.fg-kv > div > b {
    color: var(--text);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}
.fg-hl { color: var(--brand-dark); font-weight: 600; }
.fg-passbox {
    display: inline-block;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 600;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    letter-spacing: 1px; font-size: 14px;
}
.fg-pre {
    white-space: pre-wrap;
    font-family: inherit;
    background: #f9fafb;
    border: 1px solid var(--line);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text);
}

/* ---------- 视频 / 中奖墙 ---------- */
.fg-video-frame {
    width: 100%; border-radius: var(--radius-sm);
    overflow: hidden; background: #111827;
    aspect-ratio: 16 / 9;
}
.fg-video-frame video, .fg-video-frame iframe, .fg-video-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fg-video-item { margin-bottom: 12px; }
.fg-video-title { font-size: 14px; font-weight: 500; margin: 8px 0 2px; color: var(--text); }
.fg-video-meta { font-size: 12px; color: var(--text-mute); }
.fg-url-video {
    display: block;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--brand-dark);
    word-break: break-all;
    font-size: 13px;
}
.fg-winner {
    background: var(--gold-soft);
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.fg-winner-title { font-size: 15px; font-weight: 600; margin: 0 0 8px; color: #92400e; }
.fg-winner-row { font-size: 14px; padding: 4px 0; color: var(--text); }
.fg-winner-note { font-size: 12.5px; color: var(--text-sub); margin-top: 6px; }

.fg-winpost {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}
.fg-winpost-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
/* 中奖卡缩略图是 <img> 元素，必须 object-fit 否则被拉伸变形 */
.fg-winpost-thumb {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex: none;
}
.fg-winpost-thumb-empty {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: #f3f4f6;
    display: grid; place-items: center;
    color: var(--text-mute);
}
.fg-winpost-title { font-size: 14.5px; font-weight: 600; margin: 0; }
.fg-winpost-body { font-size: 13.5px; color: var(--text-sub); line-height: 1.65; }
.fg-winpost-meta { font-size: 12px; color: var(--text-mute); margin-top: 6px; }

/* ---------- 进度条 ---------- */
.fg-progress-card {
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}
.fg-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; font-size: 13.5px; }
.fg-progress-bar { height: 6px; background: #e8ebf0; border-radius: 999px; overflow: hidden; }
.fg-progress-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.fg-progress-foot { margin-top: 6px; font-size: 12.5px; color: var(--text-sub); }
.fg-progress-note { font-size: 12px; color: var(--text-mute); margin-top: 3px; }

/* ---------- Tabs / TabBar（贴底简洁） ---------- */
.fg-tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}
.fg-tab {
    flex: 1; text-align: center;
    padding: 9px 10px;
    font-size: 13.5px;
    color: var(--text-sub);
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.fg-tab.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 500;
}

.fg-tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex;
    padding: 6px 0 calc(6px + var(--safe-b));
}
.fg-tabitem {
    flex: 1; text-align: center;
    font-size: 12px;
    color: var(--text-mute);
    padding: 3px 0;
}
/* TabBar 项是 <i>图标</i><span>文字</span>，必须竖排 */
.fg-tabitem i {
    display: block;
    font-style: normal;
    font-size: 18px;
    line-height: 1.4;
}
.fg-tabitem span {
    display: block;
    font-size: 11px;
    margin-top: 1px;
}
.fg-tabitem.is-active { color: var(--brand); font-weight: 500; }

/* ---------- 个人中心 ---------- */
.fg-profile {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.fg-profile-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: grid; place-items: center;
    font-size: 17px; flex: none;
}
.fg-profile-phone { font-size: 16px; font-weight: 600; margin: 0; color: var(--text); }
.fg-profile-sub { font-size: 12.5px; color: var(--text-sub); margin: 2px 0 0; }

/* ---------- 时间线 / Step ---------- */
.fg-timeline { margin: 6px 0; }
.fg-tl-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 7px 0;
    font-size: 13.5px;
}
.fg-tl-item i {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand);
    margin-top: 7px; flex: none;
}
.fg-tl-item.is-done i { background: var(--success); }
.fg-tl-item.is-fail i { background: var(--danger); }

/* 步骤说明网格：每步 = 序号 + 标题 + 描述（长文案不再被挤压） */
.fg-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    counter-reset: fgstep;
    margin-bottom: 12px;
}
.fg-step {
    counter-increment: fgstep;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
}
.fg-step-t {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.45;
    margin: 0 0 5px;
}
.fg-step-t::before {
    content: counter(fgstep);
    flex: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: grid;
    place-items: center;
    margin-top: 1px;
}
.fg-step-d {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.6;
}
.fg-step.is-done .fg-step-t::before { background: var(--success); }
@media (max-width: 720px) {
    .fg-steps { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 数据 stat ----------
   实际结构：.fg-stat-row 是容器，.fg-stat 是每一项（内含 <b>数字</b><span>标签</span>）。
   常用于 Hero 内，故用半透明白底 + 白字。 */
.fg-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
}
.fg-stat {
    background: rgba(255, 255, 255, .16);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
}
.fg-stat b {
    display: block;
    font-size: 19px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}
.fg-stat span {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
    margin-top: 2px;
}

/* ---------- Pager ---------- */
.fg-pager {
    display: flex; justify-content: center; gap: 6px; align-items: center;
    padding: 10px 0 2px;
}
.fg-pager a, .fg-pager span {
    min-width: 30px; height: 30px;
    padding: 0 9px;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-sub);
    font-size: 13px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--line-strong);
}
/* 分页当前页：winners.php 用的是 .is-current */
.fg-pager a.is-active, .fg-pager .is-active,
.fg-pager .is-current {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.fg-pager a:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- Gift / Roster ---------- */
.fg-gift-label { font-size: 12.5px; color: var(--text-sub); margin-bottom: 3px; }
.fg-gift-name  { font-size: 14.5px; font-weight: 600; color: var(--text); }
.fg-gift-value { font-size: 13px; color: var(--brand-dark); }
.fg-roster-search {
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 12px;
}

/* ---------- 列表 / 行 ---------- */
.fg-list { display: flex; flex-direction: column; gap: 8px; }
.fg-row {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex; align-items: center; gap: 10px;
}
.fg-seq {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #f3f4f6;
    color: var(--text-sub);
    display: grid; place-items: center;
    font-weight: 600; font-size: 12px;
    flex: none;
}
/* 中奖序号：金色（纯色，不用渐变） */
.fg-seq.is-win { background: var(--gold); color: #fff; }
.fg-row-main { flex: 1; min-width: 0; }
.fg-row-line1 { font-size: 14px; font-weight: 500; color: var(--text); }
.fg-row-line2 { font-size: 12px; color: var(--text-mute); margin-top: 1px; }

/* ---------- Toast ---------- */
.fg-toast {
    position: fixed; left: 50%; bottom: calc(80px + var(--safe-b));
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}
.fg-toast.is-show { opacity: 1; }

/* ---------- Footer ---------- */
.fg-footer {
    margin-top: 16px;
    padding: 16px 0 calc(14px + var(--safe-b));
    text-align: center;
    color: var(--text-mute);
    font-size: 12px;
    line-height: 1.7;
}

/* ---------- 客服二维码 ---------- */
.fg-qr {
    width: 200px;
    height: 200px;
    margin: 0 auto 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
    display: grid;
    place-items: center;
}
.fg-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- 弹层（modal sheet） ----------
   结构：.fg-mask > .fg-sheet > (.fg-sheet-head + 表单/内容)
   显隐由 JS 切换 .is-open 类控制（openMask / closeMask）。 */
.fg-mask {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .45);
    overflow-y: auto;
}
.fg-mask.is-open { display: flex; }

.fg-sheet {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 86vh;
    margin: auto;
    padding: 0 18px 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(15, 23, 42, .2);
    overflow-y: auto;
}
.fg-sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 -18px 14px;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.fg-sheet-title { font-size: 15px; font-weight: 600; color: var(--text); }
.fg-sheet-close {
    border: 0;
    background: transparent;
    padding: 2px 6px;
    font-size: 20px;
    line-height: 1;
    color: var(--text-mute);
    cursor: pointer;
}
.fg-sheet-close:hover { color: var(--text); }
/* 弹层内字段间距（admin-erp.css 里 .fg-field 的 margin-bottom 是 0） */
.fg-sheet .fg-field { margin-bottom: 12px; }
.fg-sheet .fg-field:last-child { margin-bottom: 0; }

/* ---------- 横排输入行（后台筛选/搜索） ---------- */
.fg-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.fg-input-row .fg-input { flex: 1 1 auto; min-width: 0; }