/* ============================================================
   数据同步中心 - 全自定义控件样式
   ============================================================ */

:root {
    --primary: #4f46e5;
    --primary-2: #2563eb;
    --primary-grad: linear-gradient(135deg, #4f46e5, #2563eb);
    --bg: #eef1f8;
    --card: #ffffff;
    --border: #e6e9f2;
    --border-strong: #d4d9e6;
    --text: #1e2433;
    --text-2: #667085;
    --text-3: #98a2b3;
    --amber: #f59e0b;
    --amber-soft: #fef4e2;
    --green: #10b981;
    --green-soft: #e6f9f1;
    --red: #ef4444;
    --red-soft: #feecec;
    --gray: #94a3b8;
    --gray-soft: #f1f4f9;
    --dark: #171c2e;
    --radius: 16px;
    --shadow: 0 4px 24px rgba(30, 41, 89, .07);
    --shadow-hover: 0 10px 34px rgba(30, 41, 89, .12);
    --ring: 0 0 0 4px rgba(79, 70, 229, .12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* hidden 属性必须压过任何 display 规则（loading-mask / empty-state / modal-foot 都靠它显隐） */
[hidden] {
    display: none !important;
}

html, body {
    height: 100%;
}

body {
    background:
        radial-gradient(1200px 400px at 80% -10%, rgba(79, 70, 229, .08), transparent 60%),
        radial-gradient(900px 360px at 10% -10%, rgba(37, 99, 235, .07), transparent 60%),
        var(--bg);
    color: var(--text);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

::selection {
    background: rgba(79, 70, 229, .18);
}

/* 自定义滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7cddd; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #a8b1c7; }

/* ============ 顶部工具条 ============ */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 20;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
    flex-shrink: 0;
}

.brand-logo svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.brand-text h1 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .2px;
}

.brand-text p {
    margin-top: 1px;
    font-size: 12px;
    color: var(--text-3);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: all .18s;
}

.btn-refresh:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-refresh:active {
    transform: scale(.97);
}

.btn-refresh svg {
    width: 15px;
    height: 15px;
}

.btn-refresh.spinning svg {
    animation: spin .7s linear;
}

/* ============ 主体 ============ */
.main {
    width: 100%;
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 14px 28px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ============ 状态卡片 ============ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    flex-shrink: 0;
}

.stat-card {
    background: var(--card);
    border: 2px solid transparent;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    position: relative;
    transition: transform .18s, box-shadow .18s, border-color .18s;
    outline: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card:focus-visible {
    box-shadow: var(--shadow), var(--ring);
}

.stat-card .stat-tip {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 11px;
    color: var(--text-3);
    opacity: 0;
    transition: opacity .18s;
}

.stat-card:hover .stat-tip {
    opacity: 1;
}

.stat-card.active {
    border-color: currentColor;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.i-amber { background: var(--amber-soft); color: var(--amber); }
.i-green { background: var(--green-soft); color: var(--green); }
.i-red   { background: var(--red-soft);   color: var(--red); }
.i-gray  { background: var(--gray-soft);  color: var(--gray); }
.i-blue  { background: #eef0fe;           color: var(--primary); }

.stat-meta {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.stat-label {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 2px;
}

.stat-card[data-status="pending"].active { background: var(--amber-soft); }
.stat-card[data-status="success"].active { background: var(--green-soft); }
.stat-card[data-status="failed"].active  { background: var(--red-soft); }
.stat-card[data-status="total"].active  { background: #eef0fe; }

/* 统计加载态 */
.stats-loading .stat-card {
    pointer-events: none;
    opacity: .75;
}

/* 统计数字加载时替换为旋转圆圈（复用 .spinner 样式） */
.stat-num.loading {
    display: inline-block;
    width: 30px;
    height: 30px;
    font-size: 0;
    border: 3px solid #dde2f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

/* ============ 筛选区 ============ */
.filter-card {
    padding: 16px 22px;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    z-index: 8;
}

.filter-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
}

.field-hint {
    margin-left: 6px;
    font-weight: 400;
    color: var(--text-3);
    opacity: .8;
}

.field-actions {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* 输入框（包壳式） */
.input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    min-width: 260px;
    transition: border-color .18s, box-shadow .18s;
}

.input-box:focus-within {
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.input-icon {
    width: 16px;
    height: 16px;
    color: var(--text-3);
    flex-shrink: 0;
}

.input-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    height: 100%;
}

.input-box input::placeholder {
    color: var(--text-3);
}

.input-clear {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--gray-soft);
    color: var(--text-2);
    cursor: pointer;
    flex-shrink: 0;
}

.input-clear svg {
    width: 11px;
    height: 11px;
}

.input-box.has-value .input-clear {
    display: flex;
}

.input-clear:hover {
    background: #e2e7f2;
    color: var(--text);
}

/* 按钮 */
.btn-primary-lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 26px;
    border: none;
    border-radius: 12px;
    background: var(--primary-grad);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .32);
    transition: box-shadow .2s, transform .15s, filter .2s;
}

.btn-primary-lg svg {
    width: 15px;
    height: 15px;
}

.btn-primary-lg:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 22px rgba(79, 70, 229, .4);
}

.btn-primary-lg:active {
    transform: scale(.97);
}

.btn-plain {
    height: 42px;
    padding: 0 20px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text-2);
    font-size: 14px;
    cursor: pointer;
    transition: all .18s;
}

.btn-plain:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============ 自定义下拉 ============ */
.dd {
    position: relative;
    min-width: 190px;
}

.topbar .dd {
    min-width: 220px;
}

.topbar .dd .dd-btn {
    height: 36px;
    font-size: 13px;
}

.dd-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
    text-align: left;
}

.dd-btn:hover {
    border-color: var(--primary);
}

.dd.open .dd-btn {
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.dd-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dd-text.placeholder {
    color: var(--text-3);
}

.dd-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dd-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-3);
    transition: transform .2s;
    flex-shrink: 0;
}

