/* ============================================
   酒吧酒品库存管理系统 - 样式表
   ============================================ */

:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #e2a03f;
    --accent-hover: #c58a2e;
    --danger: #e7515a;
    --success: #00ab55;
    --info: #4361ee;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #dfe6e9;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 顶部导航 ========== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 .icon {
    font-size: 24px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    outline: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-info {
    background: var(--info);
    color: #fff;
}
.btn-info:hover { background: #3451e0; }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #00964a; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #d9444e; }

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: #f0f0f0; }

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 4px;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 主容器 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
}

/* ========== 搜索筛选区 ========== */
.filter-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.filter-section h3 {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 16px;
    font-weight: 500;
}

/* 筛选行内排列（酒名 + 搜索 + 展开按钮） */
.filter-row-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-name-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
    background: #fff;
}

.filter-name-input:focus {
    border-color: var(--accent);
}

.btn-toggle-filter {
    font-size: 13px;
    white-space: nowrap;
    transition: all var(--transition);
}

/* 可折叠筛选项 */
.filter-expandable {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin-top 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.filter-expandable.expanded {
    max-height: 800px;
    opacity: 1;
    margin-top: 16px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.filter-grid input,
.filter-grid select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
    background: #fff;
}

.filter-grid input:focus,
.filter-grid select:focus {
    border-color: var(--accent);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.total-info {
    font-size: 13px;
    color: var(--text-light);
}

/* ========== 表格列表 ========== */
.table-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* 排序栏 */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    flex-wrap: wrap;
}
.sort-bar input[type="checkbox"] {
    width: 16px; height: 16px; cursor: pointer; accent-color: #fff;
}
.sort-bar label { cursor: pointer; user-select: none; }
.sort-btns {
    display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap;
}
.sort-btn {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.sort-btn:hover { background: rgba(255,255,255,0.25); }
.sort-btn.active { background: var(--accent); }

.table-scroll {
    max-height: 62vh;
    overflow-y: auto;
}

table {
    width: 100%;
    min-width: 2000px;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 12px;
}

thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 6px 6px;
    font-size: 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover { background: #fafbff; }

/* 上枪标记 */
tr.tap-checked {
    background: #1a1a2e;
    color: #fff;
}
tr.tap-checked:hover { background: #22223a; }
tr.tap-checked .btn-info { background: #5a7aff; }
tr.tap-checked .btn-danger { background: #f06060; }
tr.tap-checked .btn-outline {
    color: #fff; border-color: rgba(255,255,255,0.3);
}
tr.tap-checked .btn-outline:hover { background: rgba(255,255,255,0.1); }

/* 售价告警 */
tr.row-price-warn {
    background: #fce4ec !important;
}
tr.row-price-warn:hover { background: #f8bbd0 !important; }
tr.tap-checked.row-price-warn {
    background: #3d1a2e !important;
}

.val-profit {
    color: var(--success);
    font-weight: 600;
}

/* 图片缩略图 */
.img-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}

.img-thumb:hover {
    transform: scale(1.3);
}

.img-placeholder {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 11px;
}



/* ========== 热卖图标 ========== */
.hot-sale-icon {
    display: inline-block;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.15s, filter 0.15s;
    user-select: none;
}
.hot-sale-icon:hover { transform: scale(1.2); }
.hot-sale-on { filter: none; }
.hot-sale-off { filter: grayscale(100%); opacity: 0.35; }

/* ========== 上抢图标 ========== */
.rush-icon {
    display: inline-block;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.15s, filter 0.15s;
    user-select: none;
}
.rush-icon:hover { transform: scale(1.2); }
.rush-on { filter: none; }
.rush-off { filter: grayscale(100%); opacity: 0.35; }

/* ========== 热卖筛选下拉 ========== */
.filter-hot-sale-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: #fff;
    min-width: 120px;
    transition: border-color var(--transition);
}
.filter-hot-sale-select:focus { border-color: var(--accent); }

/* ========== 内联编辑 ========== */
.cell-editable {
    cursor: pointer;
    display: inline-block;
    min-width: 20px;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.cell-editable:hover {
    background: #eef1ff;
    border-color: var(--info);
}

.inline-edit-input {
    width: 100%;
    padding: 4px 8px;
    border: 2px solid var(--info) !important;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}

.inline-edit-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(226, 160, 63, 0.15);
}

.inline-edit-input[type="number"] {
    width: 90px;
}

.inline-origin-dropdown .inline-origin-option:hover {
    background: #fff7e6;
    color: var(--accent);
}

/* 编辑中单元格高亮 */
td:has(.inline-edit-input) {
    padding: 2px 4px !important;
    background: #fff !important;
}



/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-light);
}

.pagination-btns {
    display: flex;
    gap: 4px;
}

.pagination-btns button {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition);
}

.pagination-btns button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-btns button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination-btns button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.25s ease;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 5;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 标题栏紧凑热卖开关 */
.toggle-switch-compact {
    gap: 6px;
    font-size: 13px;
}

.toggle-switch-compact .toggle-slider {
    width: 38px;
    height: 22px;
    border-radius: 11px;
}

.toggle-switch-compact .toggle-slider::before {
    width: 18px;
    height: 18px;
    top: 2px;
    left: 2px;
}

.toggle-switch-compact input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.toggle-switch-compact .toggle-label-text {
    font-size: 13px;
    white-space: nowrap;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.modal-close:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========== 表单 ========== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.form-group label .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
    font-family: inherit;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

/* ========== 可搜索下拉 ========== */
.searchable-dropdown {
    position: relative;
}

.searchable-input {
    width: 100%;
    padding: 10px 14px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    font-size: 14px !important;
    outline: none !important;
    background: #fff !important;
    transition: border-color var(--transition) !important;
    box-sizing: border-box !important;
}

.searchable-input:focus {
    border-color: var(--accent) !important;
}

.searchable-input:disabled {
    background: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
}

.searchable-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
}

.searchable-option {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text);
}

.searchable-option:hover,
.searchable-option.highlighted {
    background: #fff7e6;
    color: var(--accent);
}

.searchable-option.no-match {
    color: var(--text-light);
    cursor: default;
    text-align: center;
}

.searchable-option.no-match:hover {
    background: #fff;
    color: var(--text-light);
}

/* 图片上传 */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: #fafbfc;
}

