/* =====================================================================
   后台管理端样式 · 国潮轻奢 + 新零售品质感
   主色 朱砂红 #C82323 / 辅色 琥珀金 #D9A44A / 背景 暖米 #F5F2EE
   Tailwind CSS 负责栅格与间距，本文件负责布局骨架与组件外观

   分层（一份文件，不再叠覆写层）：
     01 设计令牌  02 重置基础  03 外壳侧栏  04 登录页
     05 通用控件  06 通用面板  07 表格      08 进度图表
     09 底池      10 空态图片  11 反馈层    12 响应式  13 图标
   ===================================================================== */

/* ===================== 01 设计令牌 ===================== */
:root {
    /* —— 品牌色 —— */
    --brand: #C82323;
    --brand-dark: #A81C1C;
    --brand-soft: #FDF2F2;
    --brand-line: #F5D9D9;
    --brand-deep: #8E1D1D;

    --gold: #D9A44A;
    --gold-dark: #B98A2E;
    --gold-soft: #FBF4E6;
    --gold-line: #EFDFC0;

    /* —— 表面：三段层次（页面底 → 卡片 → 内嵌） —— */
    --bg: #F5F2EE;
    --side: #FFFFFF;
    --card: #FFFFFF;
    --inset: #FAF8F5;

    /* —— 描边 —— */
    --line: #EDE7E0;
    --line-soft: #F4F0EB;
    --line-strong: #DFD7CD;

    /* —— 文字 —— */
    --ink: #1F2329;
    --ink-2: #5A6068;
    --muted: #8F959E;
    --faint: #B3AAA2;

    /* —— 语义色 —— */
    --green: #12A150;
    --green-soft: #EAF7F0;
    --blue: #2F6BFF;
    --blue-soft: #EEF3FF;
    --amber: #C98A17;
    --amber-soft: #FDF5E3;
    --violet: #7A5AF8;
    --violet-soft: #F2EFFE;

    /* —— 侧栏专用（浅色） —— */
    --side-text: #5A534E;
    --side-muted: #A89F97;
    --side-hover: #F7F3EF;
    --side-active-bg: #FDF2F2;
    --side-active: #C82323;

    /* —— 圆角：收敛到 5 档 —— */
    --r-xs: 6px;
    --r-sm: 9px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-full: 999px;

    /* —— 控件高度：3 档 —— */
    --h-sm: 30px;
    --h-md: 36px;
    --h-lg: 42px;

    /* —— 字号：4 档 + 标题级 —— */
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-md: 13.5px;
    --fs-lg: 15px;
    --fs-title: 16px;
    --fs-stat: 18px;
    --fs-2xl: 20px;

    /* —— 阴影：极轻，靠内高光造纵深 —— */
    --sh-1: 0 1px 2px rgba(31, 35, 41, .04);
    --sh-2: 0 1px 3px rgba(31, 35, 41, .05), 0 4px 14px rgba(31, 35, 41, .045);
    --sh-3: 0 12px 38px rgba(31, 35, 41, .12);
    --hairline: inset 0 1px 0 rgba(255, 255, 255, .8);

    /* —— 动效 —— */
    --ease: cubic-bezier(.2, .6, .3, 1);
    --dur: .16s;

    --sidebar-w: 224px;

    /* 兼容旧变量名（模板 / 内联样式可能引用） */
    --radius: 12px;
    --sidebar-1: #FFFFFF;
    --sidebar-2: #FFFFFF;
    --shadow-sm: var(--sh-1);
    --shadow-md: var(--sh-2);
}

/* ===================== 02 重置与基础 ===================== */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    /* 滚动条槽位恒驻：长短页切换时布局不再因滚动条出现/消失而横向抖动 */
    scrollbar-gutter: stable;
    overflow-y: scroll;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    font-size: var(--fs-md);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* 可点击用户名：任何列表里的会员名，点开「会员详情」弹窗 */
.t-link { color: var(--brand); cursor: pointer; border-bottom: 1px dashed transparent; }
.t-link:hover { border-bottom-color: var(--brand); }

/* 数字统一等宽，刷新时不左右跳 */
.num, .money, .kpi-value, .pool-orb-value, .chart-val, .pager-info {
    font-variant-numeric: tabular-nums;
}

