/**
 * 仓库管理前端样式
 */

/* 禁用body和html的滚动条，防止出现双重滚动条 */
html, body {
    overflow: hidden;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* CSS Variables */
:root {
    --wm-primary: #6366f1;
    --wm-primary-hover: #4f46e5;
    --wm-primary-dark: #4f46e5;
    --wm-success: #10b981;
    --wm-success-hover: #059669;
    --wm-warning: #f59e0b;
    --wm-danger: #ef4444;
    --wm-dark: #1e293b;
    --wm-gray-50: #f8fafc;
    --wm-gray-100: #f1f5f9;
    --wm-gray-200: #e2e8f0;
    --wm-gray-300: #cbd5e1;
    --wm-gray-400: #94a3b8;
    --wm-gray-500: #64748b;
    --wm-gray-600: #475569;
    --wm-gray-700: #334155;
    --wm-gray-800: #1e293b;
    --wm-gray-900: #0f172a;
    --wm-sidebar-width: 280px;
    --wm-sidebar-collapsed-width: 50px;
    --wm-header-height: 80px;
    --wm-pagination-height: 40px;
    --wm-radius: 12px;
    --wm-radius-sm: 8px;
    --wm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --wm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --wm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset */
.wm-app *,
.wm-app *::before,
.wm-app *::after {
    box-sizing: border-box;
}

/* Main App Container */
.wm-app {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--wm-gray-50);
    font-family: var(--wm-font);
    font-size: 14px;
    color: var(--wm-gray-800);
    position: relative;
    overflow: hidden;
}

/* WordPress Admin Bar 适配 */
#wpadminbar {
    z-index: 999999 !important;
}

/* 当WordPress管理员栏存在时，调整应用容器 */
.admin-bar .wm-app {
    height: 100vh;
    margin-top: 0;
}

/* 移动端管理员栏更高 */
@media screen and (max-width: 782px) {
    .admin-bar .wm-app {
        height: 100vh;
        margin-top: 0;
    }
}

/* Login Required */
.wm-login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
    text-align: center;
    background: white;
    border-radius: var(--wm-radius);
    box-shadow: var(--wm-shadow-lg);
}

.wm-login-required i {
    font-size: 64px;
    color: var(--wm-gray-300);
    margin-bottom: 20px;
}

.wm-login-required p {
    font-size: 18px;
    color: var(--wm-gray-600);
    margin-bottom: 24px;
}

/* Sidebar */
.wm-sidebar {
    width: var(--wm-sidebar-width);
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--wm-gray-200);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* WordPress Admin Bar 适配 - 侧边栏 */
.admin-bar .wm-sidebar {
    top: 0;
    height: 100vh;
}

@media screen and (max-width: 782px) {
    .admin-bar .wm-sidebar {
        top: 0;
        height: 100vh;
    }
}

.wm-sidebar.collapsed {
    width: var(--wm-sidebar-collapsed-width);
}

.wm-sidebar.collapsed .wm-nav {
    padding: 12px 0;
}

.wm-sidebar.collapsed .wm-nav-item {
    padding: 0;
    margin: 0 8px 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    width: 40px;
    height: 40px;
    border-radius: var(--wm-radius-sm);
}

/* 折叠后显示创建按钮的图标 */
.wm-sidebar.collapsed .wm-sidebar-header {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    height: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--wm-gray-100);
    gap: 12px;
}

.wm-sidebar.collapsed .wm-sidebar-header .wm-dropdown {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* 折叠状态下logo居中 */
.wm-sidebar.collapsed .wm-sidebar-logo {
    display: block !important;
    padding: 0;
    margin: 0;
    width: 100%;
}

.wm-sidebar.collapsed .wm-sidebar-logo img {
    width: 32px;
    height: 32px;
    margin: 0 auto;
    object-fit: contain;
}

/* 折叠后只显示图标，隐藏所有文字 */
.wm-sidebar.collapsed .wm-nav-item > span:not(.wm-toggle-text),
.wm-sidebar.collapsed .wm-nav-item > text {
    display: none !important;
}

/* 折叠后隐藏导航项中的文本节点（直接文本） */
.wm-sidebar.collapsed .wm-nav-item {
    font-size: 0;
}

.wm-sidebar.collapsed .wm-nav-item i {
    font-size: 20px !important;
    display: inline-block !important;
}

.wm-sidebar.collapsed .wm-create-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--wm-radius-sm);
    font-size: 0;
    min-width: 40px;
}

.wm-sidebar.collapsed .wm-create-btn > span,
.wm-sidebar.collapsed .wm-create-btn > i:not(.ri-add-line) {
    display: none;
}

.wm-sidebar.collapsed .wm-create-btn > i.ri-add-line {
    display: block !important;
    font-size: 20px;
    margin: 0;
}

.wm-sidebar.collapsed .wm-sidebar-content {
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    width: 0;
    padding: 0;
}

.wm-sidebar-toggle {
    position: relative;
    width: auto;
    margin: 0;
    cursor: pointer;
    border: none;
    background: none;
}

.wm-sidebar-toggle .wm-toggle-text {
    display: inline-block;
}

.wm-sidebar.collapsed .wm-sidebar-toggle .wm-toggle-text {
    display: none;
}

.wm-sidebar-toggle i {
    transition: transform 0.3s;
    display: inline-block;
    font-size: 20px;
}

.wm-sidebar.collapsed .wm-sidebar-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 12px;
    border-radius: var(--wm-radius-sm);
    justify-content: center;
    display: flex;
    align-items: center;
}

.wm-sidebar.collapsed .wm-sidebar-toggle i {
    transform: rotate(180deg);
    margin: 0;
}

.wm-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--wm-gray-100);
}

/* 侧边栏Logo */
.wm-sidebar-logo {
    display: none;
    padding: 16px 0;
    text-align: center;
    margin-bottom: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.wm-sidebar-logo:hover {
    opacity: 0.8;
}

.wm-sidebar-logo img {
    display: block;
    margin: 0 auto;
    object-fit: contain;
    max-width: 100%;
    height: auto;
}

/* PC端显示侧边栏Logo */
@media screen and (min-width: 769px) {
    .wm-sidebar-logo {
        display: block;
    }
}

/* Dropdown */
.wm-dropdown {
    position: relative;
}

.wm-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--wm-radius-sm);
    box-shadow: var(--wm-shadow-lg);
    overflow: hidden;
    z-index: 100;
    margin-top: 4px;
}

.wm-dropdown-menu.active {
    display: block;
}

.wm-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--wm-gray-700);
    text-decoration: none;
    transition: background 0.2s;
}

.wm-dropdown-item:hover {
    background: var(--wm-gray-50);
    color: var(--wm-primary);
}

.wm-dropdown-item i {
    font-size: 18px;
}

/* Navigation */
.wm-nav {
    padding: 12px;
    border-bottom: 1px solid var(--wm-gray-100);
}

.wm-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--wm-gray-600);
    text-decoration: none;
    border-radius: var(--wm-radius-sm);
    transition: all 0.2s;
    margin-bottom: 4px;
}

.wm-nav-item:hover {
    background: var(--wm-gray-50);
    color: var(--wm-gray-800);
}

.wm-nav-item.active {
    background: linear-gradient(135deg, var(--wm-primary), #818cf8);
    color: white;
}

.wm-nav-item i {
    font-size: 20px;
}

/* Sidebar Content */
.wm-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Sidebar Footer */
.wm-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--wm-gray-100);
    margin-top: auto;
}