.upload-area:hover {
    border-color: var(--accent);
    background: #fffbf0;
}

.upload-area.has-image {
    border-style: solid;
}

.upload-area img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
}

.upload-hint {
    color: var(--text-light);
    font-size: 13px;
}

/* ========== 酒标裁剪弹窗 ========== */
.crop-modal {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}
.crop-modal .modal-header {
    flex-shrink: 0;
}
.crop-modal .crop-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 24px 0;
    overflow: hidden;
}
.crop-modal .modal-footer {
    flex-shrink: 0;
}

.crop-tip {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 12px;
}

.crop-stage {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 240px;
    max-height: none;
    overflow: hidden;
    background: #000;
    border-radius: var(--radius);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    margin-bottom: 16px;
}

.crop-stage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.crop-box {
    position: absolute;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
    cursor: move;
    touch-action: none;
}

.crop-box::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crop-grid i {
    position: absolute;
    background: rgba(255,255,255,0.45);
}
.crop-grid i:nth-child(1) { left: 33.333%; top: 0; width: 1px; height: 100%; }
.crop-grid i:nth-child(2) { left: 66.666%; top: 0; width: 1px; height: 100%; }
.crop-grid i:nth-child(3) { top: 33.333%; left: 0; height: 1px; width: 100%; }
.crop-grid i:nth-child(4) { top: 66.666%; left: 0; height: 1px; width: 100%; }

.crop-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
}
.crop-handle.nw { top: -10px; left: -10px; cursor: nwse-resize; }
.crop-handle.ne { top: -10px; right: -10px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -10px; left: -10px; cursor: nesw-resize; }
.crop-handle.se { bottom: -10px; right: -10px; cursor: nwse-resize; }

.crop-shade {
    position: absolute;
    pointer-events: none;
}
.crop-shade.tl { top: 0; left: 0; }
.crop-shade.tr { top: 0; right: 0; }
.crop-shade.bl { bottom: 0; left: 0; }
.crop-shade.br { bottom: 0; right: 0; }

/* ========== Toast 提示 ========== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }

/* ========== 图片预览遮罩 ========== */
.img-preview-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: pointer;
}

.img-preview-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .container { padding: 12px; }
    .filter-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .header { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
    .header h1 { font-size: 17px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .modal { width: 95%; max-width: 95%; }
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ========== 加载中 ========== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 酒水介绍弹窗内容样式 ==================== */
#descModalBody {
    line-height: 1.8;
    font-size: 14px;
}

#descModalBody h1, #descModalBody h2, #descModalBody h3,
#descModalBody h4, #descModalBody h5, #descModalBody h6 {
    margin: 12px 0 8px;
    color: var(--text);
}