::selection { background: rgba(200, 35, 35, .14); }

/* 统一滚动条（浅色） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #DED6CC; border-radius: var(--r-full);
    border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #C9BFB2; background-clip: content-box; }

/* ===================== 03 外壳与侧栏 ===================== */
.adm-shell { display: flex; min-height: 100vh; }

.adm-sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--side);
    border-right: 1px solid var(--line);
    color: var(--side-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start; /* 高度跟随菜单内容：菜单到底背景就结束，不再拉伸出整屏空白 */
    max-height: 100vh;      /* 仅当菜单长于视口（小屏）时才内部滚动兜底 */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}
.adm-sidebar::-webkit-scrollbar { width: 6px; }
.adm-sidebar::-webkit-scrollbar-thumb {
    background: #E4DCD3; border-radius: var(--r-full); border: none;
}

/* —— 品牌区 —— */
.adm-brand {
    padding: 20px 16px 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid var(--line-soft);
    flex: 0 0 auto;
}
.adm-brand-logo {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: var(--r-sm);
    background: linear-gradient(140deg, #DC4130 0%, var(--brand) 52%, var(--brand-dark) 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 15px;
    box-shadow: 0 3px 8px rgba(200, 35, 35, .26), inset 0 1px 0 rgba(255, 255, 255, .28);
    letter-spacing: 0;
}
.adm-brand > div:last-child { min-width: 0; }
.adm-brand-name {
    color: var(--ink);
    font-size: var(--fs-lg);
    font-weight: 650;
    letter-spacing: .2px;
    line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adm-brand-sub {
    color: var(--faint);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 1.5px;
    line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* —— 导航 —— */
.adm-nav { padding: 8px 12px 22px; flex: 1; }
.adm-nav-group { margin-top: 16px; }
.adm-nav-group:first-child { margin-top: 4px; }
.adm-nav-group-title {
    padding: 0 10px 7px;
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: .08em;
    color: var(--side-muted);
}
.adm-nav-link {
    display: flex; align-items: center; gap: 10px;
    height: 38px;
    padding: 0 11px;
    margin-bottom: 2px;
    border-radius: var(--r-sm);
    font-size: var(--fs-md);
    font-weight: 500; /* 常驻字重：选中态不再加粗，避免文字宽度突变产生跳动 */
    color: var(--side-text);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    position: relative;
}
.adm-nav-link:hover { background: var(--side-hover); color: var(--ink); }
.adm-nav-link.active {
    background: var(--side-active-bg);
    color: var(--side-active);
}
.adm-nav-link.active::before {
    content: '';
    position: absolute; left: 0; top: 50%;
    width: 3px; height: 15px;
    margin-top: -7.5px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}
.adm-nav-link .ico { width: 17px; flex: 0 0 17px; opacity: .86; }
.adm-nav-link:hover .ico { opacity: 1; }
.adm-nav-link.active .ico { opacity: 1; }
.adm-nav-badge {
    margin-left: auto;
    flex: 0 0 auto;
    min-width: 18px; height: 18px;
    padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--r-full);
    box-shadow: 0 1px 3px rgba(200, 35, 35, .3);
}

/* —— 主区 —— */
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.adm-topbar {
    height: 60px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px) saturate(1.5);
    -webkit-backdrop-filter: blur(12px) saturate(1.5);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 30;
}
.adm-topbar h1 {
    font-size: var(--fs-title);
    font-weight: 650;
    margin: 0;
    letter-spacing: -.01em;
    line-height: 1.3;
    color: var(--ink);
}
.adm-topbar .crumb {
    color: var(--muted);
    font-size: var(--fs-sm);
    margin-top: 2px;
    line-height: 1.3;
}

.adm-user { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.adm-avatar {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 50%;
    background: linear-gradient(140deg, #F2C463 0%, var(--gold) 100%);
    color: #4A3208;
    font-weight: 700;
    font-size: var(--fs-sm);
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 3px rgba(185, 138, 46, .22);
}

.adm-body { padding: 20px 24px 40px; flex: 1; min-width: 0; }

/* ===================== 05 通用控件 ===================== */
/* —— 按钮 —— */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: var(--h-md);
    padding: 0 15px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-size: var(--fs-md);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
                box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(200, 35, 35, .18); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(140deg, #D63535 0%, var(--brand) 60%, var(--brand-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(200, 35, 35, .22), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(140deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 4px 12px rgba(200, 35, 35, .28), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-gold {
    background: linear-gradient(140deg, #E8B75C 0%, var(--gold) 60%, var(--gold-dark) 100%);
    color: #4A3208;
    box-shadow: 0 2px 6px rgba(217, 164, 74, .24), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-gold:hover:not(:disabled) { background: linear-gradient(140deg, var(--gold) 0%, var(--gold-dark) 100%); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { border-color: #C9BEB1; background: var(--inset); color: var(--ink); }
.btn-danger { background: #fff; border-color: var(--brand-line); color: var(--brand); }
.btn-danger:hover:not(:disabled) { background: var(--brand-soft); border-color: #EDC4C4; }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 2px 6px rgba(18, 161, 80, .22); }
.btn-success:hover:not(:disabled) { background: #0E8A44; }
.btn-sm {
    height: var(--h-sm);
    padding: 0 11px;
    font-size: var(--fs-sm);
    border-radius: 8px;
    gap: 5px;
}

/* —— 徽章 —— */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.45;
    white-space: nowrap;      /* 关键：禁止「到店自提」被压成竖排 */
    vertical-align: middle;
}
.badge-red { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-line); }
.badge-gold { background: var(--gold-soft); color: var(--gold-dark); box-shadow: inset 0 0 0 1px var(--gold-line); }
.badge-green { background: var(--green-soft); color: var(--green); box-shadow: inset 0 0 0 1px #CFEBDB; }
.badge-blue { background: var(--blue-soft); color: var(--blue); box-shadow: inset 0 0 0 1px #D6E2FF; }
.badge-gray { background: #F5F2EE; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* —— 表单 —— */
.form-label {
    display: block;
    font-size: var(--fs-md);
    color: var(--ink);
    font-weight: 500;
    margin-bottom: 6px;
}
.form-label .req { color: var(--brand); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
    width: 100%;
    height: var(--h-md);
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: #fff;
    font-size: var(--fs-md);
    color: var(--ink);
    font-family: inherit;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form-input:hover:not(:focus), .form-select:hover:not(:focus), .form-textarea:hover:not(:focus) {
    border-color: #CFC5BA;
}
.form-textarea {
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
    line-height: 1.7;
    resize: vertical;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(200, 35, 35, .09);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--faint); }
.form-hint { font-size: var(--fs-sm); color: var(--muted); margin-top: 5px; line-height: 1.6; }
.form-row { margin-bottom: 16px; }

/* 数字输入框去掉原生上下箭头，避免与圆角冲突 */
.form-input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.form-input[type=number]::-webkit-outer-spin-button,
.form-input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 原生日期控件图标对齐 */
.form-input[type=date]::-webkit-calendar-picker-indicator {
    opacity: .45; cursor: pointer; transition: opacity var(--dur) var(--ease);
}
.form-input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: .8; }

/* 隐藏文件输入（图片上传用） */
.ip-file { display: none; }

/* —— 筛选条 —— */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--inset);
}
.filter-bar .form-input,
.filter-bar .form-select {
    height: var(--h-sm);
    width: auto;
    min-width: 132px;
    font-size: var(--fs-sm);
    background: #fff;
}
.filter-bar > span {
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: var(--h-sm);
}

/* —— 标签页 —— */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
    display: inline-flex; align-items: center;
    height: var(--h-sm);
    padding: 0 14px;
    border-radius: var(--r-sm);
    font-size: var(--fs-md);
    color: var(--muted);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--dur) var(--ease);
}
.tab:hover { background: var(--inset); color: var(--ink); }
.tab.active {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: var(--brand-line);
    font-weight: 600;
}

/* —— 分页 —— */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    padding: 13px 18px;
    border-top: 1px solid var(--line-soft);
}
.pager-info { color: var(--muted); font-size: var(--fs-sm); }
.pager-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.page-btn {
    min-width: var(--h-sm);
    height: var(--h-sm);
    padding: 0 9px;
    border: 1px solid var(--line-strong);
    background: #fff;
    border-radius: 8px;
    font-size: var(--fs-sm);
    font-family: inherit;
    color: var(--ink-2);
    cursor: pointer;
    transition: all var(--dur) var(--ease);
}
.page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.page-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(200, 35, 35, .22);
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* —— 语义工具类 ——
   取代 Tailwind 的任意值类（text-[13.5px] / text-[#8F959E] ...）。
   原因：Tailwind CDN 运行时注入的 <style> 排在 admin.css 之后，
   同特异度下后者胜出 → 任意值类会反向覆盖设计令牌。 */
.t-xs { font-size: var(--fs-xs); }
.t-sm { font-size: var(--fs-sm); }
.t-md { font-size: var(--fs-md); }
.t-lg { font-size: var(--fs-lg); }
.t-title { font-size: var(--fs-title); }
.t-2xl { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.01em; }
.t-muted { color: var(--muted); }
.t-ink2 { color: var(--ink-2); }
.t-brand { color: var(--brand); }
.t-bold { font-weight: 600; }
.t-num { font-variant-numeric: tabular-nums; }
.t-nowrap { white-space: nowrap; }
.t-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片内的小统计数字（原 18~19px 任意值统一到这里） */
.stat-lg {
    font-size: var(--fs-stat);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.3px;
    font-variant-numeric: tabular-nums;
}

/* 可点击的整行（快捷入口 / 列表项） */
.quick-row { transition: background var(--dur) var(--ease); }
.quick-row:hover { background: var(--inset); }

/* ===================== 06 通用面板 ===================== */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
}
.card-head {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.card-title {
    font-size: var(--fs-lg);
    font-weight: 650;
    color: var(--ink);
    display: flex; align-items: center; gap: 9px;
    line-height: 1.4;
}
.card-title::before {
    content: '';
    width: 3px; height: 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--gold) 100%);
    flex: 0 0 3px;
}
.card-body { padding: 18px; }

/* —— KPI —— */
.kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 17px 18px;
    box-shadow: var(--sh-1);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.kpi:hover { box-shadow: var(--sh-2); border-color: var(--line-strong); }
.kpi::after {
    content: '';
    position: absolute; right: -34px; top: -34px;
    width: 96px; height: 96px; border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 35, 35, .06) 0%, transparent 70%);
    pointer-events: none;
}
.kpi-label { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 7px; line-height: 1.4; }
.kpi-value {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.6px;
    line-height: 1.15;
    color: var(--ink);
}
.kpi-value small {
    font-size: var(--fs-md);
    font-weight: 500;
    color: var(--muted);
    margin-left: 3px;
    letter-spacing: 0;
}
.kpi-foot { font-size: var(--fs-sm); color: var(--muted); margin-top: 9px; line-height: 1.5; }
.kpi-brand .kpi-value { color: var(--brand); }
.kpi-gold .kpi-value { color: var(--gold-dark); }
.kpi-green .kpi-value { color: var(--green); }

/* —— 描述列表 —— */
.desc {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px 20px;
}
.desc-item { font-size: var(--fs-md); min-width: 0; }
.desc-item .k { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 3px; line-height: 1.5; }
.desc-item .v { font-weight: 500; color: var(--ink); word-break: break-word; line-height: 1.6; }

/* —— 提示条 —— */
.tip {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    background: var(--gold-soft);
    color: #7A5A12;
    font-size: var(--fs-sm);
    line-height: 1.7;
}
.tip > .ico { margin-top: 2px; flex: 0 0 auto; }
.tip.red { background: var(--brand-soft); color: #8E1F1F; }
.tip.green { background: var(--green-soft); color: #0C6B36; }
.tip.blue { background: var(--blue-soft); color: #1C47A8; }

/* ===================== 07 表格 ===================== */
.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.table-wrap::-webkit-scrollbar { height: 9px; }
.table-wrap::-webkit-scrollbar-thumb {
    background: #DED6CC; border-radius: var(--r-full);
    border: 3px solid transparent; background-clip: content-box;
}
.table-wrap::-webkit-scrollbar-thumb:hover { background: #C9BFB2; background-clip: content-box; }

.table {
    width: 100%;
    font-size: var(--fs-md);
}
.table thead th {
    text-align: left;
    padding: 10px 12px;
    background: var(--inset);
    color: var(--muted);
    font-weight: 500;
    font-size: var(--fs-sm);
    letter-spacing: .01em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    position: sticky; top: 0;
}
.table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    /* keep-all：中文不在字间断行，只在空格 / 连字符处折 → 长文本折成
       合理的一两行，既不会逐字竖排，也不会把列撑成单行超宽 */
    word-break: keep-all;
    overflow-wrap: break-word;
}
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: var(--inset); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; }
.table .money { font-weight: 600; color: var(--ink); }
.table .strong { font-weight: 600; }
.table .muted { color: var(--muted); font-size: var(--fs-sm); }

/* 表格里的缩略图与多行文本 */
.table .thumb { vertical-align: middle; }
.table td .muted + .muted { margin-top: 2px; }
/* 单号 / 编码这类连续 ASCII，压缩字距避免占满一整列 */
.table td .muted { letter-spacing: -.1px; }

.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
/* 按钮是 flex 子项时会被压扁成一条竖线（nowrap 下尤其明显）——钉住不收缩 */
.row-actions > * { flex: 0 0 auto; }

/* 横向滚动后，把末列（通常是「操作」）钉在右侧 ——
   否则窄屏滚到中间时点不到按钮。
   ⚠ 只在「已经横向滚动」后才吸附（.is-scrolled）：
   初始不滚动时保持自然排布，否则冻结列会盖住紧邻的列，
   看起来像被裁坏了。.is-scrollable / .is-scrolled 由 admin.js 维护。 */
.table-wrap.is-scrolled .table th:last-child,
.table-wrap.is-scrolled .table td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
}
.table-wrap.is-scrolled .table thead th:last-child {
    background: var(--inset);
    box-shadow: inset 1px 0 0 var(--line), -8px 0 12px -9px rgba(31, 35, 41, .2);
}
.table-wrap.is-scrolled .table tbody td:last-child {
    background: var(--card);
    box-shadow: inset 1px 0 0 var(--line-soft), -8px 0 12px -9px rgba(31, 35, 41, .2);
}
.table-wrap.is-scrolled .table tbody tr:hover td:last-child {
    background: var(--inset);
}

/* ===================== 08 进度 / 图表 ===================== */
.bar-track {
    height: 8px;
    border-radius: var(--r-full);
    background: #F2EDE7;
    overflow: hidden;
}
.bar-track + .bar-track { margin-top: 6px; }
.bar-fill {
    height: 100%;
    border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--brand) 0%, var(--gold) 100%);
    transition: width .5s var(--ease);
}
.bar-fill.gold { background: linear-gradient(90deg, var(--gold) 0%, #F3CE7C 100%); }
.bar-fill.green { background: linear-gradient(90deg, var(--green) 0%, #4CC98A 100%); }

.chart-bars {
    display: flex; align-items: flex-end; gap: 10px;
    height: 168px; padding-top: 10px;
}
.chart-col {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    height: 100%; justify-content: flex-end;
}
.chart-bar {
    width: 100%; max-width: 40px;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, var(--brand) 0%, rgba(200, 35, 35, .45) 100%);
    min-height: 4px;
    transition: height .5s var(--ease);
}
.chart-val { font-size: var(--fs-xs); color: var(--muted); }
.chart-label { font-size: var(--fs-xs); color: var(--muted); }

/* ===================== 09 底池水波纹 ===================== */
.pool-orb {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: linear-gradient(140deg, #7E1A1A 0%, #A82121 46%, #8A2418 100%);
    color: #fff;
    padding: 22px;
    box-shadow: 0 8px 26px rgba(142, 29, 29, .22), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.pool-orb::before {
    content: '';
    position: absolute; left: -50%; bottom: -110%;
    width: 200%; height: 200%;
    border-radius: 43%;
    background: rgba(217, 164, 74, .16);
    animation: orb-rotate 9s linear infinite;
}
.pool-orb::after {
    content: '';
    position: absolute; left: -50%; bottom: -112%;
    width: 200%; height: 200%;
    border-radius: 45%;
    background: rgba(255, 255, 255, .1);
    animation: orb-rotate 13s linear infinite;
}
@keyframes orb-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.pool-orb > * { position: relative; z-index: 2; }
.pool-orb-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.6px;
    line-height: 1.15;
}
.pool-orb-label { font-size: var(--fs-sm); color: rgba(255, 255, 255, .62); }

/* ===================== 10 空态 / 图片 ===================== */
.empty {
    padding: 52px 20px;
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-md);
    line-height: 1.8;
}
.empty-ico {
    display: flex; justify-content: center;
    line-height: 0;
    opacity: .3;
    margin-bottom: 12px;
}

.thumb {
    width: 44px; height: 44px; flex: 0 0 44px;
    border-radius: var(--r-sm);
    object-fit: cover;
    background: linear-gradient(140deg, #F7F1E8 0%, #EFE7DB 100%);
    display: flex; align-items: center; justify-content: center;
    color: #C4B7A6;
    font-size: var(--fs-lg);
    font-weight: 600;
    overflow: hidden;
}
.thumb-lg { width: 64px; height: 64px; flex: 0 0 64px; font-size: 20px; }
img.thumb { display: block; }

/* —— 图片上传控件 —— */
.imgpick { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.ip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.ip-item {
    position: relative;
    width: 82px; height: 82px;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--inset);
}
.ip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ip-del {
    position: absolute; top: 4px; right: 4px;
    width: 20px; height: 20px;
    padding: 0; border: none; border-radius: 50%;
    font-size: 13px; line-height: 1; color: #fff;
    background: rgba(31, 35, 41, .6);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.ip-del:hover { background: var(--brand); transform: scale(1.08); }
.ip-btn {
    width: 82px; height: 82px; flex: 0 0 82px;
    border-radius: var(--r-sm);
    border: 1px dashed var(--line-strong);
    background: var(--inset);
    color: var(--muted);
    font-size: var(--fs-sm);
    font-family: inherit;
    line-height: 1.5;
    cursor: pointer;
    transition: all var(--dur) var(--ease);
}
.ip-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.ip-btn:disabled { cursor: default; opacity: .7; }
.ip-empty {
    width: 82px; height: 82px; flex: 0 0 82px;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    background: var(--inset);
    color: var(--faint);
    font-size: var(--fs-xs);
    text-align: center;
    line-height: 1.5;
}
.imgpick .ip-url { flex: 1 1 220px; min-width: 180px; }
.ip-tip { margin-top: 7px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.6; }

/* ===================== 11 反馈层 ===================== */
#adm-toast {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    min-width: 200px; max-width: 380px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 3px solid var(--green);
    border-radius: var(--r-sm);
    padding: 12px 16px;
    box-shadow: var(--sh-3);
    font-size: var(--fs-md);
    line-height: 1.6;
    animation: toast-in .22s var(--ease);
    pointer-events: auto;
}
.toast.error { border-left-color: var(--brand); }
.toast.info { border-left-color: var(--blue); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: none; }
}

.adm-mask {
    position: fixed; inset: 0;
    background: rgba(28, 24, 20, .42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: mask-in .18s var(--ease);
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }

.adm-modal {
    background: #fff;
    border-radius: var(--r-lg);
    width: 100%; max-width: 620px;
    max-height: 88vh;
    overflow: auto;
    box-shadow: var(--sh-3);
    animation: modal-in .2s var(--ease);
}
.adm-modal.lg { max-width: 880px; }
@keyframes modal-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to { opacity: 1; transform: none; }
}
.adm-modal-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    position: sticky; top: 0;
    background: #fff;
    z-index: 2;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.adm-modal-head h3 {
    margin: 0;
    font-size: var(--fs-title);
    font-weight: 650;
    letter-spacing: -.01em;
}
.adm-modal-body { padding: 20px 22px; }
.adm-modal-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--line-soft);
    display: flex; justify-content: flex-end; gap: 10px;
    position: sticky; bottom: 0;
    background: #fff;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-close {
    background: none; border: none;
    width: 36px; height: 36px;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--r-xs);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--dur) var(--ease);
    padding: 0;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
}
.modal-close:hover { color: var(--ink); background: var(--inset); }