.wm-sidebar.collapsed .wm-sidebar-footer {
    padding: 12px 0;
    border-top: none;
}

/* Location Tree */
.wm-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wm-tree-root {
    padding: 0;
}

.wm-tree-node {
    margin-bottom: 2px;
}

.wm-tree-node-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.wm-tree-node-content:hover {
    background: var(--wm-gray-100);
}

.wm-tree-node-content.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wm-gray-400);
    transition: transform 0.2s;
}

.wm-tree-toggle.expanded i {
    transform: rotate(90deg);
}

.wm-tree-toggle-placeholder {
    width: 20px;
}

.wm-tree-icon {
    color: var(--wm-warning);
    font-size: 18px;
}

.wm-tree-label {
    flex: 1;
    font-weight: 500;
}

.wm-tree-children {
    padding-left: 28px;
}

/* Filter Section */
.wm-filter-section {
    margin-bottom: 20px;
}

.wm-filter-section h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--wm-gray-500);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.wm-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wm-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.wm-filter-item:hover {
    background: var(--wm-gray-50);
}

.wm-filter-item input {
    accent-color: var(--wm-primary);
}

.wm-tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* 筛选区域位置树 */
.wm-filter-location-tree {
    max-height: 300px;
    overflow-y: auto;
}

.wm-filter-location-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wm-filter-location-item {
    margin: 0;
}

.wm-filter-location-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.wm-filter-location-label:hover {
    background: var(--wm-gray-50);
}

.wm-filter-location-label input[type="radio"] {
    accent-color: var(--wm-primary);
}

.wm-filter-location-label i {
    font-size: 16px;
    color: var(--wm-gray-400);
}

/* 位置树新样式 - 无radio */
.wm-filter-location-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--wm-radius-sm);
    transition: background 0.2s;
    font-size: 14px;
}

.wm-filter-location-name {
    cursor: pointer;
    color: var(--wm-gray-700);
    transition: color 0.2s;
    flex: 1;
}

.wm-filter-location-name:hover {
    color: var(--wm-primary);
}

.wm-filter-location-name.active {
    color: var(--wm-primary);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: var(--wm-radius-sm);
}

.wm-filter-location-content i {
    font-size: 16px;
    color: var(--wm-gray-400);
}

.wm-filter-location-toggle,
.wm-filter-location-toggle-placeholder {
    width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wm-filter-location-toggle i {
    font-size: 14px;
    transition: transform 0.2s;
}

/* 手机端：增加位置树展开按钮触摸区域 */
@media (max-width: 768px) {
    .wm-filter-location-toggle {
        width: 32px;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
        padding: 8px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .wm-filter-location-toggle i {
        font-size: 16px;
    }
}

.wm-filter-location-children {
    margin-left: 0;
    padding-left: 0;
}

/* 位置区域下的筛选器 */
.wm-location-filters {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--wm-gray-100);
}

.wm-filter-select-group {
    margin-bottom: 16px;
}

.wm-filter-select-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--wm-gray-500);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* 筛选器折叠/展开 */
.wm-filter-collapsible .wm-filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    padding: 8px 12px;
    background: var(--wm-gray-50);
    border-radius: var(--wm-radius-sm);
    transition: background 0.2s;
}

.wm-filter-collapsible .wm-filter-toggle:hover {
    background: var(--wm-gray-100);
}

.wm-filter-collapsible .wm-filter-toggle-icon {
    font-size: 14px;
    transition: transform 0.2s;
}

.wm-filter-collapsible .wm-filter-content {
    display: none;
    margin-top: 8px;
    padding: 0 4px;
}

.wm-filter-collapsible.expanded .wm-filter-content {
    display: block;
}

/* 筛选器操作按钮 */
.wm-filter-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.wm-filter-btn {
    padding: 4px 10px;
    border: 1px solid var(--wm-gray-300);
    border-radius: var(--wm-radius-sm);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    background: white;
    color: var(--wm-gray-700);
    position: relative;
    z-index: 1;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.4;
    min-height: 24px;
}

.wm-filter-btn:hover {
    background: var(--wm-gray-50);
    border-color: var(--wm-gray-400);
    z-index: 2;
}

.wm-filter-btn:active {
    transform: none;
}

.wm-filter-btn-clear {
    color: var(--wm-gray-600);
}

.wm-filter-btn-clear:hover {
    background: var(--wm-gray-100);
    color: var(--wm-gray-800);
    border-color: var(--wm-gray-400);
}

.wm-filter-btn-confirm {
    background: var(--wm-primary) !important;
    background-color: var(--wm-primary) !important;
    color: white !important;
    border-color: var(--wm-primary);
}

.wm-filter-btn-confirm:hover {
    background: var(--wm-primary-dark) !important;
    background-color: var(--wm-primary-dark) !important;
    border-color: var(--wm-primary-dark);
    color: white !important;
}

/* 货号范围筛选 */
.wm-sku-range-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wm-sku-range-filter .wm-filter-input {
    flex: 1;
    min-width: 0;
}

.wm-range-separator {
    font-size: 12px;
    color: var(--wm-gray-400);
    white-space: nowrap;
}

/* 日期范围筛选 */
.wm-date-range-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wm-date-range-filter .wm-filter-input {
    flex: 1;
    min-width: 0;
}

/* 筛选器输入框 */
.wm-filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    font-size: 13px;
    transition: all 0.2s;
    background: white;
}

.wm-filter-input:focus {
    outline: none;
    border-color: var(--wm-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wm-filter-select {
    width: 100%;
    padding: 5px 14px;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    font-size: 14px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.wm-filter-select:hover {
    border-color: var(--wm-gray-300);
}

.wm-filter-select:focus {
    border-color: var(--wm-primary);
}

/* 分类筛选选择器 */
.wm-category-filter-selector {
    position: relative;
}

.wm-category-filter-selected {
    padding: 5px 14px;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s;
    background: white;
    font-size: 14px;
}

.wm-category-filter-selected:hover {
    border-color: var(--wm-gray-300);
}

.wm-category-filter-selected.active {
    border-color: var(--wm-primary);
}

.wm-category-filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    box-shadow: var(--wm-shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

.wm-category-filter-dropdown.active {
    display: block;
}

.wm-category-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wm-category-filter-item {
    position: relative;
}

.wm-category-filter-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.wm-category-filter-item-content:hover {
    background: var(--wm-gray-50);
}

.wm-category-filter-item-content.selected {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-category-filter-item > .wm-category-filter-list {
    padding-left: 20px;
    border-left: 2px solid var(--wm-gray-100);
    margin-left: 16px;
    display: none;
}

.wm-category-filter-toggle {
    font-size: 14px;
    color: var(--wm-gray-400);
    transition: transform 0.2s;
    cursor: pointer;
}

.wm-category-filter-toggle.expanded {
    transform: rotate(90deg);
}

.wm-category-filter-spacer {
    display: inline-block;
    width: 14px;
}

.wm-filter-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--wm-gray-400);
    font-size: 14px;
}

/* My Section */
.wm-view-content[data-view="my"] {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wm-my-info {
    text-align: center;
    padding: 20px;
    flex-shrink: 0;
}

.wm-my-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--wm-gray-900);
}

.wm-my-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    flex-shrink: 0;
}

.wm-my-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: var(--wm-gray-100);
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.wm-my-tab.active {
    background: var(--wm-primary);
    color: white;
}

.wm-my-footer {
    padding: 16px;
    margin-top: auto;
    border-top: 1px solid var(--wm-gray-200);
}

.wm-my-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--wm-danger);
    border-radius: var(--wm-radius-sm);
    background: white;
    color: var(--wm-danger);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wm-my-logout-btn i {
    font-size: 18px;
}

