/* ============================================================================
 * 黄金珠宝管理系统 PC 后台样式
 * 主色：金色 #c8a45e / 深色 #1a1d29
 * 响应式：桌面优先，<=992px 自动转移动端布局
 * ========================================================================= */

:root {
    --primary: #c8a45e;
    --primary-dark: #a88944;
    --primary-light: #e8d3a3;
    --bg-dark: #1a1d29;
    --bg-side: #232634;
    --bg-side-hover: #2c3041;
    --text: #2b2f3a;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system,"PingFang SC","Microsoft YaHei",sans-serif; color: var(--text); background: #f4f6fa; }

/* 报表：筛选+KPI 冻结 */
.report-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: #f4f6fa;
    padding-bottom: 4px;
    margin-bottom: 4px;
}
.table-scroll {
    overflow: auto;
    max-height: 68vh;
}
.table-scroll .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f9fb;
    box-shadow: 0 1px 0 var(--border);
}
.sales-kpi { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; }
.sales-kpi .kpi { background:#f8f9fb; border-left:3px solid #c8a45e; padding:10px 16px; border-radius:6px; min-width:120px; }
.sales-kpi .kpi span { display:block; font-size:12px; color:#888; }
.sales-kpi .kpi strong { font-size:18px; color:#333; }
.ws-grid { display:grid; grid-template-columns:1fr 360px; gap:16px; }
@media (max-width:1200px){ .ws-grid { grid-template-columns:1fr; } }
.ws-kpi { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:12px; }
.ws-kpi span { background:#f8f9fb; padding:8px 14px; border-radius:6px; font-size:13px; }
.ws-kpi strong { color:#a88944; margin-left:6px; }
a { text-decoration: none; color: inherit; }

/* ===== 登录页（单屏紧凑） ===== */
.login-body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: #1a1d29;
}
.login-body:has(.login-wrap) {
    height: 100vh;
    overflow: hidden;
}

/* 演示环境 · TMS 风格双栏 */
.login-scene {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px clamp(20px, 4vw, 48px) 36px;
    background:
        radial-gradient(ellipse 70% 55% at 12% 18%, rgba(20, 184, 166, 0.16), transparent 58%),
        radial-gradient(ellipse 55% 45% at 88% 82%, rgba(59, 130, 246, 0.12), transparent 55%),
        linear-gradient(145deg, #0b1220 0%, #101a2b 45%, #0d1524 100%);
}
.login-scene__main {
    display: grid;
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}
.demo-login-intro {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}
.demo-login-intro__brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 10px;
}
.demo-login-intro__icon { font-size: 28px; line-height: 1; }
.demo-login-intro__eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: #5eead4;
    text-transform: uppercase;
}
.demo-login-intro__title {
    margin: 0 0 6px;
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 600;
    color: #fff;
}
.demo-login-intro__sub { margin: 0; font-size: 13px; color: #94a3b8; }
.demo-login-intro__scope {
    margin: 0 0 12px;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
}
.demo-login-intro__where {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(13, 148, 136, 0.15);
    border: 1px solid rgba(45, 212, 191, 0.25);
}
.demo-login-intro__where-label { font-size: 12px; color: #99f6e4; }
.demo-login-intro__where strong { font-size: 14px; color: #fff; }
.demo-login-intro__after {
    margin: 0 0 12px;
    font-size: 13px;
    color: #a5b4fc;
    line-height: 1.5;
}
.demo-login-intro__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.demo-login-intro__step {
    padding: 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.15);
}
.demo-login-intro__step-n {
    display: inline-flex;
    width: 22px; height: 22px;
    align-items: center; justify-content: center;
    border-radius: 50%;
    background: #0d9488;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}
.demo-login-intro__step-t { display: block; font-size: 13px; font-weight: 600; color: #f8fafc; }
.demo-login-intro__step-d { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; line-height: 1.4; }
.demo-login-intro__unify {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}
.demo-login-intro__unify a { color: #5eead4; }
.login-card__head { margin-bottom: 16px; }
.login-card__line-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}
.login-card__line-tag {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-light);
}
.login-chips--below-intro { margin-top: 12px; }
.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 28px 28px 22px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}
.login-card__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.login-card__brand h1 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}
.login-card__brand .login-brand__sub {
    margin: 0;
    font-size: 12px;
    color: var(--text-light);
}
.login-card__brand .login-brand__icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
    border-radius: 12px;
    background: rgba(200, 164, 94, 0.12);
    border: 1px solid rgba(200, 164, 94, 0.28);
}
.login-demo-role {
    margin: 0 0 18px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #0f766e;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.22);
}
.login-demo-role strong { color: #0d9488; font-weight: 600; }
.login-form--card .form-group { margin-bottom: 14px; }
.login-form--card .btn {
    margin-top: 6px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}
.login-form--card .btn:hover { background: linear-gradient(135deg, #0d9488, #0f766e); }
.login-card__foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #eef0f4;
    font-size: 12px;
}
.login-card__foot a { color: var(--primary); }

.demo-login-side {
    color: rgba(255, 255, 255, 0.92);
    padding: 8px 4px;
    max-height: calc(100vh - 64px);
    overflow: auto;
}
.demo-login-side__head h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
}
.demo-login-side__head p {
    margin: 0 0 22px;
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.58);
    max-width: 720px;
}
.demo-login-group { margin-bottom: 20px; }
.demo-login-group h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.04em;
}
.demo-login-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
}
.demo-login-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    font-family: inherit;
}
.demo-login-card:hover {
    border-color: rgba(45, 212, 191, 0.45);
    background: rgba(20, 184, 166, 0.1);
    transform: translateY(-1px);
}
.demo-login-card.is-active {
    border-color: rgba(45, 212, 191, 0.75);
    background: rgba(20, 184, 166, 0.16);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
}
.demo-login-card__name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.demo-login-card__cred {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.demo-login-card__desc {
    font-size: 11px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.48);
}