/* ===================== 12 响应式 ===================== */
.sidebar-toggle { display: none; }

@media (max-width: 1024px) {
    .adm-sidebar {
        position: fixed; left: -232px; z-index: 100;
        transition: left .25s var(--ease);
        box-shadow: 0 0 40px rgba(31, 35, 41, .16);
    }
    .adm-sidebar.open { left: 0; }
    .adm-body { padding: 16px 14px 34px; }
    .adm-topbar { padding: 0 14px; }
    .sidebar-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
    .adm-topbar .crumb { display: none; }
    .adm-user > span:not(.badge) { display: none; }
    .filter-bar { padding: 12px 14px; }
    .filter-bar .form-input, .filter-bar .form-select { flex: 1 1 100%; min-width: 0; }
    .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .pool-orb::before, .pool-orb::after { animation: none; }
}

/* ===================== 13 图标（内联 SVG，运行时生成，不落盘） =====================
   用法：<span class="ico" data-ico="inbox" data-ico-size="18"></span>
   颜色默认 currentColor，自动跟随所在元素/父级的 CSS 颜色。 */
.ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    vertical-align: -0.14em;
    flex: 0 0 auto;
}
.ico > svg { display: block; }

/* ===================== 14 文本工具补充 ===================== */
.t-warn { color: var(--amber); }
.t-break { word-break: break-all; overflow-wrap: anywhere; }
.t-mono {
    font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
    letter-spacing: -.2px;
}