.wm-my-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--wm-danger);
}

.wm-my-logout-btn:active {
    background: rgba(239, 68, 68, 0.15);
}

/* Main Content */
.wm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--wm-gray-50);
    margin-left: var(--wm-sidebar-width);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.wm-sidebar.collapsed ~ .wm-main {
    margin-left: 50px;
}

/* Header */
.wm-header {
    position: fixed;
    top: 0;
    left: var(--wm-sidebar-width);
    right: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: white;
    border-bottom: 1px solid var(--wm-gray-100);
    z-index: 90;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: 80px;
    transition: left 0.3s ease;
}

.wm-sidebar.collapsed ~ .wm-main .wm-header {
    left: var(--wm-sidebar-collapsed-width);
}

/* WordPress Admin Bar 适配 - Header */
/* 移除 admin bar 对 header 的影响，header 始终 top: 0 */
.admin-bar .wm-header {
    top: 0 !important;
}

@media screen and (max-width: 782px) {
    .admin-bar .wm-header {
        top: 0 !important;
    }
}

/* Header右侧区域（排序选择框等） */
.wm-header-right {
    flex-shrink: 0;
    display: none;
    align-items: center;
}

@media screen and (min-width: 769px) {
    .wm-header-right {
        display: flex;
    }
}

/* 搜索区域容器 */
.wm-search-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* PC端：搜索栏居中，最大宽度888px */
@media screen and (min-width: 769px) {
    .wm-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
    }
    
    /* 搜索栏居中 */
    .wm-search-wrapper {
        flex: 1;
        max-width: 888px;
        min-width: 0;
        margin: 0 auto;
        order: 2;
    }
    
    /* 右侧选择框 */
    .wm-header-right {
        flex-shrink: 0;
        margin-left: 16px;
        order: 3;
    }
}

/* 当屏幕宽度不够时，调整布局避免重叠 */
@media screen and (min-width: 769px) and (max-width: 1600px) {
    .wm-header {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .wm-header-right {
        right: 12px;
    }
    
    .wm-search-wrapper {
        /* 动态计算：100% 减去左右固定元素的宽度和间距 */
        max-width: min(888px, calc(100% - 400px));
        padding-left: 0;
        padding-right: 0;
    }
}

/* 更窄的屏幕 */
@media screen and (min-width: 769px) and (max-width: 1200px) {
    .wm-search-wrapper {
        max-width: calc(100% - 300px);
        min-width: 250px;
    }
}

/* 非常窄的屏幕，使用更紧凑的布局 */
@media screen and (min-width: 769px) and (max-width: 1000px) {
    .wm-header {
        gap: 8px;
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .wm-header-right {
        margin-left: 8px;
    }
    
    .wm-search-wrapper {
        max-width: none;
        min-width: 200px;
        margin: 0;
    }
    
    .wm-sort-box {
        gap: 6px;
    }
    
    .wm-sort-box select {
        font-size: 12px;
        padding: 4px 8px;
        padding-right: 22px;
    }
    
    #wm-per-page-select {
        width: 90px;
    }
    
    #wm-per-row-select {
        width: 95px;
    }
    
    #wm-sort-select {
        width: 120px;
    }
}

/* 搜索框样式 - 类似淘宝 */
.wm-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--wm-primary);
    border-radius: 20px;
    overflow: hidden;
    height: 40px;
    box-shadow: none !important;
}

/* 移除focus高亮 */
.wm-main .wm-header .wm-search-box {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: none !important;
}

.wm-search-box input {
    flex: 1;
    border: none !important;
    background: none;
    font-size: 14px;
    outline: none;
    padding: 0 16px;
    color: var(--wm-gray-800);
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    margin: 0;
    margin-bottom: 0 !important;
}

.wm-search-box input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}

.wm-search-box input::placeholder {
    color: var(--wm-gray-400);
}

/* 确保搜索框本身也不会有focus高亮和阴影 */
.wm-search-box:focus-within {
    border-color: var(--wm-primary);
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}

/* 搜索按钮 - 在搜索框内右边 */
.wm-search-btn {
    height: 100%;
    padding: 0 20px;
    border: none;
    background: var(--wm-primary) !important;
    background-color: var(--wm-primary) !important;
    color: white !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    margin: 0;
    margin-bottom: 0 !important;
}

.wm-search-btn:hover {
    background: var(--wm-primary-dark) !important;
    background-color: var(--wm-primary-dark) !important;
    color: white !important;
}

.wm-search-btn:active {
    background: var(--wm-primary) !important;
    background-color: var(--wm-primary) !important;
    color: white !important;
}

/* 扫码按钮 - 在搜索框外右边 */
.wm-qr-scan-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    height: 40px;
    border: 2px solid var(--wm-primary);
    background: white;
    color: var(--wm-primary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    margin: 0;
    box-sizing: border-box;
}

.wm-qr-scan-btn i {
    font-size: 18px;
}

.wm-qr-scan-btn:hover {
    background: var(--wm-primary);
    color: white;
}

.wm-qr-scan-btn:active {
    background: var(--wm-primary-dark);
}
/* 视图切换按钮 */
.wm-view-toggle-btn {
    padding: 5px 10px;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    font-size: 13px;
    background: white;
    cursor: pointer;
    outline: none;
    color: var(--wm-gray-900);
    transition: all 0.2s;
    height: 36px;
    margin-right: 10px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    box-sizing: border-box;
}

.wm-view-toggle-btn:hover {
    border-color: var(--wm-gray-300);
}

.wm-view-toggle-btn.active {
    background: var(--wm-primary);
    color: white;
    border-color: var(--wm-primary);
}

.wm-view-toggle-btn.active:hover {
    background: var(--wm-primary-dark);
    border-color: var(--wm-primary-dark);
}

.wm-sort-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wm-sort-box select {
    padding: 5px 10px;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    font-size: 13px;
    background: white;
    cursor: pointer;
    outline: none;
    color: var(--wm-gray-900);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 26px;
    min-width: 0;
    height: 36px;
    box-sizing: border-box;
}

/* 每页和每行选择框宽度 */
#wm-per-page-select {
    width: 105px;
}

#wm-per-row-select {
    width: 110px;
}

/* 排序选择框宽度 */
#wm-sort-select {
    width: 140px;
}

.wm-sort-box select:focus {
    border-color: var(--wm-primary);
}

/* 每行数量选择器在手机端隐藏 */
@media (max-width: 768px) {
    .wm-per-row-select {
        display: none !important;
    }
}

/* Content */
.wm-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: var(--wm-pagination-height);
    height: calc(100vh - var(--wm-header-height) - var(--wm-pagination-height));
    box-sizing: border-box;
}

/* PC端：保持margin上下0，padding上80下80 */
@media screen and (min-width: 769px) {
    .wm-content,
    #wm-router-view {
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 80px;
        padding-bottom: 80px;
    }
}

/* PC端：表格视图下，左右padding为0，底部padding为40 */
@media screen and (min-width: 769px) {
    #wm-router-view:has(.wm-products-table-wrapper) {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 40px;
    }
}