#descModalBody p { margin: 8px 0; }
#descModalBody ul, #descModalBody ol { padding-left: 24px; margin: 8px 0; }
#descModalBody li { margin: 4px 0; }
#descModalBody table { width: 100%; border-collapse: collapse; margin: 12px 0; }
#descModalBody table th,
#descModalBody table td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
#descModalBody table th { background: #f5f5f5; font-weight: 600; }
#descModalBody img { max-width: 100%; height: auto; }
#descModalBody blockquote { border-left: 4px solid var(--accent); margin: 12px 0; padding: 8px 16px; background: #fff7e6; color: #666; }
#descModalBody a { color: var(--accent); }

/* CKEditor 在表单内的样式调整 */
.cke_chrome { border-radius: 6px !important; }

/* ==================== 实时利润计算器 ==================== */
.profit-calculator {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profit-calc-title {
    font-size: 14px;
    font-weight: 600;
    color: #15803d;
    padding-bottom: 8px;
    border-bottom: 1px solid #bbf7d0;
    margin-bottom: 4px;
}

.profit-calc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.profit-calc-label {
    width: 140px;
    color: #374151;
    font-weight: 500;
    flex-shrink: 0;
}

.profit-calc-value {
    font-size: 18px;
    font-weight: 700;
    color: #15803d;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 12px;
    border-radius: 6px;
    min-width: 80px;
    text-align: center;
}

.profit-calc-unit {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

/* ==================== 热卖开关 (Toggle Switch) ==================== */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    transition: background 0.25s;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label-text {
    color: var(--text);
    font-weight: 400;
}

/* ==================== 导入诊断弹窗 ==================== */
.import-diag {
    margin-bottom: 16px;
}

.diag-section {
    margin-bottom: 16px;
}

.diag-section h4 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 600;
}

.diag-section.diag-warn {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    color: #991b1b;
    font-size: 13px;
}

.diag-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.diag-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.diag-badge.diag-ok {
    background: #d1fae5;
    color: #065f46;
}

.diag-badge.diag-unknown {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px dashed #d1d5db;
}

/* 错误明细表格 */
.error-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.error-table th,
.error-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.error-table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text);
}

.error-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.error-table td:first-child {
    width: 60px;
    text-align: center;
    color: #ef4444;
    font-weight: 600;
}

.error-table td:nth-child(2) {
    width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.error-table td:nth-child(3) {
    color: var(--text-light);
    word-break: break-word;
}

/* ==================== 种类管理弹窗 ==================== */
.category-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.category-add-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.category-add-row input:focus {
    border-color: var(--accent);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 350px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: background 0.15s;
    background: #fafbfc;
}

.category-item:hover {
    background: #f0f4ff;
}

.category-item .category-name {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    flex: 1;
}

.category-item .category-name-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.category-item .category-actions {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-shrink: 0;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-icon:hover { background: #e8ecf1; color: var(--text); }
.btn-icon.btn-del:hover { background: #fee2e2; color: var(--danger); }
.btn-icon.btn-edit:hover { background: #e0e7ff; color: var(--info); }
.btn-icon.btn-up:hover,
.btn-icon.btn-down:hover { background: #d1fae5; color: var(--success); }

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.btn-icon:disabled:hover {
    background: transparent;
    color: var(--text-light);
}

.category-item .category-inline-btns {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}

.category-item .btn-inline-save {
    padding: 4px 10px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.category-item .btn-inline-save:hover {
    background: #00964a;
}

.category-item .btn-inline-cancel {
    padding: 4px 10px;
    background: #f0f0f0;
    color: var(--text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.category-item .btn-inline-cancel:hover {
    background: #e0e0e0;
}

/* 种类下拉+热卖同行 */
.category-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-row select {
    flex: 1;
}

/* 热卖开关在表单中的微调 */
.category-row .toggle-switch-compact {
    flex-shrink: 0;
    padding: 0 4px;
}

/* ==================== 品牌产地管理弹窗表格 ==================== */
.brand-origin-table {
    table-layout: fixed;
    min-width: 0;
}
.brand-origin-table th:nth-child(1) { width: 35%; }
.brand-origin-table th:nth-child(2) { width: 15%; }
.brand-origin-table th:nth-child(3) { width: 30%; }
.brand-origin-table th:nth-child(4) { width: 20%; }

/* ==================== 供应商管理弹窗表格 ==================== */
.supplier-table {
    table-layout: fixed;
    min-width: 0;
    font-size: 13px;
}
.supplier-table th,
.supplier-table td {
    padding: 6px 8px;
}
.supplier-table th:nth-child(1) { width: 25%; }
.supplier-table th:nth-child(2) { width: 12%; }
.supplier-table th:nth-child(3) { width: 15%; }
.supplier-table th:nth-child(4) { width: 15%; }
.supplier-table th:nth-child(5) { width: 18%; }
.supplier-table th:nth-child(6) { width: 15%; }