.dd.open .dd-arrow {
    transform: rotate(180deg);
}

.dd-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 100%;
    max-height: 360px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(23, 28, 46, .16);
    padding: 6px;
    z-index: 80;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    pointer-events: none;
    transition: opacity .16s, transform .16s;
}

.dd-search {
    display: none;
    padding: 4px 6px 8px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.dd.searchable .dd-search {
    display: block;
}

.dd-search input {
    width: 100%;
    height: 34px;
    border: 1.5px solid var(--border-strong);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
    color: var(--text);
}

.dd-search input:focus {
    border-color: var(--primary);
}

.dd-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
}

.dd.open .dd-menu {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s;
}

.dd-item:hover {
    background: #f3f5fc;
}

.dd-item.selected {
    background: #eef0fe;
    color: var(--primary);
    font-weight: 500;
}

.dd-item .dd-check {
    width: 14px;
    height: 14px;
    margin-left: auto;
    color: var(--primary);
    visibility: hidden;
    flex-shrink: 0;
}

.dd-item.selected .dd-check {
    visibility: visible;
}

.dd-item-sub {
    color: var(--text-3);
    font-size: 12px;
    margin-left: auto;
}

/* 顶部深色横幅里的下拉 */
.dd-hero .dd-btn {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .22);
    color: #fff;
    backdrop-filter: blur(6px);
    min-width: 280px;
}

.dd-hero .dd-btn:hover,
.dd-hero.open .dd-btn {
    border-color: rgba(255, 255, 255, .5);
    box-shadow: none;
}

.dd-hero .dd-menu {
    min-width: 320px;
}

.dd-hero .dd-search input {
    background: #fff;
}

.dd-hero .dd-text.placeholder,
.dd-hero .dd-arrow {
    color: rgba(255, 255, 255, .65);
}

.dd-sm .dd-btn {
    height: 34px;
    font-size: 13px;
    border-radius: 10px;
}

/* 底部分页里的下拉：向上弹出，避免被表格/卡片裁掉 */
.dd-sm .dd-menu {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateY(6px) scale(.98);
    transform-origin: bottom left;
}

.dd-sm.open .dd-menu {
    transform: none;
}

/* ============ 自定义日期选择 ============ */
.datepair {
    display: flex;
    align-items: center;
    gap: 8px;
}

.datepair-sep {
    color: var(--text-3);
}

.dp {
    position: relative;
}

.dp-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px;
    min-width: 150px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
}

.dp-btn:hover {
    border-color: var(--primary);
}

.dp.open .dp-btn {
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.dp-btn svg {
    width: 15px;
    height: 15px;
    color: var(--text-3);
}

.dp-btn .dp-text.placeholder {
    color: var(--text-3);
}

.dp-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 292px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(23, 28, 46, .16);
    padding: 14px;
    z-index: 60;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    pointer-events: none;
    transition: opacity .16s, transform .16s;
}