/* Loading overlay for pagination */
.wm-loading-overlay {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.wm-loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.wm-pagination .wm-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--wm-gray-500);
    font-size: 14px;
    margin-left: 12px;
}

/* Products Grid */
.wm-products-grid {
    display: grid;
    gap: 20px;
}

#wm-router-view .wm-products-grid {
    padding-bottom: 21px;
    padding-top: 0;
}

/* PC端：产品网格顶部间距 */
@media screen and (min-width: 769px) {
    #wm-router-view .wm-products-grid {
        padding-top: 24px;
    }
}

/* 默认每行8个（通过类控制） */
.wm-products-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.wm-products-grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.wm-products-grid-8 {
    grid-template-columns: repeat(8, 1fr);
}

.wm-products-grid-10 {
    grid-template-columns: repeat(10, 1fr);
}

/* 响应式调整：大屏幕 */
@media (min-width: 1600px) {
    .wm-products-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .wm-products-grid-6 {
        grid-template-columns: repeat(6, 1fr);
    }
    .wm-products-grid-8 {
        grid-template-columns: repeat(8, 1fr);
    }
    .wm-products-grid-10 {
        grid-template-columns: repeat(10, 1fr);
    }
}

@media (max-width: 1599px) {
    .wm-products-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .wm-products-grid-6,
    .wm-products-grid-8,
    .wm-products-grid-10 {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1400px) {
    .wm-products-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    .wm-products-grid-6,
    .wm-products-grid-8,
    .wm-products-grid-10 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .wm-products-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    .wm-products-grid-6,
    .wm-products-grid-8,
    .wm-products-grid-10 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wm-products-grid-4,
    .wm-products-grid-6,
    .wm-products-grid-8,
    .wm-products-grid-10 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Products Table */
.wm-products-table-wrapper {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    margin-bottom: 0;
    margin-top: 0;
}

.wm-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wm-products-table thead {
    background: var(--wm-gray-50);
    border-bottom: 2px solid var(--wm-gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wm-products-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--wm-gray-700);
    white-space: nowrap;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--wm-gray-50);
}

.wm-products-table th:first-child {
    padding-left: 16px;
    padding-right: 16px;
}

.wm-products-table tbody tr {
    border-bottom: 1px solid var(--wm-gray-100);
    transition: background 0.2s;
}

.wm-products-table tbody tr:hover {
    background: var(--wm-gray-50);
}

.wm-products-table tbody tr.wm-product-table-row {
    cursor: pointer;
}

.wm-products-table td {
    padding: 12px 16px;
    color: var(--wm-gray-800);
    vertical-align: middle;
}

.wm-products-table td:first-child {
    padding-left: 16px;
    padding-right: 16px;
}

.wm-table-thumb-cell {
    width: 60px;
    padding: 8px 16px;
}

.wm-table-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--wm-radius-sm);
    background: var(--wm-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-table-thumb-cell i {
    font-size: 24px;
    color: var(--wm-gray-300);
}

.wm-table-name-cell {
    font-weight: 500;
    color: var(--wm-gray-900);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-table-sku-cell {
    font-family: 'Courier New', monospace;
    color: var(--wm-gray-900);
}

.wm-table-sku-cell .wm-sku-filter-item {
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    padding: 4px 8px;
    background: transparent;
    color: var(--wm-gray-900);
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

.wm-table-sku-cell .wm-sku-filter-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-table-location-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--wm-gray-600);
}

.wm-table-location-cell .wm-location-filter-item {
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    padding: 4px 8px;
    background: transparent;
    color: var(--wm-gray-700);
    border-radius: 4px;
    font-weight: normal;
    transition: all 0.2s;
}

.wm-table-location-cell .wm-location-filter-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-table-creator-cell .wm-created-by-filter-item {
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    padding: 4px 8px;
    background: transparent;
    color: var(--wm-gray-700);
    border-radius: 4px;
    font-weight: normal;
    transition: all 0.2s;
}

.wm-table-creator-cell .wm-created-by-filter-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-table-actions-cell {
    white-space: nowrap;
}

.wm-table-actions-cell .wm-btn-stock-out {
    padding: 6px 12px;
    font-size: 12px;
}

/* Product Card */
.wm-product-card {
    background: white;
    border-radius: var(--wm-radius);
    overflow: hidden;
    box-shadow: var(--wm-shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.wm-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--wm-shadow-lg);
}

.wm-product-image {
    aspect-ratio: 1;
    background: var(--wm-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wm-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wm-product-image i {
    font-size: 48px;
    color: var(--wm-gray-300);
}

.wm-product-info {
    padding: 16px;
}

@media (max-width: 768px) {
    .wm-product-info {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* 手机端产品卡位置信息左右padding */
    .wm-product-location,
    .wm-location-breadcrumb {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    /* 手机端图片画廊支持触摸滑动 */
    .wm-image-gallery {
        touch-action: pan-y; /* 允许垂直滚动，但处理水平滑动 */
        -webkit-overflow-scrolling: touch;
    }
    
    .wm-image-current {
        touch-action: pan-x; /* 允许水平滑动 */
    }
}

.wm-product-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.wm-product-row:has(.wm-product-location) {
    align-items: flex-start;
}

.wm-product-row:last-child {
    margin-bottom: 0;
}

.wm-product-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--wm-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.wm-product-category {
    font-size: 13px;
    color: var(--wm-gray-500);
}

.wm-product-quantity {
    font-weight: 600;
    color: var(--wm-primary);
}

.wm-product-location {
    font-size: 12px;
    color: var(--wm-gray-400);
    white-space: normal;
    word-wrap: break-word;
    word-break: break-all;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.wm-product-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.wm-btn-stock-out {
    padding: 4px 10px;
    font-size: 12px;
    background: var(--wm-danger);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.wm-btn-stock-out:hover {
    background: #dc2626;
}

/* Tags */
.wm-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    border-radius: 4px;
}

/* Loading & Empty */
.wm-loading,
.wm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--wm-gray-400);
}

.wm-loading i,
.wm-empty i {
    font-size: 48px;
    margin-bottom: 16px;
}

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

.ri-spin {
    animation: spin 1s linear infinite;
}

/* Pagination */
.wm-pagination {
    position: fixed;
    bottom: 0;
    left: var(--wm-sidebar-width);
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 0 24px;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 90;
    border-top: 1px solid var(--wm-gray-200);
    height: var(--wm-pagination-height);
    box-sizing: border-box;
}

/* 当有筛选内容时，使用 space-between 布局 */
.wm-pagination:has(.wm-pagination-filters) {
    justify-content: space-between;
}

.wm-pagination-filters {
    flex: 1;
    font-size: 12px;
    color: var(--wm-gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    min-width: 0;
}

/* 当筛选内容为空时隐藏 */
.wm-pagination-filters:empty {
    display: none;
}

.wm-pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wm-sidebar.collapsed ~ .wm-main .wm-pagination {
    left: var(--wm-sidebar-collapsed-width);
}

/* Pagination */
#wm-router-view .wm-pagination {
    transform: translatex(0px) translatey(0px);
    padding-top: 10px;
    padding-right: 70px;
}

.wm-page-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--wm-gray-200);
    background: white;
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.wm-page-btn:hover {
    border-color: var(--wm-primary);
    color: var(--wm-primary);
}

.wm-page-btn.active {
    background: var(--wm-primary);
    border-color: var(--wm-primary);
    color: white;
}

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

/* 分页省略号 */
.wm-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    color: var(--wm-gray-400);
    font-size: 12px;
    user-select: none;
    pointer-events: none;
}

/* Pagination Info */
.wm-pagination-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--wm-gray-600);
}

