/* =========================================================
   扫码红包系统 · 后台设计系统
   ========================================================= */
:root {
    --brand: #4f46e5;
    --brand-strong: #4338ca;
    --brand-soft: #eef0ff;
    --brand-grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 55%, #7c3aed 100%);
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e7ebf3;
    --line-soft: #f0f3f9;
    --surface: #ffffff;
    --canvas: #f4f6fb;
    --sidebar: #0d1526;
    --sidebar-2: #111c33;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --radius-lg: 18px;
    --radius-md: 13px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 18px 40px -24px rgba(15, 23, 42, .35), 0 1px 2px rgba(15, 23, 42, .04);
    --sidebar-w: 260px;
    --topbar-h: 66px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--canvas);
    color: var(--ink);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
code, .font-monospace { font-family: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace; }
::selection { background: #c7d2fe; color: #1e1b4b; }

/* ---------- 布局骨架 ---------- */
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120% 55% at 0% 0%, rgba(99, 102, 241, .22), transparent 60%),
        radial-gradient(90% 45% at 100% 100%, rgba(124, 58, 237, .16), transparent 60%),
        linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    color: #cbd5e1;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    position: relative;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--brand-grad);
    color: #fff;
    font-size: 21px;
    box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .9);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { color: #f8fafc; font-size: 15px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { color: #74829c; font-size: 11px; letter-spacing: .08em; }

.sidebar-close {
    position: absolute;
    right: 14px;
    top: 20px;
    border: 0;
    background: rgba(255, 255, 255, .06);
    color: #cbd5e1;
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.sidebar-nav { padding: 6px 14px 12px; flex: 1; }

.nav-group { margin-bottom: 3px; }

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: none;
    border-radius: 11px;
    color: #b3bfd4;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.nav-group-toggle > i:first-child { font-size: 16px; width: 18px; text-align: center; color: #7d8cab; transition: color .18s ease; }
.nav-group-toggle span { flex: 1; text-align: left; }

.nav-group-toggle:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-group-toggle:hover > i:first-child { color: #c7d2fe; }

.nav-arrow { font-size: 12px; color: #5b6b86; transition: transform .2s ease; }
.nav-group.open .nav-arrow { transform: rotate(180deg); }

.nav-group-items {
    display: none;
    margin: 2px 0 6px 20px;
    padding-left: 9px;
    border-left: 1px solid rgba(255, 255, 255, .08);
}
.nav-group.open .nav-group-items { display: block; }

.nav-group-items .side-link { padding: 8px 12px; margin-bottom: 2px; border-radius: 9px; }
.nav-group-items .side-link.active::before { display: none; }

.side-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: 11px;
    color: #b3bfd4;
    font-weight: 500;
    position: relative;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.side-link i { font-size: 16px; width: 18px; text-align: center; color: #7d8cab; transition: color .18s ease; }
.side-link span { flex: 1; }

.side-link:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.side-link:hover i { color: #c7d2fe; }

.side-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, .28), rgba(99, 102, 241, .1));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .22);
}

.side-link.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    border-radius: 0 4px 4px 0;
    background: #818cf8;
    box-shadow: 0 0 14px rgba(129, 140, 248, .9);
}

.side-link.active i { color: #c7d2fe; }

.sidebar-foot { padding: 14px; }

.quick-card {
    border-radius: 15px;
    padding: 15px;
    background: linear-gradient(150deg, rgba(99, 102, 241, .22), rgba(15, 23, 42, .18));
    border: 1px solid rgba(129, 140, 248, .18);
}

.quick-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(129, 140, 248, .22);
    color: #c7d2fe;
    margin-bottom: 10px;
}

.quick-title { color: #f1f5f9; font-weight: 600; font-size: 13px; }
.quick-desc { color: #8493ad; font-size: 11.5px; margin: 3px 0 11px; line-height: 1.5; }

.sidebar-clear-cache {
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, .16);
    color: #b3bfd4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.sidebar-clear-cache:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .28); color: #fff; }

.sidebar-meta { text-align: center; color: #4d5c76; font-size: 11px; padding: 14px 0 4px; letter-spacing: .04em; }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 13, 24, .55);
    backdrop-filter: blur(2px);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.menu-toggle {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.topbar-crumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; min-width: 0; }
.topbar-crumb i { font-size: 10px; color: var(--muted-2); }
.topbar-crumb strong { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.topbar-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 16px;
    transition: all .18s ease;
}

.topbar-icon:hover { border-color: #c7d2fe; color: var(--brand); background: var(--brand-soft); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 4px 12px 4px 4px;
    color: var(--ink-2);
    font-weight: 500;
    font-size: 13px;
}

.user-chip:hover { border-color: #c7d2fe; }
.user-chip .bi-chevron-down { font-size: 10px; color: var(--muted-2); }

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-grad);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 6px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
}

.dropdown-item { border-radius: 8px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; }
.dropdown-item i { font-size: 14px; color: var(--muted); }
.dropdown-item:hover { background: var(--line-soft); }
.dropdown-item.text-danger i { color: var(--danger); }
.dropdown-menu form { margin: 0; }

/* ---------- 内容区 ---------- */
.app-content { padding: 28px; flex: 1; max-width: 1680px; width: 100%; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; color: var(--ink); }
.page-subtitle { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius-lg);
    --bs-card-inner-border-radius: var(--radius-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.card-body { padding: 20px; }

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--line-soft);
    padding: 15px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
}

.section-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.section-card .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
}
.section-title { font-size: 14px; font-weight: 650; margin: 0; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--brand); }
.section-sub { color: var(--muted-2); font-size: 12px; }