.login-wrap {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.login-banner {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 48px;
    color: #fff;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(200,164,94,0.18) 0%, transparent 60%),
        linear-gradient(145deg, #1a1d29 0%, #252a38 50%, #2d2618 100%);
    overflow: hidden;
}
.login-banner-inner {
    max-width: 480px;
    width: 100%;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}
.login-brand__icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: rgba(200,164,94,0.15);
    border: 1px solid rgba(200,164,94,0.3);
    flex-shrink: 0;
}
.login-banner h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 600;
    color: var(--primary-light);
    line-height: 1.3;
}
.login-brand__sub {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.55);
}
.login-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.login-chips span {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
}
.login-slogan {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.45);
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}
.login-line-badge {
    display: inline-block;
    margin: 0 0 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
}

.login-form-wrap {
    width: 420px;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
    box-shadow: -8px 0 32px rgba(0,0,0,0.12);
}
.login-form {
    width: 100%;
    max-width: 320px;
}
.login-form__head {
    margin-bottom: 28px;
    text-align: center;
}
.login-form__head h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
}
.login-form__head p {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
}
.login-form .form-group { margin-bottom: 16px; }
.login-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-light);
    font-size: 13px;
}
.login-form .form-control {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border .2s, box-shadow .2s;
    box-sizing: border-box;
}
.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200,164,94,0.15);
}
.login-form .btn {
    width: 100%;
    height: 42px;
    margin-top: 4px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}
.login-form .btn:hover { background: var(--primary-dark); }
.login-form .btn:disabled { opacity: 0.7; cursor: not-allowed; }
.login-form .msg {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
    text-align: center;
}
.login-form .msg.error { color: var(--danger); }
.login-form .msg.success { color: var(--success); }
.login-form .tips {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}
.login-form__demo-tag,
.login-slogan--demo {
    color: #b8860b;
    font-size: 13px;
    margin-top: 8px;
}
.demo-login-panel {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px dashed #d4b86a;
    border-radius: 8px;
    background: #fffbeb;
}
.demo-login-panel--compact { background: #f8f9fb; border-color: #e2e5ec; }
.demo-login-panel__title {
    font-size: 12px;
    font-weight: 600;
    color: #8a6d1d;
    margin-bottom: 8px;
}
.demo-login-panel__hint {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--text-light);
}
.demo-login-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.demo-login-role {
    padding: 6px 12px;
    border: 1px solid #e2c96b;
    border-radius: 999px;
    background: #fff;
    color: #6b5612;
    font-size: 12px;
    cursor: pointer;
}
.demo-login-role:hover,
.demo-login-role.is-active {
    background: #c9a227;
    border-color: #c9a227;
    color: #fff;
}
.demo-login-more {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-light);
}
.demo-login-more summary { cursor: pointer; color: var(--primary); }
.demo-login-links {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    font-size: 11px;
}
.demo-login-links li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}
.demo-login-links li:last-child { border-bottom: none; }
.demo-login-links a { color: var(--primary); font-weight: 500; }
.demo-login-links span { color: var(--text-light); }
.login-form-wrap .copyright {
    margin-top: 24px;
    font-size: 11px;
    color: #c5c9d2;
}