.wm-pagination-total {
    white-space: nowrap;
}

.wm-pagination-jump {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.wm-pagination-jump label {
    color: var(--wm-gray-600);
    font-size: 12px;
}

.wm-page-jump-input {
    width: 50px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid var(--wm-gray-300);
    border-radius: var(--wm-radius-sm);
    text-align: center;
    font-size: 12px;
    transition: border-color 0.2s;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;
}

.wm-page-jump-input:focus {
    outline: none;
    border-color: var(--wm-primary);
    box-shadow: 0 0 0 2px rgba(var(--wm-primary-rgb, 99, 102, 241), 0.1);
}

.wm-page-jump-btn {
    min-width: 45px;
    height: 30px;
    padding: 0 10px;
    background: var(--wm-primary);
    color: white;
    border: none;
    border-radius: var(--wm-radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.wm-page-jump-btn:hover {
    background: var(--wm-primary-dark, #4f46e5);
}

.wm-page-jump-btn:active {
    transform: translateY(1px);
}

/* 响应式：移动端隐藏分页信息 */
@media (max-width: 768px) {
    .wm-pagination-info {
        display: none;
    }
}

/* Buttons */
.wm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    background: var(--wm-gray-100);
    color: var(--wm-gray-700);
}

.wm-btn:hover {
    background: var(--wm-gray-200);
}

.wm-btn-primary {
    background: linear-gradient(135deg, var(--wm-primary), #818cf8);
    color: white;
}

.wm-btn-primary:hover {
    background: linear-gradient(135deg, var(--wm-primary-hover), var(--wm-primary));
    transform: translateY(-1px);
}

.wm-btn-success {
    background: linear-gradient(135deg, var(--wm-success), #34d399);
    color: white;
}

.wm-btn-success:hover {
    background: linear-gradient(135deg, var(--wm-success-hover), var(--wm-success));
}

.wm-btn-danger {
    background: var(--wm-danger);
    color: white;
}

.wm-btn-danger:hover {
    background: #dc2626;
}

.wm-btn-block {
    width: 100%;
}

.wm-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.wm-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

/* Modal */
.wm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.wm-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.wm-modal-container {
    position: relative;
    background: white;
    border-radius: var(--wm-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--wm-shadow-lg);
    animation: modalIn 0.3s ease;
    z-index: 1;
}

.wm-modal-large {
    max-width: 700px;
}

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

.wm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--wm-gray-100);
}

@media (max-width: 768px) {
    .wm-modal-header {
        height: 60px;
        padding: 0 16px;
        min-height: 60px;
    }
    
    .wm-modal-header h2 {
        font-size: 16px;
    }
}

.wm-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

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

.wm-location-scan-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--wm-primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    padding: 0;
    box-sizing: border-box;
    margin-bottom: 0;
}

.wm-location-scan-btn:hover {
    background: var(--wm-primary-dark);
    transform: scale(1.05);
}

.wm-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--wm-gray-100);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    position: relative;
    z-index: 1001;
    pointer-events: auto;
    color: var(--wm-gray-500);
    transition: all 0.2s;
    margin-bottom: 0;
}

.wm-modal-close:hover {
    background: var(--wm-gray-200);
    color: var(--wm-gray-700);
}

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

.wm-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--wm-gray-100);
    background: var(--wm-gray-50);
}

/* 手机端底部按钮更紧凑 */
@media screen and (max-width: 768px) {
    .wm-modal-footer {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .wm-modal-footer .wm-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 36px;
    }
    
    #wm-save-continue {
        font-size: 12px;
        padding: 8px 10px;
        white-space: nowrap;
    }
}

/* Form */
.wm-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.wm-form-group {
    flex: 1;
}

.wm-form-group-full {
    flex: 0 0 100%;
}

/* 手机端：位置字段独占一行，货号移到第二行 */
@media (max-width: 768px) {
    /* 位置字段组独占一行 */
    .wm-form-group-location {
        flex: 0 0 100% !important;
        width: 100% !important;
    }
    
    /* 如果位置字段和货号在同一行，强制位置字段独占一行，货号换行 */
    .wm-form-row:has(.wm-form-group-location) {
        flex-wrap: wrap;
    }
    
    /* 确保位置字段后的字段（如货号）换行显示在第二行 */
    .wm-form-row:has(.wm-form-group-location) .wm-form-group-location {
        flex: 0 0 100% !important;
        margin-bottom: 16px;
    }
    
    .wm-form-row:has(.wm-form-group-location) .wm-form-group:not(.wm-form-group-location) {
        flex: 1;
    }
}

.wm-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--wm-gray-700);
}

.wm-form-group label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.wm-form-group label span {
    cursor: pointer;
    user-select: none;
}

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

.wm-form-group input,
.wm-form-group select,
.wm-form-group textarea {
    width: 100%;
    padding: 5px 16px;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

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

.wm-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 数量输入框带加减按钮 */
.wm-quantity-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wm-quantity-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--wm-gray-200);
    background: white;
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: var(--wm-gray-700);
    transition: all 0.2s;
}

.wm-quantity-minus {
    margin-right: 0 !important;
}

.wm-quantity-btn:hover {
    background: var(--wm-primary);
    border-color: var(--wm-primary);
    color: white;
}

.wm-quantity-btn:active {
    transform: scale(0.95);
}

.wm-quantity-input-wrapper input[type="number"] {
    width: 100px !important;
    text-align: center;
}

/* Location Selector */
.wm-location-selector {
    position: relative;
}

.wm-location-selected {
    padding: 12px 16px;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s;
}

.wm-location-selected:hover {
    border-color: var(--wm-gray-300);
}

.wm-location-selected.active {
    border-color: var(--wm-primary);
}

.wm-placeholder {
    color: var(--wm-gray-400);
}

.wm-location-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    box-shadow: var(--wm-shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

/* 手机端：调整位置选择器下拉框宽度和定位 */
@media (max-width: 768px) {
    .wm-location-dropdown {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        border-radius: var(--wm-radius);
        margin-left: 0;
        margin-right: 0;
    }
    
    /* 确保在模态框内时正确显示 */
    .wm-modal-container .wm-location-dropdown {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
    }
}

.wm-location-dropdown.active {
    display: block;
}

.wm-location-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wm-location-item {
    position: relative;
}

.wm-location-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    transition: background 0.2s;
}

.wm-location-item-content:hover {
    background: var(--wm-gray-50);
}

