/* ============================================================
   门店距离备案系统 · H5 样式
   移动端优先，兼容微信内置浏览器 / 主流手机浏览器
   ============================================================ */

:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-soft: #e6f4f1;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f2f6f7;
    --card: #ffffff;
    --ok: #15803d;
    --ok-soft: #e8f6ed;
    --warn: #b45309;
    --warn-soft: #fdf3e3;
    --danger: #b42318;
    --danger-soft: #fdeceb;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 8px 24px rgba(15, 23, 42, .08);
    --tabbar-h: 62px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
}

body.is-app { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
body.is-login { background: linear-gradient(165deg, #0f766e 0%, #115e59 30%, #eaf2f2 60%, #f2f6f7 100%); background-attachment: fixed; }

a { color: var(--brand); text-decoration: none; }
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
svg { display: block; }

/* ---------------------------------- 顶栏 ---------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .28);
}

.brand-mark.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; }

.brand-text h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-text p { margin: 1px 0 0; font-size: 11px; color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.user-chip {
    max-width: 92px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    padding: 6px 4px;
    cursor: pointer;
}
.icon-btn:active { opacity: .6; }

/* ---------------------------------- 页面容器 ---------------------------------- */
.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page-head h2 { margin: 2px 0 4px; font-size: 20px; letter-spacing: -.4px; }
.page-desc { margin: 0; font-size: 13px; color: var(--muted); }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }

.badge {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}
.badge.soft { background: var(--warn-soft); color: var(--warn); }

/* ---------------------------------- 表单 ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }

label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.req { color: var(--danger); margin-left: 2px; }

input, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fbfcfd;
    font-size: 15px; /* 避免 iOS 聚焦缩放 */
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
    -webkit-appearance: none;
}
textarea { min-height: 66px; resize: vertical; line-height: 1.5; }

input::placeholder, textarea::placeholder { color: #94a3b8; }

input:focus, textarea:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

input.is-error, textarea.is-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .1);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 359px) { .field-row { grid-template-columns: 1fr; } }

.hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------------------------------- 按钮 ---------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: #f1f5f9;
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform .08s, opacity .15s, background .15s;
    user-select: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }

.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(15, 118, 110, .24); }
.btn.primary:active { background: var(--brand-dark); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger-solid { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }

/* ---------------------------------- 地图 ---------------------------------- */
.map-box {
    position: relative;
    height: 260px;
    border-radius: 12px;
    overflow: hidden;
    background: #eef3f4;
    border: 1px solid var(--line);
    touch-action: none;
}
.map-box canvas, .map-full canvas { display: block; width: 100%; height: 100%; }

.coord-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.coord-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f6f9fa;
    border: 1px solid var(--line);
}
.coord-item span { font-size: 11px; color: var(--muted); }
.coord-item b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }

.manual { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.manual summary {
    font-size: 13px;
    color: var(--brand);
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.manual summary::-webkit-details-marker { display: none; }
.manual summary::after { content: "›"; font-size: 16px; transform: translateY(-1px); }
.manual[open] summary::after { transform: rotate(90deg) translateX(-1px); }
.manual-row { margin-top: 12px; }

/* ---------------------------------- 校验结果 ---------------------------------- */
.check-box {
    border-radius: 12px;
    padding: 14px;
    background: #f8fafb;
    border: 1px dashed var(--line);
    font-size: 14px;
    color: var(--muted);
}
.check-idle { margin: 0; font-size: 13px; line-height: 1.6; }

.check-pass {
    border-style: solid;
    border-color: #bfe3cd;
    background: var(--ok-soft);
    color: var(--ok);
}
.check-fail {
    border-style: solid;
    border-color: #f6c9c5;
    background: var(--danger-soft);
    color: var(--danger);
}
.check-loading { border-style: solid; border-color: var(--line); background: #f8fafb; color: var(--muted); }

.check-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.check-title .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.check-text { margin: 0; font-size: 13px; line-height: 1.6; color: inherit; opacity: .9; }

.check-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.check-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .7);
    font-size: 12.5px;
    color: var(--ink-2);
}
.check-list li strong { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

.page-actions { margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.actions-hint { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------------------------------- 门店列表 ---------------------------------- */
.search-row { display: flex; gap: 8px; align-items: center; }
.search-input {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 44px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--muted);
}
.search-input input {
    flex: 1;
    min-height: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 14px;
}
.search-input input:focus { box-shadow: none; }
.search-input input::-webkit-search-cancel-button { display: none; }

.list-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    color: var(--muted);
    padding: 0 2px;
}
.list-meta-tip { font-size: 12px; }

.store-list { display: flex; flex-direction: column; gap: 12px; }

.store-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px 12px;
}

.store-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.store-name { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.2px; word-break: break-all; }
.store-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.store-code { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.contact-item { min-width: 0; }
.contact-role { font-size: 11px; color: var(--muted); }
.contact-line { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; }
.contact-name { font-size: 13.5px; font-weight: 500; }
.contact-phone { font-size: 13px; color: var(--brand); font-variant-numeric: tabular-nums; }
.contact-phone a { color: inherit; }

.store-loc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f7fafa;
    font-size: 12px;
    color: var(--muted);
}
.store-loc b { color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }

.store-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.store-actions .btn { flex: 1; }

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px 24px;
    text-align: center;
}
.empty-icon {
    width: 62px; height: 62px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
}
.empty h3 { margin: 4px 0 0; font-size: 16px; }
.empty p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }

.load-more { color: var(--muted); }

/* ---------------------------------- 地图页 ---------------------------------- */
.map-page {
    position: relative;
    height: calc(100vh - var(--tabbar-h) - 55px);
    height: calc(100dvh - var(--tabbar-h) - 55px);
    margin-top: 0;
}
.map-full {
    position: absolute;
    inset: 0;
    background: #eaf0f1;
    touch-action: none;
}

.map-toolbar {
    position: absolute;
    right: 14px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
}
.map-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    color: var(--ink-2);
    font-size: 12.5px;
    box-shadow: var(--shadow);
}
.map-tool:active { background: #f1f5f9; }

.map-legend {
    position: absolute;
    left: 14px;
    bottom: 18px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-2);
    box-shadow: var(--shadow-sm);
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.map-legend em { font-style: normal; color: var(--muted); }

.sheet {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 70px;
    z-index: 8;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 8px 16px 14px;
    max-height: 52%;
    overflow-y: auto;
    animation: sheet-in .18s ease;
}
@keyframes sheet-in { from { transform: translateY(10px); opacity: .6; } to { transform: none; opacity: 1; } }

.sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.sheet-body { margin-top: 10px; display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.sheet-body .row { display: flex; justify-content: space-between; gap: 10px; }
.sheet-body .row span:first-child { color: var(--muted); }
.sheet-body .row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-actions { display: flex; gap: 8px; margin-top: 12px; }
.sheet-actions .btn, .sheet-actions a { flex: 1; }

/* ---------------------------------- 登录页 ---------------------------------- */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 520px;
    margin: 0 auto;
    padding: calc(48px + env(safe-area-inset-top, 0px)) 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.login-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-align: center;
}
.login-hero .brand-mark.lg { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.login-hero h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: .5px; }
.login-hero p { margin: 0; font-size: 12.5px; opacity: .82; }

.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 22px 20px 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
}

.login-card .field { margin-bottom: 14px; }
.login-card .field label { font-size: 13px; }
.login-foot { margin: 14px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); }
.login-copyright { margin: 0; text-align: center; font-size: 11px; color: var(--muted); }

.form-error {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 9px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 12.5px;
}

/* ---------------------------------- 底部导航 ---------------------------------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
    transition: color .15s;
}
.tab-item.active { color: var(--brand); font-weight: 600; }
.tab-item.active .tab-icon { transform: translateY(-1px); }
.tab-icon { transition: transform .15s; }

/* ---------------------------------- Toast / Modal / Loading ---------------------------------- */
.toast-wrap {
    position: fixed;
    left: 50%;
    top: calc(66px + env(safe-area-inset-top, 0px));
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: max-content;
    max-width: 86vw;
    pointer-events: none;
}
.toast {
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(15, 23, 42, .9);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: var(--shadow);
    animation: toast-in .18s ease;
}
.toast.ok { background: rgba(21, 128, 61, .94); }
.toast.err { background: rgba(180, 35, 24, .94); }
.toast.warn { background: rgba(180, 83, 9, .94); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(2px);
}
.modal {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    animation: toast-in .16s ease;
}
.modal h3 { margin: 0 0 8px; font-size: 16px; }
.modal p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; white-space: pre-wrap; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

.loading-mask {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(2px);
    font-size: 13px;
    color: var(--muted);
}
.spinner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(15, 118, 110, .18);
    border-top-color: var(--brand);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------- 地图气泡 / 标记（各 SDK 共用） ---------------------------------- */
