/**
 * 库存盘点页面样式
 * 命名空间：.inventory-container
 * 兼容主题 CSS 变量：--primary-color, --secondary-color, --bg-color
 */

/* ========== 容器与页面布局 ========== */
.inventory-container {
    --inv-primary: var(--primary-color, #667eea);
    --inv-secondary: var(--secondary-color, #764ba2);
    --inv-bg: var(--bg-color, #f5f7fa);
    --inv-text: #1a1a2e;
    --inv-text-muted: #666;
    --inv-border: #e0e0e0;
    --inv-radius: 12px;
    --inv-radius-lg: 16px;
    --inv-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --inv-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --inv-matched-bg: #d4edda;
    --inv-matched-color: #28a745;
    --inv-multi-bg: #fff3cd;
    --inv-multi-color: #ffc107;
    --inv-notfound-bg: #f8d7da;
    --inv-notfound-color: #dc3545;

    padding: 24px;
    background: linear-gradient(135deg, var(--inv-bg) 0%, #e4e8ec 100%);
    min-height: calc(100vh - 60px);
    color: var(--inv-text);
}

.inventory-container .task-list-page,
.inventory-container .task-detail-page {
    animation: invFadeIn 0.25s ease;
}

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

/* ========== Toast 提示 ========== */
.inventory-container .inventory-toast {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: var(--inv-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: invSlideInRight 0.3s ease;
}

@keyframes invSlideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

.inventory-container .inventory-toast.toast-success {
    background: #fff;
    border-left: 4px solid var(--inv-matched-color);
}

.inventory-container .inventory-toast.toast-error {
    background: #fff;
    border-left: 4px solid var(--inv-notfound-color);
}

.inventory-container .inventory-toast.toast-warning {
    background: #fff;
    border-left: 4px solid var(--inv-multi-color);
}

.inventory-container .toast-icon-wrapper {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.inventory-container .toast-success .toast-icon-wrapper { color: var(--inv-matched-color); }
.inventory-container .toast-error .toast-icon-wrapper { color: var(--inv-notfound-color); }
.inventory-container .toast-warning .toast-icon-wrapper { color: #d97706; }

.inventory-container .toast-icon-wrapper svg {
    width: 100%;
    height: 100%;
}

.inventory-container .toast-content {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.inventory-container .toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.inventory-container .toast-close:hover { background: #e8e8e8; }
.inventory-container .toast-close svg { width: 14px; height: 14px; color: #888; }

/* ========== 页面头部 ========== */
.inventory-container .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.inventory-container .header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inventory-container .header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--inv-primary);
    width: fit-content;
}

.inventory-container .header-badge svg {
    width: 14px;
    height: 14px;
}

.inventory-container .page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--inv-text);
    margin: 0;
}

.inventory-container .page-subtitle {
    font-size: 14px;
    color: var(--inv-text-muted);
    margin: 0;
}

.inventory-container .header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.inventory-container .header-right {
    width: 150px;
}

.inventory-container .task-detail-page .page-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
}

/* ========== 按钮系统 ========== */
.inventory-container .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.4, 1);
    white-space: nowrap;
    text-decoration: none;
}

.inventory-container .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.inventory-container .btn-primary {
    background: linear-gradient(135deg, var(--inv-primary) 0%, var(--inv-secondary) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.inventory-container .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.inventory-container .btn-outline-primary {
    background: transparent;
    color: var(--inv-primary);
    border: 2px solid var(--inv-primary);
}

.inventory-container .btn-outline-primary:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.08);
}

.inventory-container .btn-outline-secondary {
    background: transparent;
    color: var(--inv-text-muted);
    border: 2px solid var(--inv-border);
}

.inventory-container .btn-outline-secondary:hover:not(:disabled) {
    background: #f5f5f5;
}

.inventory-container .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.inventory-container .btn-warning:hover:not(:disabled) {
    transform: translateY(-2px);
}

.inventory-container .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

.inventory-container .btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
}

.inventory-container .btn-lg { padding: 12px 28px; font-size: 16px; }
.inventory-container .btn-sm { padding: 6px 14px; font-size: 12px; }
.inventory-container .btn-icon { width: 18px; height: 18px; flex-shrink: 0; }
.inventory-container .btn-back { padding: 10px 16px; }

.inventory-container .btn-outline-primary svg,
.inventory-container .btn-back svg {
    width: 16px;
    height: 16px;
}

/* ========== 筛选区域 ========== */
.inventory-container .filter-section { margin-bottom: 24px; }

.inventory-container .filter-card {
    background: #fff;
    border-radius: var(--inv-radius-lg);
    padding: 16px 20px;
    box-shadow: var(--inv-shadow);
}

.inventory-container .filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inventory-container .filter-icon {
    width: 18px;
    height: 18px;
    color: var(--inv-primary);
    flex-shrink: 0;
}

.inventory-container .filter-label {
    font-size: 14px;
    color: var(--inv-text-muted);
    font-weight: 500;
}

.inventory-container .select-field {
    padding: 10px 16px;
    border: 2px solid var(--inv-border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 160px;
}

.inventory-container .select-field:focus {
    outline: none;
    border-color: var(--inv-primary);
}

/* ========== 统计卡片 ========== */
.inventory-container .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.inventory-container .stat-card {
    position: relative;
    background: #fff;
    border-radius: var(--inv-radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--inv-shadow);
    overflow: hidden;
}

.inventory-container .stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inventory-container .stat-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.inventory-container .stat-card-blue .stat-icon-wrapper {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
}

.inventory-container .stat-card-orange .stat-icon-wrapper {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #ea580c;
}

.inventory-container .stat-card-green .stat-icon-wrapper {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #16a34a;
}

.inventory-container .stat-content {
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.inventory-container .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--inv-text);
    line-height: 1.2;
}

.inventory-container .stat-label {
    font-size: 13px;
    color: #888;
}

.inventory-container .stat-bg-effect {
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.08;
}

.inventory-container .stat-card-blue .stat-bg-effect { background: #0284c7; }
.inventory-container .stat-card-orange .stat-bg-effect { background: #ea580c; }
.inventory-container .stat-card-green .stat-bg-effect { background: #16a34a; }

/* ========== 任务卡片列表 ========== */
.inventory-container .task-grid { margin-bottom: 24px; }

.inventory-container .loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
}

.inventory-container .loading-ring {
    width: 40px;
    height: 40px;
    border: 3px solid var(--inv-border);
    border-top-color: var(--inv-primary);
    border-radius: 50%;
    animation: invSpin 0.8s linear infinite;
}

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

.inventory-container .loading-text {
    color: #888;
    font-size: 14px;
}

.inventory-container .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    gap: 16px;
    text-align: center;
}

.inventory-container .empty-illustration svg { max-width: 200px; height: auto; }
.inventory-container .empty-illustration.small svg { max-width: 100px; }

.inventory-container .empty-state h3 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.inventory-container .empty-state p {
    color: #888;
    margin: 0;
}

.inventory-container .grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.inventory-container .task-card {
    position: relative;
    background: #fff;
    border-radius: var(--inv-radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.4, 1);
}

.inventory-container .task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--inv-shadow-hover);
}

.inventory-container .card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.inventory-container .card-glow.glow-0 { background: linear-gradient(90deg, #fde68a, #f59e0b); }
.inventory-container .card-glow.glow-1 { background: linear-gradient(90deg, #bfdbfe, #2563eb); }
.inventory-container .card-glow.glow-2 { background: linear-gradient(90deg, #bbf7d0, #16a34a); }

.inventory-container .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.inventory-container .status-tag,
.inventory-container .status-tag-lg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.inventory-container .status-tag-lg {
    padding: 6px 16px;
    font-size: 13px;
}

.inventory-container .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.inventory-container .status-0 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.inventory-container .status-1 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.inventory-container .status-2 {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.inventory-container .card-action-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.inventory-container .card-action-btn:hover {
    color: var(--inv-primary);
    background: rgba(102, 126, 234, 0.08);
}

.inventory-container .card-action-btn svg { width: 18px; height: 18px; }

.inventory-container .card-body { padding: 20px; }

.inventory-container .card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--inv-text);
    margin: 0 0 12px;
    line-height: 1.4;
}

.inventory-container .card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inventory-container .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--inv-text-muted);
}

.inventory-container .meta-icon {
    width: 16px;
    height: 16px;
    color: var(--inv-primary);
    flex-shrink: 0;
}

.inventory-container .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #fafafa;
}

.inventory-container .card-date {
    font-size: 12px;
    color: #999;
}

.inventory-container .card-footer .btn-outline-primary svg {
    width: 14px;
    height: 14px;
}

/* ========== 分页 ========== */
.inventory-container .pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.inventory-container .pagination-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--inv-border);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.inventory-container .pagination-btn svg { width: 18px; height: 18px; }

.inventory-container .pagination-btn:hover:not(:disabled) {
    border-color: var(--inv-primary);
    color: var(--inv-primary);
}

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

.inventory-container .pagination-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--inv-text-muted);
}