.wm-location-item-content.selected {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-location-item-content .wm-location-name {
    cursor: pointer;
    flex: 1;
}

.wm-location-item-content i {
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.wm-location-item-content i.rotated {
    transform: rotate(90deg);
}

.wm-location-item > .wm-location-list {
    padding-left: 20px;
    border-left: 2px solid var(--wm-gray-100);
    margin-left: 16px;
    display: none;
}

.wm-location-toggle {
    font-size: 16px;
    color: var(--wm-gray-400);
    transition: transform 0.2s;
    margin-right: 4px;
}

.wm-location-toggle.expanded {
    transform: rotate(90deg);
}

.wm-location-spacer {
    display: inline-block;
    width: 16px;
    margin-right: 4px;
}

/* Category Selector */
.wm-category-selector {
    position: relative;
}

.wm-category-selected {
    padding: 5px 16px;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s;
}

.wm-category-selected:hover {
    border-color: var(--wm-gray-300);
}

.wm-category-selected.active {
    border-color: var(--wm-primary);
}

.wm-category-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    box-shadow: var(--wm-shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
}

.wm-category-dropdown.active {
    display: block;
}

.wm-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wm-category-item {
    position: relative;
}

.wm-category-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.wm-category-item-content:hover {
    background: var(--wm-gray-50);
}

.wm-category-item-content.selected {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-category-item > .wm-category-list {
    padding-left: 20px;
    border-left: 2px solid var(--wm-gray-100);
    margin-left: 16px;
    display: none;
}

.wm-category-toggle {
    font-size: 16px;
    color: var(--wm-gray-400);
    transition: transform 0.2s;
    margin-right: 4px;
}

.wm-category-toggle.expanded {
    transform: rotate(90deg);
}

/* Tags Selector */
.wm-tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wm-tag-checkbox {
    cursor: pointer;
}

.wm-tag-checkbox input {
    display: none;
}

.wm-tag-checkbox .wm-tag-label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.wm-tag-checkbox input:checked + .wm-tag-label {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--wm-primary);
    transform: scale(1.05);
}

.wm-tag-checkbox .wm-tag-label:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.wm-tag-checkbox input:checked + .wm-tag {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--wm-primary);
}

/* Image Upload */
.wm-image-upload {
    position: relative;
}

.wm-image-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--wm-gray-300);
    border-radius: var(--wm-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    background: var(--wm-gray-50);
}

.wm-image-preview:hover {
    border-color: var(--wm-primary);
    background: rgba(99, 102, 241, 0.05);
}

.wm-image-preview i {
    font-size: 36px;
    color: var(--wm-gray-400);
    margin-bottom: 8px;
}

.wm-image-preview span {
    font-size: 13px;
    color: var(--wm-gray-500);
}

.wm-image-preview small {
    font-size: 11px;
    color: var(--wm-gray-400);
}

.wm-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wm-image-preview.has-image i,
.wm-image-preview.has-image > span {
    display: none;
}

/* 上传中状态 */
.wm-image-preview.uploading {
    position: relative;
}

.wm-image-preview.uploading img {
    opacity: 0.5;
}

.wm-upload-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.wm-upload-progress::after {
    content: '...';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 多图片上传 */
.wm-images-upload {
    width: 100%;
}

.wm-images-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wm-image-add-btn {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--wm-gray-300);
    border-radius: var(--wm-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--wm-gray-50);
}

.wm-image-add-btn:hover {
    border-color: var(--wm-primary);
    background: rgba(99, 102, 241, 0.05);
}

.wm-image-add-btn i {
    font-size: 32px;
    color: var(--wm-gray-400);
    margin-bottom: 4px;
}

.wm-image-add-btn span {
    font-size: 12px;
    color: var(--wm-gray-500);
    text-align: center;
    padding: 0 8px;
}

.wm-image-add-btn small {
    font-size: 10px;
    color: var(--wm-gray-400);
    text-align: center;
    margin-top: 4px;
}

.wm-image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border: 2px solid var(--wm-gray-200);
    border-radius: var(--wm-radius-sm);
    overflow: hidden;
    background: var(--wm-gray-100);
}

.wm-image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wm-image-preview-item .wm-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    opacity: 0;
}

.wm-image-preview-item:hover .wm-image-remove {
    opacity: 1;
}

.wm-image-preview-item .wm-image-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.wm-image-preview-item.uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-image-preview-item.uploading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 图片拖拽排序样式 */
.wm-images-preview-container.ui-sortable,
#wm-edit-images-preview.ui-sortable {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wm-image-preview-item {
    cursor: move;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wm-image-preview-item:active {
    cursor: grabbing;
}

.wm-image-preview-item.ui-sortable-helper {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0.9;
}

.wm-image-sortable-placeholder {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--wm-primary);
    border-radius: var(--wm-radius-sm);
    background: rgba(59, 130, 246, 0.1);
    visibility: visible !important;
}

/* Product Detail */
.wm-product-detail {
    padding: 0;
}

.wm-detail-header {
    background: white;
    padding: 24px;
    border-radius: var(--wm-radius);
    margin-bottom: 24px;
    display: flex;
    gap: 24px;
}

.wm-detail-image {
    width: 200px;
    height: 200px;
    border-radius: var(--wm-radius);
    overflow: hidden;
    background: var(--wm-gray-100);
    flex-shrink: 0;
}

.wm-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wm-detail-image i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 64px;
    color: var(--wm-gray-300);
}

/* 图片轮播 */
.wm-image-gallery {
    position: relative;
    width: 100%;
    height: 100%;
}

.wm-image-current {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    overflow: hidden;
}

.wm-image-slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.wm-image-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
}

.wm-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wm-image-current img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

.wm-image-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.wm-image-nav button {
    pointer-events: auto;
}

.wm-image-current:hover .wm-image-nav {
    opacity: 1;
}

.wm-image-prev,
.wm-image-next {
    width: auto;
    height: auto;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    padding: 4px;
    z-index: 10;
}

.wm-image-prev {
    margin-left: 3px;
}

.wm-image-next {
    margin-right: 3px;
}

.wm-image-prev:hover,
.wm-image-next:hover {
    color: white;
    transform: scale(1.1);
}

.wm-image-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 图片缩略图列表 */
.wm-image-thumbnails {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    margin-top: 12px;
}

.wm-image-thumbnail {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.wm-image-thumbnail:hover {
    border-color: var(--wm-primary);
    transform: scale(1.05);
}

.wm-image-thumbnail.active {
    border-color: var(--wm-primary);
    box-shadow: 0 0 0 2px rgba(var(--wm-primary-rgb), 0.2);
}

.wm-image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wm-image-thumbnail-labels {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wm-image-label {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.wm-image-label-current {
    background: #10b981;
    color: white;
}

.wm-image-label-history {
    background: #6b7280;
    color: white;
}

.wm-image-time {
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    white-space: nowrap;
}

/* 图片预览弹窗 */
.wm-image-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y; /* 允许垂直滚动，但处理水平滑动 */
}

.wm-image-viewer-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.wm-image-viewer-slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.wm-image-viewer-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-image-viewer-slide img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.wm-image-viewer-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: opacity 0.3s ease;
}

.wm-image-viewer-info {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10002;
    max-width: 90%;
    flex-wrap: wrap;
    justify-content: center;
}

.wm-image-viewer-info .wm-image-label {
    font-size: 13px;
    padding: 4px 10px;
}

.wm-image-viewer-info .wm-image-time {
    color: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.wm-image-viewer-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s;
    z-index: 10002;
}

.wm-image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.wm-image-viewer-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 32px;
    transition: all 0.2s;
    z-index: 10002;
    padding: 16px;
}

.wm-image-viewer-nav:hover {
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.wm-image-viewer-prev {
    left: 0;
}

.wm-image-viewer-next {
    right: 0;
}

.wm-image-viewer-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10002;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 当同时有标签和时间信息时，调整指示器位置 */
.wm-image-viewer-modal:has(.wm-image-viewer-info) .wm-image-viewer-indicator {
    top: 20px;
}

.wm-detail-info {
    flex: 1;
}

.wm-detail-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--wm-gray-500);
    margin-bottom: 8px;
}

.wm-detail-category {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--wm-gray-500);
    margin-bottom: 8px;
}

