/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: #4facfe;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

/* 零件管理按钮 */
.library-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.library-action-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.library-action-btn.edit {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.library-action-btn.delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.library-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 添加零件按钮 */
.add-part-btn {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.add-part-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 233, 123, 0.2);
}

.btn-close {
    background: transparent;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
}

.btn-close:hover {
    background: #f0f0f0;
}

/* 主内容区域 */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 页面样式 */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* 重叠零件信息标题样式 */
.overlap-result .page-header h2 {
    font-size: 1.1rem;
}

/* 零件清单按钮区域样式 */
.overlap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.selected-parts-count {
    font-size: 0.9rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.page-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 首页 - 类别网格 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #4facfe;
}

.category-card i {
    font-size: 3rem;
    color: #4facfe;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* 选项卡容器 */
.tabs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tab-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.tab-btn:hover {
    border-color: #4facfe;
    color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.15);
}

.tab-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: #4facfe;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.2);
}

/* 选中结果区域 */
.selection-result {
    background: #e8f5e8;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0 2rem;
    border: 2px solid #c8e6c9;
}

.selection-result h3 {
    color: #2e7d32;
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.selected-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-tag {
    background: white;
    color: #2e7d32;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid #c8e6c9;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tag .remove-filter {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.filter-tag .remove-filter:hover {
    background: #ee5a24;
    transform: scale(1.1);
}

/* 可折叠面板样式 */
.filters-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.collapse-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.collapse-panel:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.collapse-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.collapse-header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4090 100%);
}

.collapse-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collapse-header i {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.collapse-header.active i {
    transform: rotate(180deg);
}

.collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8f9fa;
}

.collapse-content.active {
    max-height: 500px;
    overflow-y: auto;
}

.filter-options {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
}

.filter-option:hover {
    border-color: #4facfe;
    color: #4facfe;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.15);
}

/* 空状态的部件过滤选项样式 */
.empty-filter {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    text-align: center;
    justify-content: center;
    color: #666;
}

.empty-filter i {
    font-size: 2rem;
    color: #4facfe;
}

.empty-filter p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4facfe;
}

.filter-option.active {
    border-color: #4facfe;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1), rgba(0, 242, 254, 0.1));
    color: #4facfe;
}

/* 重叠零件显示区域 */
.overlap-result {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.overlap-components {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.overlap-component {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow: hidden;
}

/* 零件信息样式 */
.component-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.component-info h3 {
    margin: 0;
    font-size: 1rem;
    color: #2c3e50;
    line-height: 1.2;
}

.component-spec {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

/* 零件表格样式 */
.component-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.component-table td {
    padding: 0.375rem;
    border-bottom: 1px solid #e0e0e0;
}

.component-table td:first-child {
    font-weight: bold;
    color: #333;
}

/* 图片和数量区域 */
.component-image-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* 零件图片样式 */
.component-image {
    flex: 1;
    height: 50px;
    overflow: hidden;
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.component-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 数量控制区域 */
.component-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.overlap-component:hover {
    border-color: #4facfe;
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.15);
    transform: translateY(-3px);
}

/* 重叠零件头部区域 */
.overlap-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

/* 选中状态的零件样式 */
.overlap-component.selected {
    border-color: #43e97b;
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.1), rgba(56, 249, 215, 0.1));
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.2);
    position: relative;
}

.overlap-component.selected::before {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* 重叠零件列表容器 */
.overlap-components-list,
.filtered-components-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 选中零件列表区域 */
.selected-components-list {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1.5rem;
    border: 1px solid #e0e0e0;
}

.selected-components-list h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-components-list h3::before {
    content: '📋';
    font-size: 0.9rem;
}

/* 选中零件项样式 */
.selected-overlap-component {
    background: white;
    border: 1px solid #43e97b;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.selected-overlap-component:hover {
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.2);
    transform: translateY(-2px);
}

.selected-overlap-component h4 {
    color: #2c3e50;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.selected-component-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.4rem;
    font-size: 0.8rem;
}

