* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* SVG图标样式 */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    /* 更简洁的淡色背景 */
    background: radial-gradient(circle at top, #ffffff 0, #f5f7fa 55%, #e9edf5 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-text {
    background: transparent;
    color: #667eea;
}

.btn-text:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

/* 主界面布局 */
.main-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    background: white;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    color: #666;
}

.menu-toggle:hover {
    color: #333;
    background-color: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    color: #666;
    font-size: 14px;
}

.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    overflow-y: auto;
    transition: all 0.3s;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.nav-menu {
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    gap: 12px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: #f5f7fa;
    color: #667eea;
}

.nav-item.active {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 500;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-text {
    flex: 1;
}

.nav-sub {
    padding-left: 52px;
    font-size: 14px;
}

/* 导航组 */
.nav-group {
    margin-bottom: 4px;
}

.nav-group-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #555;
    cursor: pointer;
    transition: all 0.3s;
    gap: 12px;
    border-left: 3px solid transparent;
}

.nav-group-header:hover {
    background-color: #f5f7fa;
    color: #667eea;
}

.nav-group-header.active {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-left-color: #667eea;
}

.nav-group-header .nav-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.nav-group-header.active .nav-arrow {
    transform: rotate(90deg);
}

.nav-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.nav-group-content.show {
    max-height: 1000px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background-color: #f5f7fa;
}

.page-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.page-header h2 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-card-primary {
    border-left: 4px solid #667eea;
}

.stat-card-success {
    border-left: 4px solid #27ae60;
}

.stat-card-info {
    border-left: 4px solid #3498db;
}

.stat-card-warning {
    border-left: 4px solid #f39c12;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.stat-card-success .stat-icon {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.stat-card-info .stat-icon {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.stat-card-warning .stat-icon {
    background-color: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-content p {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 表格容器 */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.data-table td {
    color: #666;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background-color: #f5f7fa;
    border-color: #667eea;
}

.pagination button.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 500;
}

.tab-content {
    margin-top: 20px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    color: #333;
    background-color: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* 状态标签 */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved,
.status-passed {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-normal {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-disabled {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-low {
    background-color: #fff3cd;
    color: #856404;
}

/* Dashboard部分 */
.dashboard-section {
    margin-top: 32px;
}

.dashboard-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 16px;
    font-weight: 600;
}

.inventory-overview {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 999;
        transition: left 0.3s;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-input,
    .filter-select {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .table-container {
        overflow-x: scroll;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}