.inventory-container .pagination-total {
    font-size: 12px;
    color: #999;
}

/* ========== 任务详情 - 信息面板 ========== */
.inventory-container .detail-info-panel { margin-bottom: 24px; }

.inventory-container .info-card {
    background: #fff;
    border-radius: var(--inv-radius-lg);
    box-shadow: var(--inv-shadow);
    overflow: hidden;
}

.inventory-container .info-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    font-weight: 600;
    color: var(--inv-text);
}

.inventory-container .info-card-header svg {
    width: 20px;
    height: 20px;
    color: var(--inv-primary);
}

.inventory-container .info-content { padding: 8px 20px 16px; }

.inventory-container .info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 12px;
}

.inventory-container .info-row:last-child { border-bottom: none; }

.inventory-container .info-label {
    width: 100px;
    flex-shrink: 0;
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.inventory-container .info-value {
    flex: 1;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

/* ========== Excel 上传区域 ========== */
.inventory-container .upload-section { margin-bottom: 24px; }

.inventory-container .upload-card {
    background: #fff;
    border-radius: var(--inv-radius-lg);
    padding: 24px;
    box-shadow: var(--inv-shadow);
}

.inventory-container .upload-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.inventory-container .upload-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inventory-container .upload-icon-wrapper svg {
    width: 26px;
    height: 26px;
    color: var(--inv-primary);
}

.inventory-container .upload-title h3 {
    font-size: 18px;
    color: var(--inv-text);
    margin: 0;
}

.inventory-container .upload-title p {
    font-size: 14px;
    color: #888;
    margin: 4px 0 0;
}

.inventory-container .upload-form {
    display: flex;
    gap: 16px;
    align-items: stretch;
    flex-wrap: wrap;
}

.inventory-container .file-upload-label {
    flex: 1;
    min-width: 260px;
    min-height: 120px;
    border: 2px dashed var(--inv-border);
    border-radius: var(--inv-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.inventory-container .file-upload-label:hover {
    border-color: var(--inv-primary);
    background: rgba(102, 126, 234, 0.04);
}

.inventory-container .file-upload-label.has-file {
    border-color: var(--inv-matched-color);
    border-style: solid;
    background: var(--inv-matched-bg);
}

.inventory-container .file-input { display: none; }

.inventory-container .file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #888;
    padding: 16px;
    text-align: center;
}

.inventory-container .upload-svg {
    width: 48px;
    height: 48px;
    color: var(--inv-primary);
    opacity: 0.7;
}

.inventory-container .file-selected {
    font-weight: 600;
    color: var(--inv-matched-color);
    word-break: break-all;
}

.inventory-container .upload-hint {
    font-size: 12px;
    color: #aaa;
}

.inventory-container .upload-btn {
    align-self: center;
    padding: 12px 28px;
}

/* ========== 导入结果汇总 ========== */
.inventory-container .import-summary-card {
    margin-top: 16px;
    background: #fff;
    border-radius: var(--inv-radius-lg);
    padding: 24px;
    box-shadow: var(--inv-shadow);
}

.inventory-container .summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.inventory-container .summary-header h4 {
    font-size: 16px;
    color: var(--inv-text);
    margin: 0;
}

.inventory-container .summary-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.inventory-container .summary-badge.success {
    background: var(--inv-matched-bg);
    color: var(--inv-matched-color);
}

.inventory-container .summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.inventory-container .summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #fafafa;
    border-radius: var(--inv-radius);
    border: 1px solid transparent;
}

.inventory-container .summary-stat.matched {
    background: var(--inv-matched-bg);
    border-color: var(--inv-matched-color);
}

.inventory-container .summary-stat.multi {
    background: var(--inv-multi-bg);
    border-color: var(--inv-multi-color);
}

.inventory-container .summary-stat.not-found {
    background: var(--inv-notfound-bg);
    border-color: var(--inv-notfound-color);
}

.inventory-container .summary-stat .stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--inv-text);
}

