/* ===== CSS 变量和重置 ===== */
:root {
    /* 颜色系统 */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --secondary-dark: #475569;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --dark: #1e293b;
    --dark-light: #334155;
    --light: #f8fafc;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 布局尺寸 */
    --sidebar-width: 260px;
    --top-nav-height: 70px;
    --border-radius: 12px;
    
    /* 视觉效果 */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    
    /* 响应式断点 */
    --breakpoint-mobile: 480px;
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 1024px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
    font-size: 14px;
}

/* ===== 布局组件 ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-light) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header p {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 400;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary);
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-left-color: var(--primary);
    box-shadow: inset 0 0 20px rgba(37, 99, 235, 0.1);
}

.nav-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.top-nav {
    background: white;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--top-nav-height);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--border-light);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--border-light);
    border-radius: var(--border-radius);
    font-weight: 500;
}

.user-info i {
    color: var(--primary);
}

.user-role {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-actions a {
    padding: 8px 16px;
    background: var(--border-light);
    color: var(--secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-actions a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.user-actions a.active {
    background: var(--primary);
    color: white;
}

/* 主要内容 */
.content {
    padding: 24px;
    flex: 1;
}

/* ===== 通用组件 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    gap: 8px;
    text-align: center;
    line-height: 1;
    color: white;
    background: var(--primary);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn:active {
    transform: translateY(0);
}

/* 按钮变体 - 修复版 */
.btn-primary { 
    background: var(--primary); 
}
.btn-primary:hover { 
    background: var(--primary-dark); 
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-success { 
    background: var(--success); 
}
.btn-success:hover { 
    background: var(--success-dark); 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-warning { 
    background: var(--warning); 
}
.btn-warning:hover { 
    background: var(--warning-dark); 
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-danger { 
    background: var(--danger); 
}
.btn-danger:hover { 
    background: var(--danger-dark); 
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-secondary { 
    background: var(--secondary); 
}
.btn-secondary:hover { 
    background: var(--secondary-dark); 
}

.btn-info { 
    background: #06b6d4; 
}
.btn-info:hover { 
    background: #0891b2; 
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.btn-purple { 
    background: #8b5cf6; 
}
.btn-purple:hover { 
    background: #7c3aed; 
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-green { 
    background: #70AD47; 
}
.btn-green:hover { 
    background: #5d8a37; 
    box-shadow: 0 4px 12px rgba(112, 173, 71, 0.4);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.stat-card.total::before { background: var(--primary); }
.stat-card.out-of-stock::before { background: var(--danger); }
.stat-card.low-stock::before { background: var(--warning); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.stat-card.total .number { color: var(--primary); }
.stat-card.out-of-stock .number { color: var(--danger); }
.stat-card.low-stock .number { color: var(--warning); }

.stat-description {
    font-size: 0.75rem;
    color: var(--secondary);
    margin-top: 8px;
    opacity: 0.8;
}

/* 状态标签 */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    text-align: center;
    min-width: 80px;
}

.status-normal {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-low {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-out {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* 类型标签 */
.type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.type-toner {
    background: #dbeafe;
    color: #1e40af;
}

.type-drum {
    background: #fce7f3;
    color: #be185d;
}

/* ===== 页面特定组件 ===== */
/* 页面头部 */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.75rem;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.page-header p {
    color: var(--secondary);
    font-size: 1rem;
}

/* 快捷操作 */
.quick-actions {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.quick-actions h2 {
    margin-bottom: 20px;
    color: var(--dark);
    font-size: 1.25rem;
    font-weight: 600;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

/* 库存区域 */
.inventory-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    color: var(--dark);
    font-size: 1.25rem;
    font-weight: 600;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.total-count {
    font-size: 0.875rem;
    color: var(--secondary);
    background: white;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--border-light);
    font-weight: 600;
    color: var(--secondary-dark);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table tr:hover {
    background: var(--border-light);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 供应信息 */
.supply-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supply-info i {
    color: var(--primary);
}

.stock-quantity {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.stock-quantity.status-normal {
    background: #dcfce7;
    color: #166534;
}

.stock-quantity.status-low {
    background: #fef3c7;
    color: #92400e;
}

.stock-quantity.status-out {
    background: #fee2e2;
    color: #991b1b;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 1.25rem;
}

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

.empty-state-cell {
    text-align: center;
    padding: 40px 20px;
    color: var(--secondary);
}

.empty-state-cell i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-cell strong {
    display: block;
    color: var(--dark);
    margin-bottom: 4px;
}

.empty-state-cell a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.empty-state-cell a:hover {
    text-decoration: underline;
}

/* ===== 工具类 ===== */
.text-muted {
    color: var(--secondary);
    font-style: italic;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    }
    
    .main-content {
        margin-left: 0;
        transition: margin-left 0.3s ease;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* 添加遮罩层 */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .sidebar.active::before {
        opacity: 1;
        pointer-events: auto;
    }
}

/* 确保在宽屏时侧边栏正常显示 */
@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0) !important;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .mobile-menu-btn {
        display: none !important;
    }
    
    /* 确保宽屏时没有遮罩层 */
    .sidebar::before {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .number {
        font-size: 2rem;
    }
    
    /* 修改：让快捷操作按钮在平板和手机端每行显示2个 */
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .top-nav {
        padding: 0 16px;
    }
    
    .user-info {
        display: none;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }
    
    .quick-actions {
        padding: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .content {
        padding: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .number {
        font-size: 1.75rem;
    }
    
    .section-header {
        padding: 16px 20px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 6px;
        font-size: 0.75rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
        min-width: 70px;
    }
    
    /* 在非常小的屏幕上保持每行2个按钮，但调整间距 */
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    /* 如果按钮内容太长，可以调整按钮内边距 */
    .action-buttons .btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* ===== 辅助功能 ===== */
/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--border-light);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-dark);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card, .quick-actions, .inventory-section {
    animation: fadeIn 0.5s ease-out;
}

/* 打印样式 */
@media print {
    .sidebar, .top-nav, .quick-actions {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content {
        padding: 0;
    }
    
    .inventory-section {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* 表格移动端卡片式布局 - 优化状态显示 */
@media (max-width: 768px) {
    /* 其他样式保持不变... */
    
    /* 状态单元格优化 - 只显示颜色图标 */
    .data-table td:nth-child(7) {
        width: 50px; /* 固定宽度 */
        min-width: 50px;
        text-align: center;
        padding: 8px 4px;
    }
    
    .data-table td:nth-child(7)::before {
        content: "状态";
        display: block;
        font-weight: 600;
        color: var(--secondary);
        font-size: 0.75rem;
        margin-bottom: 4px;
        text-align: center;
    }
    
    /* 状态徽章优化 - 只显示图标 */
    .status-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 0; /* 隐藏文字 */
        padding: 0;
        border: 2px solid transparent;
    }
    
    .status-badge i {
        font-size: 1rem; /* 图标大小 */
        margin: 0;
    }
    
    /* 不同状态的颜色 */
    .status-normal {
        background: #dcfce7;
        color: #166534;
        border-color: #bbf7d0;
    }
    
    .status-low {
        background: #fef3c7;
        color: #92400e;
        border-color: #fde68a;
    }
    
    .status-out {
        background: #fee2e2;
        color: #991b1b;
        border-color: #fecaca;
    }
    
    /* 为状态图标添加悬停提示 */
    .status-badge {
        position: relative;
        cursor: help;
    }
    
    .status-badge::after {
        content: attr(data-status);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.75rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
        z-index: 10;
    }
    
    .status-badge:hover::after {
        opacity: 1;
    }
    
    /* 移动端触摸提示 */
    @media (hover: none) {
        .status-badge:active::after {
            opacity: 1;
        }
    }
}

/* 在更小的屏幕上调整布局 */
@media (max-width: 480px) {
    .data-table td:nth-child(7) {
        width: 45px;
        min-width: 45px;
    }
    
    .status-badge {
        width: 28px;
        height: 28px;
    }
    
    .status-badge i {
        font-size: 0.9rem;
    }
}

/* 统计卡片在移动端垂直布局 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .number {
        font-size: 1.8rem;
    }
}

/* 快捷操作按钮优化 */
@media (max-width: 768px) {
    .quick-actions {
        padding: 16px;
    }
    
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .action-buttons .btn {
        padding: 12px 8px;
        font-size: 0.8rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        min-height: 70px;
        text-align: center;
        line-height: 1.3;
    }
    
    .action-buttons .btn i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .action-buttons .btn {
        min-height: 60px;
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px 16px;
    }
    
    .action-buttons .btn i {
        margin-bottom: 0;
        margin-right: 8px;
    }
}

/* 筛选器移动端优化 */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }
    
    .filter-label {
        text-align: center;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .filter-select {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    .filter-badge {
        align-self: center;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* 顶部导航用户信息优化 */
@media (max-width: 768px) {
    .user-info span:not(.user-role) {
        display: none;
    }
    
    .user-actions a span {
        display: none;
    }
    
    .user-actions a {
        padding: 8px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .user-actions a i {
        margin: 0;
    }
}

/* 页面标题优化 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
}

/* 侧边栏移动端优化 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    /* 添加遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar.active + .sidebar-overlay {
        display: block;
    }
}

/* 确保在宽屏时侧边栏正常显示 */
@media (min-width: 1025px) {
    .sidebar {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .mobile-menu-btn {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

/* 非常小的屏幕优化 */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .content {
        padding: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .number {
        font-size: 1.75rem;
    }
    
    .section-header {
        padding: 16px 20px;
    }
    
    .data-table td {
        padding: 10px 6px;
        font-size: 0.75rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
        min-width: 70px;
    }
    
    /* 在非常小的屏幕上保持每行2个按钮，但调整间距 */
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    /* 如果按钮内容太长，可以调整按钮内边距 */
    .action-buttons .btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}
@media (max-width: 768px) {
    /* 隐藏采购类型、预警值和状态列 */
    .data-table th:nth-child(4),
    .data-table td:nth-child(4), /* 采购类型列 */
    .data-table th:nth-child(6), 
    .data-table td:nth-child(6), /* 预警值列 */
    .data-table th:nth-child(7),
    .data-table td:nth-child(7)  /* 状态列 */
    {
        display: none;
    }
    
    /* 调整表格列宽，让剩余列有更好的显示 */
    .data-table th:nth-child(1), /* 耗材名称 */
    .data-table td:nth-child(1) {
        min-width: 120px;
        max-width: 150px;
    }
    
    .data-table th:nth-child(2), /* 适用打印机型号 */
    .data-table td:nth-child(2) {
        min-width: 140px;
        max-width: 180px;
    }
    
    .data-table th:nth-child(3), /* 类型 */
    .data-table td:nth-child(3) {
        width: 80px;
    }
    
    .data-table th:nth-child(5), /* 当前库存 */
    .data-table td:nth-child(5) {
        width: 80px;
    }
    
    /* 调整空状态单元格的colspan */
    .empty-state-cell {
        text-align: center;
    }
    
    /* 确保空状态单元格正确跨越所有可见列 */
    .empty-state-cell[colspan] {
        /* 现在只有4列可见，所以colspan应该是4 */
    }
}

@media (max-width: 480px) {
    /* 在更小的屏幕上进一步调整 */
    .data-table th:nth-child(1),
    .data-table td:nth-child(1) {
        min-width: 100px;
        max-width: 130px;
    }
    
    .data-table th:nth-child(2),
    .data-table td:nth-child(2) {
        min-width: 120px;
        max-width: 150px;
    }
    
    /* 简化打印机型号显示 */
    .printer-models-list {
        max-width: 120px;
    }
    
    .printer-model-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 2px 0;
    }
    
    .usage-count {
        font-size: 0.7rem;
        padding: 1px 4px;
        margin-left: 0;
    }
}
/* ===== 移动端库存表格优化 - 耗材类型和库存数量同行显示 ===== */
@media (max-width: 768px) {
    /* 在移动端将类型和库存放在同一行 */
    .inventory-section .data-table tr {
        display: flex;
        flex-wrap: wrap;
        padding: 12px 8px;
        border-bottom: 1px solid var(--border);
        align-items: flex-start;
    }
    
    .inventory-section .data-table td {
        border: none;
        padding: 4px 6px;
    }
    
    /* 耗材名称 - 占整行 */
    .inventory-section .data-table td:nth-child(1) {
        width: 100%;
        order: 1;
        padding-bottom: 8px;
    }
    
    /* 适用打印机型号 - 占整行 */
    .inventory-section .data-table td:nth-child(2) {
        width: 100%;
        order: 2;
        padding-bottom: 8px;
    }
    
    /* 类型和库存放在同一行 */
    .inventory-section .data-table td:nth-child(3),
    .inventory-section .data-table td:nth-child(5) {
        width: 50%;
        order: 3;
        text-align: center;
        padding: 4px 8px;
    }
    
    /* 类型列右边界 */
    .inventory-section .data-table td:nth-child(3) {
        border-right: 1px solid var(--border-light);
    }
    
    /* 隐藏表头 */
    .inventory-section .data-table thead {
        display: none;
    }
    
    /* 调整类型和库存的显示样式 */
    .inventory-section .type-badge,
    .inventory-section .stock-quantity {
        display: block;
        margin: 0 auto;
        text-align: center;
        width: fit-content;
        min-width: 60px;
    }
    
    /* 调整类型标签大小 */
    .inventory-section .type-badge {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    /* 调整库存数量样式 */
    .inventory-section .stock-quantity {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    /* 空状态行适配 */
    .inventory-section .empty-state-cell {
        display: block;
        width: 100%;
        order: 1;
    }
}

/* 针对小屏幕的进一步优化 */
@media (max-width: 480px) {
    .inventory-section .data-table tr {
        padding: 10px 6px;
    }
    
    .inventory-section .data-table td:nth-child(3),
    .inventory-section .data-table td:nth-child(5) {
        padding: 4px 6px;
    }
    
    .inventory-section .type-badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    .inventory-section .stock-quantity {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
}