/* 当前登录管理员所在行（管理员账号页） */
.table tbody tr.row-me { background: var(--brand-soft); }
.table tbody tr.row-me:hover { background: #FBEBEB; }
.table tbody tr.row-me td { border-bottom-color: var(--brand-line); }

/* ===================== 15 列表勾选与批量操作 =====================
   勾选框由 Adm.table({ selectable: true }) 自动插入到每行首列，
   thead 里的 th.col-check 需要页面自己写，用于全选。 */
.col-check {
    width: 40px;
    padding-left: 16px !important;
    padding-right: 4px !important;
    text-align: left;
}
.col-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
    vertical-align: middle;
}
.batch-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 0 0 12px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    border-radius: var(--r-sm);
    animation: batch-in var(--dur) var(--ease);
}
.batch-bar[hidden] { display: none; }
.batch-count { font-size: var(--fs-sm); color: var(--ink-2); }
.batch-count b { color: var(--brand); font-size: var(--fs-md); margin: 0 2px; }
@keyframes batch-in {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: none; }
}

/* 不可参与批量操作的行（如批量发货里状态不符的订单） */
.table tbody tr.row-disabled { opacity: .5; }
.table tbody tr.row-disabled:hover { background: transparent; }

/* 宽缩略图（轮播图预览，2:1 横图） */
.thumb-wide {
    width: 104px;
    height: 52px;
    flex: 0 0 104px;
    font-size: var(--fs-xs);
    border-radius: var(--r-xs);
}

/* ===================== 16 视频上传控件 ===================== */
.videopick { display: flex; flex-direction: column; gap: 8px; }
.vp-box {
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--inset);
    padding: 10px 12px;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}
.vp-box.has-video { border-style: solid; border-color: var(--line); background: #fff; }
.vp-empty { color: var(--muted); font-size: var(--fs-sm); padding: 6px 2px; }
.vp-video {
    width: 100%;
    max-width: 420px;
    max-height: 240px;
    border-radius: var(--r-xs);
    background: #000;
    display: block;
}
.vp-name { max-width: 100%; }
.vp-actions { display: flex; gap: 8px; }

/* ===================== 17 地图（区域招商） ===================== */
.map-overview {
    height: 296px;
    margin: 0 16px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--inset);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-pick {
    height: 280px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--inset);
    overflow: hidden;
}
.map-loading,
.map-fail {
    padding: 12px 16px;
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.9;
    text-align: center;
}
.map-legend {
    padding: 0 16px 14px;
    color: var(--muted);
    font-size: var(--fs-sm);
    line-height: 1.65;
}
