/* ====== 全局重置 & 基础变量 ====== */
:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0891b2;
    --info-light: #cffafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --header-h: 56px;
    --bottom-nav-h: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: var(--gray-800);
    background: var(--gray-100);
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100%;
    background: var(--gray-100);
}

/* ====== 顶部标题栏 ====== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-md);
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-date {
    font-size: 13px;
    opacity: 0.85;
}

/* ====== 主内容区 ====== */
.app-main {
    padding: 12px 12px calc(var(--bottom-nav-h) + 12px);
    min-height: calc(100vh - var(--header-h));
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== 底部导航 ====== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: var(--bottom-nav-h);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    display: flex;
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--gray-400);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* ====== 通用组件 ====== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--gray-700);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: var(--primary);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    color: var(--gray-400);
    padding: 24px 0;
    font-size: 14px;
}

/* ====== 按钮 ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: var(--white);
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    min-height: 56px;
    width: 100%;
    margin-bottom: 8px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-icon {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: var(--gray-200);
}

.icon {
    font-size: 16px;
}

/* ====== 扫码页面 ====== */
.scan-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scan-area {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.camera-wrap {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
}

.qr-reader {
    width: 100%;
    min-height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.qr-reader video {
    width: 100% !important;
    border-radius: var(--radius);
    object-fit: cover;
}

.qr-reader img {
    display: none;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.scan-overlay.active {
    display: flex;
}

.scan-frame {
    width: 200px;
    height: 200px;
    border: 3px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.scan-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 13px;
    background: rgba(0,0,0,0.5);
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.scan-controls {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.scan-status {
    margin-top: 8px;
    font-size: 13px;
    color: var(--gray-500);
    min-height: 18px;
}

/* 收货表单 */
.receive-form-area {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.receive-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
}

.form-row-2col {
    flex-direction: row;
    gap: 12px;
}

.form-row-2col > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 三个并排的下拉（新建波次：年 / 月 / 第几波） */
.form-row-3col {
    flex-direction: row;
    gap: 10px;
}

.form-row-3col > div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 新建波次的名称预览 */
.wave-preview {
    margin: 10px 0 4px;
    padding: 10px 12px;
    background: var(--gray-50, #F7F6F3);
    border: 1px dashed #D3D1C7;
    border-radius: 8px;
    font-size: 13px;
    color: var(--gray-600, #5F5E5A);
    text-align: center;
}
.wave-preview b {
    font-size: 15px;
    color: var(--text, #2C2C2A);
}

/* 必填星号 */
.req {
    color: var(--danger, #E24B4A);
    font-weight: 500;
    margin-left: 1px;
}

/* 列映射弹窗的「高级选项」折叠区：默认收起，只留必须核对的 3 项在外面 */
.map-advanced {
    margin: 14px 0 6px;
    border: 0.5px solid var(--gray-200, #E8E6DF);
    border-radius: 8px;
    background: var(--gray-50, #FAFAF8);
}
.map-advanced > summary {
    padding: 9px 12px;
    font-size: 12.5px;
    color: var(--gray-600, #5F5E5A);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.map-advanced > summary::-webkit-details-marker { display: none; }
.map-advanced > summary::after {
    content: '展开';
    font-size: 11.5px;
    color: var(--gray-400, #888780);
    flex-shrink: 0;
}
.map-advanced[open] > summary::after { content: '收起'; }
.map-advanced > summary small {
    font-weight: normal;
    color: var(--gray-400, #888780);
    font-size: 11.5px;
}
.map-advanced-body {
    padding: 4px 12px 12px;
    border-top: 0.5px solid var(--gray-200, #E8E6DF);
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea {
    resize: vertical;
    min-height: 40px;
}

.input-with-btn {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-btn input {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.form-actions .btn-primary {
    flex: 1;
}

/* 最近收货列表 */
.recent-scans {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    font-size: 14px;
}

.recent-item-info {
    flex: 1;
    min-width: 0;
}

.recent-item-name {
    font-weight: 500;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-item-meta {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 2px;
}

.recent-item-qty {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.recent-item-time {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
}

/* ====== 看板页面 ====== */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
}

.stat-primary {
    border-left-color: var(--primary);
}

.stat-success {
    border-left-color: var(--success);
}

.stat-info {
    border-left-color: var(--info);
}

.stat-warning {
    border-left-color: var(--warning);
}

.stat-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* 今日单量构成细分（完整签收 / 部分签收） */
.stat-sub {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 3px;
}

.bd-bar {
    display: flex;
    height: 5px;
    margin-top: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--gray-200);
}

.bd-seg {
    height: 100%;
    width: 0;
    transition: width .25s ease;
}

.bd-seg-full { background: var(--success); }
.bd-seg-partial { background: var(--warning); }
.bd-seg-unknown { background: var(--gray-400); }

.bd-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 5px;
    font-size: 11px;
    color: var(--gray-600);
}

.bd-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.bd-item b {
    font-weight: 600;
    color: var(--gray-800);
}

.bd-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.bd-dot-full { background: var(--success); }
.bd-dot-partial { background: var(--warning); }
.bd-dot-unknown { background: var(--gray-400); }

.bd-hint {
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 4px;
}

.bd-note {
    font-size: 10px;
    color: var(--danger);
    margin-top: 3px;
}

.bd-note:empty {
    display: none;
}

/* ====== 合托（跨票货合并记录）====== */
.btn-block {
    width: 100%;
    justify-content: center;
}

.batch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    border: 1px solid var(--primary);
}

.batch-bar-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.batch-seq {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
}

.batch-stat {
    font-size: 12px;
    color: var(--gray-700);
}

.batch-codes {
    font-size: 11px;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ====== 记录页「托号」列 ====== */
.batch-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    background: var(--primary);
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
}

.batch-badge-cell {
    display: inline-block;
    cursor: pointer;
}

.batch-badge-cell:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* 进行中的托用绿色区分，已结束为蓝色 */
.batch-badge.is-open {
    background: var(--success);
}

.col-batch-empty {
    color: var(--gray-300);
}

/* 到货核对：缺口列里的缺箱号提示 */
.col-gap {
    max-width: 150px;
    white-space: normal;
}

.gap-boxes {
    font-size: 11px;
    color: var(--warning);
    margin-top: 3px;
    line-height: 1.35;
    word-break: break-word;
}

/* 进度条 */
.progress-section {
    padding: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
}

.progress-header span:last-child {
    color: var(--primary);
    font-weight: 700;
}

.progress-bar-track {
    width: 100%;
    height: 24px;
    background: var(--gray-200);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    border-radius: 20px;
    transition: width 0.5s ease;
    min-width: 0;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-400);
}

/* 图表 */
.chart-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.chart-card {
    padding: 16px;
}

.chart-wrap {
    position: relative;
    height: 220px;
    width: 100%;
}

/* 活动列表 */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-name {
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-meta {
    font-size: 12px;
    color: var(--gray-400);
}

.activity-qty {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

/* ====== 记录页面 ====== */
.records-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-group label {
    font-size: 13px;
    color: var(--gray-500);
    white-space: nowrap;
}

.filter-input {
    flex: 1;
    min-width: 180px;
}

.filter-date {
    width: 140px;
}

.records-summary {
    display: flex;
    gap: 20px;
    padding: 0 4px;
    font-size: 14px;
    color: var(--gray-500);
}

.records-summary strong {
    color: var(--primary);
}

.table-wrap {
    overflow-x: auto;
    padding: 0;
    scroll-margin-top: calc(var(--header-h) + 12px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    white-space: nowrap;
}

.data-table tr:hover {
    background: var(--gray-50);
}

.data-table .col-qty {
    font-weight: 600;
    color: var(--primary);
}

.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    color: var(--gray-400);
    transition: color 0.15s;
}

.btn-delete:hover {
    color: var(--danger);
}

.table-empty {
    padding: 32px 0;
}

/* ====== 设置页面 ====== */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
}

.settings-container .account-current {
    margin-bottom: 0;
    background: var(--white);
}

/* 折叠式设置列表：一行一个入口，点开才展开 */
.setting-list {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.setting-item + .setting-item {
    border-top: 1px solid var(--gray-100);
}

.setting-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.setting-head:hover {
    background: var(--gray-50);
}

.setting-head:active {
    background: var(--gray-100);
}

.setting-ico {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
}

.setting-titles {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.setting-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 6px;
}

.setting-badge {
    font-size: 10.5px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-500);
    white-space: nowrap;
}

.setting-sub {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.setting-arrow {
    flex: 0 0 auto;
    color: var(--gray-300);
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s ease, color 0.15s;
}

.setting-item.open > .setting-head {
    background: var(--gray-50);
}

.setting-item.open > .setting-head .setting-name {
    color: var(--primary);
}

.setting-item.open > .setting-head .setting-arrow {
    transform: rotate(90deg);
    color: var(--primary);
}

/* 展开区：默认收起，点开才出现 */
.setting-body {
    display: none;
}

.setting-item.open > .setting-body {
    display: block;
    animation: settingOpen 0.18s ease;
}

@keyframes settingOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.setting-body-inner {
    padding: 14px 16px 18px;
    border-top: 1px dashed var(--gray-200);
}

/* 展开后表单控件统一撑满，PDA 上更好点 */
.setting-body-inner > .account-input,
.setting-body-inner .account-pwd-block .account-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.setting-body-inner .btn-block {
    width: 100%;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.setting-row:last-of-type {
    border-bottom: none;
}

.setting-row label {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.setting-row input,
.setting-row select {
    max-width: 200px;
}

/* ===== 恢复点（误删找回） ===== */
.snap-block {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 12px 13px;
    margin-bottom: 14px;
    background: var(--gray-50, #f9fafb);
}
.snap-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.snap-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-700, #374151);
}
.snap-hint {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.65;
    margin-top: 6px;
}
.snap-total {
    font-size: 11.5px;
    color: var(--gray-400);
    margin: 10px 0 6px;
}
.snap-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 8px;
}
.snap-empty {
    font-size: 12px;
    color: var(--gray-400);
    line-height: 1.7;
}
.snap-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}
.snap-item-main { min-width: 0; }
.snap-item-title {
    font-size: 13px;
    color: var(--gray-800, #1f2937);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.snap-item-sub {
    font-size: 11.5px;
    color: var(--gray-400);
    margin-top: 2px;
    line-height: 1.5;
}
.snap-item button { flex: none; }

@media (max-width: 540px) {
    .snap-head { flex-wrap: wrap; }
    .snap-item { align-items: flex-start; }
    .snap-item-title { white-space: normal; }
}

.setting-row strong {
    color: var(--primary);
    font-size: 16px;
}

.setting-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.setting-actions .btn {
    flex: 1;
    min-width: 140px;
}

.about-text {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.8;
    padding-top: 10px;
}

/* ====== Toast ====== */
.toast-container {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: 100%;
    max-width: 360px;
    transition: transform .18s ease;
}

/* 签收浮现卡出现时，把底下还挂着的报错提示往下让开，别叠在一起看不清 */
.toast-container.shifted { transform: translateX(-50%) translateY(86px); }

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.25s ease;
    pointer-events: auto;
}

.toast-success {
    background: var(--success);
    color: var(--white);
}

.toast-error {
    background: var(--danger);
    color: var(--white);
}

.toast-info {
    background: var(--gray-700);
    color: var(--white);
}

.toast.fade-out {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-12px); }
}

/* ====== 签收成功浮现卡 ======
   自动签收的即时反馈：一眼确认这一箱进了账，1.5 秒自己消失。
   只放「箱号 / 回运单号 / 服务店」，已收缺哪些箱号去「到货核对」看，不在这里堆。 */
.sign-flash {
    position: fixed;
    top: calc(var(--header-h) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10050;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 24px);
    max-width: 380px;
    padding: 13px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #17a34a 0%, #15803d 100%);
    color: #fff;
    box-shadow: 0 10px 28px rgba(21, 128, 61, .34);
    pointer-events: none;
    animation: signFlashIn .18s ease;
}

.sign-flash.hidden { display: none; }

.sign-flash.is-done { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); box-shadow: 0 10px 28px rgba(15, 118, 110, .34); }
.sign-flash.is-over { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 10px 28px rgba(217, 119, 6, .34); }

.sign-flash-ico {
    flex: none;
    font-size: 28px;
    line-height: 1;
}

.sign-flash-main { min-width: 0; flex: 1; }

.sign-flash-box {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
}

.sign-flash-box b { font-size: 22px; margin: 0 2px; }

.sign-flash-code {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.35;
    opacity: .95;
    word-break: break-all;
}

.sign-flash-prog {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    opacity: .82;
}

.sign-flash.fade-out { animation: signFlashOut .26s ease forwards; }

@keyframes signFlashIn {
    from { opacity: 0; transform: translate(-50%, -10px) scale(.97); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes signFlashOut {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, -8px); }
}

/* ====== 开关（设置页） ====== */
.setting-row-switch { align-items: flex-start; }

.setting-row-switch > label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.setting-row-switch > label small {
    font-size: 12px;
    line-height: 1.45;
    color: var(--gray-400);
    font-weight: 400;
}

.switch-wrap {
    position: relative;
    flex: none;
    display: inline-flex;
    margin-top: 2px;
}

.switch-wrap input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.switch-track {
    display: block;
    width: 46px;
    height: 27px;
    border-radius: 999px;
    background: var(--gray-300);
    transition: background .16s ease;
    position: relative;
}

.switch-dot {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .16s ease;
}

.switch-wrap input[type="checkbox"]:checked + .switch-track { background: var(--success); }
.switch-wrap input[type="checkbox"]:checked + .switch-track .switch-dot { transform: translateX(19px); }
.switch-wrap input[type="checkbox"]:disabled + .switch-track { opacity: .5; }

/* ====== 弹窗 ====== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 320px;
    width: calc(100% - 48px);
    box-shadow: var(--shadow-lg);
}

.modal-text {
    font-size: 15px;
    color: var(--gray-700);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ====== 扫码匹配提示 ====== */
.match-hint {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
    border: 1px solid;
}

.match-partial {
    background: var(--primary-light);
    border-color: #93c5fd;
    color: var(--primary-dark);
}

.match-done {
    background: var(--success-light);
    border-color: #86efac;
    color: #15803d;
}

.match-none {
    background: var(--warning-light);
    border-color: #fcd34d;
    color: #b45309;
}

/* ====== 到货核对页 ====== */
.import-tip {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.7;
    margin-bottom: 12px;
}

.import-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recon-summary {
    padding: 16px;
}

.recon-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.recon-qty-rate {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.recon-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.recon-stat {
    text-align: center;
    padding: 8px 4px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.recon-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
}

.recon-stat-label {
    font-size: 12px;
    color: var(--gray-500);
}

.status-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.status-tab {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: 20px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
}

.status-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending {
    background: var(--gray-200);
    color: var(--gray-600);
}

.badge-partial {
    background: var(--warning-light);
    color: #b45309;
}

.badge-done {
    background: var(--success-light);
    color: #15803d;
}

.badge-over {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    color: var(--gray-400);
    transition: color 0.15s;
}

.btn-edit:hover {
    color: var(--primary);
}

/* ====== 表单弹窗 ====== */
.modal-form {
    max-width: 400px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.modal-body-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-body-form label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
}

/* ====== 自定义列映射弹窗 ====== */
.map-hint {
    margin: 2px 0 10px;
    font-size: 12.5px;
    color: var(--gray-500);
}

.map-preview-wrap {
    margin-top: 6px;
}

.map-preview-wrap > label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.map-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--gray-50);
    padding: 8px;
    overflow-x: auto;
    max-height: 180px;
    overflow-y: auto;
}

.map-preview-empty {
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
    margin: 8px 0;
}

.map-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.map-preview-table th {
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.map-preview-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--gray-700);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-preview-table tr:last-child td {
    border-bottom: none;
}

/* ====== 动态表单字段 ====== */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title-row .section-title {
    margin-bottom: 0;
}

.form-empty-hint {
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
    padding: 16px 0;
    background: var(--gray-50, #f8fafc);
    border-radius: var(--radius, 8px);
    border: 1px dashed var(--gray-200, #e2e8f0);
}

.form-fields-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 0;
}

.field-check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 8px;
    font-size: 13px;
    color: var(--gray-600, #475569);
    cursor: pointer;
    user-select: none;
    background: var(--bg-card, #fff);
    transition: border-color 0.15s, background 0.15s;
}

.field-check-item:hover {
    border-color: var(--primary, #2563eb);
}

.field-check-item:has(input:checked) {
    border-color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.06);
    color: var(--primary, #2563eb);
    font-weight: 500;
}

.field-check-item input[type="checkbox"] {
    accent-color: var(--primary, #2563eb);
    width: 15px;
    height: 15px;
}

/* ====== 响应式 ====== */
@media (min-width: 768px) {
    .app-main {
        padding: 16px 20px calc(var(--bottom-nav-h) + 16px);
    }

    .stat-cards {
        grid-template-columns: repeat(4, 1fr);
    }

    .recon-stats {
        grid-template-columns: repeat(6, 1fr);
    }

    .chart-section {
        grid-template-columns: 1fr 1fr;
    }

    .stat-value {
        font-size: 28px;
    }

    .scan-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .scan-area {
        flex: 0 0 360px;
    }

    .receive-form-area {
        flex: 1;
        min-width: 320px;
    }

    .recent-scans {
        flex-basis: 100%;
    }
}

@media (min-width: 1024px) {
    .bottom-nav {
        max-width: 1200px;
    }
}

/* ====== 账号与权限 ====== */
.account-current {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.account-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.account-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-600);
    white-space: nowrap;
}

.account-role.role-supervisor {
    background: var(--warning-light);
    color: #92400e;
}

.account-role.role-ops_manager {
    background: #ede9fe;
    color: #5b21b6;
}

.account-role.role-biz_manager,
.account-role.role-biz_supervisor {
    background: #dcfce7;
    color: #166534;
}

.account-role.role-biz {
    background: #e0f2fe;
    color: #075985;
}

.account-role.role-finance {
    background: #fce7f3;
    color: #9d174d;
}

.account-role.role-admin {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.account-username {
    font-size: 12px;
    color: var(--gray-400);
    margin-left: auto;
}

.account-role-hint {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 12px;
}

.account-role-hint:empty {
    display: none;
}

.account-pwd-block {
    border-top: 1px dashed var(--gray-200);
    padding-top: 12px;
    margin-bottom: 12px;
}

.account-sub-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.account-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    font-size: 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    outline: none;
    background: var(--white);
    color: var(--gray-900);
}

.account-input:focus {
    border-color: var(--primary);
}

.admin-only-tag {
    font-size: 11px;
    font-weight: 400;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 2px 7px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 4px;
}

.new-user-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.new-user-form .account-input {
    flex: 1 1 130px;
    min-width: 100px;
    margin-bottom: 0;
}

.new-user-form .btn {
    flex: 0 0 auto;
}

.user-list-wrap {
    overflow-x: auto;
}

.user-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

/* ==================== 孤儿收货记录提示 ==================== */

.orphan-alert {
    border-left: 3px solid #f59e0b;
    background: #fffbeb;
    margin-bottom: 16px;
}

.orphan-alert-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.orphan-alert-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.orphan-alert-text {
    flex: 1;
    min-width: 0;
}

.orphan-alert-text b {
    display: block;
    color: #92400e;
    font-size: 14px;
    margin-bottom: 2px;
}

.orphan-alert-text span {
    display: block;
    font-size: 12px;
    color: #a16207;
    line-height: 1.5;
}

.orphan-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #fcd34d;
}

.orphan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.orphan-table th {
    text-align: left;
    font-weight: 500;
    color: var(--gray-500);
    font-size: 12px;
    padding: 6px 8px;
    border-bottom: 1px solid #fde68a;
    white-space: nowrap;
}

.orphan-table td {
    padding: 8px;
    border-bottom: 1px solid #fef3c7;
    vertical-align: middle;
}

.orphan-table tr:last-child td {
    border-bottom: none;
}

.orphan-boxes {
    color: var(--gray-600);
    max-width: 220px;
    word-break: break-all;
}

.orphan-tip {
    margin-top: 10px;
    font-size: 12px;
    color: #a16207;
    line-height: 1.6;
}

/* ==================== 操作日志 ==================== */

.audit-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.audit-toolbar .audit-input {
    width: auto;
    min-width: 110px;
}

.audit-toolbar .admin-kw {
    flex: 1;
    min-width: 150px;
}

.audit-summary {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 8px;
    min-height: 16px;
}

.audit-summary b {
    color: var(--gray-800);
}

.audit-list-wrap {
    max-height: 460px;
    overflow: auto;
    border: 1px solid var(--gray-100);
    border-radius: 8px;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.audit-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    font-weight: 500;
    color: var(--gray-500);
    font-size: 12px;
    padding: 8px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.audit-table td {
    padding: 8px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
    color: var(--gray-800);
}

.audit-table tr:last-child td {
    border-bottom: none;
}

.audit-col-time {
    white-space: nowrap;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
}

.audit-col-user {
    white-space: nowrap;
}

.audit-acct {
    display: block;
    font-size: 11px;
    color: var(--gray-400);
}

.audit-col-role {
    white-space: nowrap;
    color: var(--gray-500);
    font-size: 12px;
}

.audit-col-action {
    white-space: nowrap;
}

.audit-col-detail {
    line-height: 1.5;
    word-break: break-all;
}

.audit-col-ip {
    white-space: nowrap;
    color: var(--gray-400);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

.audit-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 11.5px;
}

.audit-tag.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.audit-empty {
    text-align: center;
    color: var(--gray-400);
    padding: 24px 8px !important;
    font-size: 13px;
}

.user-list-table th {
    text-align: left;
    font-weight: 500;
    color: var(--gray-500);
    font-size: 12px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.user-list-table td {
    padding: 8px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.user-row-disabled {
    opacity: .55;
}

.user-cell-name {
    font-size: 13px;
    color: var(--gray-900);
    font-weight: 500;
}

.user-cell-account {
    font-size: 11px;
    color: var(--gray-400);
}

.user-self {
    font-size: 10px;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 1px 5px;
    border-radius: 8px;
}

.user-state {
    font-size: 12px;
    white-space: nowrap;
}

.user-state.on {
    color: var(--success);
}

.user-state.off {
    color: var(--danger);
}

.user-cell-time {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
}

.user-cell-actions {
    white-space: nowrap;
}

.user-role-select {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    color: var(--gray-700);
}

.btn-mini {
    font-size: 11px;
    padding: 4px 8px;
    margin-right: 4px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-600);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-mini:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-mini-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.user-list-err {
    color: var(--danger);
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.user-list-tip {
    font-size: 11px;
    color: var(--gray-400);
    line-height: 1.6;
    margin-top: 10px;
}

.col-operator {
    font-size: 12px;
    color: var(--gray-600);
    white-space: nowrap;
}

/* ==================== 收货地（收货方）权限 ==================== */

/* 纯只读账号（财务）：扫码页只给提示，不给能填不能提交的表单 */
.readonly-note {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed var(--gray-300, #d1d5db);
    color: var(--gray-600, #4b5563);
    margin-bottom: 12px;
}
.readonly-note .readonly-ico { font-size: 20px; line-height: 1.2; }
.readonly-note b { display: block; font-size: 15px; color: var(--gray-800, #1f2937); margin-bottom: 4px; }
.readonly-note p { margin: 0; font-size: 13px; line-height: 1.7; }

body.is-readonly .receive-form-area,
body.is-readonly #cameraPanel,
body.is-readonly #batchBar,
body.is-readonly #matchHint { display: none !important; }

body.is-readonly .readonly-note { display: flex; }

/* 扫码页顶部：我的收货地提示条 */
.my-site-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    font-size: 14px;
    color: var(--gray-700, #374151);
}
.my-site-bar.hidden { display: none; }

.my-site-label {
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
}

.my-site-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.my-site-value { font-weight: 600; }

.my-site-note {
    font-size: 12px;
    color: var(--gray-500, #6b7280);
    margin-left: auto;
}

/* 未分配收货地：醒目的黄条 */
.my-site-bar.my-site-warn {
    background: var(--warning-light);
    border-color: #fcd34d;
}
.my-site-bar.my-site-warn .my-site-label { color: #b45309; }
.my-site-bar.my-site-warn .my-site-value { color: #b45309; }

/* 不受限角色（主管/经理）：灰底弱化 */
.my-site-bar.my-site-free {
    background: var(--gray-100);
    border-color: var(--gray-200, #e5e7eb);
}
.my-site-bar.my-site-free .my-site-label { color: var(--gray-600, #4b5563); }

/* 扫码提示里的收货地一行 */
.match-site {
    color: var(--gray-600, #4b5563);
    font-size: 13px;
    line-height: 1.6;
}
.match-site b { color: var(--primary-dark); }
.match-site small { color: var(--gray-400); }
.match-site .site-contact { color: var(--gray-500); font-size: 12px; }
.match-site-block {
    padding: 6px 8px;
    margin-top: 4px;
    background: #fef2f2;
    border-left: 3px solid var(--danger);
    border-radius: 4px;
    line-height: 1.6;
}
.match-site-block small { color: var(--gray-500); }

/* 账号管理：可收收货地单元格 */
.user-cell-sites { min-width: 150px; }

.site-cell-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.site-cell-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.site-cell-free {
    font-size: 12px;
    color: var(--gray-400);
}

.site-edit-btn { font-size: 12px; padding: 3px 8px; }

.site-edit-warn {
    border-color: var(--warning) !important;
    color: #b45309 !important;
    background: var(--warning-light);
    font-weight: 600;
}

/* 分配收货地弹窗 */
.site-pick-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.site-pick-tip {
    font-size: 12px;
    color: var(--gray-500, #6b7280);
    margin-bottom: 10px;
}

.site-pick-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}

.site-pick-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
}
.site-pick-row:hover { background: var(--gray-100); }

.site-pick-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.site-pick-name {
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.site-pick-partner { font-size: 11px; color: var(--gray-400); font-weight: 400; }
.site-pick-meta { font-size: 11px; color: var(--gray-400); margin-left: 6px; flex-shrink: 0; }

.site-pick-taken {
    font-size: 11px;
    color: var(--gray-400);
    margin-left: auto;
}

.site-pick-foot {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-200, #e5e7eb);
}

/* 新建账号时的收货地勾选区 */
.new-user-sites {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 0;
    width: 100%;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 13px;
}
.new-user-sites.hidden { display: none; }

.new-user-sites-label {
    font-weight: 600;
    color: var(--gray-600, #4b5563);
}

.new-user-site-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    cursor: pointer;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}
.nus-alias { font-weight: 600; }
.nus-partner { font-size: 10.5px; color: var(--gray-400); }
.new-user-site-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.new-user-sites-empty {
    color: var(--gray-400);
    font-size: 12px;
}

/* ====== 收货区域名单（管理员维护） ====== */
.site-pool {
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 12px 13px;
    margin-bottom: 14px;
}
.site-pool-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 9px;
}
.site-pool-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-700);
}
.site-pool-hint {
    font-size: 11.5px;
    color: var(--gray-400);
}
.site-pool-add {
    display: flex;
    gap: 8px;
}
.site-pool-add .account-input {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.site-pool-add .btn {
    flex-shrink: 0;
    white-space: nowrap;
}
.site-pool-empty {
    font-size: 12px;
    color: var(--gray-400);
    line-height: 1.6;
}

/* 区域档案卡片 */
.site-pool-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.site-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 11px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 9px;
}
.site-card-main { flex: 1; min-width: 0; }
.site-card-title {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.site-card-alias { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.site-card-partner { font-size: 11.5px; color: var(--gray-400); }
.site-card-src {
    font-size: 10px;
    color: var(--primary-dark);
    background: var(--primary-light);
    border-radius: 8px;
    padding: 1px 5px;
}
.site-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray-600);
}
.site-card-miss { color: var(--gray-300); }
.site-card-addr {
    margin-top: 3px;
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.45;
    word-break: break-all;
}
.site-card-note { margin-top: 2px; font-size: 11.5px; color: var(--gray-400); }
.site-card-stats { margin-top: 5px; font-size: 11.5px; color: var(--gray-400); }
.site-card-warn { color: #b45309; }
.site-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* 明细里有、还没建档的收货方 */
.site-unreg {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 9px;
    padding: 8px 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}
.site-unreg.hidden { display: none; }
.site-unreg-text {
    flex: 1;
    min-width: 180px;
    font-size: 11.5px;
    color: #b45309;
    line-height: 1.5;
}

/* 区域档案表单 */
.site-form { max-width: 430px; width: calc(100vw - 32px); }
.site-form-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 64vh;
    overflow-y: auto;
    padding-right: 2px;
}
.site-form .form-row { gap: 4px; }
.site-form-tip { font-size: 11.5px; color: var(--gray-400); line-height: 1.55; margin: 2px 0 0; }
.site-form-hint { font-size: 11px; color: var(--gray-400); line-height: 1.5; }

@media (max-width: 540px) {
    .site-pool { padding: 10px 11px; }
    .site-pool-hint { display: block; width: 100%; }
    .site-card { flex-direction: column; gap: 8px; }
    .site-card-actions { flex-direction: row; }
}

/* 越权拦截 toast：字多、层级高、耐看 */
.toast { cursor: pointer; }
.toast-error {
    max-width: 420px;
    line-height: 1.5;
}
.toast-error small {
    font-size: 12px;
    opacity: .85;
}

/* ==================== 接货人名单 ==================== */

.receivers-tip {
    font-size: 12px;
    color: var(--gray-500, #6b7280);
    margin: -4px 0 10px;
}

.receivers-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 20px;
}

.receivers-empty {
    font-size: 12px;
    color: var(--gray-400);
}

.receiver-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.receiver-del {
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.08);
    color: inherit;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}
.receiver-del:hover {
    background: var(--danger);
    color: #fff;
}

.receivers-edit-row {
    display: flex;
    gap: 8px;
}
.receivers-edit-row .account-input { flex: 1; }

/* ====== 扫码页 PDA 优化（v1.36）====== */

/* 单号 / 箱号：PDA 主输入框，一眼看清、一枪扫完 */
.scan-big-input {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 13px 14px;
    min-height: 52px;
}

.scan-big-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* 核对提示：放表单正上方，加大字号，进度数字一眼可读
   固定两行高度 —— 扫一件更新一次只在原地换字，绝不把下面的表单和按钮顶来顶去 */
.match-hint {
    font-size: 14px;
    padding: 10px 14px;
    min-height: 68px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    line-height: 1.55;
}

.match-hint b {
    font-size: 15px;
}

/* 单行截断：服务店名再长也只占一行，不让提示框长高 */
.match-hint-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 等扫码时的占位：高度和正常态一致，扫第一件时页面不会往上跳 */
.match-idle {
    background: var(--gray-50);
    border-color: var(--gray-200);
    color: var(--gray-400);
    font-size: 13px;
}

/* 异常说明（重复箱号 / 箱号越界 / 超区）：该看清楚的，允许它多占几行 */
.match-hint-warn {
    color: var(--danger);
    font-size: 12.5px;
    line-height: 1.5;
    white-space: normal;
    margin-top: 2px;
}

/* 低频功能：收进一行小工具按钮，不占主界面 */
.form-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 2px;
}

.btn-tool {
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-tool:hover {
    color: var(--gray-700);
    border-color: var(--gray-300);
    background: var(--gray-100);
}

.btn-tool.hidden {
    display: none;
}

/* v1.37：合托提为常驻大按钮；箱号框比单号小一号 */
.btn-batch {
    padding: 12px 24px;
    font-size: 15px;
    min-height: 48px;
    margin-bottom: 4px;
}

.btn-batch .icon {
    font-size: 17px;
}

/* 合托进行中：同一个按钮就地变成「结束合托」，用实心绿跟「开始合托」的描边区分开 */
.btn-batch-end {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
    font-weight: 600;
}

.btn-batch-end:hover {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
    filter: brightness(1.06);
}

.btn-batch-end .icon {
    font-weight: 700;
}

.scan-mid-input {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    min-height: 44px;
}

.scan-mid-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* v1.37 修正：确认收货与开始合托上下排，各自全宽 */
.receive-form .form-actions {
    flex-direction: column;
    align-items: stretch;
}

.receive-form .form-actions .btn-primary {
    flex: none;
    margin-bottom: 0;
}

/* ==================== 波次管理 ==================== */
.wave-panel .wave-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:8px}
.wave-head-actions{display:flex;gap:8px;flex-wrap:wrap}
.wave-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--gray-200);border-radius:10px;margin-bottom:8px;background:#fafaf8}
.wave-item-closed{opacity:.75;background:var(--gray-100)}
.wave-item-title{display:flex;align-items:center;gap:8px;font-size:14.5px;flex-wrap:wrap}
.wave-item-stats{font-size:12.5px;color:var(--gray-500);margin-top:3px}
.wave-item-memo{font-size:12px;color:var(--gray-500);margin-top:4px;padding:3px 8px;background:var(--gray-50, #F7F6F3);border-left:2px solid #C8C4B8;border-radius:3px;display:inline-block;max-width:100%}
.wave-closed-info{font-size:12px;color:var(--gray-400);margin-top:3px}
.wave-item-actions{display:flex;gap:8px;flex-shrink:0;flex-wrap:wrap}
.wave-badge{display:inline-block;font-size:11px;line-height:1;padding:4px 8px;border-radius:10px;color:#fff;white-space:nowrap}
.wave-open{background:#1D9E75}
.wave-closed{background:#8a8578}
.wave-pending{background:#BA7517}
.wave-tip{font-size:12px;color:var(--gray-400);margin-top:10px;margin-bottom:0}

/* ==================== 看板：波次进度条 ==================== */
.wave-strip-card{padding:14px 16px}
.wave-strip-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.wave-strip-title{font-size:15px;font-weight:600;color:var(--gray-800)}
.wave-strip-hint{font-size:12px;color:var(--gray-400)}
.wave-strip-list{display:flex;gap:10px;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin}
.wave-strip-empty{font-size:13px;color:var(--gray-400);padding:8px 0}

.wave-chip{
    flex:0 0 auto;min-width:196px;max-width:230px;text-align:left;cursor:pointer;
    background:var(--white);border:1.5px solid var(--gray-200);border-radius:10px;
    padding:10px 12px;font-family:inherit;transition:border-color .15s,box-shadow .15s,transform .1s;
}
.wave-chip:hover{border-color:var(--gray-300);box-shadow:var(--shadow-sm)}
.wave-chip:active{transform:scale(.99)}
.wave-chip.active{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.wave-chip.closed{background:var(--gray-50)}
.wave-chip.muted{opacity:.85}

.wave-chip-top{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:6px}
.wave-chip-name{font-size:13.5px;font-weight:600;color:var(--gray-800);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wave-chip-rate{font-size:15px;font-weight:700;color:var(--primary);flex-shrink:0}
.wave-chip.tone-done .wave-chip-rate{color:var(--success)}
.wave-chip.tone-low .wave-chip-rate{color:var(--warning)}

.wave-chip-bar{height:6px;border-radius:4px;background:var(--gray-100);overflow:hidden;margin-bottom:7px}
.wave-chip-bar>i{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--primary),#60a5fa);transition:width .25s}
.wave-chip.tone-done .wave-chip-bar>i{background:linear-gradient(90deg,var(--success),#4ade80)}
.wave-chip.tone-low .wave-chip-bar>i{background:linear-gradient(90deg,var(--warning),#fbbf24)}

.wave-chip-meta{display:flex;justify-content:space-between;gap:8px;font-size:11.5px;color:var(--gray-500);line-height:1.5}
.wave-chip-meta b{color:var(--gray-700);font-weight:600}
.wave-chip-meta .gap{color:var(--danger)}
.wave-chip-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:3px;font-size:11px;color:var(--gray-400)}
.wave-chip-tag{background:var(--gray-100);color:var(--gray-500);border-radius:8px;padding:1px 6px;white-space:nowrap}

@media (max-width:540px){
    .wave-chip{min-width:168px}
    .wave-strip-card{padding:12px}
}

/* ==================== 看板：显示口径 ==================== */
.caliber-picker{padding:14px 16px}
.caliber-picker-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.caliber-picker-title{font-size:15px;font-weight:600;color:var(--gray-800)}
.caliber-picker-hint{font-size:12px;color:var(--gray-400)}
.caliber-chips{display:flex;flex-wrap:wrap;gap:8px}

.caliber-chip{
    display:inline-flex;align-items:center;gap:6px;padding:7px 12px;
    border:1px solid var(--gray-200);background:var(--white);border-radius:20px;
    font-family:inherit;font-size:13px;color:var(--gray-600);cursor:pointer;
    transition:border-color .15s,background .15s,color .15s;
}
.caliber-chip:hover{border-color:var(--gray-300)}
.caliber-chip .caliber-box{
    width:15px;height:15px;flex-shrink:0;border:1.5px solid var(--gray-300);border-radius:4px;
    display:flex;align-items:center;justify-content:center;
    font-size:10px;line-height:1;color:#fff;background:var(--white);
}
.caliber-chip.on{border-color:var(--primary);background:var(--primary-light);color:var(--primary-dark);font-weight:600}
.caliber-chip.on .caliber-box{background:var(--primary);border-color:var(--primary)}
.caliber-chip.disabled{opacity:.45;cursor:not-allowed}

.caliber-grid{display:flex;flex-direction:column;gap:12px}
.caliber-empty{
    background:var(--white);border-radius:var(--radius);padding:16px;
    font-size:13px;color:var(--gray-400);box-shadow:var(--shadow-sm);
}

.cal-card{background:var(--white);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow-sm)}
.cal-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.cal-card-title{font-size:14.5px;font-weight:600;color:var(--gray-800)}
.cal-card-sub{font-size:11.5px;color:var(--gray-400);margin-top:2px}
.cal-card-x{border:none;background:transparent;color:var(--gray-300);font-size:20px;line-height:1;cursor:pointer;padding:0 2px;font-family:inherit}
.cal-card-x:hover{color:var(--gray-500)}
.cal-card-empty{font-size:13px;color:var(--gray-400);padding:10px 0 2px}

.cal-card-body{display:flex;align-items:center;gap:16px;margin-top:12px}
.cal-ring{
    position:relative;width:88px;height:88px;flex-shrink:0;border-radius:50%;
    display:flex;flex-direction:column;align-items:center;justify-content:center;
}
.cal-ring::before{content:'';position:absolute;inset:9px;background:var(--white);border-radius:50%}
.cal-ring-val{position:relative;z-index:1;font-size:21px;font-weight:700;color:var(--gray-800);line-height:1.1}
.cal-ring-cap{position:relative;z-index:1;font-size:10.5px;color:var(--gray-400);margin-top:1px}

.cal-metrics{flex:1;min-width:0;display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.cal-metric b{display:block;font-size:16px;font-weight:700;color:var(--gray-800);line-height:1.2;word-break:break-all}
.cal-metric span{display:block;font-size:11px;color:var(--gray-400);margin-top:2px}
.cal-metric.is-gap b{color:var(--danger)}

.cal-spark{display:flex;align-items:flex-end;gap:2px;height:36px;margin-top:12px;padding-top:6px;border-top:1px dashed var(--gray-200)}
.cal-spark i{flex:1;min-height:2px;border-radius:2px 2px 0 0;background:var(--spark-tone,var(--primary));opacity:.75}
.cal-spark i.muted{background:var(--gray-200);opacity:1}

.cal-foot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:11px;color:var(--gray-400);margin-top:8px}

/* 核心指标区标题 + 图表口径说明 */
.dash-section-label{font-size:12.5px;font-weight:600;color:var(--gray-500);padding:2px 2px 0}
.dash-section-label span{color:var(--gray-800)}
.chart-scope-note{font-size:12px;color:var(--gray-400);padding:0 2px}

@media (max-width:540px){
    .caliber-picker{padding:12px}
    .cal-card{padding:12px 13px}
    .cal-card-body{gap:12px}
    .cal-ring{width:78px;height:78px}
    .cal-ring-val{font-size:19px}
    .cal-metric b{font-size:15px}
}


/* ====== 到货核对明细表 v1.60：固定列宽 + 箱号标签 + 分页 ====== */
.table-expected {
    table-layout: fixed;
    min-width: 1150px;
    scroll-margin-top: calc(var(--header-h) + 12px);
}

.table-expected col.colc-status { width: 72px; }
.table-expected col.colc-wave { width: 150px; }
.table-expected col.colc-need { width: 66px; }
.table-expected col.colc-got { width: 60px; }
.table-expected col.colc-gap { width: 64px; }
.table-expected col.colc-box { width: 168px; }
.table-expected col.colc-code { width: 136px; }
.table-expected col.colc-act { width: 74px; }

.table-expected th,
.table-expected td {
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

.table-expected thead th {
    vertical-align: middle;
    padding-top: 11px;
    padding-bottom: 11px;
}

.table-expected .th-center { text-align: center; }

.table-expected tbody tr:nth-child(even) { background: #fcfdff; }
.table-expected tbody tr:hover { background: var(--primary-light); }

/* 商品名称 / 条码：上下两行，名称深、条码浅 */
.cell-name .nm {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}
.cell-name .cd {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--gray-400);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* 波次名称放最后一列：字号收小、允许换行，长名字也看全。
   选择器带 td 是为了盖掉 .data-table td 的 nowrap。 */
.table-expected td.cell-wave {
    color: var(--gray-600);
    font-size: 11.5px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    padding-top: 4px;
}

/* 数量列：数字居中、单位小字 */
.cell-num {
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: var(--gray-800);
}
.cell-num small {
    font-size: 11px;
    font-weight: 400;
    color: var(--gray-400);
    margin-left: 2px;
}

.cell-gap { text-align: center; }
.gap-num {
    display: inline-block;
    min-width: 34px;
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.gap-num.is-short { background: var(--warning-light); color: #b45309; }
.gap-num.is-over { background: var(--danger-light); color: var(--danger); }

.cell-dim { color: var(--gray-300); }

/* 箱号标签：格宽固定、自动换行；三行定高 → 整表每行高度一致 */
.table-expected .cell-boxes {
    white-space: normal;
    padding-top: 8px;
    padding-bottom: 8px;
}
.box-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-content: flex-start;
    min-height: 61px;
}
.box-chip {
    display: inline-block;
    min-width: 18px;
    padding: 1px 4px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 15px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
    white-space: nowrap;
}
.box-chip.is-miss {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
    font-weight: 600;
}
.box-chip.is-recv {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
/* 超出 15 个后的「+N / 收起」按钮 */
.box-more {
    align-self: flex-start;
    padding: 1px 6px;
    height: 19px;
    border: 1px dashed var(--gray-300);
    border-radius: 5px;
    background: var(--white);
    color: var(--gray-500);
    font-size: 11px;
    line-height: 15px;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s, color .15s, background .15s;
}
.box-more:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.box-more.is-collapse {
    border-style: solid;
    border-color: var(--gray-200);
    color: var(--gray-600);
}

.cell-ellipsis { white-space: nowrap; color: var(--gray-600); }
.cell-code {
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--gray-600);
    letter-spacing: 0.2px;
}
.cell-act { text-align: center; white-space: nowrap; }

/* 分页条 */
.table-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.pager-info { font-size: 13px; color: var(--gray-500); }
.pager-info b { color: var(--gray-800); font-variant-numeric: tabular-nums; }
.pager-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: 8px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s, color .15s, background .15s;
}
.pager-btn:hover:not(:disabled):not(.is-active) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.pager-btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    font-weight: 700;
}
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-nav { padding: 0 10px; color: var(--gray-700); }
.pager-gap { color: var(--gray-400); padding: 0 2px; font-size: 13px; }

@media (max-width: 640px) {
    .table-pager { justify-content: center; padding: 10px 8px; }
    .pager-info { width: 100%; text-align: center; font-size: 12px; }
    .pager-btn { min-width: 30px; height: 30px; padding: 0 7px; font-size: 12.5px; }
}