/* 面包屑导航 */
.wm-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.wm-breadcrumb-item {
    cursor: pointer;
    transition: all 0.2s;
    padding: 2px 6px;
    border-radius: 4px;
}

.wm-breadcrumb-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-breadcrumb-item:active {
    background: rgba(99, 102, 241, 0.2);
}

.wm-breadcrumb .ri-arrow-right-s-line {
    font-size: 14px;
    color: var(--wm-gray-400);
    margin: 0 -2px;
}

.wm-detail-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.wm-detail-sku {
    color: var(--wm-gray-500);
    margin-bottom: 16px;
}

.wm-detail-meta {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--wm-gray-500);
}

.wm-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.wm-detail-action-buttons {
    display: flex;
    gap: 8px;
}

.wm-detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

/* Detail Tabs */
.wm-detail-tabs {
    display: flex;
    gap: 4px;
    background: white;
    padding: 8px;
    border-radius: var(--wm-radius);
    margin-bottom: 16px;
}

.wm-detail-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    border-radius: var(--wm-radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.wm-detail-tab.active {
    background: var(--wm-primary);
    color: white;
}

.wm-detail-content {
    background: white;
    padding: 24px;
    border-radius: var(--wm-radius);
}

/* Detail Info List */
.wm-info-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.wm-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wm-info-label {
    font-size: 12px;
    color: var(--wm-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wm-info-value {
    font-size: 16px;
    font-weight: 500;
}

.wm-info-item.full {
    grid-column: span 2;
}

.wm-info-actions {
    display: flex;
    gap: 12px;
}

/* QR Code */
.wm-qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--wm-gray-50);
    border-radius: var(--wm-radius-sm);
}

.wm-qrcode {
    padding: 10px;
    background: white;
    border-radius: var(--wm-radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wm-qrcode img,
.wm-qrcode canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.wm-qrcode-hint {
    font-size: 13px;
    color: var(--wm-gray-500);
}

/* 产品详情页图片网格 */
.wm-detail-images-grid {
    width: 100%;
}

.wm-detail-images-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.wm-detail-image-item {
    flex: 0 0 auto;
}

.wm-detail-image-wrapper {
    position: relative;
    background: var(--wm-gray-50);
    border-radius: var(--wm-radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.wm-detail-image-wrapper:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.wm-detail-image-img {
    display: block;
    object-fit: contain;
    background: var(--wm-gray-50);
    /* 限制短边最大为400px：同时设置max-width和max-height，图片会按比例缩放 */
    /* 对于横图（宽>高），max-height会限制短边；对于竖图（高>宽），max-width会限制短边 */
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
}

.wm-detail-image-overlay {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    width: 100%;
    gap: 8px;
}

.wm-detail-image-overlay .wm-image-label {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.wm-detail-image-overlay .wm-image-label-current {
    background: var(--wm-success);
    color: white;
}

.wm-detail-image-overlay .wm-image-label-history {
    background: var(--wm-gray-600);
    color: white;
}

.wm-detail-image-overlay .wm-image-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wm-detail-image-overlay .wm-image-time {
    color: var(--wm-gray-700);
    font-size: 11px;
    padding: 3px 8px;
    white-space: nowrap;
}

.wm-detail-image-overlay .wm-image-user {
    color: var(--wm-gray-700);
    font-size: 11px;
    padding: 3px 8px;
    white-space: nowrap;
}

.wm-empty-images {
    text-align: center;
    padding: 40px 20px;
    color: var(--wm-gray-400);
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .wm-detail-images-grid-container {
        gap: 12px;
    }
    
    .wm-detail-image-overlay {
        padding: 6px 10px;
    }
    
    .wm-detail-image-overlay .wm-image-label {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    .wm-detail-image-overlay .wm-image-time {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .wm-detail-image-img {
        max-width: calc((100vw - 100px) / 2);
        max-height: calc((100vw - 100px) / 2);
    }
}

/* QR Scanner Modal */
.wm-qr-scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.wm-qr-scanner-container {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: var(--wm-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wm-qr-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--wm-gray-200);
}

.wm-qr-scanner-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--wm-gray-800);
}

.wm-qr-scanner-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--wm-gray-500);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    z-index: 10001;
    pointer-events: auto;
}

.wm-qr-scanner-close:hover {
    background: var(--wm-gray-100);
    color: var(--wm-gray-800);
}

#wm-qr-reader {
    width: 100%;
    border-radius: var(--wm-radius-sm);
    overflow: hidden;
}

.wm-qr-scanner-hint {
    text-align: center;
    font-size: 14px;
    color: var(--wm-gray-600);
}

/* PC端隐藏扫码按钮 */
@media screen and (min-width: 769px) {
    /* 隐藏PC端搜索框旁边的扫码按钮 */
    #wm-qr-scan-btn {
        display: none !important;
    }
    
    /* 隐藏产品创建表单中的位置扫码按钮 */
    #wm-location-scan-btn {
        display: none !important;
    }
}

/* Records List */
.wm-records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wm-record-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--wm-gray-50);
    border-radius: var(--wm-radius-sm);
}

.wm-record-time {
    font-size: 13px;
    color: var(--wm-gray-500);
    min-width: 150px;
}

.wm-record-action {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.wm-record-action.create {
    background: rgba(16, 185, 129, 0.1);
    color: var(--wm-success);
}

.wm-record-action.update {
    background: rgba(99, 102, 241, 0.1);
    color: var(--wm-primary);
}

.wm-record-action.stock_in {
    background: rgba(16, 185, 129, 0.1);
    color: var(--wm-success);
}

.wm-record-action.stock_out {
    background: rgba(239, 68, 68, 0.1);
    color: var(--wm-danger);
}

.wm-record-detail {
    flex: 1;
}

.wm-record-user {
    font-size: 13px;
    color: var(--wm-gray-600);
}

.wm-record-quantity {
    font-weight: 600;
}

.wm-record-quantity.positive {
    color: var(--wm-success);
}

.wm-record-quantity.negative {
    color: var(--wm-danger);
}

/* Back Button */
.wm-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    margin-bottom: 16px;
    background: white;
    border-radius: var(--wm-radius-sm);
    color: var(--wm-gray-600);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.wm-back-btn:hover {
    background: var(--wm-gray-100);
    color: var(--wm-gray-800);
}

/* Toast */
.wm-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--wm-gray-800);
    color: white;
    border-radius: var(--wm-radius-sm);
    box-shadow: var(--wm-shadow-lg);
    z-index: 2000;
    animation: toastIn 0.3s ease;
}

.wm-toast.success {
    background: var(--wm-success);
}

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

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

/* ========== 移动端样式 ========== */

/* 桌面端隐藏移动端元素 */
.wm-mobile-menu-btn,
.wm-mobile-sidebar,
.wm-mobile-sidebar-overlay,
.wm-mobile-bottom-nav {
    display: none;
}