.dp.open .dp-pop {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.dp-title {
    font-size: 14px;
    font-weight: 600;
}

.dp-nav {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.dp-nav:hover {
    background: #f0f2f9;
}

.dp-nav svg {
    width: 14px;
    height: 14px;
}

.dp-week, .dp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dp-week span {
    text-align: center;
    font-size: 11px;
    color: var(--text-3);
    padding: 4px 0;
}

.dp-day {
    height: 34px;
    border: none;
    border-radius: 9px;
    background: transparent;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: background .12s, color .12s;
    font-variant-numeric: tabular-nums;
}

.dp-day:hover:not(.other):not(.sel) {
    background: #eef0fe;
}

.dp-day.other {
    color: #c3cad8;
    cursor: default;
}

.dp-day.today {
    box-shadow: inset 0 0 0 1.5px var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.dp-day.sel {
    background: var(--primary-grad);
    color: #fff;
    font-weight: 600;
}

.dp-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.dp-foot button {
    border: none;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background .15s;
}

.dp-foot .dp-today {
    color: var(--primary);
}

.dp-foot .dp-today:hover {
    background: #eef0fe;
}

.dp-foot .dp-clear {
    color: var(--text-3);
}

.dp-foot .dp-clear:hover {
    background: #f3f5f9;
    color: var(--text-2);
}

/* ============ 快捷区间 chips ============ */
.chips {
    display: flex;
    gap: 8px;
}

.chip {
    height: 42px;
    padding: 0 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: 21px;
    background: #fff;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: all .16s;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chip.active {
    background: var(--primary-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}

/* ============ 表格 ============ */
.table-card {
    overflow: visible;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 260px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.warn-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--amber-soft);
    color: #92400e;
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1.5;
}

.warn-banner[hidden] {
    display: none !important;
}

.last-refresh {
    font-size: 12px;
    color: var(--text-3);
}

.col-billno {
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.col-billno:hover {
    color: var(--primary);
}

.empty-state .empty-hint {
    font-size: 12.5px;
    color: var(--text-3);
    max-width: 360px;
    text-align: center;
    line-height: 1.6;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.total-text {
    font-size: 13px;
    color: var(--text-2);
}

.total-text b {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* 自定义开关 */
.switch-box {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.switch-label {
    font-size: 13px;
    color: var(--text-2);
}

.switch {
    width: 38px;
    height: 22px;
    border-radius: 11px;
    background: #d4d9e6;
    position: relative;
    transition: background .2s;
}

.switch-dot {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: left .2s;
}

.switch.on {
    background: var(--primary);
}

.switch.on .switch-dot {
    left: 19px;
}

.table-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.table-scroll {
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8f9fd;
    color: var(--text-2);
    font-weight: 500;
    font-size: 12.5px;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f9;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background .12s;
}

.data-table tbody tr:hover {
    background: #f7f8fd;
}

.data-table tbody tr.row-selected {
    background: #eef0fe;
}

.col-check {
    width: 46px;
    text-align: center;
}

.col-op {
    width: 110px;
}

.col-billno {
    font-weight: 500;
    white-space: nowrap;
}

.col-time {
    white-space: nowrap;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.col-err {
    max-width: 340px;
}

.cfg-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 7px;
    background: var(--gray-soft);
    color: var(--text-2);
    font-size: 12px;
    white-space: nowrap;
}

.cfg-sub {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
}

/* 自定义复选框 */
.chk {
    display: inline-flex;
    width: 19px;
    height: 19px;
    border: 2px solid #c3cad8;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all .15s;
    vertical-align: middle;
    background: #fff;
}

.chk:hover {
    border-color: var(--primary);
}

.chk.checked {
    background: var(--primary-grad);
    border-color: transparent;
}

.chk.checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(42deg);
}

.chk.indeterminate {
    background: var(--primary-grad);
    border-color: transparent;
}

.chk.indeterminate::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 7px;
    width: 8px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.chk.disabled {
    opacity: .3;
    cursor: not-allowed;
}

.chk.disabled:hover {
    border-color: #c3cad8;
}

/* 状态徽章 */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.pill.pending { color: var(--amber); background: var(--amber-soft); }
.pill.pending::before { animation: pulse 1.6s ease-in-out infinite; }
.pill.success { color: var(--green); background: var(--green-soft); }
.pill.failed  { color: var(--red);   background: var(--red-soft); }
.pill.failed::before { animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
    50% { opacity: .55; }
}

/* 行内按钮 */
.row-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background .15s;
    white-space: nowrap;
}

.row-btn:hover {
    background: #eef0fe;
}

.row-btn svg {
    width: 13px;
    height: 13px;
}

.err-text {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--red);
}

.err-none {
    color: var(--text-3);
}

/* 空状态 / 加载 */
.empty-state {
    position: absolute;
    inset: 55px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-3);
    background: #fff;
}

.empty-state svg {
    width: 60px;
    height: 60px;
    opacity: .5;
}

.empty-state p {
    font-size: 13.5px;
}

.loading-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-2);
    font-size: 13px;
    z-index: 5;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #dde2f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ 分页 ============ */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 22px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    flex-shrink: 0;
    position: relative;
    z-index: 6; /* 让分页大小下拉能浮在表格内容上方 */
}

.pager {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pg-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    font-variant-numeric: tabular-nums;
}

.pg-btn:hover:not(:disabled):not(.current) {
    border-color: var(--primary);
    color: var(--primary);
}

.pg-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.pg-btn.current {
    background: var(--primary-grad);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.pg-ellipsis {
    color: var(--text-3);
    padding: 0 3px;
}

.pg-info {
    font-size: 12.5px;
    color: var(--text-3);
    margin-right: 10px;
}

/* ============ 浮动批量操作条 ============ */
.batch-bar {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 90px);
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--dark);
    color: #fff;
    padding: 12px 14px 12px 22px;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(23, 28, 46, .4);
    z-index: 90;
    opacity: 0;
    transition: transform .28s cubic-bezier(.2, .9, .3, 1.2), opacity .22s;
    pointer-events: none;
}

