* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #1f2937;
    background: #f4f6fa;
}
a { color: inherit; text-decoration: none; }

/* 布局：侧栏与顶栏固定，仅内容区滚动 */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
    width: 220px;
    flex: 0 0 220px;
    background: #fff;
    color: #374151;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-direction: column;
    overflow: hidden;
    transition: width .18s ease, flex-basis .18s ease;
}
.brand {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid #eef2f7;
    white-space: nowrap;
}
.brand-logo {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    flex: 0 0 30px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { color: #111827; font-size: 15px; font-weight: 600; }
.brand-sub { color: #9ca3af; font-size: 11px; }

.nav { padding: 8px 0; overflow-y: auto; overflow-x: hidden; flex: 1; }
/* 主菜单：选中为圆角矩形，左右留边距 */
.nav-item, .nav-group-title {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    margin: 2px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
}
.nav-item:hover, .nav-group-title:hover { color: #111827; background: #f1f5f9; }
.nav-item.active {
    color: #2563eb;
    background: #eff6ff;
    font-weight: 600;
}
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    color: #94a3b8;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { color: #2563eb; }
.nav-text { overflow: hidden; text-overflow: ellipsis; }
.nav-group-title { cursor: default; font-size: 12px; margin-top: 8px; }
.nav-sub-item {
    display: block;
    padding: 8px 12px 8px 40px;
    margin: 2px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}
.nav-sub-item:hover { color: #111827; background: #f1f5f9; }
.nav-sub-item.active { color: #2563eb; background: #eff6ff; font-weight: 600; }

/* 收缩按钮 */
.sidebar-toggle {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}
.sidebar-toggle:hover { color: #2563eb; border-color: #2563eb; }
.topbar-left { display: flex; align-items: center; }

/* 收起状态 */
.layout.collapsed .sidebar { width: 60px; flex: 0 0 60px; }
.layout.collapsed .brand { justify-content: center; padding: 0; }
.layout.collapsed .brand-text,
.layout.collapsed .nav-text,
.layout.collapsed .nav-sub { display: none; }
.layout.collapsed .nav-item,
.layout.collapsed .nav-group-title {
    justify-content: center;
    padding: 6px 0;
    margin: 4px 8px;
    text-align: center;
    cursor: pointer;
}.layout.collapsed .nav-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    margin-right: 0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
}
.layout.collapsed .nav-item:hover .nav-icon,
.layout.collapsed .nav-group-title:hover .nav-icon { background: #f1f5f9; }
.layout.collapsed .nav-item.active .nav-icon { background: #eff6ff; color: #2563eb; }

/* 收起时的悬浮子菜单 */
.nav-flyout {
    position: fixed;
    left: 68px;
    min-width: 150px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
    display: none;
    z-index: 60;
}
.nav-flyout.show { display: block; }
.nav-flyout-title { padding: 6px 12px; font-size: 12px; color: #9ca3af; }
.nav-flyout .nav-sub-item { padding: 8px 12px; border-radius: 6px; }

.container { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    height: 56px;
    flex: 0 0 56px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 14px; color: #6b7280; }
.btn-logout { color: #ef4444; }

/* 用户下拉菜单 */
.user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    color: #374151;
    user-select: none;
}
.user-trigger:hover { background: #f1f5f9; }
.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.user-name { font-size: 14px; }
.user-menu {
    display: none;
    position: absolute;
    top: 48px;
    right: 16px;
    min-width: 150px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 6px;
    z-index: 100;
}
.user-menu.show { display: block; }
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
}
.user-menu-item:hover { background: #f1f5f9; color: #111827; }
.user-menu-item.user-menu-logout { color: #ef4444; }
.user-menu-item.user-menu-logout:hover { background: #fef2f2; color: #dc2626; }

/* 弹窗底部按钮区 */
.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}
.form-footer .btn {
    font-size: 13px;
    height: 32px;
    padding: 0 16px;
}
.btn-secondary { background: #fff; border-color: #d1d5db; color: #374151; }
.btn-secondary:hover { background: #f3f4f6; color: #111827; }
.content { padding: 20px; flex: 1; overflow-y: auto; }

/* 卡片 */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    padding: 16px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}
.card-title { font-size: 15px; font-weight: 600; }

/* 表单控件 */
.search-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea,
button, .btn {
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    font-size: 13px;
    background: #fff;
    color: #1f2937;
    line-height: 34px;
    box-sizing: border-box;
}
input[type=date] { font-family: inherit; color: #1f2937; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; }
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
textarea { height: auto; padding: 8px 10px; line-height: 1.5; }
.form-row { display: flex; gap: 14px; }
.form-row .form-item { flex: 1; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: #2563eb; }

.btn {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
}
.btn:hover { border-color: #2563eb; color: #2563eb; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; color: #fff; }
.btn-danger { background: #fff; border-color: #fca5a5; color: #ef4444; }
.btn-danger:hover { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn-sm { height: 25px; padding: 0 9px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-sm .btn-ico { flex: 0 0 12px; width: 12px; height: 12px; }

/* 表格 */
/* 调试结果列：限宽省略，悬浮展开全文 */
.result-cell { overflow: hidden; }
.result-cell .result-text {
    display: block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-cell:hover .result-text { white-space: normal; word-break: break-all; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    white-space: nowrap;
    font-size: 12px;
}
.table th { background: #f8fafc; color: #6b7280; font-weight: 600; }
.table tbody tr:hover { background: #f9fafb; }
.table .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-tip { padding: 30px; text-align: center; color: #9ca3af; }

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    background: #f1f5f9;
    color: #64748b;
}
.tag-success { background: #ecfdf5; color: #059669; }
.tag-danger { background: #fef2f2; color: #dc2626; }
.tag-warn { background: #fffbeb; color: #d97706; }
.tag-muted { background: #f3f4f6; color: #9ca3af; }
.tag-warning { background: #fef3c7; color: #b45309; }

/* 库存流水筛选条 */
.logs-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 0;
    margin-bottom: 14px;
}
.logs-filters select,
.logs-filters input {
    height: 32px;
    font-size: 13px;
}
.logs-filters input[type="text"] { width: 150px; }

/* 顶栏：主题切换 + 低库存铃铛 */
.topbar-bell {
    position: relative;
    color: #6b7280;
    display: inline-flex;
    padding: 8px;
    border-radius: 8px;
}
.topbar-bell:hover { background: #f1f5f9; color: #dc2626; }
/* 无预警时的灰显状态 */
.topbar-bell.bell-idle { color: #9ca3af; }
.topbar-bell.bell-idle:hover { background: transparent; color: #9ca3af; }
.topbar-bell.bell-idle .bell-badge { display: none; }
/* 使用手册入口 */
.topbar-book:hover { background: #eff6ff; color: #2563eb; }
.bell-badge {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

/* 报表页 */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary-card { padding: 16px 20px; }
.summary-label { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.summary-value { font-size: 22px; font-weight: 700; }
.chart-box { position: relative; height: 320px; padding: 8px 16px 16px; }
.rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.rank-grid > .card { min-width: 0; overflow: hidden; }
@media (max-width: 900px) { .rank-grid { grid-template-columns: 1fr; } }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.page-title h1 { font-size: 20px; margin: 0 0 4px; }
.page-desc { font-size: 12px; color: #6b7280; margin: 0; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ===== 深色模式 ===== */
.tag-info { background: #eff6ff; color: #2563eb; }

/* 分页 */
.page-box { margin-top: 14px; text-align: right; }
.pagination { display: inline-flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.pagination li a, .pagination li span {
    display: inline-block;
    min-width: 32px;
    height: 32px;
    line-height: 30px;
    padding: 0 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #374151;
}
.pagination li.active span { background: #2563eb; border-color: #2563eb; color: #fff; }
.pagination li.disabled span { color: #cbd5e1; }

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 700px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-item {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    min-width: 0;
}
.stat-label { color: #6b7280; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-top: 6px;
    white-space: nowrap;
}

/* 顶部多页签（位于顶栏内） */
.nav-tabs {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 16px 0 0;
    height: 56px;
}
.nav-tabs-scroll {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-tabs-scroll::-webkit-scrollbar { display: none; }
.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 10px 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    color: #4b5563;
    white-space: nowrap;
    cursor: pointer;
    background: #f8fafc;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav-tab:hover { color: #111827; background: #f1f5f9; }
.nav-tab.active {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
    font-weight: 600;
}
.nav-tab-link { color: inherit; text-decoration: none; }
.nav-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    color: #9ca3af;
}
.nav-tab-close:hover { color: #ef4444; background: #fecaca; }
/* 溢出滚动箭头（需要时显示） */
.nav-tabs-btn {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}
.nav-tabs-btn.show { display: inline-flex; }
.nav-tabs-btn:hover { color: #2563eb; border-color: #bfdbfe; }

/* 按钮小图标 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.btn .btn-ico {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    color: currentColor;
}
.btn .btn-ico svg { width: 100%; height: 100%; display: block; }

/* 弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99;
}
.modal-mask.show {
    display: flex;
    animation: maskFade .2s ease both;
}
.modal-mask.show .modal {
    animation: modalIn .28s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes maskFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(26px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .modal-mask.show,
    .modal-mask.show .modal { animation: none; }
}
.modal {
    width: 520px;
    max-width: 94vw;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, .2);
}
/* 直播平台 logo */
.plat-logo {
    width: 20px;
    height: 20px;
    vertical-align: -5px;
    margin-right: 6px;
    border-radius: 4px;
}
.plat-logo-fb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    vertical-align: -5px;
    margin-right: 6px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

/* 播放调试弹窗：外层固定高度不滚动，仅线路列表内部滚动 */
.play-modal {
    height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.play-modal .modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.play-modal-video {
    width: 100%;
    height: 48vh;
    max-height: 430px;
    background: #000;
    border-radius: 6px;
    flex-shrink: 0;
}
.play-modal-urls {
    margin-top: 6px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 8px 10px;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { cursor: pointer; color: #9ca3af; font-size: 20px; line-height: 1; }
.modal-body { padding: 20px; }

/* 全局确认 / 输入弹窗（替代系统原生） */
.ui-dialog {
    width: 380px;
    max-width: 92vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, .2);
    overflow: hidden;
}
.ui-dialog-head {
    padding: 20px 24px 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.ui-dialog-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ui-dialog-icon svg { width: 20px; height: 20px; }
.ui-dialog-icon.danger  { background: #fee2e2; color: #dc2626; }
.ui-dialog-icon.warning { background: #fef3c7; color: #d97706; }
.ui-dialog-icon.info    { background: #dbeafe; color: #2563eb; }
.ui-dialog-text { flex: 1; min-width: 0; padding-top: 1px; }
.ui-dialog-title { font-size: 16px; font-weight: 600; color: #111827; }
.ui-dialog-msg { margin-top: 6px; font-size: 14px; color: #6b7280; line-height: 1.6; word-break: break-all; }
.ui-dialog-body { padding: 16px 24px 0 76px; }
.ui-dialog-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}
.ui-dialog-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }

/* 长文本单元格：超宽省略，悬停 title 显示完整 */
.cell-ellipsis {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* 弹窗尺寸 */
.modal-lg { width: 760px; max-width: calc(100vw - 40px); }
.total-primary { color: #2563eb; }

/* 工作台统计卡片（可点击跳转） */
.stat-link {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.stat-icon {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-body { min-width: 0; }

/* 工作台图表 */
.chart-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
    margin-bottom: 16px;
}
.chart-card {
    margin-bottom: 0;
    min-width: 0;
    overflow: hidden;
}
.chart-grid .chart-card:nth-child(3) { grid-column: 1 / -1; }
.chart-box { position: relative; height: 300px; min-width: 0; }
.chart-box-tall { height: 360px; }
/* 自绘图例（胶囊形） */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 8px 0 2px;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}
.legend-item.off { opacity: .35; }
.legend-pill {
    width: 24px;
    height: 10px;
    border-radius: 5px;
    display: inline-block;
}

.chart-filter {
    width: auto;
    min-width: 150px;
    max-width: 220px;
    padding: 2px 26px 2px 8px;
    font-size: 12px;
    height: auto;
    line-height: 1.6;
}
@media (max-width: 900px) {
    .chart-grid { grid-template-columns: 1fr; }
}

/* 产品表单：左图右字段 */
.goods-form-split {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}
.goods-form-left {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.goods-form-right { flex: 1; min-width: 0; }
.image-picker {
    width: 150px;
    height: 150px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s ease, background .15s ease;
}
.image-picker:hover { border-color: #2563eb; background: #eff6ff; }
.image-picker-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    font-size: 12px;
    padding: 8px;
    text-align: center;
}
.image-picker-tip { font-size: 10px; color: #cbd5e1; line-height: 1.4; }
.image-picker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.image-picker.has-img { border-style: solid; }
.image-remove {
    align-self: center;
    color: #ef4444;
    border-color: #fecaca;
}
.image-remove:hover { background: #fef2f2; color: #dc2626; }

/* 产品列表缩略图与大图预览 */
.goods-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}
.goods-thumb {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    cursor: zoom-in;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}
.goods-thumb:hover { border-color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,.25); }

/* 大图预览层 */
.img-viewer {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .8);
    z-index: 300;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.img-viewer.show { display: flex; }
.img-viewer img {
    max-width: 86vw;
    max-height: 86vh;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0,0,0,.4);
}

/* 库存流水：点行筛选 */
tr.row-select { cursor: pointer; transition: background .12s ease; }
tr.row-select:hover td { background: #eff6ff; }
tr.row-selected td { background: #dbeafe !important; }
.logs-filter-tip { font-size: 12px; font-weight: 400; color: #2563eb; margin-left: 6px; }

/* 宽表格：容器内横向滚动，不撑破页面 */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-scroll .table { min-width: 1100px; }
/* 排行小表：仅 3-4 列，不滚动、收窄列宽 */
.rank-grid .table-scroll .table { min-width: 0; table-layout: auto; }
.rank-grid .table th:nth-child(1), .rank-grid .table td:nth-child(1) { width: 40px; }
.rank-grid .table th:nth-child(3), .rank-grid .table td:nth-child(3) { width: 60px; }
.rank-grid .table th:nth-child(4), .rank-grid .table td:nth-child(4) { width: 110px; }

/* 经营报表：金额统一蓝色 */
.report-page .table td:last-child { color: #2563eb; font-weight: 600; }

/* 明细弹窗信息行（往来单位/日期） */
.detail-info {
    padding: 8px 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    margin-bottom: 10px;
}

/* 列表/明细中的库存、价格等关键数值高亮 */
.num-hl { color: #2563eb; font-weight: 600; }
/* 价格：蓝色不加粗（产品列表） */
.num-price { color: #2563eb; }
/* 库存量：按预警值红绿显示（全局） */
.stock-ok { color: #059669; }
.stock-warn { color: #dc2626; }
.text-primary { color: #2563eb; }

/* 弹窗内明细表 */
.table-item { margin: 8px 0 12px; width: 100%; table-layout: fixed; box-sizing: border-box; }
.table-item th, .table-item td { padding: 4px 6px; overflow: hidden; }
.table-item input, .table-item select {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    box-sizing: border-box;
}
.table-item input[readonly] { background: #f9fafb; }
.table-item .td-del { text-align: center; }
.table-item select.b-goods { width: 100%;   }
.btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.btn-icon-danger:hover { background: #fecaca; }
input[type="text"]:disabled,
input[type="number"]:disabled,
select:disabled,
textarea:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}
.ui-dialog-foot {
    padding: 20px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.ui-btn {
    height: 34px;
    line-height: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    transition: all .15s ease;
}
.ui-btn .btn-ico { flex: 0 0 14px; width: 14px; height: 14px; }
.ui-btn:hover { background: #f9fafb; color: #111827; }
.ui-btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.ui-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.ui-btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.ui-btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.modal-footer {
    padding: 12px 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.form-item { margin-bottom: 14px; }
.form-label { display: block; margin-bottom: 6px; color: #4b5563; font-size: 13px; }
.form-item input[type=text], .form-item input[type=password], .form-item input[type=date], .form-item select { width: 100%; }
.form-tip { color: #9ca3af; font-size: 12px; margin-top: 4px; }
.radio-group { display: flex; gap: 18px; height: 34px; align-items: center; }
.radio-group label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* 权限选择 */
.rule-group { margin-bottom: 14px; }
.rule-group-title { font-size: 13px; color: #374151; font-weight: 600; margin-bottom: 8px; }
.rule-list { display: flex; flex-wrap: wrap; gap: 10px; }
.rule-list label { display: inline-flex; align-items: center; gap: 5px; color: #4b5563; cursor: pointer; }

/* 提示（四类：成功/错误/警告/信息） */
.toast {
    display: none;
    position: fixed;
    left: 50%;
    top: 40px;
    transform: translateX(-50%);
    align-items: center;
    gap: 8px;
    background: rgba(17, 24, 39, .85);
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    z-index: 200;
}
.toast.show { display: flex; }
.toast span { display: inline-flex; align-items: center; }
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info { background: rgba(17, 24, 39, .85); }

/* 登录页 */
/* 登录页：浅色简约风 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f8fb;
    position: relative;
    overflow: hidden;
}
/* 简约装饰元素：柔和几何色块 */
.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.login-page::before {
    width: 420px;
    height: 420px;
    top: -140px;
    right: -120px;
    background: radial-gradient(circle at 35% 35%, rgba(37, 99, 235, .10), rgba(37, 99, 235, .02) 65%, transparent 75%);
}
.login-page::after {
    width: 520px;
    height: 520px;
    bottom: -200px;
    left: -160px;
    background: radial-gradient(circle at 60% 40%, rgba(13, 148, 136, .10), rgba(13, 148, 136, .02) 60%, transparent 75%);
}
/* 顶部细线装饰 */
.login-topline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #0d9488);
}
.login-box {
    width: 380px;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    padding: 36px 32px 30px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .06);
    position: relative;
    z-index: 1;
}
.login-brand { display: flex; justify-content: center; margin-bottom: 16px; }
.login-logo { width: 64px; height: auto; display: block; }
.login-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 6px; letter-spacing: .5px; }
.login-sub { text-align: center; color: #9ca3af; margin-bottom: 26px; font-size: 13px; }
/* 标题下短横线装饰 */
.login-sub::after {
    content: '';
    display: block;
    width: 28px;
    height: 3px;
    margin: 14px auto 0;
    border-radius: 2px;
    background: linear-gradient(90deg, #2563eb, #0d9488);
}
.login-box .btn-primary { width: 100%; height: 38px; margin-top: 6px; letter-spacing: 6px; }
.login-footer {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    color: #b6c1cf;
    font-size: 12px;
    z-index: 1;
}

/* 无权限提示 */
.tip-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.tip-box { text-align: center; color: #6b7280; }
.tip-box .code { font-size: 48px; font-weight: 700; color: #d1d5db; }
.tip-logo {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* ===== 深色模式补全 ===== */