/* ---------- 快捷指标卡 ---------- */
.kpi-card {
    --kpi: var(--brand);
    --kpi-bg: var(--brand-soft);
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.kpi-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--kpi-bg);
    opacity: .55;
    pointer-events: none;
}

.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #dbe2ef; }

.kpi-icon {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 19px;
    color: var(--kpi);
    background: var(--kpi-bg);
}

.kpi-body { position: relative; z-index: 1; min-width: 0; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-bottom: 4px; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; color: var(--ink); }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-foot { margin-top: 6px; color: var(--muted-2); font-size: 11.5px; display: flex; align-items: center; gap: 6px; }
.kpi-foot .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.kpi-indigo { --kpi: #4f46e5; --kpi-bg: #eef0ff; }
.kpi-emerald { --kpi: #059669; --kpi-bg: #e8f8f1; }
.kpi-amber { --kpi: #d97706; --kpi-bg: #fdf3e2; }
.kpi-rose { --kpi: #e11d48; --kpi-bg: #fdeaef; }
.kpi-sky { --kpi: #0284c7; --kpi-bg: #e7f4fc; }
.kpi-violet { --kpi: #7c3aed; --kpi-bg: #f1eafe; }
.kpi-slate { --kpi: #475569; --kpi-bg: #eef1f6; }

/* ---------- 图表 ---------- */
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 190px;
    padding: 8px 2px 0;
}

.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.chart-value { font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; height: 16px; }
.chart-track {
    flex: 1;
    width: 100%;
    max-width: 44px;
    display: flex;
    align-items: flex-end;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc, #eef2f9);
    overflow: hidden;
}
.chart-fill {
    width: 100%;
    min-height: 3px;
    border-radius: 8px 8px 0 0;
    background: var(--brand-grad);
    opacity: .9;
    transition: height .5s ease;
}
.chart-col.is-today .chart-fill { background: linear-gradient(180deg, #22c55e, #059669); }
.chart-label { font-size: 11px; color: var(--muted-2); margin-top: 8px; white-space: nowrap; }
.chart-bars-reverse { flex-direction: row-reverse; }
.chart-bars-dense { gap: 5px; height: 170px; }
.chart-bars-dense .chart-track { max-width: 30px; border-radius: 5px; }
.chart-bars-dense .chart-fill { border-radius: 5px 5px 0 0; }
.chart-bars-dense .chart-label { font-size: 9.5px; transform: rotate(-38deg); transform-origin: center; margin-top: 14px; white-space: nowrap; }
.chart-bars-dense .chart-value { font-size: 9.5px; height: 13px; }

.table-scroll { max-height: 480px; overflow-y: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; }
.table-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: #d8dfea; border-radius: 8px; }

/* ---------- 表格 ---------- */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-responsive { border-radius: inherit; }

.table {
    --bs-table-color: var(--ink-2);
    --bs-table-hover-bg: #f8faff;
    --bs-table-border-color: var(--line-soft);
    margin: 0;
    font-size: 13px;
}

.table > :not(caption) > * > * { padding: 12px 16px; vertical-align: middle; }

.table thead th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table tbody tr { transition: background .15s ease; }
.table tbody td { border-bottom: 1px solid var(--line-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8faff; }

.table-sm > :not(caption) > * > * { padding: 10px 14px; }

.cell-title { font-weight: 600; color: var(--ink); }
.cell-sub { color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.code-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 8px;
    border-radius: 7px;
    background: #f4f6fb;
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
}
.code-chip:hover { border-color: #c7d2fe; color: var(--brand); }
.copy-btn {
    border: 0;
    background: transparent;
    color: var(--muted-2);
    padding: 0;
    line-height: 1;
    font-size: 12px;
}
.copy-btn:hover { color: var(--brand); }

.amount { font-weight: 650; color: #e11d48; font-variant-numeric: tabular-nums; }
.amount-muted { color: var(--muted); font-weight: 500; }

.user-inline { display: flex; align-items: center; gap: 8px; }
.avatar-sm {
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    background: #eef0ff; color: var(--brand);
    font-size: 11.5px; font-weight: 600; flex: 0 0 28px;
}

.table-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.action-btn {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    color: var(--muted);
    border: 1px solid transparent;
    background: transparent;
    font-size: 14px;
    transition: all .15s ease;
}
.action-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: #dfe3ff; }
.action-btn.danger:hover { background: #fdeaef; color: var(--danger); border-color: #f8d3dd; }

.table-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--line-soft);
    background: #fff;
}

.table-foot .meta { color: var(--muted-2); font-size: 12px; }

/* ---------- 分页 ---------- */
.table-foot-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-2);
    font-size: 12.5px;
    white-space: nowrap;
}
.table-foot-meta i { font-size: 13px; color: #b8c1d1; }
.table-foot-meta strong { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.table-foot-meta .meta-sep { width: 1px; height: 12px; background: var(--line); }

.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.pager-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.pager-btn:hover {
    color: var(--brand-strong);
    background: var(--brand-soft);
    border-color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -12px rgba(79, 70, 229, .9);
}

.pager-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(99, 102, 241, .22); }

.pager-btn.is-active {
    color: #fff;
    background: var(--brand-grad);
    border-color: transparent;
    box-shadow: 0 10px 18px -12px rgba(79, 70, 229, .95);
    cursor: default;
}

.pager-btn.pager-nav { color: var(--muted); font-size: 13px; }
.pager-btn.pager-nav:hover { color: var(--brand-strong); }

.pager-btn.is-disabled,
.pager-btn.is-disabled:hover {
    color: #cbd5e1;
    background: #f8fafc;
    border-color: var(--line-soft);
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

.pager-dots {
    min-width: 22px;
    text-align: center;
    color: var(--muted-2);
    font-size: 12px;
    letter-spacing: 1px;
    user-select: none;
}

@media (max-width: 575.98px) {
    .table-foot { justify-content: center; }
    .table-foot-meta { width: 100%; justify-content: center; }
    .pager-btn { min-width: 30px; height: 30px; }
}

/* ---------- 徽标 ---------- */
.badge { font-weight: 600; padding: .38em .68em; border-radius: 999px; font-size: 11px; letter-spacing: .01em; }
.badge-soft-success { background: #e8f8f1; color: #047857; }
.badge-soft-warning { background: #fdf3e2; color: #b45309; }
.badge-soft-info { background: #e7f4fc; color: #0369a1; }
.badge-soft-secondary { background: #eef1f6; color: #475569; }
.badge-soft-danger { background: #fdeaef; color: #be123c; }
.badge-soft-primary { background: var(--brand-soft); color: var(--brand-strong); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 5px; background: currentColor; }

/* ---------- 按钮 ---------- */
.btn { --bs-btn-font-size: 13px; --bs-btn-font-weight: 550; border-radius: var(--radius-sm); padding: .48rem .95rem; transition: all .18s ease; }
.btn-sm { --bs-btn-font-size: 12.5px; padding: .38rem .7rem; border-radius: 9px; }
.btn-lg { --bs-btn-font-size: 15px; padding: .68rem 1.2rem; border-radius: 12px; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-strong);
    --bs-btn-hover-border-color: var(--brand-strong);
    --bs-btn-active-bg: var(--brand-strong);
    --bs-btn-active-border-color: var(--brand-strong);
    box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .8);
}

.btn-brand { background: var(--brand-grad); border: 0; color: #fff; box-shadow: 0 10px 20px -10px rgba(79, 70, 229, .85); }
.btn-brand:hover { color: #fff; filter: brightness(1.06); }

.btn-light { --bs-btn-bg: #f3f5fa; --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink-2); --bs-btn-hover-bg: #e9edf5; }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: #dbe2ee; --bs-btn-hover-bg: #f3f5fa; --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #cbd5e1; }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: #c7d2fe; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.btn-outline-danger { --bs-btn-color: var(--danger); --bs-btn-border-color: #f6c9d4; --bs-btn-hover-bg: var(--danger); --bs-btn-hover-border-color: var(--danger); }
.btn-outline-dark { --bs-btn-color: var(--ink); --bs-btn-border-color: #cfd8e6; --bs-btn-hover-bg: var(--ink); }
.btn-outline-success { --bs-btn-color: #059669; --bs-btn-border-color: #b9e8d5; --bs-btn-hover-bg: #059669; --bs-btn-hover-border-color: #059669; }
.btn-link { text-decoration: none; }

/* ---------- 表单 ---------- */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-text { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: #dfe5ef;
    padding: .52rem .8rem;
    font-size: 13px;
    color: var(--ink);
    background-color: #fff;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.form-control-sm, .form-select-sm { padding: .38rem .6rem; font-size: 12.5px; border-radius: 8px; }
.form-control::placeholder { color: #a8b3c5; }

.form-control:focus, .form-select:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, .13);
    color: var(--ink);
}

.input-group-text { border-color: #dfe5ef; background: #f8fafc; color: var(--muted); font-size: 12.5px; border-radius: var(--radius-sm); }

.form-check-input { border-color: #cbd5e1; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3.5px rgba(99, 102, 241, .13); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }

/* ---------- 筛选栏 ---------- */
.filter-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.filter-card .form-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }

/* ---------- 提示 / 空状态 ---------- */
.alert { border: 1px solid transparent; border-radius: var(--radius-md); font-size: 13px; padding: 12px 15px; display: flex; align-items: flex-start; gap: 9px; }
.alert i { margin-top: 1px; }
.alert-success { background: #ecfdf5; border-color: #c6f0dd; color: #047857; }
.alert-danger { background: #fef2f4; border-color: #fad1da; color: #be123c; }
.alert-warning { background: #fffaeb; border-color: #fbe7b8; color: #b45309; }
.alert-info { background: #eff8ff; border-color: #cfe7fb; color: #0369a1; }
.alert .btn-close { margin-left: auto; padding: 10px; font-size: 9px; }

.warning-box {
    border: 1px solid #fbe7b8;
    background: linear-gradient(180deg, #fffdf5, #fffaeb);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 18px;
}
.warning-box .warning-title { display: flex; align-items: center; gap: 8px; font-weight: 650; color: #92400e; font-size: 13px; margin-bottom: 8px; }
.warning-box ul { margin: 0; padding-left: 20px; color: #b45309; font-size: 12.5px; line-height: 1.9; }

.empty-state { text-align: center; padding: 52px 20px; color: var(--muted-2); }
.empty-state .empty-icon {
    width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 12px;
    display: grid; place-items: center; background: #f3f5fa; color: #a8b3c5; font-size: 24px;
}
.empty-state .empty-title { color: var(--ink-2); font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }

/* ---------- 选择工具条 ---------- */
.selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line-soft);
    min-height: 52px;
}
.selection-info { color: var(--muted); font-size: 12.5px; }
.selection-info strong { color: var(--brand); }
.selection-actions { display: flex; gap: 8px; }

/* ---------- 分页 ---------- */
.pagination {
    --bs-pagination-color: var(--ink-2);
    --bs-pagination-border-color: var(--line);
    --bs-pagination-hover-bg: var(--brand-soft);
    --bs-pagination-hover-color: var(--brand);
    --bs-pagination-hover-border-color: #dfe3ff;
    --bs-pagination-active-bg: var(--brand);
    --bs-pagination-active-border-color: var(--brand);
    --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
    --bs-pagination-border-radius: 9px;
    gap: 4px;
    margin: 0;
}
.pagination .page-link { border-radius: 9px; min-width: 32px; text-align: center; padding: .32rem .6rem; font-size: 12.5px; }
.pagination .page-item:first-child .page-link, .pagination .page-item:last-child .page-link { border-radius: 9px; }

/* ---------- 进度条 ---------- */
.progress { background: #eef2f8; border-radius: 999px; }
.progress-bar { background: var(--brand-grad); }
.progress-bar.bg-success { background: linear-gradient(90deg, #34d399, #059669) !important; }
.progress-bar.bg-warning { background: linear-gradient(90deg, #fbbf24, #d97706) !important; }
.progress-bar.bg-danger { background: linear-gradient(90deg, #f87171, #dc2626) !important; }

.quota-text { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.quota-text span { color: var(--muted-2); }

/* ---------- 标签页 ---------- */
.nav-tabs { border-bottom: 1px solid var(--line); gap: 4px; }
.nav-tabs .nav-link {
    border: 0;
    color: var(--muted);
    font-weight: 550;
    font-size: 13px;
    padding: 10px 15px;
    border-radius: 10px 10px 0 0;
    position: relative;
}
.nav-tabs .nav-link:hover { color: var(--ink); background: #f6f8fc; }
.nav-tabs .nav-link.active { color: var(--brand); background: transparent; }
.nav-tabs .nav-link.active::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: -1px;
    height: 2px; border-radius: 2px;
    background: var(--brand);
}

.tab-panel { background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: 24px; }

/* 设置页左侧导航 */
.setting-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.setting-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 8px; position: sticky; top: calc(var(--topbar-h) + 18px); }
.setting-nav button {
    display: flex; align-items: center; gap: 9px;
    width: 100%; border: 0; background: transparent; color: var(--muted);
    text-align: left; font-size: 13px; font-weight: 550;
    padding: 10px 12px; border-radius: 10px; margin-bottom: 2px;
}
.setting-nav button i { font-size: 15px; }
.setting-nav button:hover { background: #f6f8fc; color: var(--ink); }
.setting-nav button.active { background: var(--brand-soft); color: var(--brand-strong); }
.setting-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 6px 22px 22px; box-shadow: var(--shadow-sm); }
.setting-row { display: grid; grid-template-columns: 210px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > label { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-top: 7px; }
.setting-row .form-text { margin-top: 5px; }
.save-bar {
    position: sticky; bottom: 0; z-index: 30;
    margin-top: 18px; padding: 14px 20px;
    background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    box-shadow: 0 -10px 30px -22px rgba(15, 23, 42, .4);
}

/* ---------- 信息列表 ---------- */
.info-list { display: grid; gap: 0; }
.info-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.info-item:last-child { border-bottom: 0; }
.info-item .label { color: var(--muted); flex: 0 0 auto; }
.info-item .value { color: var(--ink-2); text-align: right; word-break: break-all; }

.summary-tile { border-radius: var(--radius-md); background: #f8fafc; border: 1px solid var(--line-soft); padding: 12px 14px; }
.summary-tile .label { color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }
.summary-tile .value { font-weight: 650; font-size: 15px; color: var(--ink); }

/* ---------- 操作员配额概览 ---------- */
.operator-profile { display: flex; align-items: center; gap: 12px; }
.avatar-lg {
    width: 44px; height: 44px; border-radius: 14px;
    display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand);
    font-size: 18px; font-weight: 700; flex: 0 0 44px;
}
.operator-meta { min-width: 0; }
.operator-name { font-size: 15px; font-weight: 650; color: var(--ink); }
.operator-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-tile {
    border: 1px solid var(--line-soft); background: #f8fafc;
    border-radius: var(--radius-md); padding: 12px 14px;
    transition: border-color .15s ease, background .15s ease;
}
.stat-tile:hover { border-color: #dbe2ef; background: #fff; }
.stat-tile[data-bs-toggle="tooltip"] { cursor: help; }
.stat-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.stat-head i { color: var(--brand); font-size: 13px; }
.stat-value {
    margin-top: 6px; font-size: 20px; font-weight: 700; color: var(--ink);
    line-height: 1.2; font-variant-numeric: tabular-nums; word-break: break-all;
}

.quota-usage { margin-top: 14px; }
.field-sep { height: 1px; background: var(--line-soft); margin: 18px 0; }

@media (max-width: 575.98px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(60% 60% at 12% 15%, rgba(99, 102, 241, .35), transparent 60%),
        radial-gradient(50% 50% at 90% 85%, rgba(124, 58, 237, .28), transparent 60%),
        #0b1220;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 940px;
    min-height: 540px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .7);
}

.login-visual {
    position: relative;
    padding: 44px;
    color: #fff;
    background:
        radial-gradient(90% 70% at 0% 0%, rgba(129, 140, 248, .55), transparent 62%),
        linear-gradient(150deg, #1e1b4b 0%, #312e81 45%, #4f46e5 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.login-visual::after {
    content: "";
    position: absolute;
    width: 340px; height: 340px;
    right: -120px; bottom: -120px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 0 0 40px rgba(255, 255, 255, .04), 0 0 0 90px rgba(255, 255, 255, .02);
}

.login-visual .brand { padding: 0; }
.login-visual .brand-mark { background: rgba(255, 255, 255, .14); box-shadow: none; border: 1px solid rgba(255, 255, 255, .2); }
.login-visual .brand-text strong { color: #fff; font-size: 17px; }
.login-visual .brand-text span { color: rgba(224, 231, 255, .65); }

.login-hero h1 { font-size: 32px; line-height: 1.3; letter-spacing: -.02em; font-weight: 700; margin: 0 0 14px; }
.login-hero p { color: rgba(224, 231, 255, .72); font-size: 13.5px; line-height: 1.85; margin: 0; max-width: 320px; }
.login-points { display: flex; gap: 22px; margin-top: 26px; }
.login-point { font-size: 12px; color: rgba(224, 231, 255, .78); display: flex; align-items: center; gap: 7px; }
.login-point i { color: #a5b4fc; }

.login-foot { color: rgba(224, 231, 255, .45); font-size: 11.5px; position: relative; z-index: 1; }

.login-form-wrap { padding: 48px 46px; display: flex; flex-direction: column; justify-content: center; }
.login-form-wrap h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.login-form-wrap .login-desc { color: var(--muted); font-size: 13px; margin-bottom: 26px; }

.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 15px; }
.input-icon .form-control { padding-left: 40px; height: 46px; border-radius: 12px; }
.input-icon .toggle-eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--muted-2);
    width: 34px; height: 34px; border-radius: 8px;
}
.input-icon .toggle-eye:hover { color: var(--ink-2); background: #f3f5fa; }

.login-submit { height: 46px; border-radius: 12px; font-weight: 600; }

/* ---------- 封面图上传 ---------- */
.cover-upload-row { display: flex; gap: 8px; align-items: center; }
.cover-upload-row .form-control { flex: 1 1 auto; min-width: 0; }
.cover-upload-row .btn { flex: 0 0 auto; white-space: nowrap; }
.cover-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f8fafc;
}
.cover-preview-img {
    width: 72px; height: 72px;
    flex: 0 0 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}
.cover-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.5; }
.cover-dimension { font-weight: 600; color: var(--ink-2); }
.cover-ratio { color: var(--success); }
.cover-ratio-warn { color: var(--warning); }

/* ---------- 工具类 ---------- */
.text-muted-2 { color: var(--muted-2) !important; }
.text-ink { color: var(--ink) !important; }
.fw-650 { font-weight: 650 !important; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.stack-sm > * + * { margin-top: 10px; }
.mono-xs { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11.5px; }
.sticky-panel { position: sticky; top: calc(var(--topbar-h) + 18px); }
.form-hint-box { background: #f8fafc; border: 1px dashed #dbe2ee; border-radius: var(--radius-md); padding: 12px 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ---------- 响应式 ---------- */
@media (max-width: 1199.98px) {
    .app-content { padding: 22px; }
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: 20px 0 60px rgba(2, 6, 23, .45); }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    body.sidebar-open { overflow: hidden; }
    .app-main { margin-left: 0; }
    .app-topbar { padding: 0 18px; }
    .app-content { padding: 18px; }
    .setting-layout { grid-template-columns: 1fr; }
    .setting-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
    .setting-nav button { width: auto; }
    .login-shell { grid-template-columns: 1fr; max-width: 460px; min-height: auto; }
    .login-visual { display: none; }
    .login-form-wrap { padding: 38px 30px; }
}

@media (max-width: 575.98px) {
    .page-title { font-size: 21px; }
    .app-content { padding: 14px; }
    .app-topbar { height: 60px; padding: 0 14px; }
    .topbar-crumb span, .topbar-crumb i { display: none; }
    .kpi-card { padding: 15px; gap: 11px; }
    .kpi-icon { width: 38px; height: 38px; flex-basis: 38px; font-size: 17px; }
    .kpi-value { font-size: 21px; }
    .setting-row { grid-template-columns: 1fr; gap: 6px; }
    .chart-bars { gap: 6px; height: 160px; }
    .table > :not(caption) > * > * { padding: 10px 12px; }
}
