/* 苹果安全库存管理系统 - 安全库存管理页面样式 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    overflow-x: hidden;
}

/* 加载动画 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.apple-logo {
    font-size: 48px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-text {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 500;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 主应用容器 */
.app-container {
    min-height: 100vh;
    background: #f5f5f7;
}

/* 顶部导航栏 */
.top-navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-button,
.dashboard-button {
    background: none;
    border: none;
    color: #007aff;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.back-button:hover,
.dashboard-button:hover {
    background: rgba(0, 122, 255, 0.1);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
}

.nav-right {
    display: flex;
    gap: 12px;
}

.refresh-button,
.export-button {
    background: #007aff;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.refresh-button:hover,
.export-button:hover {
    background: #0056cc;
    transform: translateY(-1px);
}

/* 主要内容区域 */
.main-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 数据可视化区域 */
.visualization-section {
    margin-bottom: 32px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.chart-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
}

.chart-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.chart-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #86868b;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-color.safe { background: #00ff00; } /* 纯绿色 */
.legend-color.warning { background: #ffff00; } /* 黄色 */
.legend-color.danger { background: #ff0000; } /* 红色 */
.legend-color.critical { background: #000000; } /* 黑色 */



/* 图表画布样式 */
.chart-container canvas {
    flex: 1;
    max-height: 200px;
    width: 100% !important;
    height: 100% !important;
}

.chart-container {
    min-height: 320px; /* 为图例和统计信息预留空间 */
}

.chart-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
    padding: 8px 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.stat-label {
    color: #86868b;
    font-weight: 500;
}

.stat-value {
    color: #1d1d1f;
    font-weight: 600;
    background: rgba(0, 122, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 30px;
    text-align: center;
}

/* 筛选区域 */
.filter-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
}

.filter-select,
.range-input {
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
}

.filter-select:focus,
.range-input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-separator {
    color: #86868b;
    font-weight: 500;
}

.filter-actions {
    display: flex;
    gap: 12px;
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.filter-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.filter-button.primary {
    background: #007aff;
    color: white;
}

.filter-button.primary:hover {
    background: #0056cc;
}

.filter-button.secondary {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.filter-button.secondary:hover {
    background: #e5e5e7;
}

/* 表格区域 */
.table-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-header {
    padding: 24px;
    border-bottom: 1px solid #f2f2f2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.stock-level-legend {
    display: flex;
    gap: 16px;
    align-items: center;
}

.stock-level-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1d1d1f;
}

.stock-level-legend .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.stock-level-legend .legend-color.safe {
    background: #00ff00; /* 纯绿色 */
}

.stock-level-legend .legend-color.warning {
    background: #ffff00; /* 黄色 */
}

.stock-level-legend .legend-color.danger {
    background: #ff0000; /* 红色 */
}

.stock-level-legend .legend-color.critical {
    background: #000000; /* 黑色 */
}

.table-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.record-count {
    font-size: 14px;
    color: #86868b;
}



/* 数据表格 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed; /* 启用固定表格布局以支持列宽调整 */
}

.data-table th {
    background: #f8f8f8;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #1d1d1f;
    border-bottom: 1px solid #e5e5e7;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.data-table th.sortable:hover {
    background: #f0f0f0;
}

.filter-icon {
    margin-left: 6px;
    color: #86868b;
    transition: color 0.2s;
    cursor: pointer;
}

.data-table th.sortable:hover .filter-icon {
    color: #007aff;
}

.filter-icon:hover {
    color: #007aff;
    transform: scale(1.1);
}

/* 列宽调整手柄样式 */
.data-table th {
    position: relative;
}

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    font-size: 12px;
    transition: all 0.2s;
    z-index: 20;
}

.resize-handle:hover {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.resize-handle:active {
    background: rgba(0, 122, 255, 0.2);
    color: #007aff;
}

/* 调整时的全局样式 */
body.resizing {
    cursor: col-resize !important;
    user-select: none;
}

.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f2f2f2;
    vertical-align: middle;
}

/* 代理商名称样式 */
.data-table td:nth-child(3) {
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 省份样式 */
.data-table td:nth-child(4) {
    font-size: 12px;
    font-weight: 400;
    color: #6e6e73;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 通用表格字体调整 */
.data-table td {
    font-size: 13px;
    line-height: 1.4;
}

/* 特定列字体调整 */
.data-table td:nth-child(1) { /* MPN */
    font-size: 12px;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.data-table td:nth-child(2) { /* 状态 */
    font-size: 11px;
}

.data-table td:nth-child(5) { /* 平均销量 */
    font-size: 12px;
    font-weight: 500;
}

.data-table td:nth-child(6) { /* 库存 */
    font-size: 12px;
    font-weight: 500;
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background: #f8f8f8;
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-indicator.presale {
    background: #e3f2fd;
    color: #1976d2;
}

.status-indicator.onsale {
    background: #e8f5e8;
    color: #388e3c;
}

.status-indicator.stop {
    background: #fff3e0;
    color: #f57c00;
}

.status-indicator.clear {
    background: #fce4ec;
    color: #c2185b;
}

/* 库存等级指示器 */
.stock-level-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stock-level-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.stock-level-dot.safe { background: #00ff00; } /* 纯绿色 */
.stock-level-dot.warning { background: #ffff00; } /* 黄色 */
.stock-level-dot.danger { background: #ff0000; } /* 红色 */
.stock-level-dot.critical { background: #000000; } /* 黑色 */

/* 颜色图例样式 */
.color-legend {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legend-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
    text-align: center;
}

.legend-items {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.safe { background: #00ff00; } /* 纯绿色 */
.legend-dot.warning { background: #ffff00; } /* 黄色 */
.legend-dot.danger { background: #ff0000; } /* 红色 */
.legend-dot.critical { background: #000000; } /* 黑色 */

.legend-text {
    font-size: 13px;
    color: #6e6e73;
    font-weight: 500;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-email {
    background: #007aff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-email:hover {
    background: #0056cc;
}

.btn-email.resend {
    background: #ff9500;
}

.btn-email.resend:hover {
    background: #e6850e;
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-top: 1px solid #f2f2f2;
}

.pagination-button {
    background: white;
    border: 1px solid #d2d2d7;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-button:hover:not(:disabled) {
    background: #f5f5f7;
    border-color: #007aff;
}

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

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.page-number:hover {
    background: #f5f5f7;
    border-color: #007aff;
}

.page-number.active {
    background: #007aff;
    color: white;
    border-color: #007aff;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

/* 列筛选模态框样式 */
.column-filter-modal .modal-content {
    max-width: 600px; /* 增加宽度 */
    max-height: 75vh; /* 增加高度 */
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 8px;
}

.filter-section.compact {
    margin-bottom: 12px;
    padding: 10px;
}

.filter-section h4 {
    margin: 0 0 12px 0;
    color: #1d1d1f;
    font-size: 15px;
    font-weight: 600;
}

.filter-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-header h4 {
    margin: 0;
    font-size: 14px;
}

.filter-mode {
    display: flex;
    gap: 16px;
    align-items: center;
}

.filter-mode-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #1d1d1f;
}

.filter-mode-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.filter-mode-option span {
    cursor: pointer;
}

.filter-controls {
    display: flex;
    gap: 4px;
}

.search-box {
    margin-bottom: 12px;
}

.search-box input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 13px;
}

.category-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-control {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-control:hover {
    background: #e5e5e7;
    border-color: #007aff;
}

.btn-control:active {
    background: #d2d2d7;
}

.category-list {
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid #e5e5e7;
    border-radius: 6px;
    background: white;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #f2f2f2;
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-item:last-child {
    border-bottom: none;
}

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

.category-item input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.range-input label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #1d1d1f;
}

.range-input input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 13px;
}

.range-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6e6e73;
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #e5e5e7;
}

.range-info.compact {
    font-size: 11px;
    padding: 4px 8px;
    background: #f5f5f7;
    border: none;
}

.sort-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sort-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.sort-option:hover {
    background: #f5f5f7;
}

.sort-option input[type="radio"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e5e5e7;
    background: #f8f8f8;
}

.btn-secondary {
    background: #6e6e73;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: #5a5a5e;
}

.btn-primary {
    background: #007aff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #0056cc;
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid #f2f2f2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.btn-compact {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-compact.btn-secondary {
    background: #6e6e73;
    color: white;
}

.btn-compact.btn-secondary:hover {
    background: #5a5a5e;
}

.btn-compact.btn-primary {
    background: #007aff;
    color: white;
}

.btn-compact.btn-primary:hover {
    background: #0056cc;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #86868b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

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

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #f2f2f2;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-button.primary {
    background: #007aff;
    color: white;
}

.modal-button.primary:hover {
    background: #0056cc;
}

.modal-button.secondary {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.modal-button.secondary:hover {
    background: #e5e5e7;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1d1d1f;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

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

/* 提示消息 */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background: #34c759;
}

.toast.error {
    background: #ff3b30;
}

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

/* 响应式设计 */
@media (max-width: 1400px) {
    .chart-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-container {
        height: 350px;
    }
}

@media (max-width: 1200px) {
    .chart-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-container {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
    
    .top-navbar {
        padding: 12px 16px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chart-container {
        height: 300px;
        padding: 16px;
    }
    
    .filter-container {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-actions {
        justify-content: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .nav-left {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .back-button span,
    .dashboard-button span {
        display: none;
    }
    
    .refresh-button span,
    .export-button span {
        display: none;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .filter-section {
        padding: 16px;
    }
    
    .table-header {
        padding: 16px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
} 

/* 筛选条件标签样式 */
.applied-filters {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e5e5e7;
}

.applied-filters h4 {
    margin: 0 0 12px 0;
    color: #1d1d1f;
    font-size: 16px;
    font-weight: 600;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #007aff;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag:hover {
    background: #0056cc;
    transform: translateY(-1px);
}

.filter-tag .remove-tag {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background-color 0.2s;
}

.filter-tag .remove-tag:hover {
    background: rgba(255, 255, 255, 0.3);
}

.clear-all-filters {
    background: #ff3b30;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.clear-all-filters:hover {
    background: #d70015;
    transform: translateY(-1px);
}



/* 筛选条件区域显示/隐藏 */
.filter-section {
    transition: all 0.3s ease;
}

.filter-section.hidden {
    display: none;
}

.filter-section.visible {
    display: block;
} 

/* ===== Enhanced styles for column filter modal (inventory) ===== */
.column-filter-modal .modal-content {
    padding: 0;
    border: 1px solid #e5e5e7;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22), 0 8px 16px rgba(0, 0, 0, 0.12);
    max-width: 600px; /* 增加宽度 */
    width: 90%;
}

.column-filter-modal .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid #e5e5e7;
    padding: 14px 16px;
}

.column-filter-modal .modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.column-filter-modal .header-actions {
    gap: 10px;
}

.column-filter-modal .btn-compact {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 18px;
}

.column-filter-modal .btn-compact.btn-primary {
    box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset;
}

.column-filter-modal .btn-compact.btn-secondary {
    box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
}

.column-filter-modal .modal-body {
    padding: 12px 16px 16px;
}

/* Section blocks */
.column-filter-modal .filter-section {
    background: #fafafa;
    border-radius: 10px;
    padding: 16px; /* 增加内边距 */
    border: 1px solid #efeff0;
    margin-bottom: 16px; /* 增加底部间距 */
}

.column-filter-modal .filter-section.compact {
    padding: 14px; /* 增加紧凑模式的内边距 */
}

.column-filter-modal .filter-header {
    gap: 12px; /* 增加间距 */
    margin-bottom: 16px; /* 增加底部间距 */
}

.column-filter-modal .filter-mode-option span {
    font-size: 13px;
    color: #1d1d1f;
}

/* Controls row - 与 sales 保持一致 */
.column-filter-modal .filter-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.column-filter-modal .btn-control {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.column-filter-modal .btn-control:hover {
    background: #e9ecef;
    color: #007aff;
    border-color: #007aff;
    transform: translateY(-1px);
}

.column-filter-modal .btn-control:active {
    background: #d2d2d7;
}

/* Search box */
.column-filter-modal .search-box {
    margin-bottom: 16px; /* 增加底部间距 */
}

.column-filter-modal .search-box input {
    padding: 8px 12px;
    border-radius: 8px; /* 与 sales 保持一致 */
    border: 1px solid #dee2e6; /* 与 sales 保持一致 */
    background: #fff;
    transition: all 0.2s ease;
    font-size: 13px;
}

.column-filter-modal .search-box input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

/* Category list - 与 sales 保持一致 */
.column-filter-modal .category-list {
    max-height: 250px; /* 增加高度 */
    overflow-y: auto;
    border-radius: 8px; /* 与 sales 保持一致 */
    border: 1px solid #dee2e6; /* 与 sales 保持一致 */
    background: #f8f9fa; /* 与 sales 保持一致 */
    padding: 8px; /* 与 sales 保持一致 */
}

.column-filter-modal .category-item {
    border-bottom: 1px solid #e9ecef; /* 与 sales 保持一致 */
    padding: 8px 12px; /* 与 sales 保持一致 */
    border-radius: 6px; /* 与 sales 保持一致 */
    background: white; /* 与 sales 保持一致 */
    border: 1px solid #e9ecef; /* 与 sales 保持一致 */
    margin-bottom: 8px; /* 添加底部间距 */
    transition: all 0.2s ease; /* 与 sales 保持一致 */
}

.column-filter-modal .category-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.column-filter-modal .category-item:hover {
    background: rgba(0, 122, 255, 0.05); /* 与 sales 保持一致 */
    border-color: #007aff; /* 与 sales 保持一致 */
}

.column-filter-modal .category-item input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

/* Range inputs */
.column-filter-modal .range-inputs {
    gap: 16px; /* 增加间距 */
    margin-bottom: 16px; /* 增加底部间距 */
}

.column-filter-modal .range-input label {
    margin-bottom: 8px; /* 增加底部间距 */
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
}

.column-filter-modal .range-input input {
    border-radius: 8px; /* 与 sales 保持一致 */
    border: 1px solid #dee2e6; /* 与 sales 保持一致 */
    padding: 8px 12px; /* 与 sales 保持一致 */
    transition: all 0.2s ease; /* 与 sales 保持一致 */
    font-size: 13px;
}

.column-filter-modal .range-input input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

/* Range info chip */
.column-filter-modal .range-info.compact {
    border-radius: 8px; /* 与 sales 保持一致 */
    background: #f8f9fa; /* 与 sales 保持一致 */
    border: 1px solid #dee2e6; /* 与 sales 保持一致 */
    padding: 8px 12px; /* 与 sales 保持一致 */
}

/* Sort options */
.column-filter-modal .sort-options {
    gap: 8px; /* 增加间距 */
}

.column-filter-modal .sort-option {
    padding: 8px 12px; /* 与 sales 保持一致 */
    border-radius: 6px; /* 与 sales 保持一致 */
    background: white; /* 与 sales 保持一致 */
    border: 1px solid #e9ecef; /* 与 sales 保持一致 */
    transition: all 0.2s ease; /* 与 sales 保持一致 */
}

.column-filter-modal .sort-option:hover {
    background: rgba(0, 122, 255, 0.05); /* 与 sales 保持一致 */
    border-color: #007aff; /* 与 sales 保持一致 */
}

.column-filter-modal .sort-option input[type="radio"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

/* Scrollbar (webkit) */
.column-filter-modal .category-list::-webkit-scrollbar {
    width: 8px;
}
.column-filter-modal .category-list::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.column-filter-modal .category-list::-webkit-scrollbar-track {
    background: transparent;
}
/* ===== End enhanced styles ===== */

/* ===== New layout styles for filter modal ===== */
.filter-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    height: 100%;
}

.filter-left {
    display: flex;
    flex-direction: column;
}

.filter-right {
    display: flex;
    flex-direction: column;
}

.sorting-section {
    height: fit-content;
}

.sort-options-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sort-option-simple {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.sort-option-simple:hover {
    background: rgba(0, 122, 255, 0.05);
    border-color: #007aff;
}

.sort-option-simple input[type="radio"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.sort-option-simple span {
    font-size: 13px;
    color: #1d1d1f;
    font-weight: 500;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .filter-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filter-right {
        order: -1; /* 在移动端，排序选项显示在上方 */
    }
}

/* 调整弹窗高度以适应新布局 */
.column-filter-modal .modal-content {
    max-height: 80vh; /* 增加高度以适应新布局 */
}

.column-filter-modal .category-list {
    max-height: 200px; /* 调整分类列表高度 */
}

.column-filter-modal .filter-section {
    margin-bottom: 0; /* 移除底部间距，因为现在使用 grid 布局 */
}
/* ===== End new layout styles ===== */ 