/* 登录页响应式 */
@media (max-width: 900px) {
    .login-scene { padding: 16px 14px 24px; }
    .login-scene__main {
        grid-template-columns: 1fr;
    }
    .demo-login-intro__steps { grid-template-columns: 1fr; }
    .demo-login-side {
        max-height: none;
        overflow: visible;
    }
    .demo-login-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .login-wrap { flex-direction: column; }
    .login-banner {
        flex: none;
        padding: 28px 24px 24px;
    }
    .login-banner-inner { max-width: none; }
    .login-brand { margin-bottom: 16px; }
    .login-banner h1 { font-size: 20px; }
    .login-brand__icon { width: 44px; height: 44px; font-size: 22px; }
    .login-slogan { display: none; }
    .login-form-wrap {
        width: 100%;
        flex: 1;
        box-shadow: none;
        padding: 28px 24px;
    }
}

/* ===== 主布局 ===== */
.layout { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar { height: 56px; background: var(--bg-dark); color: #fff; display: flex; align-items: center; padding: 0 20px; }
.topbar .logo-text { font-size: 16px; font-weight: 600; color: var(--primary-light); }
.topbar .sidebar-toggle { background: transparent; border: none; color: #fff; font-size: 20px; padding: 4px 12px; margin-right: 12px; cursor: pointer; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.shop-switcher select { background: var(--bg-side); border: 1px solid var(--bg-side-hover); color: #fff; }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.user-info .btn-logout { padding: 4px 10px; border: 1px solid var(--primary); border-radius: 4px; color: var(--primary-light); font-size: 12px; }
.user-info .btn-logout:hover { background: var(--primary); color: #fff; }

.layout-body { display: flex; flex: 1; overflow: hidden; }
.sidebar { width: 220px; background: var(--bg-side); color: #d1d5db; overflow-y: auto; flex-shrink: 0; transition: transform .3s; }
.sidebar .menu { list-style: none; padding: 12px 0; margin: 0; }
.sidebar .menu-item { }
.sidebar .menu-link { display: flex; align-items: center; padding: 10px 18px; cursor: pointer; transition: all .2s; font-size: 14px; }
.sidebar .menu-link:hover { background: var(--bg-side-hover); color: var(--primary-light); }
.sidebar .menu-link .icon { width: 20px; margin-right: 10px; font-size: 14px; }
.sidebar .submenu { list-style: none; padding: 0; margin: 0; max-height: 0; overflow: hidden; transition: max-height .3s; background: rgba(0,0,0,0.2); }
.sidebar .menu-item.open .submenu { max-height: 500px; }
.sidebar .submenu a { display: block; padding: 8px 18px 8px 48px; font-size: 13px; color: #9ca3af; }
.sidebar .submenu a:hover, .sidebar .submenu a.active { color: var(--primary-light); background: var(--bg-side-hover); }
.sidebar .has-children > .menu-link::after { content: '▾'; margin-left: auto; transition: transform .2s; opacity: 0.6; }
.sidebar .menu-item.open > .menu-link::after { transform: rotate(180deg); }

.main { flex: 1; position: relative; background: #f4f6fa; overflow: hidden; }
.main iframe { width: 100%; height: 100%; border: 0; }

/* 演示水印 */
.demo-watermark-layer {
  pointer-events: none;
  user-select: none;
  background-repeat: repeat;
  background-size: 380px 240px;
}
.demo-watermark-layer:not(.demo-watermark-layer--embed) {
  position: fixed;
  inset: 0;
  z-index: 99999;
}
.demo-watermark-layer--embed {
  position: absolute;
  inset: 0;
  z-index: 99990;
}
.page-body,
.dash-body,
.welcome-body {
  position: relative;
}

/* 移动端：侧栏抽屉 */
@media (max-width: 992px) {
    .sidebar { position: fixed; left: 0; top: 56px; bottom: 0; transform: translateX(-100%); z-index: 100; box-shadow: 2px 0 12px rgba(0,0,0,0.2); }
    .sidebar.show { transform: translateX(0); }
}

/* ===== 欢迎页 ===== */
.welcome-body { background: #f4f6fa; }
.welcome-wrap { padding: 24px; }
.welcome-banner { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: 12px; padding: 32px; margin-bottom: 24px; box-shadow: 0 4px 16px rgba(200,164,94,0.3); }
.welcome-banner h1 { margin: 0 0 8px; font-size: 24px; font-weight: 600; }
.welcome-banner p { margin: 0; opacity: 0.9; font-size: 14px; }
.quick-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; margin-bottom: 24px; }
.quick-card { background: #fff; border-radius: 10px; padding: 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: all .2s; }
.quick-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.qc-icon { font-size: 36px; width: 56px; height: 56px; background: var(--primary-light); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.qc-text h3 { margin: 0 0 4px; font-size: 16px; }
.qc-text p { margin: 0; font-size: 13px; color: var(--text-light); }
.welcome-info { background: #fff; border-radius: 10px; padding: 20px; }
.welcome-info p { margin: 6px 0; color: var(--text-light); font-size: 14px; }

/* ===== 数据驾驶舱 ===== */
.dash-body { background: linear-gradient(160deg, #1a1d29 0%, #232634 40%, #2a2418 100%); min-height: 100vh; }
.dash-wrap { padding: 16px 20px 32px; }
.dash-hero {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
    padding: 20px 24px; border-radius: 14px; margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(200,164,94,0.25), rgba(26,29,41,0.8));
    border: 1px solid rgba(200,164,94,0.35); box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.dash-hero h1 { margin: 0 0 4px; font-size: 22px; color: var(--primary-light); font-weight: 600; }
.dash-hero p { margin: 0; font-size: 13px; color: rgba(255,255,255,0.65); }
.dash-hero__right { display: flex; align-items: center; gap: 12px; }
.dash-select {
    height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(200,164,94,0.4);
    background: rgba(0,0,0,0.3); color: #fff; font-size: 13px;
}
.dash-user { font-size: 13px; color: rgba(255,255,255,0.7); }

.dash-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dash-tab {
    padding: 8px 16px; border: 1px solid rgba(255,255,255,0.12); border-radius: 20px;
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); font-size: 13px;
    cursor: pointer; transition: all .2s;
}
.dash-tab:hover { border-color: var(--primary); color: var(--primary-light); }
.dash-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border-color: transparent; font-weight: 500;
    box-shadow: 0 4px 12px rgba(200,164,94,0.4);
}

.dash-panel { display: none; animation: dashFadeIn .35s ease; }
.dash-panel.active { display: block; }
@keyframes dashFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.dash-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.dash-kpi {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 16px; text-align: center;
    backdrop-filter: blur(8px); transition: transform .2s;
}
.dash-kpi:hover { transform: translateY(-2px); border-color: rgba(200,164,94,0.3); }
.dash-kpi__icon { font-size: 24px; margin-bottom: 6px; }
.dash-kpi__val { font-size: 22px; font-weight: 700; color: var(--primary-light); }
.dash-kpi__val small { font-size: 12px; color: rgba(255,255,255,0.5); margin-left: 2px; }
.dash-kpi__lbl { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 4px; }

.dash-chart-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.dash-chart-card {
    flex: 1; min-width: 280px; background: rgba(255,255,255,0.95); border-radius: 12px;
    padding: 14px 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.dash-chart-card--wide { flex: 2; min-width: 400px; }
.dash-chart-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
.dash-chart { width: 100%; height: 280px; }
.dash-chart--tall { height: 340px; }

.dash-summary-list { padding: 12px 0; }
.dash-summary-item { display: flex; justify-content: space-between; padding: 12px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
.dash-summary-item strong { color: var(--primary-dark); }

.dash-mini-kpis { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.dash-mini-kpi {
    flex: 1; min-width: 140px; background: rgba(200,164,94,0.15); border: 1px solid rgba(200,164,94,0.3);
    border-radius: 10px; padding: 12px 16px; color: #fff;
}
.dash-mini-kpi span { display: block; font-size: 12px; opacity: 0.7; }
.dash-mini-kpi strong { font-size: 20px; color: var(--primary-light); }

.dash-table-wrap { overflow-x: auto; }
.dash-table { font-size: 13px; }
.dash-rank {
    display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center;
    border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
}

@media (max-width: 992px) {
    .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-chart-card--wide { min-width: 100%; }
}

/* ===== 错误页 ===== */
.error-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f4f6fa; }
.error-wrap { text-align: center; }
.error-wrap h1 { font-size: 80px; color: var(--primary); margin: 0; }
.error-wrap p { color: var(--text-light); margin: 8px 0 24px; }
.error-wrap .muted { font-size: 12px; }
.btn-primary { display: inline-block; padding: 8px 24px; background: var(--primary); color: #fff; border-radius: 6px; }

/* ===== 通用表单页/列表页基础 ===== */
.page { padding: 20px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { margin: 0; font-size: 18px; }
.toolbar { background: #fff; padding: 12px 16px; border-radius: 8px; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .form-control, .toolbar .form-select { width: auto; height: 32px; font-size: 13px; }
.btn-action { padding: 6px 14px; border-radius: 4px; font-size: 13px; border: none; cursor: pointer; }
.btn-primary-sm { background: var(--primary); color: #fff; }
.btn-default-sm { background: #fff; border: 1px solid var(--border); }

.data-table { width: 100%; background: #fff; border-radius: 8px; overflow: hidden; }
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th { background: #fafbfc; text-align: left; padding: 10px 12px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.data-table tr:hover { background: #f8f9fb; }

@media (max-width: 768px) {
    .data-table { font-size: 12px; overflow-x: auto; }
    .data-table table { min-width: 700px; }
}

/* ===== 工具类（替代 Bootstrap 部分） ===== */
.form-control, .form-select { display: inline-block; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; outline: none; background: #fff; box-sizing: border-box; }
.form-control:focus, .form-select:focus { border-color: var(--primary); }
.form-select-sm { height: 32px; padding: 4px 8px; font-size: 13px; }
.btn { display: inline-block; padding: 6px 14px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; font-size: 14px; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-default { background: #fff; border-color: var(--border); color: var(--text); }
.btn-default:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-light); }
.d-lg-none { display: inline-block; }
@media (min-width: 992px) { .d-lg-none { display: none !important; } }
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.col, [class^="col-"] { padding: 0 8px; box-sizing: border-box; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-6 { flex: 0 0 100%; max-width: 100%; }
.col-md-4 { flex: 0 0 100%; max-width: 100%; }
.col-md-3 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) {
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
}
.card { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #f3f4f6; color: var(--text-light); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* ===== 列表/表单页扩展 ===== */
.page-body { background: #f4f6fa; min-height: 100vh; }
.page-wrap { padding: 16px; }
.col-md-2 { flex: 0 0 100%; max-width: 100%; }
.col-md-8 { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
}
.mt-2 { margin-top: 12px; }
.req { color: var(--danger); }

.filter-card { padding: 16px; }
.filter-form .form-control { width: 100%; height: 36px; }
.filter-form .btn { height: 36px; line-height: 24px; margin-right: 6px; }

.list-card { padding: 0; }
.list-card .list-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.list-card .table-wrap { overflow-x: auto; }
.list-card .data-table { border-radius: 0; }
.list-card .empty-row { text-align: center; color: var(--text-light); padding: 40px 0; }

/* 商品列表：图片与唯一码 */
.goods-img-cell {
    width: 72px; max-width: 72px; padding: 6px 8px !important;
    overflow: hidden; vertical-align: middle;
}
.goods-thumb-wrap {
    display: block; width: 56px; height: 56px; overflow: hidden;
    border-radius: 6px; border: 1px solid var(--border); background: #f8f9fb;
}
.goods-thumb {
    width: 56px !important; height: 56px !important; max-width: 56px !important; max-height: 56px !important;
    object-fit: cover; border-radius: 6px; display: block;
}
.goods-thumb.is-broken, .goods-thumb--empty {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; color: #9ca3af;
}
.goods-thumb--demo { object-fit: contain; padding: 4px; background: #faf8f3; }
.goods-code-cell { min-width: 200px; }
.goods-code-box { display: flex; flex-direction: column; gap: 4px; }
.goods-code-visual { display: flex; gap: 8px; align-items: flex-end; }
.goods-code-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.goods-code-label { font-size: 10px; color: var(--text-light); line-height: 1; }
.goods-barcode { height: 36px; max-width: 110px; display: block; }
.goods-qrcode { width: 56px !important; height: 56px !important; }
.goods-code-text {
    font-family: 'Courier New', monospace; font-size: 11px; font-weight: 600;
    color: var(--text); letter-spacing: 0.5px;
}
.goods-image-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.goods-image-preview img {
    width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
    border: 1px solid var(--border);
}
.form-hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.text-muted { color: var(--text-light); font-size: 12px; }

.btn-link { color: var(--primary); padding: 0 6px; }
.btn-link:hover { color: var(--primary-dark); text-decoration: underline; }
.btn-danger-link { color: var(--danger); }
.btn-danger-link:hover { color: #991b1b; }

.pagination { padding: 12px 16px; text-align: right; }
.pagination .page { display: inline-block; padding: 4px 10px; margin: 0 2px; border: 1px solid var(--border); border-radius: 4px; color: var(--text); }
.pagination .page.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.badge.status-1 { background: #d1fae5; color: #065f46; }
.badge.status-2 { background: #fee2e2; color: #991b1b; }
.badge.status-3 { background: #fef3c7; color: #92400e; }
.badge.status-4 { background: #e5e7eb; color: var(--text-light); }
.badge.status-5 { background: #f3f4f6; color: var(--text-light); }

/* Tabs */
.tabs { display: flex; list-style: none; padding: 0; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.tabs .tab { padding: 10px 18px; cursor: pointer; font-size: 14px; color: var(--text-light); border-bottom: 2px solid transparent; }
.tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.goods-form .form-group { margin-bottom: 16px; }
.goods-form label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.goods-form .form-control { width: 100%; height: 36px; }
.goods-form textarea.form-control { height: auto; padding: 8px 10px; }
.form-action { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-action .btn { margin-right: 8px; }
.form-action .msg { margin-left: 12px; font-size: 13px; }
.form-action .msg.success { color: var(--success); }
.form-action .msg.error { color: var(--danger); }

/* ===== 统计卡片 ===== */
.stat-card { text-align: center; padding: 20px 12px; }
.stat-card .stat-num { font-size: 28px; color: var(--primary); font-weight: 600; }
.stat-card .stat-num small { font-size: 14px; color: var(--text-light); }
.stat-card .stat-lbl { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.badge.type-1 { background: #d1fae5; color: #065f46; }
.badge.type-2 { background: #fee2e2; color: #991b1b; }
.badge.type-3 { background: #dbeafe; color: #1e40af; }
.badge.type-4 { background: #fef3c7; color: #92400e; }
.badge.type-5 { background: #ede9fe; color: #5b21b6; }

/* ===== 收银台 ===== */
.cashier-header { background: linear-gradient(135deg, #fff 0%, #f9f6f0 100%); padding: 16px 20px; }
.cashier-header .lbl { color: var(--text-light); font-size: 12px; margin-bottom: 4px; }
.cashier-header .val { font-size: 16px; font-weight: 600; color: var(--text); }
.cashier-header .price-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cashier-header .price-tag { display: inline-block; padding: 4px 10px; background: var(--primary); color: #fff; border-radius: 14px; font-size: 12px; font-weight: 500; }
.cashier-demo-tip { padding: 10px 16px; margin-bottom: 12px; font-size: 13px; background: #f0f7ff; border: 1px solid #d6e8ff; }
.cashier-demo-tip--warn { background: #fff8e6; border-color: #ffe0a3; }
.cashier-demo-tip .btn-demo-code { margin: 2px 4px 2px 0; font-family: monospace; }

.scan-row { display: flex; gap: 8px; }
.scan-row .form-control { flex: 1; height: 44px; font-size: 16px; }
.scan-row .btn { height: 44px; padding: 0 24px; }

.editable-table .form-control,
.form-control.mini { height: 32px; padding: 4px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 4px; width: 100%; }
.editable-table input:focus,
.form-control.mini:focus { border-color: var(--primary); outline: none; }

.settle-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
.settle-row .form-control.mini { width: 120px; text-align: right; }
.settle-row .amt { font-weight: 600; color: var(--text); }
.settle-row.total-row { border-top: 2px solid var(--primary); padding-top: 12px; margin-top: 8px; }
.settle-row .amt.big { font-size: 22px; color: var(--primary); }

.btn-block { display: block; width: 100%; margin-top: 10px; }
.btn-default { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-default:hover { background: #f4f6fa; }

.text-muted { color: var(--text-light); }
.text-danger { color: var(--danger); }

/* ===== 弹窗 / 表单（全局字典 & CRUD 编辑页） ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(26, 29, 41, 0.48);
    backdrop-filter: blur(2px);
    overflow-y: auto;
}
.modal.is-open,
.modal[style*="display: block"],
.modal[style*="display:block"] {
    display: flex !important;
}
body.modal-open { overflow: hidden; }

.modal-dialog {
    width: 100%;
    max-width: 520px;
    margin: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    animation: modalIn .22s ease-out;
}
.modal-dialog--wide { max-width: 680px; }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.modal-content { display: flex; flex-direction: column; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #faf8f3 0%, #fff 100%);
}
.modal-header h4, .modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
}
.modal-close:hover { background: #f3f4f6; color: var(--text); }

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}

.modal-dialog > form {
    display: flex;
    flex-direction: column;
}
.modal-dialog > form > .form-group,
.modal-dialog > form > .form-row {
    padding: 0 20px;
}
.modal-dialog > form > .form-group:first-of-type { padding-top: 20px; }
.modal-dialog > form > .btn,
.modal-dialog > form > button[type="submit"],
.modal-dialog > form > button#btnCancel {
    margin: 0 20px 8px;
}
.modal-dialog > form > button[type="submit"] { margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.form-group .form-control,
.form-control {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-group textarea.form-control {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
    resize: vertical;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 164, 94, 0.15);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 576px) {
    .form-row { grid-template-columns: 1fr; }
}

.card-title--toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-title--toolbar .btn { flex-shrink: 0; }
.exchange-toolbar { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 4px; vertical-align: middle; }
.card-title--toolbar > span:last-child { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quota-hint {
    margin: 0 0 12px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-light);
    background: #f8f9fb;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.form-page .card { max-width: 720px; }
.form-page .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.admin-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    z-index: 3000;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
    background: rgba(43, 47, 58, 0.92);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    opacity: 0;
    transition: transform .25s, opacity .25s;
    pointer-events: none;
}
.admin-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.admin-toast--ok { background: #059669; }
.admin-toast--err { background: #dc2626; }

.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
}
.status-tag--on { background: #d1fae5; color: #065f46; }
.status-tag--off { background: #f3f4f6; color: #6b7280; }

/* 平台运营开关 */
.platform-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.platform-switch-group__desc { margin: 0 0 12px; font-size: 13px; }
.platform-switch-list { display: flex; flex-direction: column; gap: 12px; }
.platform-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.platform-switch-row__main { flex: 1; min-width: 0; }
.platform-switch-row__main strong { display: block; margin-bottom: 4px; }
.platform-switch-row__main p { margin: 0; font-size: 13px; }
.platform-switch-row__ctrl { flex-shrink: 0; }
.platform-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}
.platform-maint-status {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-light);
}
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    vertical-align: middle;
}
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.switch-toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    transition: .2s;
}
.switch-toggle__slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.switch-toggle input:checked + .switch-toggle__slider { background: var(--primary); }
.switch-toggle input:checked + .switch-toggle__slider:before { transform: translateX(20px); }