.map-pin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--brand);
    color: var(--brand-dark);
    font-size: 11px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .16);
}
.map-pin.self { border-color: var(--warn); color: var(--warn); background: #fffaf2; }

/* ---------------------------------- 工具类 ---------------------------------- */
[hidden] { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); border: 0;
}

/* ---------------------------------- 前台 H5 ---------------------------------- */
.h5-hero {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    color: #fff;
    padding: 18px 18px 16px;
    position: relative;
}
.h5-hero-inner { display: flex; align-items: center; gap: 12px; }
.h5-hero h1 { margin: 0; font-size: 20px; letter-spacing: .5px; }
.h5-hero p { margin: 4px 0 0; font-size: 12px; color: rgba(255,255,255,.82); line-height: 1.5; }
.h5-admin-link {
    position: absolute; right: 14px; top: 14px;
    font-size: 12px; color: rgba(255,255,255,.85);
    text-decoration: none; border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px; padding: 3px 10px;
}
.h5-admin-link:hover { background: rgba(255,255,255,.14); }
.is-h5 .page { padding-top: 14px; }

/* ---------------------------------- 工具栏 ---------------------------------- */
.toolbar-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; flex-wrap: wrap;
}
.toolbar-row .search-input { flex: 1 1 180px; }
.toolbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.toolbar-actions .btn { white-space: nowrap; }

/* ---------------------------------- 产品勾选 ---------------------------------- */
.product-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.product-item {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid #d7e1e8; border-radius: 10px;
    padding: 10px 12px; background: #fff; cursor: pointer;
    min-height: 44px; box-sizing: border-box;
    transition: border-color .15s, background .15s;
}
.product-item input { width: 18px; height: 18px; accent-color: var(--brand); flex: 0 0 auto; }
.product-item .product-name { font-size: 14px; color: #0f172a; line-height: 1.35; word-break: break-all; }
.product-item .product-code { font-size: 11px; color: #64748b; margin-left: auto; }
.product-item.checked { border-color: var(--brand); background: #ecfdf5; }
.product-item:hover { border-color: var(--brand); }

.store-products {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-top: 8px; font-size: 12px;
}
.product-tag {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    background: #ecfdf5; color: var(--brand-dark); font-size: 12px;
}
.product-empty { color: #94a3b8; font-size: 12px; }

/* ---------------------------------- 产品管理 ---------------------------------- */
.product-list { display: flex; flex-direction: column; gap: 10px; }
.product-card {
    background: #fff; border: 1px solid #e2e8ee; border-radius: 12px;
    padding: 12px 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.product-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.product-card-name { margin: 0; font-size: 16px; color: #0f172a; }
.product-card-sub { margin: 4px 0 0; font-size: 12px; color: #64748b; }
.product-card-spec, .product-card-remark { margin: 6px 0 0; font-size: 12px; color: #475569; }
.product-card-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.badge.ok { background: #ecfdf5; color: var(--brand-dark); }
.badge.muted { background: #f1f5f9; color: #64748b; }

.form-mask {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(15,23,42,.45);
    display: flex; align-items: flex-end; justify-content: center;
    padding: 16px;
}
.form-panel {
    width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
    background: #fff; border-radius: 14px; padding: 16px;
    box-shadow: 0 20px 40px rgba(15,23,42,.24);
}
.form-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.form-panel-head h3 { margin: 0; font-size: 17px; }
.form-panel-actions { display: flex; gap: 10px; margin-top: 14px; }
.form-panel-actions .btn { flex: 1; }
.switch-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: #475569; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--brand); }

@media (max-width: 420px) {
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .toolbar-actions .btn { padding-left: 10px; padding-right: 10px; }
}
/* 产品勾选：覆盖全局 input 样式 */
.product-grid { width: 100%; }
.product-item { min-width: 0; }
.product-item input[type="checkbox"],
.switch-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    flex: 0 0 20px;
    accent-color: var(--brand);
}
.product-item input[type="checkbox"]:focus,
.switch-row input[type="checkbox"]:focus { box-shadow: none; background: transparent; }
.product-item .product-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}
.product-item .product-code {
    flex: 0 1 auto;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 自绘勾选框 */
.product-item input[type="checkbox"],
.switch-row input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    position: relative;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
}
.product-item input[type="checkbox"]:checked,
.switch-row input[type="checkbox"]:checked {
    background: var(--brand);
    border-color: var(--brand);
}
.product-item input[type="checkbox"]:checked::after,
.switch-row input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}