:root {
    --primary: #2b5ce6;
    --primary-hover: #1f4bd0;
    --text: #1f2329;
    --text-2: #646a73;
    --text-3: #8f959e;
    --line: #e5e6eb;
    --line-2: #f0f1f3;
    --bg: #f5f6f8;
    --card: #ffffff;
    --ok: #00b42a;
    --ok-bg: #e8ffea;
    --danger: #f53f3f;
    --danger-bg: #ffece8;
    --warn: #ff7d00;
    --warn-bg: #fff7e8;
    --info-bg: #e8f0ff;
    --radius: 4px;
}

* { box-sizing: border-box; }

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;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

/* ===== 布局：侧边导航 + 顶部栏 ===== */
.page { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
    width: 224px;
    flex: 0 0 224px;
    background: #fff;
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--line-2);
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex: 0 0 28px;
}

/* 名称完整显示：不用省略号，长名称换行并适当缩字号，不挤压右侧控件 */
.brand-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .2px;
    min-width: 0;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.brand-name-long { font-size: 13px; line-height: 1.3; }

.side-nav { padding: 10px; display: flex; flex-direction: column; gap: 3px; }

.side-link {
    display: block;
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
}

.side-link:hover { background: #f2f3f5; color: var(--text); }
.side-link.active { background: var(--info-bg); color: var(--primary); font-weight: 500; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    min-height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-2); flex: 0 0 auto; white-space: nowrap; }

.user-chip { display: inline-flex; align-items: center; gap: 6px; }
.user-chip em { font-style: normal; font-size: 12px; color: var(--text-3); }
.topbar-link { color: var(--text-2); text-decoration: none; }
.topbar-link:hover { color: var(--primary); }

.content { padding: 20px 24px 34px; width: 100%; max-width: 1680px; }
.footer { display: none; }

/* ===== 标题与说明 ===== */
.page-title { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.page-desc { font-size: 13.5px; color: var(--text-3); margin: 0 0 16px; line-height: 1.65; }

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 15.5px;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--text);
}

.card h2:last-child { margin-bottom: 0; }

/* ===== 统计卡 ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
}

/* 统计行第一格：新增门店（仅超管，主色卡片） */
.stat-add {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.stat-add:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.stat-add-icon {
    width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .22);
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1;
}
.stat-add-text { font-size: 15px; font-weight: 600; margin-top: 6px; }
.stat-add-sub { font-size: 12px; color: rgba(255, 255, 255, .78); }

.stat-label { font-size: 13px; color: var(--text-3); }
.stat-value { font-size: 24px; font-weight: 600; margin-top: 6px; line-height: 1.2; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }

/* 批量改派：默认折叠，仅超管可见 */
.assign-col { display: none; }
body.assign-open .assign-col { display: table-cell; }
.assign-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background: #fafbfc;
}
.assign-panel .assign-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
#assignToggle.active { background: var(--info-bg); border-color: #c7d6fb; color: var(--primary); }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }

table.data th {
    background: #fafafa;
    color: var(--text-2);
    font-weight: 500;
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

table.data td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line-2);
    color: var(--text);
    vertical-align: middle;
}