.inventory-container .summary-stat .stat-text {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

/* ========== 盘点条目表格 ========== */
.inventory-container .items-section {
    background: #fff;
    border-radius: var(--inv-radius-lg);
    padding: 24px;
    box-shadow: var(--inv-shadow);
}

.inventory-container .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.inventory-container .section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.inventory-container .section-title h3 {
    font-size: 18px;
    color: var(--inv-text);
    margin: 0;
}

.inventory-container .section-count {
    font-size: 13px;
    color: #888;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 12px;
}

.inventory-container .section-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.inventory-container .btn-confirm { padding: 12px 24px; }

.inventory-container .data-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--inv-radius);
    border: 1px solid #f0f0f0;
}

.inventory-container .table-toolbar {
    padding: 12px 16px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.inventory-container .table-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-container .filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--inv-border);
    color: var(--inv-text-muted);
    transition: all 0.2s;
    user-select: none;
}

.inventory-container .filter-chip:hover { border-color: var(--inv-primary); color: var(--inv-primary); }

.inventory-container .filter-chip.active {
    background: var(--inv-primary);
    border-color: var(--inv-primary);
    color: #fff;
}

.inventory-container .filter-chip.filter-matched.active {
    background: var(--inv-matched-color);
    border-color: var(--inv-matched-color);
}

