.zsx-search-category-link,
.zsx-search-product-link{color:#1976d2; text-decoration:none;}
.zsx-search-category-link:hover,
.zsx-search-product-link:hover{text-decoration:underline;}
.zsx-global-search .zsx-search-results h3,
.zsx-global-search .zsx-search-results h4{margin:16px 0 8px; font-size:1.05em;}
.zsx-table-widget tr.zsx-row-highlight{background:#fff8e1;}
.zsx-table-widget tr.zsx-row-highlight .zsx-name{font-weight:700;}
.zsx-global-search{margin:12px 0;}
.zsx-global-search .zsx-search-wrap{display:inline-block; position:relative; max-width:100%;}
.zsx-global-search .zsx-search{padding:14px 56px 14px 16px; border:1px solid #dcdcdc; box-shadow:0 0 0 0 rgba(0,0,0,0);} 
.zsx-global-search .zsx-search-btn{position:absolute; right:6px; top:50%; transform:translateY(-50%); width:44px; height:44px; border-radius:50%; border:2px solid #e6e6e6; background:#212a6b; display:inline-flex; align-items:center; justify-content:center; cursor:pointer;}
/* 使用背景图标，避免 mask 在部分主题里缩放异常 */
.zsx-global-search .zsx-search-btn{background-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><rect width=\"24\" height=\"24\" fill=\"none\"/><circle cx=\"11\" cy=\"11\" r=\"7\" stroke=\"white\" stroke-width=\"2\" fill=\"none\"/><line x1=\"16\" y1=\"16\" x2=\"21\" y2=\"21\" stroke=\"white\" stroke-width=\"2\" stroke-linecap=\"round\"/></svg>'); background-repeat:no-repeat; background-position:center; background-size:22px 22px;}
/* ===== 搜索：图标点击展开模式 ===== */
.zsx-global-search.zsx-collapsible{position:relative; margin:0; display:inline-block;}
.zsx-search-toggle{width:44px; height:44px; padding:0; border:none; background:transparent; color:#212a6b; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; transition:background .2s;}
.zsx-search-toggle:hover{background:rgba(0,0,0,.06);}
.zsx-search-toggle::before{content:""; width:24px; height:24px; background-color:currentColor; -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/></svg>') no-repeat center / contain; mask:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/></svg>') no-repeat center / contain;}
.zsx-global-search.zsx-collapsible .zsx-search-panel{display:none; position:absolute; top:100%; right:0; z-index:100001; width:360px; max-width:90vw; margin-top:8px; padding:12px; background:#fff; border:1px solid #e1e5e9; border-radius:10px; box-shadow:0 12px 30px rgba(0,0,0,.15);}
.zsx-global-search.zsx-collapsible.is-open .zsx-search-panel{display:block;}
.zsx-global-search.zsx-collapsible .zsx-search-wrap{display:block; width:100%;}
.zsx-global-search.zsx-collapsible .zsx-search{width:100% !important; box-sizing:border-box;}
.zsx-global-search.zsx-collapsible .zsx-search-results{max-height:60vh; overflow:auto;}
@media (max-width:768px){
  .zsx-global-search.zsx-collapsible .zsx-search-panel{position:fixed; left:0; right:0; top:var(--zsx-search-panel-top,60px); width:100vw; max-width:100vw; margin-top:0; border-radius:0; border-left:none; border-right:none;}
}

.zsx-loading{display:flex; align-items:center; gap:8px; color:#666; font-size:14px; padding:12px 0;}
.zsx-spinner{width:16px; height:16px; border-radius:50%; border:2px solid #dcdcdc; border-top-color:#1976d2; animation:zsxspin 1s linear infinite;}
@keyframes zsxspin{to{transform:rotate(360deg)}}
.zsx-table-widget{width:100%;}
.zsx-layout{display:flex; gap:16px; align-items:flex-start;}
.zsx-sidebar{flex:0 0 280px; position:sticky; top:80px; align-self:flex-start; max-height:60vh; overflow:auto; padding:12px;}
.zsx-sidebar-header{display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; padding-bottom:10px; border-bottom:2px solid #e5e7eb; gap:8px;}
.zsx-sidebar-title{font-size:16px; font-weight:700; color:#333; flex:0 0 auto;}
.zsx-filter-reset{flex:1 1 auto; padding:6px 12px; border:1px solid #1976d2; background:#1976d2; color:#fff; border-radius:4px; cursor:pointer; font-size:13px; font-weight:600; transition:all 0.2s;}
.zsx-filter-reset:hover{background:#1565c0; border-color:#1565c0;}
.zsx-sidebar-close{width:28px; height:28px; flex:0 0 auto; border:none; background:#f5f5f5; border-radius:50%; cursor:pointer; display:none; font-size:18px; color:#666; transition:background 0.2s;}
.zsx-sidebar-close:hover{background:#e0e0e0;}
.zsx-main{flex:1 1 auto; min-width:0;}
.zsx-main-toolbar{margin:8px 0; display:flex; justify-content:flex-start; align-items:center; gap:8px;}
.zsx-excel-btn{padding:6px 10px; border:1px solid #1976d2; background:#1976d2; color:#fff; border-radius:4px; text-decoration:none;}
.zsx-excel-btn:hover{opacity:.9}
.zsx-filter-toggle{padding:6px 10px; border:1px solid #ddd; background:#fff; border-radius:4px; cursor:pointer;}
.zsx-search-wrap{position:relative; width:320px;}
.zsx-search-wrap .zsx-search{width:100%; padding:8px 32px 8px 10px;}
.zsx-search-wrap .zsx-search-ico{position:absolute; right:8px; top:50%; transform:translateY(-50%); width:16px; height:16px; background:currentColor; -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/></svg>') no-repeat center / contain; mask: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/></svg>') no-repeat center / contain; opacity:.6;}
.zsx-pagination{margin:12px 0; display:flex; align-items:center; gap:8px; justify-content:flex-end; flex-wrap:wrap;}
.zsx-pagination .zsx-page-btn{padding:4px 8px; border:1px solid #ddd; background:#fff; cursor:pointer; border-radius:4px;}
.zsx-pagination .zsx-page-btn.active{background:#1976d2; color:#fff; border-color:#1976d2;}
.zsx-pagination .zsx-page-btn[disabled]{opacity:.5; cursor:not-allowed;}
.zsx-pagination .zsx-page-info{font-size:12px; color:#555; margin:0 8px;}
.zsx-pagination .zsx-page-select{display:flex; align-items:center; gap:6px;}
.zsx-table-toolbar{margin:8px 0; display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
.zsx-table-toolbar .zsx-search{flex:1 1 240px; max-width:480px; padding:6px 8px;}
.zsx-filters{display:block; width:100%; border:1px solid #e5e7eb; padding:4px; border-radius:6px; background:#fafafa;}
.zsx-filter-item{display:block; margin:8px 4px; padding:8px 10px; border:1px solid #e5e7eb; border-radius:6px; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,0.05);}
.zsx-filter-heading{font-size:12px; color:#333; font-weight:600; cursor:pointer; display:flex; align-items:center; gap:6px;}
.zsx-col-toggle{font-size:11px; line-height:1; padding:3px 6px; border-radius:10px; border:1px solid #ddd; background:#f5f5f5; color:#555;}
.zsx-col-toggle.open{background:#e8f5e9; border-color:#c8e6c9; color:#2e7d32;}
.zsx-col-toggle.close{background:#fff3e0; border-color:#ffe0b2; color:#ef6c00;}
.zsx-filter-heading::after{content:"\25BC"; font-size:10px; color:#999; margin-left:auto;}
.zsx-filter-item.open .zsx-filter-heading::after{content:"\25B2";}
.zsx-filter-body{display:none; margin-top:6px;}
.zsx-filter-item.open .zsx-filter-body{display:block;}
.zsx-filter-field input{width:92px;}
.zsx-filter-slider{display:flex; gap:8px; align-items:center; margin-top:6px;}
.zsx-filter-slider input[type=range]{width:140px;}
.zsx-filter-list{max-height:160px; overflow:auto; display:flex; flex-direction:column; gap:4px;}
.zsx-filter-empty{color:#888; font-size:12px;}
.zsx-filter-tools{display:flex; gap:6px; align-items:center; margin-bottom:6px;}
.zsx-filter-search{padding:4px 6px;}
.zsx-filter-bool label{margin-right:8px;}
.zsx-table{width:100%;border-collapse:collapse;}
.zsx-table th,.zsx-table td{border:1px solid #ddd;padding:6px 8px; text-align:center; vertical-align:middle;}
.zsx-table th{text-align:center; background:#f8f9fa; position:sticky; top:0; z-index:20;}
.sticky-col{
    position:sticky; 
    left:0; 
    z-index:5; 
    background:#fff;
    border-right: 2px solid #e5e7eb;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}
.zsx-th-name{
    z-index:25;
    background:#f8f9fa;
    border-right: 2px solid #e5e7eb;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}
.zsx-td-name{
    position: relative;
    background:#fff;
    min-width: 200px;
    padding-right: 30px;
    text-align: center;
}
.zsx-name{display:inline-block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width: 260px;}
.zsx-pdf{position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin-left: 0 !important;}
.zsx-table-container{max-height:60vh; overflow:auto; border:1px solid #eee;}
.zsx-sidebar{height: auto;}
.zsx-table-widget.fullscreen .zsx-layout{align-items:stretch;}
.zsx-table-widget.fullscreen .zsx-sidebar{align-self:stretch;}
.zsx-sortable{cursor:pointer;}
.zsx-sortable.zsx-sort-asc::after{content:" \25B2"; color:#666;}
.zsx-sortable.zsx-sort-desc::after{content:" \25BC"; color:#666;}
.zsx-pdf{display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; margin-left:6px; border-radius:2px; background:#f2f2f2; text-decoration:none;}
.zsx-pdf-ico{fill:#d32f2f; display:block;}

/* 全屏占位模式：在 Elementor 高级 → CSS 类 输入 fullscreen 即可 */
.zsx-table-widget.fullscreen{width:100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);} /* 打破主题容器，横向全宽 */
.zsx-table-widget.fullscreen .zsx-layout{height: calc(100vh - 120px);} /* 120px 预留页头/间距，如需可再调 */
.zsx-table-widget.fullscreen .zsx-table-container{height: 100%; max-height: none;}
.zsx-table-widget.fullscreen .zsx-sidebar{position:sticky; top:80px;}

/* 骨架屏加载占位符 */
.zsx-skeleton-loader{min-height: 600px; padding: 20px 0;}
.zsx-skeleton-layout{display: flex; gap: 16px; align-items: flex-start;}
.zsx-skeleton-sidebar{flex: 0 0 280px;}
.zsx-skeleton-main{flex: 1 1 auto; min-width: 0;}
.zsx-skeleton-toolbar{display: flex; gap: 8px; margin-bottom: 16px;}
.zsx-skeleton-table{border: 1px solid #eee; border-radius: 4px; overflow: hidden;}
.zsx-skeleton-table-header{display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: #f8f9fa; padding: 8px;}
.zsx-skeleton-table-row{display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: #fff; padding: 8px; border-top: 1px solid #eee;}
.zsx-skeleton-filter{margin-bottom: 16px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 4px; background: #fafafa;}
.zsx-skeleton-pagination{margin-top: 16px; display: flex; justify-content: flex-end;}
.zsx-skeleton-message{text-align: center; color: #666; font-size: 14px; margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 10px;}
.zsx-skeleton-message::before{content: ''; display: inline-block; width: 20px; height: 20px; border: 2px solid #dcdcdc; border-top-color: #1976d2; border-radius: 50%; animation: zsxspin 1s linear infinite;}

/* 骨架屏动画线条 */
.zsx-skeleton-line, .zsx-skeleton-box{
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}
@keyframes skeleton-loading{
    0%{background-position: 200% 0;}
    100%{background-position: -200% 0;}
}

/* 加载完成后隐藏骨架屏 */
.zsx-table-widget:not(.zsx-loading-state) .zsx-skeleton-loader{display: none;}
.zsx-table-widget:not(.zsx-loading-state) .zsx-layout{display: flex !important;}

/* 错误消息 */
.zsx-error-message{
    text-align: center;
    padding: 40px 20px;
    color: #d32f2f;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    min-height: 200px;
}
.zsx-error-message span:first-child{font-size: 48px;}

/* 移动端遮罩层 */
.zsx-overlay{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.zsx-overlay.active{
    display: block;
    opacity: 1;
}

/* 响应式：移动端优化 */
@media (max-width: 768px) {
    /* 布局改为垂直堆叠 */
    .zsx-layout{flex-direction: column; gap: 0;}
    
    /* 侧边栏改为抽屉式 */
    .zsx-sidebar{
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        max-height: 100vh;
        background: #fff;
        z-index: 999;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 16px;
    }
    
    /* 侧边栏打开状态 */
    .zsx-sidebar.mobile-open{
        left: 0;
    }
    
    /* 工具栏优化 */
    .zsx-main-toolbar{
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Filters按钮在移动端更醒目 */
    .zsx-filter-toggle{
        order: -1;
        flex: 0 0 auto;
        padding: 8px 16px;
        background: #1976d2;
        color: #fff;
        border-color: #1976d2;
        font-weight: 600;
    }
    
    /* 搜索框在移动端占满宽度 */
    .zsx-search-wrap{
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        order: 1;
    }
    
    /* Excel按钮在移动端 */
    .zsx-excel-btn{
        order: 2;
        flex: 1 1 auto;
        text-align: center;
    }
    
    /* 表格容器在移动端 */
    .zsx-table-container{
        max-height: none;
        overflow-x: auto;
    }
    
    /* 表格在移动端最小宽度 */
    .zsx-table{
        min-width: 600px;
    }
    
    /* 分页在移动端 */
    .zsx-pagination{
        justify-content: center;
        font-size: 12px;
    }
    .zsx-pagination .zsx-page-btn{
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* 筛选器在移动端 */
    .zsx-filters{
        border: none;
        padding: 0;
        background: transparent;
    }
    
    .zsx-filter-item{
        margin: 8px 0;
    }
    
    /* 侧边栏顶部 - 移动端显示关闭按钮 */
    .zsx-sidebar-close{
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    /* 骨架屏在移动端 */
    .zsx-skeleton-layout{flex-direction: column;}
    .zsx-skeleton-sidebar{flex: 1 1 auto; width: 100%;}
    .zsx-skeleton-table-header, .zsx-skeleton-table-row{grid-template-columns: repeat(3, 1fr);}
}

/* 小屏手机进一步优化 */
@media (max-width: 480px) {
    .zsx-sidebar{
        width: 90%;
        max-width: none;
    }
    
    .zsx-table{
        min-width: 500px;
    }
    
    .zsx-pagination .zsx-page-info{
        display: none;
    }
    
    .zsx-filter-toggle{
        font-size: 14px;
    }
}