table.data tbody tr:hover { background: #fafbfc; }
table.data tbody tr:last-child td { border-bottom: 0; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 34px;
    padding: 0 16px;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}

.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #f7f8fa; border-color: #d0d3d9; color: var(--text); }

.btn-danger { background: #fff; color: var(--danger); border-color: #ffd2cc; }
.btn-danger:hover { background: var(--danger-bg); border-color: #ffbdb3; color: var(--danger); }

.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-strong { height: 38px; padding: 0 18px; font-weight: 600; box-shadow: 0 2px 10px rgba(43, 92, 230, .28); }
.btn-block { width: 100%; height: 40px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ===== 表单 ===== */
input[type="text"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="tel"],
input[type="number"],
input[type="email"],
select,
textarea {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    max-width: 100%;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(43, 92, 230, .08);
}

input[readonly] { background: #fafbfc; color: var(--text-2); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); }
.phone-cc { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-2); color: var(--text-2); font-size: 12px; font-weight: 400; vertical-align: 1px; white-space: nowrap; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px 18px;
    margin-bottom: 16px;
}

.field-full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

/* 门店列表：搜索 + 筛选（窄屏自动换行，不横向滚动） */
.filter-form { display: flex; flex-direction: column; gap: 8px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-search { flex: 0 1 420px; min-width: 240px; max-width: 100%; }
.filter-count { margin-left: auto; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.filter-group { display: inline-flex; align-items: center; gap: 6px; }
.filter-bar select { max-width: 100%; }
.filter-sep { color: var(--text-3); font-size: 12.5px; }

/* ===== 首页概览 ===== */
.line-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.line-tab {
    display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 16px; background: #fff;
    color: var(--text-2); font-size: 13px; text-decoration: none; white-space: nowrap;
}
.line-tab:hover { border-color: #c7d6fb; color: var(--primary); }
.line-tab.active { background: var(--info-bg); border-color: #c7d6fb; color: var(--primary); font-weight: 600; }

.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.dash-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.dash-label { font-size: 12.5px; color: var(--text-3); }
.dash-value { font-size: 22px; font-weight: 600; margin-top: 6px; line-height: 1.2; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.dash-grid .card { margin-bottom: 14px; }

/* 概览趋势：横向柱状，一行一项，区域内滚动 */
.chart-card { height: 352px; display: flex; flex-direction: column; }
.chart-card h2 { flex: 0 0 auto; }
.hbar-list { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding-right: 4px; }
.hbar-row {
    display: flex; align-items: center; gap: 8px; height: 26px; font-size: 12.5px;
    color: var(--text-2); border-radius: 3px;
}
.hbar-row:hover { background: #fafbfc; }
.hbar-label { flex: 0 0 66px; max-width: 66px; white-space: nowrap; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hbar-track { flex: 1 1 auto; min-width: 0; height: 9px; background: #f2f3f5; border-radius: 5px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: #6d8df0; border-radius: 5px; min-width: 2px; }
.hbar-row:hover .hbar-fill { background: var(--primary); }
.hbar-value {
    flex: 0 0 46px; max-width: 46px; text-align: right; white-space: nowrap;
    color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums;
}

.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rank-name { flex: 0 0 150px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.rank-track { flex: 1 1 auto; height: 9px; background: #f2f3f5; border-radius: 5px; overflow: hidden; }
.rank-bar { display: block; height: 100%; background: #6d8df0; border-radius: 5px; }
.rank-value { flex: 0 0 auto; min-width: 70px; text-align: right; color: var(--text-2); white-space: nowrap; }

/* 注册链接 + 二维码（按产品线分组，一行 3 个） */
.qr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 20px; row-gap: 16px; align-items: stretch; }
.qr-item {
    display: flex; flex-direction: column; gap: 12px;
    border: 1px solid var(--line-2); border-radius: 6px; padding: 16px; background: #fcfcfd;
}
.qr-item .qr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; }
.reg-qr {
    width: 140px; height: 140px; flex: 0 0 auto; background: #fff;
    border-radius: 6px; overflow: hidden; line-height: 0;
}
.reg-qr canvas { display: block; }
.link-row { display: flex; align-items: center; gap: 8px; }
.link-row input[type="text"] {
    flex: 1 1 auto; min-width: 0; height: 30px; font-size: 12px;
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.copy-btn { flex: 0 0 56px; width: 56px; height: 30px; padding: 0; justify-content: center; }
.qr-actions { display: flex; gap: 8px; margin-top: auto; }
.qr-actions .btn { flex: 1 1 0; min-width: 0; height: 30px; padding: 0 8px; font-size: 12px; }
.ch-expand td { background: #fafbfc; padding: 14px 16px; }
.ch-expand .qr-item { background: #fff; }
.ch-toggle.active { background: var(--info-bg); border-color: #c7d6fb; color: var(--primary); }

/* 可授权产品线：并排勾选 */
.line-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.line-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.line-pick {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; flex: 1 1 0; min-width: 92px; height: 32px; padding: 0 12px;
    border: 1px solid #d9dce3; border-radius: 6px; background: #fff;
    font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none;
}
.line-pick input {
    position: absolute; width: 0; height: 0; opacity: 0; margin: 0; pointer-events: none;
}
.line-pick::before {
    content: ''; flex: 0 0 18px; width: 18px; height: 18px;
    border: 1px solid #c9cdd4; border-radius: 4px; background: #fff no-repeat center / 12px 12px;
    transition: background-color .12s, border-color .12s;
}
.line-pick:hover { border-color: #b9c8f5; }
.line-pick:has(input:checked) { border-color: var(--primary); background: var(--info-bg); color: var(--primary); font-weight: 600; }
.line-pick:has(input:checked)::before {
    background-color: var(--primary); border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3.2L13 4.8'/%3E%3C/svg%3E");
}
.line-pick:has(input:focus-visible) { box-shadow: 0 0 0 2px rgba(43, 92, 230, .18); }
.line-all {
    flex: 0 0 auto; min-width: 0; height: 32px; padding: 0 4px; gap: 6px; white-space: nowrap;
    border: 0; background: none; font-size: 12.5px; font-weight: 500; color: var(--text-2);
}
.line-all::before { width: 16px; height: 16px; flex-basis: 16px; border-radius: 4px; }
.line-all:has(input:checked) { background: none; border-color: transparent; color: var(--text-2); font-weight: 500; }
.line-note { font-size: 12px; color: var(--text-3); }
.line-picker.disabled { opacity: .45; }
.line-picker.disabled .line-pick { pointer-events: none; }
.line-picker.error { outline: 1px solid var(--danger); outline-offset: 5px; border-radius: 6px; }
.line-error { display: none; margin-top: 6px; font-size: 12px; color: var(--danger); }
.line-error.show { display: block; }
.line-picker-sm { gap: 6px; }
.line-picker-sm .line-pick { height: 26px; padding: 0 7px; gap: 5px; flex: 0 0 auto; min-width: 0; font-size: 11.5px; white-space: nowrap; }
.line-picker-sm .line-pick::before { width: 15px; height: 15px; flex-basis: 15px; border-radius: 3px; background-size: 10px 10px; }
.line-picker-sm .line-all { height: 26px; font-size: 11.5px; padding: 0 2px; }
.line-form { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin: 0 0 6px; width: 100%; max-width: 100%; }
.line-form > .line-picker { width: 100%; max-width: 100%; }
.line-form .line-error { margin-top: 4px; }
.line-form > .btn { margin-top: 8px; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }

@media (max-width: 900px) {
    .qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .qr-grid { grid-template-columns: minmax(0, 1fr); }
    .line-pick { flex: 1 1 calc(50% - 6px); }
}

@media (max-width: 720px) {
    .rank-name { flex-basis: 96px; max-width: 96px; }
    .hbar-label { flex-basis: 58px; max-width: 58px; }
    .chart-card { height: 320px; }
}

/* ===== 标签 ===== */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 20px;
    white-space: nowrap;
}

.badge-ok { background: var(--ok-bg); color: #009a29; }
.badge-danger { background: var(--danger-bg); color: #cb2634; }
.badge-warn { background: var(--warn-bg); color: #d25f00; }
.badge-info { background: var(--info-bg); color: var(--primary); }
.badge-muted { background: #f2f3f5; color: var(--text-2); }

/* ===== 提示条 ===== */
.flash {
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 14px;
    border: 1px solid transparent;
}

.flash-success { background: #f0fff4; border-color: #c6f5cf; color: #00861f; }
.flash-error { background: #fff2f0; border-color: #ffd2cc; color: #cb2634; }

.notice {
    padding: 12px 14px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: var(--radius);
    color: #ad6800;
    font-size: 13.5px;
    line-height: 1.65;
}

/* ===== 通用 ===== */
.muted { color: var(--text-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }

.empty { padding: 32px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ===== 统一分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line-2);
    font-size: 13.5px;
    color: var(--text-2);
}

.pager-total { color: var(--text-3); margin-right: 4px; }

.pager-link {
    display: inline-block;
    min-width: 34px;
    height: 34px;
    line-height: 32px;
    padding: 0 10px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text-2);
    text-decoration: none;
    background: #fff;
}

.pager-link:hover { border-color: var(--primary); color: var(--primary); }
.pager-link.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-link.disabled { color: var(--text-3); background: #fafafa; cursor: not-allowed; }
.pager-link.disabled:hover { border-color: var(--line); color: var(--text-3); }
.pager-gap { color: var(--text-3); padding: 0 2px; }
.pager-pages { color: var(--text-3); margin: 0 6px; }

.pager-per { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--text-3); }
.pager-per-item {
    display: inline-block;
    min-width: 30px;
    height: 30px;
    line-height: 28px;
    padding: 0 8px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text-2);
    text-decoration: none;
    background: #fff;
}
.pager-per-item:hover { border-color: var(--primary); color: var(--primary); }
.pager-per-item.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.cell-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

/* ===== 详情页顶部操作条（滚动时吸顶） ===== */
.action-bar {
    position: sticky;
    top: 68px;
    z-index: 9;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin: 0 0 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(31, 35, 41, .08);
}

.action-bar .bar-label { font-size: 13px; color: var(--text-3); }
.action-bar .bar-group { display: inline-flex; align-items: center; gap: 8px; }
.action-bar .divider { width: 1px; height: 24px; background: var(--line); }
.action-bar .spacer { flex: 1; }

@media (max-width: 720px) {
    .action-bar { position: static; }
}

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
.detail-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 14px; }
.detail-row .k { width: 96px; flex: 0 0 96px; color: var(--text-3); }
.detail-row .v { flex: 1; min-width: 0; word-break: break-word; }

/* 门店详情：基本信息 + 绑定机器 双栏 */
.store-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; margin-bottom: 16px; }
.store-split > .card { margin-bottom: 0; }
.detail-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mb-list { display: flex; flex-direction: column; gap: 10px; }
.mb-item { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; }
.mb-item .mb-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.mb-item .mb-meta { color: var(--text-3); font-size: 12.5px; margin-top: 4px; line-height: 1.6; }
@media (max-width: 1100px) {
    .store-split { grid-template-columns: 1fr; }
    .detail-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== 登录 / 公开注册页 ===== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #f8f9fb 0%, #eef1f7 55%, #e9edf5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-wrap { width: 100%; max-width: 400px; }

.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 22px 20px;
    box-shadow: 0 14px 36px rgba(31, 35, 41, .10), 0 2px 6px rgba(31, 35, 41, .04);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 14px;
    min-width: 0;
}
.auth-brand > span:last-child { min-width: 0; line-height: 1.35; overflow-wrap: anywhere; word-break: break-word; }

.auth-title { font-size: 19px; font-weight: 600; margin: 0 0 4px; }
.auth-subtitle { font-size: 13px; color: var(--text-3); margin: 0 0 16px; }

.auth-card .field { margin-bottom: 11px; }
.auth-card .field label { margin-bottom: 0; font-size: 12.5px; }
.auth-card .hint { line-height: 1.5; }
.auth-card .btn-block { margin-top: 6px; }

.reg-line {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 0 0 12px; padding: 7px 10px; border-radius: 6px;
    background: var(--info-bg); color: var(--text-2); font-size: 13px;
}
.reg-line strong { color: var(--primary); font-weight: 600; }

@media (max-width: 480px) {
    .auth-page { padding: 12px; align-items: flex-start; }
    .auth-wrap { max-width: 100%; }
    .auth-card { padding: 18px 16px; border-radius: 10px; }
}

.auth-foot {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
}

.auth-foot a { color: var(--text-2); text-decoration: none; }
.auth-foot a:hover { color: var(--primary); }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
    .page { flex-direction: column; }
    .sidebar {
        width: 100%;
        flex: none;
        height: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .side-nav { flex-direction: row; overflow-x: auto; padding: 7px 12px; gap: 4px; }
    .side-link { padding: 9px 12px; }
    .topbar { position: static; padding: 0 16px; }
    .content { padding: 16px 16px 26px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* 窄屏下表格保持可读列宽，改为卡片内横向滑动，不再挤压单元格 */
    table.data { min-width: 720px; }
    .table-wrap { max-width: 100%; }
    .toolbar { row-gap: 8px; }
    .toolbar > * { min-width: 0; }
}

@media (max-width: 520px) {
    .stats { grid-template-columns: 1fr; }
    .page-title { font-size: 17px; }
    .card { padding: 14px; }
    table.data { font-size: 13px; }
    .topbar-right .user-chip em { display: none; }
}

/* ===== 产品线标签（门店列表） ===== */
.line-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0 0 14px;
    overflow-x: auto;
    scrollbar-width: none;
}

.line-tabs::-webkit-scrollbar { display: none; }

.line-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    height: 34px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}

.line-tab:hover { border-color: #c9cdd4; background: #f7f8fa; }

.line-tab.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.line-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--line-2);
    color: var(--text-2);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.line-tab.is-active .line-tab-count {
    background: rgba(255, 255, 255, .24);
    color: #fff;
}

/* 渠道激活码额度 */
.quota-block {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 14px;
}
.quota-block + .quota-block { margin-top: 12px; }
.quota-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.quota-head .muted { font-size: 12px; color: var(--text-3); }
.quota-table { margin: 0; }
.quota-input { width: 88px; padding: 5px 8px; }
.quota-total {
    display: flex;
    align-items: center;
    gap: 8px;
}
.quota-total .quota-input { width: 84px; }
.quota-total .quota-input:disabled { background: var(--line-2); color: var(--text-3); }
.quota-unlimited {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
}
.quota-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    font-size: 12px;
}
.quota-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.quota-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--line-2);
    font-size: 12.5px;
    color: var(--text-2);
}
.quota-chip em { font-style: normal; font-weight: 600; color: var(--text); }
.quota-chip.is-empty { background: #fdecec; color: #b42318; }
.quota-chip.is-empty em { color: #b42318; }
.quota-self-title { font-size: 13px; margin-right: 4px; }
.quota-self .quota-chips { font-size: 13px; }
.quota-self-compact { padding: 12px 16px; }
.quota-self-compact .quota-chips { gap: 10px; }
.quota-self-compact + .card { margin-top: 14px; }