/* 移动端响应式 - 768px以下 */
@media screen and (max-width: 768px) {
    /* 显示移动端元素 */
    .wm-mobile-menu-btn,
    .wm-mobile-bottom-nav {
        display: flex;
    }
    
    /* 隐藏桌面端元素 */
    .wm-desktop-only,
    .wm-sidebar {
        display: none !important;
    }
    
    /* 主应用容器 */
    .wm-app {
        flex-direction: column;
    }
    
    /* 主内容区 */
    .wm-main {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    /* 顶部搜索栏 */
    .wm-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        z-index: 1000;
        background: white;
        border-bottom: 1px solid var(--wm-gray-200);
        padding: 8px 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .admin-bar .wm-header {
        top: 0 !important;
    }
    
    /* 移动端菜单按钮 */
    .wm-mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: var(--wm-gray-100);
        border-radius: 8px;
        color: var(--wm-gray-700);
        font-size: 20px;
        cursor: pointer;
        flex-shrink: 0;
        pointer-events: auto !important;
        z-index: 1001 !important;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        margin: 0;
    }
    
    .wm-mobile-menu-btn:focus {
        outline: none;
    }
    
    .wm-mobile-menu-btn:active {
        background: var(--wm-gray-200);
    }
    
    .wm-mobile-menu-btn:focus {
        outline: none;
    }
    
    /* 搜索框适配 */
    .wm-search-wrapper {
        flex: 1;
        min-width: 0;
    }
    
    .wm-search-box {
        height: 44px;
    }
    
    .wm-search-box input {
        font-size: 14px;
        padding: 0 12px;
    }
    
    .wm-search-btn {
        padding: 0 16px;
        font-size: 13px;
    }
    
    /* 内容区 */
    .wm-content {
        padding-top: 80px;
        padding-bottom: 100px;
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 0;
        margin-top: 0;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-bar .wm-content {
        padding-top: 80px;
    }
    
    /* 移动端筛选弹窗 */
    #wm-mobile-filter-modal {
        z-index: 2000;
    }
    
    .wm-mobile-filter-modal-container {
        width: 90%;
        max-width: 400px;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
        border-radius: var(--wm-radius);
        box-shadow: var(--wm-shadow-lg);
    }
    
    .wm-mobile-filter-modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
        flex: 1;
        max-height: calc(85vh - 60px);
    }
    
    /* 保留用户信息侧滑菜单样式 */
    .wm-mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }
    
    .wm-mobile-sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* 用户信息侧滑菜单 */
    .wm-mobile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        background: white;
        z-index: 1999;
        transform: translateX(-100%);
        transition: transform 0.3s;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }
    
    .wm-mobile-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-bar .wm-mobile-sidebar {
        top: 46px;
    }
    
    /* 侧滑菜单头部 */
    .wm-mobile-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid var(--wm-gray-200);
        background: var(--wm-gray-50);
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .wm-mobile-sidebar-header h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--wm-gray-800);
    }
    
    .wm-mobile-sidebar-close {
        width: 32px;
        height: 32px;
        border: none;
        background: none;
        color: var(--wm-gray-600);
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        pointer-events: auto;
        z-index: 1001;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }
    
    .wm-mobile-sidebar-close:active {
        background: var(--wm-gray-200);
    }
    
    /* 侧滑菜单内容 */
    .wm-mobile-sidebar-content {
        padding: 16px;
    }
    
    /* 用户信息样式 */
    .wm-mobile-user-info {
        padding: 20px 0;
        border-bottom: 1px solid var(--wm-gray-200);
        margin-bottom: 16px;
    }
    
    .wm-mobile-user-greeting {
        font-size: 18px;
        font-weight: 600;
        color: var(--wm-gray-800);
    }
    
    .wm-mobile-user-name {
        color: var(--wm-primary);
    }
    
    /* 用户功能按钮 */
    .wm-mobile-user-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .wm-mobile-user-action-btn {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border: 1px solid var(--wm-gray-200);
        border-radius: var(--wm-radius-sm);
        background: white;
        color: var(--wm-gray-700);
        font-size: 15px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
        text-align: left;
        width: 100%;
    }
    
    .wm-mobile-user-action-btn i {
        font-size: 20px;
        color: var(--wm-primary);
    }
    
    .wm-mobile-user-action-btn:active {
        background: var(--wm-gray-50);
        border-color: var(--wm-primary);
    }
    
    .wm-mobile-user-action-btn-logout {
        border-color: var(--wm-danger);
        color: var(--wm-danger);
    }
    
    .wm-mobile-user-action-btn-logout i {
        color: var(--wm-danger);
    }
    
    .wm-mobile-user-action-btn-logout:active {
        background: rgba(239, 68, 68, 0.1);
        border-color: var(--wm-danger);
    }
    
    .wm-mobile-sort-section {
        margin-top: 24px;
        padding-top: 24px;
        border-top: 1px solid var(--wm-gray-200);
    }
    
    .wm-mobile-sort-section h4 {
        margin: 0 0 16px 0;
        font-size: 14px;
        font-weight: 600;
        color: var(--wm-gray-700);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* 移动端底部导航 */
    .wm-mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: white;
        border-top: 1px solid var(--wm-gray-200);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 1000;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .wm-mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        height: 100%;
        border: none;
        background: none;
        color: var(--wm-gray-500);
        font-size: 11px;
        cursor: pointer;
        transition: color 0.2s;
        pointer-events: auto !important;
        position: relative;
        z-index: 1001 !important;
        -webkit-tap-highlight-color: transparent;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .wm-mobile-nav-btn i {
        pointer-events: none;
        font-size: 22px;
        line-height: 1;
    }
    
    .wm-mobile-nav-btn span {
        pointer-events: none;
        font-size: 11px;
        line-height: 1.2;
    }
    
    .wm-mobile-nav-btn:focus {
        outline: none;
    }
    
    .wm-mobile-nav-btn.active {
        color: var(--wm-primary);
    }
    
    .wm-mobile-nav-btn:active {
        background: none;
        background-color: transparent;
    }
    
    /* 分页优化 - 去除白色框和阴影 */
    .wm-pagination {
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 16px 12px !important;
        margin-top: 16px;
        margin-bottom: 16px;
    }
    
    /* 产品网格适配 */
    .wm-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px !important;
        padding-bottom: 20px !important;
    }
    
    /* 下拉刷新容器 - 仅在移动端显示 */
    .wm-pull-refresh-indicator {
        position: absolute;
        top: -50px;
        left: 50%;
        transform: translateX(-50%);
        display: none;
        align-items: center;
        gap: 8px;
        color: var(--wm-gray-500);
        font-size: 14px;
        opacity: 0;
        transition: opacity 0.2s;
        pointer-events: none;
        z-index: 1;
    }
    
    .wm-pull-refresh-indicator.active {
        opacity: 1;
    }
    
    .wm-pull-refresh-indicator i {
        font-size: 18px;
        animation: wm-spin 1s linear infinite;
    }
    
    /* 移动端显示下拉刷新指示器 */
    @media (max-width: 768px) {
        .wm-pull-refresh-indicator {
            display: flex;
        }
    }
    
    /* PC端隐藏下拉刷新指示器 */
    @media screen and (min-width: 769px) {
        .wm-pull-refresh-indicator {
            display: none !important;
        }
    }
    
    @keyframes wm-spin {
        from {
            transform: rotate(0deg);
        }
        to {
            transform: rotate(360deg);
        }
    }
    
    /* 详情页适配 */
    .wm-detail-header {
        flex-direction: column;
    }
    
    .wm-detail-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
    
    .wm-info-list {
        grid-template-columns: 1fr;
    }
    
    /* 弹窗适配 */
    .wm-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .wm-qr-scanner-container {
        max-width: 100%;
        width: 100%;
    }
    
    .wm-qrcode-container {
        padding: 15px;
    }
    
    .wm-qrcode {
        padding: 8px;
    }
}

