/* ==================== 专业产品管理UI ==================== */

.products-professional-page {
    background: #f8fafc;
    min-height: 100vh;
    padding: 0;
}

/* ==================== 紧凑统计面板 ==================== */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #3b82f6;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.875rem 1rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }
}

/* ==================== 顶部统计面板 ==================== */
.products-stats-panel {
    background: white;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.stat-card-pro {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card-pro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.stat-card-pro:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.stat-card-pro .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card-pro .stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card-pro .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.stat-card-pro .stat-trend {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend.up {
    color: #10b981;
}

.stat-trend.down {
    color: #ef4444;
}

/* ==================== 工具栏 ==================== */
.products-toolbar {
    background: white;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-box-pro {
    position: relative;
    min-width: 300px;
}

.search-box-pro input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-box-pro input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box-pro i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
}

.btn-toolbar,
.filter-toggle-btn,
.view-toggle-btn,
.btn-primary-pro {
    padding: 0.75rem 1.25rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-toolbar:hover,
.filter-toggle-btn:hover,
.view-toggle-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-toolbar.active,
.filter-toggle-btn.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-primary,
.btn-primary-pro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover,
.btn-primary-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 视图切换按钮组 */
.view-toggle {
    display: flex;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.view-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
    font-size: 1rem;
    border-right: 2px solid #e2e8f0;
}

.view-btn:last-child {
    border-right: none;
}

.view-btn:hover {
    background: #f8fafc;
    color: #3b82f6;
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.view-toggle-group {
    display: flex;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.view-toggle-group button {
    padding: 0.75rem 1rem;
    border: none;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    border-right: 2px solid #e2e8f0;
}

.view-toggle-group button:last-child {
    border-right: none;
}

.view-toggle-group button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.view-toggle-group button:hover:not(.active) {
    background: #f8fafc;
}

/* ==================== 高级筛选面板 ==================== */
.advanced-filter-panel {
    background: white;
    padding: 0;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.advanced-filter-panel.show {
    max-height: 600px;
    opacity: 1;
    padding: 1.5rem;
}

.advanced-filters {
    background: white;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: none;
}

.advanced-filters.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-grid,
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 0;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-item label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.filter-item select,
.filter-item input,
.filter-select,
.filter-input {
    padding: 0.625rem 0.875rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
    width: 100%;
}

.filter-item select:focus,
.filter-item input:focus,
.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-filter,
.btn-filter-apply,
.btn-filter-reset {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-filter-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-filter-reset {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-filter-reset:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* ==================== 表格视图 ==================== */
.products-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.products-table-view {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    border-bottom: 2px solid #e2e8f0;
}

.products-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    position: relative;
}

.products-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.products-table th.sortable:hover {
    background: #e2e8f0;
}

.products-table th.sortable::after {
    content: '⇅';
    margin-left: 0.5rem;
    opacity: 0.3;
}

.products-table th.sorted-asc::after {
    content: '↑';
    opacity: 1;
    color: #3b82f6;
}

.products-table th.sorted-desc::after {
    content: '↓';
    opacity: 1;
    color: #3b82f6;
}

.products-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
}

.products-table tbody tr:hover {
    background: #f8fafc;
}

.products-table tbody tr.selected {
    background: #eff6ff;
}

.products-table td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: #1e293b;
}

.product-cell-image,
.table-product-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    display: block;
}

.table-product-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.table-product-batch {
    font-size: 0.8rem;
    color: #64748b;
}

.table-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #475569;
}

.table-stock {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stock-value {
    font-weight: 700;
    font-size: 1rem;
}

.stock-value.stock-normal {
    color: #10b981;
}

.stock-value.stock-low {
    color: #ef4444;
}

.stock-threshold {
    color: #94a3b8;
    font-size: 0.85rem;
}

.badge-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.table-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.table-tag.tag-new {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.table-tag.tag-hot {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.table-tag.tag-recommend {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.table-tag.tag-limited {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.table-price {
    font-weight: 700;
    color: #1e293b;
    font-size: 1rem;
}

.table-price-member {
    font-size: 0.8rem;
    color: #10b981;
    margin-top: 0.25rem;
}

.table-date {
    font-size: 0.85rem;
    color: #64748b;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-table-action {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.85rem;
}

.btn-table-action:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-table-action.btn-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.product-cell-name {
    font-weight: 600;
    color: #1e293b;
}

.product-cell-batch {
    font-family: 'Consolas', monospace;
    color: #64748b;
    font-size: 0.85rem;
}

.product-cell-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.product-cell-stock {
    font-weight: 600;
}

.product-cell-stock.low {
    color: #ef4444;
}

.product-cell-stock.normal {
    color: #10b981;
}

.product-tag-cell {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-tag-cell.new {
    background: #dbeafe;
    color: #1e40af;
}

.product-tag-cell.hot {
    background: #fee2e2;
    color: #991b1b;
}

.product-tag-cell.recommend {
    background: #fef3c7;
    color: #92400e;
}

.product-tag-cell.limited {
    background: #e9d5ff;
    color: #6b21a8;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-icon.view {
    color: #3b82f6;
}

.btn-icon.view:hover {
    background: #eff6ff;
}

.btn-icon.edit {
    color: #8b5cf6;
}

.btn-icon.edit:hover {
    background: #f5f3ff;
}

.btn-icon.delete {
    color: #ef4444;
}

.btn-icon.delete:hover {
    background: #fef2f2;
}

/* ==================== 侧边抽屉编辑器 ==================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.drawer-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.product-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 680px;
    max-width: 90vw;
    background: white;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
}

.product-drawer.show {
    transform: translateX(0);
}

/* 自定义滚动条 */
.drawer-content::-webkit-scrollbar {
    width: 8px;
}

.drawer-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.drawer-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653b8e 100%);
}

.drawer-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.drawer-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.drawer-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.drawer-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 2rem;
}

.drawer-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
    top: 2px;
}

.drawer-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.drawer-tab:hover:not(.active) {
    color: #3b82f6;
    background: #f1f5f9;
}

/* 抽屉内容区域 */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #fafbfc;
}

.drawer-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.drawer-tab-content.active {
    display: block;
}

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

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.drawer-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-drawer {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-drawer-cancel {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-drawer-cancel:hover {
    background: #f8fafc;
}

.btn-drawer-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-drawer-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-drawer-delete {
    background: #ef4444;
    color: white;
    margin-right: auto;
}

.btn-drawer-delete:hover {
    background: #dc2626;
}

.btn-drawer-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-drawer-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 抽屉表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.form-group .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Fieldset 样式 */
.form-fieldset {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-fieldset legend {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-fieldset legend i {
    color: #667eea;
    font-size: 1.1rem;
}

/* iOS 风格开关 */
.form-group-switch {
    margin-bottom: 1.25rem;
}

.switch-label-pro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.switch-label-pro > span:first-child {
    font-weight: 600;
    color: #475569;
    font-size: 0.95rem;
}

.switch-input {
    position: relative;
    width: 52px;
    height: 28px;
    appearance: none;
    background: #cbd5e1;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.switch-input:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.switch-input::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-input:checked::before {
    left: 27px;
}

.switch-slider {
    display: none;
}

.form-group-switch small {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* 图片上传区域 */
.image-upload-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.image-preview-grid .no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-size: 0.95rem;
}

.existing-image-pro,
.pending-image-pro {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    transition: all 0.2s;
}

.existing-image-pro:hover,
.pending-image-pro:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.existing-image-pro img,
.pending-image-pro img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.existing-image-pro figcaption,
.pending-image-pro figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.existing-image-pro:hover figcaption,
.pending-image-pro:hover figcaption {
    opacity: 1;
}

.delete-image-btn-pro,
.remove-pending-btn-pro {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.delete-image-btn-pro:hover,
.remove-pending-btn-pro:hover {
    background: #dc2626;
}

.image-upload-zone {
    border: 3px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s;
}

.image-upload-zone:hover {
    border-color: #667eea;
    background: #eff6ff;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: #64748b;
}

.upload-label i {
    font-size: 2.5rem;
    color: #667eea;
}

.upload-label span {
    font-weight: 600;
    font-size: 1rem;
    color: #475569;
}

.upload-label small {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* 库存历史 */
.inventory-history-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.inventory-history-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #cbd5e1;
}

.history-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.history-icon.icon-in {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.history-icon.icon-out {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.history-content {
    flex: 1;
}

.history-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-quantity {
    color: #667eea;
    font-weight: 700;
}

.history-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.history-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.history-notes {
    font-size: 0.85rem;
    color: #475569;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    border-left: 2px solid #667eea;
}

.no-history {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .product-drawer {
        width: 500px;
    }
}

@media (max-width: 768px) {
    .products-stats-panel,
    .products-toolbar,
    .advanced-filters,
    .products-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .search-box-pro {
        min-width: 200px;
    }

    .toolbar-content {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .product-drawer {
        width: 100%;
        max-width: 100vw;
    }

    .products-table {
        font-size: 0.85rem;
    }

    .products-table th,
    .products-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ==================== 卡片视图 ==================== */
.product-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card-pro {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-card-pro:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.product-card-pro.card-low-stock {
    border-color: #fbbf24;
    background: linear-gradient(to bottom, #fffbeb, white);
}

.card-header-pro {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.card-badge-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-image-pro {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8fafc;
}

.card-body-pro {
    padding: 1.25rem;
}

.card-title-pro {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem;
}

.card-batch-pro {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 1rem;
}

.card-meta-pro {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 1rem;
}

.card-meta-pro span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-meta-pro i {
    color: #94a3b8;
}

.card-footer-pro {
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.btn-card-action {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-card-action:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* ==================== 空状态 ==================== */
.empty-state-pro {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.95rem;
}

.empty-state-pro i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.empty-state-pro h3 {
    font-size: 1.5rem;
    color: #475569;
    margin: 0 0 0.75rem;
}

.empty-state-pro p {
    color: #94a3b8;
    margin: 0 0 2rem;
}

/* ==================== 加载状态 ==================== */
.table-loading {
    padding: 4rem 2rem;
    text-align: center;
    color: #64748b;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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