.info-item {
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.info-item::before {
    content: '•';
    color: #43e97b;
    font-weight: bold;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .overlap-components-list,
    .filtered-components-list {
        grid-template-columns: 1fr;
    }
    
    .selected-component-info {
        grid-template-columns: 1fr;
    }
    
    .overlap-header {
        justify-content: center;
    }
    
    .selection-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .selection-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 导入导出按钮区域样式 */
.selection-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.selection-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.overlap-component h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.overlap-component .component-spec {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.overlap-component .component-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.8rem;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 700;
}

/* 数量控制样式 */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.quantity-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.2);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 60px;
    height: 30px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.quantity-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.overlap-component .component-relations {
    margin-top: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #4facfe;
}

.relations-title {
    font-size: 0.9rem;
    color: #4facfe;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.relations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.relation-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.375rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* 二级页面 - 零部件列表 */
.component-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* 零件库样式 */
.parts-library {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}

.library-container {
    margin-top: 2rem;
}

/* 零件库头部操作区域 */
.library-header-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

/* 设备分类零件的空状态样式 */
.library-container .empty-state {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
    margin-top: 2rem;
}

.library-container .empty-state i {
    font-size: 3rem;
    color: #4facfe;
    margin-bottom: 1rem;
}

.library-container .empty-state h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.library-container .empty-state p {
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

.library-category {
    margin-bottom: 2.5rem;
}

.library-category-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.library-category-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 172, 254, 0.2);
}

.library-category-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.library-category-header i {
    font-size: 1.2rem;
}

.library-category-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.library-part {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.library-part:hover {
    border-color: #4facfe;
    box-shadow: 0 6px 15px rgba(79, 172, 254, 0.15);
    transform: translateY(-3px);
}

.library-part h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.library-part-model {
    color: #4facfe;
    font-weight: 600;
    font-size: 0.9rem;
}

.library-part-spec {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.5;
    flex-grow: 1;
}

.library-part-price {
    color: #e74c3c;
    font-size: 1.1rem;
    font-weight: 700;
}

.library-part-supplier {
    color: #3498db;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.library-part-stock {
    color: #27ae60;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.library-part-image {
    text-align: center;
    margin-bottom: 0.5rem;
}

.library-part-image img {
    max-width: 100px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: white;
    padding: 0.25rem;
}

/* 零件清单页面样式 */
.parts-list-content {
    padding: 1rem;
}

.selected-component-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.selected-component-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background: white;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.component-thumbnail {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.no-image {
    color: #999;
    font-size: 0.6rem;
    text-align: center;
}

.selected-component-info {
    flex-grow: 1;
}

.selected-component-info h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 0.9rem;
}

.selected-component-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    font-size: 0.8rem;
}

/* 数量编辑样式 */
.quantity-edit {
    display: inline-block;
}

.quantity-edit .quantity-input {
    width: 60px;
    padding: 0.125rem 0.25rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8rem;
    text-align: center;
}

.selected-component-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.3;
    border-radius: 0.25rem;
}

/* 添加按钮样式 */
.add-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    background-color: #4facfe;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover {
    background-color: #3e9aff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-btn:active {
    transform: translateY(0);
}

/* 只读数量输入框样式 */
.quantity-input[readonly] {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #495057;
    cursor: not-allowed;
}

/* 数量控制容器样式调整 */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 数量按钮样式 */
.quantity-btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1;
    border-radius: 0.25rem;
    background-color: #4facfe;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #3e9aff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quantity-btn:active {
    transform: translateY(0);
}

/* 数量输入框样式 */
.quantity-input {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .filters-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .overlap-components {
        grid-template-columns: 1fr;
    }
    
    .component-table {
        font-size: 0.85rem;
    }
    
    .component-table td {
        padding: 0.375rem;
    }
    
    .component-image-section {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
    
    .component-image {
        height: 50px;
    }
    
    .component-quantity {
        min-width: 100px;
        justify-content: center;
        margin-top: 0;
    }
    
    .component-info h3 {
        font-size: 1rem;
    }
    
    .library-category-content {
        grid-template-columns: 1fr;
    }
}

.component-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.component-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #38f9d7;
}

.component-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.component-card h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.component-card .component-model {
    color: #4facfe;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.component-card .component-desc {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.component-card .component-price {
    color: #e74c3c;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* 三级页面 - 详情编辑 */
.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
}

.detail-left {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

.image-actions {
    width: 100%;
    text-align: center;
}

.detail-right {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 文件输入容器样式 */
.file-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.file-input-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    transition: all 0.3s ease;
}

.file-input-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.2);
}

.file-input-text {
    color: #666;
    font-size: 0.9rem;
    flex-grow: 1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

/* 选型侧边栏 */
.selection-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.selection-sidebar.open {
    right: 0;
}

.selection-sidebar .sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.selection-sidebar .sidebar-header h3 {
    color: #2c3e50;
    font-size: 1.2rem;
}

.selection-sidebar .sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.selection-sidebar .sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.selected-component {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.selected-component img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    background: white;
}

.selected-component .selected-info {
    flex-grow: 1;
}

.selected-component h4 {
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.selected-component .selected-model {
    color: #4facfe;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.selected-component .selected-price {
    color: #e74c3c;
    font-size: 1rem;
    font-weight: 700;
}

.selected-component .btn-remove {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.selected-component .btn-remove:hover {
    background: #ee5a24;
    transform: scale(1.1);
}

/* 底部信息 */
.footer {
    background: #f8f9fa;
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.selected-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #4facfe;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .component-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .selection-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* 复选框样式 */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-container label {
    margin: 0;
    font-weight: normal;
    color: #666;
}