.inventory-container .filter-chip.filter-multi.active {
    background: #d97706;
    border-color: #d97706;
}

.inventory-container .filter-chip.filter-unmatched.active {
    background: var(--inv-notfound-color);
    border-color: var(--inv-notfound-color);
}

.inventory-container .data-table { min-width: 1200px; }

.inventory-container .table-header-row {
    display: grid;
    grid-template-columns: 60px 160px 160px 90px 150px 90px 150px 100px 120px 160px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--inv-primary) 0%, var(--inv-secondary) 100%);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.inventory-container .table-data-row {
    display: grid;
    grid-template-columns: 60px 160px 160px 90px 150px 90px 150px 100px 120px 160px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: background 0.2s;
}

.inventory-container .table-data-row:hover { background: #f9fafb; }

.inventory-container .table-data-row.match-matched { background: var(--inv-matched-bg); }
.inventory-container .table-data-row.match-matched:hover { background: #c3e6cb; }

.inventory-container .table-data-row.match-multi_match { background: var(--inv-multi-bg); }
.inventory-container .table-data-row.match-multi_match:hover { background: #ffeeba; }

.inventory-container .table-data-row.match-not_found { background: var(--inv-notfound-bg); }
.inventory-container .table-data-row.match-not_found:hover { background: #f1b0b7; }

.inventory-container .th,
.inventory-container .td { padding: 4px; }

.inventory-container .th { text-align: left; }

.inventory-container .row-number {
    font-weight: 600;
    color: #888;
    text-align: center;
}

/* ========== 表单控件 ========== */
.inventory-container .form-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--inv-border);
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s;
    background: #fff;
}

.inventory-container .form-input:focus {
    outline: none;
    border-color: var(--inv-primary);
}

.inventory-container .form-input-sm { max-width: 80px; }

.inventory-container .form-input-lg {
    width: 100%;
    padding: 12px 16px 12px 44px;
    font-size: 15px;
    border-radius: 8px;
}

.inventory-container .form-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--inv-border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

.inventory-container .form-select:focus {
    outline: none;
    border-color: var(--inv-primary);
}

.inventory-container .text-primary {
    color: var(--inv-primary);
    font-weight: 500;
}

/* ========== 匹配状态标签 ========== */
.inventory-container .match-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
}

.inventory-container .match-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.inventory-container .match-tag.match-matched,
.inventory-container .match-matched.match-tag {
    background: var(--inv-matched-bg);
    color: var(--inv-matched-color);
    border-color: var(--inv-matched-color);
}

.inventory-container .match-tag.match-matched .match-dot,
.inventory-container .match-matched .match-dot { background: var(--inv-matched-color); }

.inventory-container .match-tag.match-multi_match,
.inventory-container .match-multi_match.match-tag {
    background: var(--inv-multi-bg);
    color: #856404;
    border-color: var(--inv-multi-color);
}

.inventory-container .match-tag.match-multi_match .match-dot,
.inventory-container .match-multi_match .match-dot { background: #d97706; }

.inventory-container .match-tag.match-not_found,
.inventory-container .match-not_found.match-tag {
    background: var(--inv-notfound-bg);
    color: var(--inv-notfound-color);
    border-color: var(--inv-notfound-color);
}

.inventory-container .match-tag.match-not_found .match-dot,
.inventory-container .match-not_found .match-dot { background: var(--inv-notfound-color); }

/* ========== 行操作按钮 ========== */
.inventory-container .row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.inventory-container .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.inventory-container .action-btn svg { width: 14px; height: 14px; }

.inventory-container .action-btn-primary {
    background: var(--inv-primary);
    color: #fff;
}

.inventory-container .action-btn-primary:hover { opacity: 0.9; }

.inventory-container .action-btn-secondary {
    background: #f0f0f0;
    color: var(--inv-text-muted);
}

.inventory-container .action-btn-secondary:hover { background: #e0e0e0; }

.inventory-container .action-btn-danger {
    background: var(--inv-notfound-bg);
    color: var(--inv-notfound-color);
}

.inventory-container .action-btn-danger:hover { background: #f1b0b7; }

.inventory-container .table-loading,
.inventory-container .table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 12px;
    color: #888;
    font-size: 14px;
}

/* ========== 弹窗 / 模态框 ========== */
.inventory-container .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 16px;
    animation: invFadeIn 0.2s ease;
}

.inventory-container .modal-container {
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: invSlideUp 0.3s cubic-bezier(0.2, 0.8, 0.4, 1);
}

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

.inventory-container .confirm-modal { max-width: 520px; }

.inventory-container .modal-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.inventory-container .modal-header.warning-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.inventory-container .modal-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inventory-container .modal-icon-wrapper svg {
    width: 22px;
    height: 22px;
    color: var(--inv-primary);
}

.inventory-container .modal-icon-wrapper.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.inventory-container .modal-icon-wrapper.warning svg { color: #d97706; }

.inventory-container .modal-title-section { flex: 1; }

.inventory-container .modal-title-section h3 {
    font-size: 20px;
    color: var(--inv-text);
    margin: 0 0 4px;
}

.inventory-container .modal-title-section p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.inventory-container .modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.inventory-container .modal-close:hover { background: #e0e0e0; }
.inventory-container .modal-close svg { width: 18px; height: 18px; color: #666; }

.inventory-container .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.inventory-container .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ========== 创建任务表单 ========== */
.inventory-container .form-group { margin-bottom: 20px; }

.inventory-container .form-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.inventory-container .label-required { color: #ef4444; }

.inventory-container .input-wrapper {
    position: relative;
}

.inventory-container .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #aaa;
    pointer-events: none;
}

.inventory-container .warehouse-selector {
    border: 2px solid var(--inv-border);
    border-radius: var(--inv-radius);
    padding: 16px;
    background: #fafafa;
}

.inventory-container .warehouse-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.inventory-container .checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.inventory-container .checkbox-item:hover { background: #f0f0f0; }
.inventory-container .checkbox-item input { display: none; }

.inventory-container .checkbox-icon {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.inventory-container .checkbox-item input:checked + .checkbox-icon {
    background: var(--inv-primary);
    border-color: var(--inv-primary);
}

.inventory-container .checkbox-item input:checked + .checkbox-icon::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.inventory-container .checkbox-text {
    font-size: 13px;
    color: #333;
}

/* ========== 产品选择弹窗 ========== */
.inventory-container .select-model-content { display: flex; flex-direction: column; gap: 16px; }

.inventory-container .model-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
}

.inventory-container .model-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid var(--inv-border);
    border-radius: var(--inv-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-container .model-card:hover {
    border-color: var(--inv-primary);
    background: rgba(102, 126, 234, 0.05);
}

.inventory-container .model-radio {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: var(--inv-primary);
}

.inventory-container .model-radio svg { width: 100%; height: 100%; }

.inventory-container .model-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.inventory-container .model-drawing {
    font-size: 14px;
    font-weight: 600;
    color: var(--inv-text);
}

.inventory-container .model-name {
    font-size: 13px;
    color: var(--inv-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-container .model-state {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.inventory-container .model-state.state-1 { background: #e0f2fe; color: #0284c7; }
.inventory-container .model-state.state-2 { background: var(--inv-matched-bg); color: var(--inv-matched-color); }
.inventory-container .model-state.state-3 { background: var(--inv-multi-bg); color: #856404; }
.inventory-container .model-state.state-4,
.inventory-container .model-state.state-5,
.inventory-container .model-state.state-6 { background: var(--inv-notfound-bg); color: var(--inv-notfound-color); }

/* ========== 确认入库弹窗 ========== */
.inventory-container .warning-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--inv-multi-bg);
    border: 1px solid var(--inv-multi-color);
    border-radius: var(--inv-radius);
    margin-bottom: 20px;
}

.inventory-container .warning-icon-wrapper {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #d97706;
}

.inventory-container .warning-icon-wrapper svg { width: 100%; height: 100%; }

.inventory-container .warning-content h4 {
    font-size: 16px;
    color: #92400e;
    margin: 0 0 4px;
}

.inventory-container .warning-content p {
    font-size: 14px;
    color: #b45309;
    margin: 0;
    line-height: 1.5;
}

.inventory-container .confirm-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.inventory-container .confirm-stat {
    text-align: center;
    padding: 24px;
    background: #fafafa;
    border-radius: var(--inv-radius);
}

.inventory-container .confirm-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--inv-primary);
    line-height: 1;
}

.inventory-container .confirm-text {
    display: block;
    font-size: 14px;
    color: #888;
    margin-top: 8px;
}

.inventory-container .confirm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inventory-container .confirm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 8px;
    font-size: 14px;
    color: var(--inv-text-muted);
}

.inventory-container .confirm-item svg {
    width: 20px;
    height: 20px;
    color: var(--inv-primary);
    flex-shrink: 0;
}

/* ========== 移动端响应式 ========== */
@media (max-width: 768px) {
    .inventory-container {
        padding: 16px;
    }

    .inventory-container .page-title {
        font-size: 22px;
    }

    .inventory-container .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .inventory-container .page-header .btn-lg {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }

    .inventory-container .task-detail-page .page-header {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .inventory-container .header-center {
        align-items: flex-start;
    }

    .inventory-container .header-right {
        display: none;
    }

    .inventory-container .stats-row {
        grid-template-columns: 1fr;
    }

    .inventory-container .grid-container {
        grid-template-columns: 1fr;
    }

    .inventory-container .upload-form {
        flex-direction: column;
    }

    .inventory-container .file-upload-label {
        min-width: 100%;
    }

    .inventory-container .upload-btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    .inventory-container .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .inventory-container .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .inventory-container .section-actions {
        flex-direction: column;
    }

    .inventory-container .section-actions .btn {
        width: 100%;
        padding: 14px;
        font-size: 15px;
        justify-content: center;
    }

    .inventory-container .data-table-container {
        margin: 0 -8px;
        border-radius: 8px;
    }

    .inventory-container .inventory-toast {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 24px;
        min-width: auto;
    }

    .inventory-container .modal-container {
        width: 94%;
        max-height: 85vh;
        border-radius: 16px;
    }

    .inventory-container .modal-footer {
        flex-direction: column-reverse;
    }

    .inventory-container .modal-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .inventory-container .warehouse-grid {
        grid-template-columns: 1fr;
    }

    .inventory-container .pagination-container {
        gap: 12px;
    }

    .inventory-container .pagination-btn {
        width: 44px;
        height: 44px;
    }

    .inventory-container .filter-card {
        padding: 12px 16px;
    }

    .inventory-container .select-field {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .inventory-container .summary-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .inventory-container .summary-stat .stat-number {
        font-size: 20px;
    }

    .inventory-container .confirm-number {
        font-size: 36px;
    }
}

/* ========== 紧急修复：表格宽度溢出 ========== */
.inventory-container .task-detail-page {
    max-width: 100%;
    overflow-x: hidden;
}

.inventory-container .detail-info-panel,
.inventory-container .info-card,
.inventory-container .upload-card,
.inventory-container .items-section,
.inventory-container .import-summary-card {
    max-width: 100%;
    overflow-x: hidden;
}

.inventory-container .info-content {
    max-width: 100%;
    overflow-x: hidden;
}

.inventory-container .info-row {
    max-width: 100%;
    flex-wrap: wrap;
}

.inventory-container .info-value {
    max-width: 65%;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 表格容器强制滚动条 */
.inventory-container .data-table-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 关键修复：压缩表格列宽 */
.inventory-container .data-table {
    min-width: 1000px;  /* 从1200px降低 */
}

.inventory-container .table-header-row,
.inventory-container .table-data-row {
    grid-template-columns: 50px 130px 120px 70px 120px 70px 120px 80px 90px 140px;
    /* 总宽度 = 990px，留10px buffer */
}

.inventory-container .th,
.inventory-container .td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 操作按钮区域允许换行 */
.inventory-container .row-actions {
    flex-wrap: wrap;
    gap: 4px;
}

.inventory-container .action-btn {
    padding: 4px 8px;
    font-size: 11px;
}

.inventory-container .action-btn span {
    display: none;  /* 小屏隐藏按钮文字，只显示图标 */
}

/* 弹窗宽度限制 */
.inventory-container .modal-container {
    max-width: 520px;
}

/* ========== 批量更新表格样式 ========== */
.inventory-container .batch-update-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 12px;
}

.inventory-container .batch-update-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
    table-layout: auto;
}

.inventory-container .batch-update-table th,
.inventory-container .batch-update-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    font-size: 13px;
    vertical-align: middle;
    text-align: left;
}

.inventory-container .batch-update-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.inventory-container .batch-update-table td {
    background: #fff;
}

.inventory-container .batch-update-table tr:hover td {
    background: #f9fafb;
}

.inventory-container .batch-update-row.match-matched td {
    background: #d4edda;
}

.inventory-container .batch-update-row.match-matched:hover td {
    background: #c3e6cb;
}

.inventory-container .batch-update-row.match-not_found td {
    background: #f8d7da;
}

.inventory-container .batch-update-row.match-not_found:hover td {
    background: #f1b0b7;
}

.inventory-container .batch-update-table .row-number {
    font-weight: 600;
    color: #666;
    min-width: 50px;
}

.inventory-container .batch-update-table .form-input-sm {
    width: 70px;
}

.inventory-container .batch-update-table .form-input {
    width: 130px;
}

.inventory-container .batch-update-table .form-select {
    min-width: 100px;
}

.inventory-container .batch-update-table .action-btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    margin-top: 4px;
}

.inventory-container .batch-update-table .action-btn-sm span {
    display: none;
}

.inventory-container .batch-update-table .match-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.inventory-container .batch-update-table .match-tag.match-matched {
    background: #d4edda;
    color: #28a745;
}

.inventory-container .batch-update-table .match-tag.match-not_found {
    background: #f8d7da;
    color: #dc3545;
}

.inventory-container .batch-update-table .match-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* ========== 批量更新页面 - 蓝色主题 ========== */
.batch-update-container {
    --inv-primary: #2563eb;
    --inv-secondary: #1d4ed8;
    --inv-bg: #eff6ff;
    --inv-matched-bg: #dbeafe;
    --inv-matched-color: #1d4ed8;
    --inv-notfound-bg: #fee2e2;
    --inv-notfound-color: #dc2626;
}

.batch-update-container .batch-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 24px 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.35);
    color: #fff;
}

.batch-update-container .header-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.batch-update-container .header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #bfdbfe;
    width: fit-content;
}

.batch-update-container .header-badge svg {
    width: 14px;
    height: 14px;
}

.batch-update-container .page-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.batch-update-container .page-subtitle {
    font-size: 14px;
    color: #bfdbfe;
    margin: 0;
}

.batch-update-container .batch-upload-card {
    border: 2px solid rgba(37, 99, 235, 0.15);
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.batch-update-container .upload-icon-wrapper {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(30, 64, 175, 0.1) 100%);
}

.batch-update-container .upload-icon-wrapper svg {
    color: #2563eb;
}

.batch-update-container .upload-title h3 {
    color: #1e40af;
}

.batch-update-container .upload-svg {
    color: #2563eb;
}

.batch-update-container .file-upload-label:hover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.04);
}

.batch-update-container .batch-upload-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.batch-update-container .batch-upload-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.batch-update-container .summary-stat.matched {
    background: #dbeafe;
    border-color: #2563eb;
}

.batch-update-container .summary-stat.matched .stat-number {
    color: #1d4ed8;
}

.batch-update-container .filter-chip.filter-matched.active {
    background: #2563eb;
    border-color: #2563eb;
}

.batch-update-container .table-header-row {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.batch-update-container .table-data-row.match-matched {
    background: #dbeafe;
}

.batch-update-container .table-data-row.match-matched:hover {
    background: #bfdbfe;
}

.batch-update-container .form-input:focus {
    border-color: #2563eb;
}

.batch-update-container .form-select:focus {
    border-color: #2563eb;
}

.batch-update-container .btn-outline-primary {
    color: #2563eb;
    border-color: #2563eb;
}

.batch-update-container .btn-outline-primary:hover:not(:disabled) {
    background: rgba(37, 99, 235, 0.08);
}

.batch-update-container .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.batch-update-container .action-btn-primary {
    background: #2563eb;
}

.batch-update-container .action-btn-secondary:hover {
    background: #e0e7ff;
}

.batch-update-container .match-tag.match-matched {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #2563eb;
}

.batch-update-container .match-tag.match-matched .match-dot {
    background: #2563eb;
}

.batch-update-container .modal-icon-wrapper {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(30, 64, 175, 0.1) 100%);
}

.batch-update-container .modal-icon-wrapper svg {
    color: #2563eb;
}

.batch-update-container .confirm-number {
    color: #2563eb;
}

.batch-update-container .confirm-item svg {
    color: #2563eb;
}