.batch-bar.show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.batch-count {
    font-size: 13.5px;
    color: rgba(255, 255, 255, .75);
}

.batch-count b {
    color: #fbbf24;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.batch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: filter .18s, transform .15s;
}

.batch-btn svg {
    width: 14px;
    height: 14px;
}

.batch-btn:hover {
    filter: brightness(1.08);
}

.batch-btn:active {
    transform: scale(.97);
}

.batch-clear {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, .55);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: color .15s;
}

.batch-clear:hover {
    color: #fff;
}

/* ============ 弹窗 / 确认框 ============ */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(18, 22, 38, .48);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 120;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.modal-mask.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #fff;
    border-radius: 18px;
    width: 620px;
    max-width: calc(100vw - 48px);
    max-height: 74vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 70px rgba(18, 22, 38, .35);
    transform: translateY(14px) scale(.97);
    transition: transform .22s cubic-bezier(.2, .9, .3, 1.15);
}

.modal-mask.open .modal-box {
    transform: none;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title .mt-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-title .mt-icon svg {
    width: 16px;
    height: 16px;
}

.modal-x {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.modal-x:hover {
    background: #f1f3f9;
    color: var(--text);
}

.modal-x svg {
    width: 16px;
    height: 16px;
}

.modal-body {
    padding: 20px 24px;
    overflow: auto;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
}

.modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f7f8fd;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-list-item .mli-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-top: 7px;
    flex-shrink: 0;
}

/* 确认框按钮 */
.btn-danger {
    height: 38px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: filter .18s;
}

.btn-danger:hover {
    filter: brightness(1.08);
}

.btn-ghost {
    height: 38px;
    padding: 0 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--text-2);
    font-size: 13.5px;
    cursor: pointer;
    transition: all .15s;
}

.btn-ghost:hover {
    border-color: var(--text-3);
    color: var(--text);
}

/* ============ Toast ============ */
.toast-wrap {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 260px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(18, 22, 38, .18);
    border: 1px solid var(--border);
    font-size: 13.5px;
    line-height: 1.6;
    opacity: 0;
    transform: translateX(24px);
    transition: all .26s cubic-bezier(.2, .9, .3, 1.1);
}

.toast.show {
    opacity: 1;
    transform: none;
}

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-icon svg {
    width: 13px;
    height: 13px;
}

.toast-success .toast-icon { background: var(--green-soft); color: var(--green); }
.toast-error   .toast-icon { background: var(--red-soft);   color: var(--red); }
.toast-warning .toast-icon { background: var(--amber-soft); color: var(--amber); }
.toast-info    .toast-icon { background: #eef0fe;           color: var(--primary); }

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .field-actions { margin-left: 0; }
}
