/* ==========================================================================
   整合的零件管理系统样式表
   包含两个页面的所有样式
   ========================================================================== */

/* CSS变量定义 */
:root {
    --primary-color: #1e5799;
    --secondary-color: #207cca;
    --accent-color: #4a7dff;
    --light-color: #f8fafc;
    --border-color: #e1e5eb;
    --text-color: #333;
    --text-light: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --sidebar-width: 280px;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   文件1的样式开始 - 基础目录
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 20px);
}

/* 顶部导航栏 */
.top-nav {
    background: linear-gradient(to right, #2c3e50, #34495e);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    color: white;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 2px;
}

.logo-text .subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.nav-tabs {
    display: flex;
    gap: 8px;
}

.nav-tab {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.nav-tab:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 主内容区域 */
.main-area {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 侧边栏 - 商品类别树 */
.sidebar {
    width: 280px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    background-color: white;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

/* 文件1的搜索框 */
.search-box {
    position: relative;
    margin-bottom: 10px;
}

.search-box input {
    width: 100%;
    padding: 8px 15px 8px 35px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* 树形分类样式 */
.tree-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.tree-list {
    list-style: none;
}

.tree-item {
    margin-bottom: 5px;
}

.tree-header {
    padding: 10px 12px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.tree-header:hover {
    border-color: #3498db;
    background-color: #f0f8ff;
}

.tree-header.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

.tree-header.active:hover {
    background-color: #2980b9;
}

.tree-toggle {
    width: 16px;
    text-align: center;
}

.tree-toggle i {
    transition: transform 0.2s;
    font-size: 12px;
}

.tree-icon {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.tree-header.active .tree-icon {
    color: white;
}

.tree-content {
    padding-left: 40px;
    margin-top: 5px;
    display: none;
}

.tree-content.expanded {
    display: block;
}

.tree-subitem {
    padding: 8px 10px;
    margin-bottom: 4px;
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-subitem:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.tree-subitem.active {
    background-color: #e3f2fd;
    border-color: #3498db;
    font-weight: 500;
}

.part-count {
    margin-left: auto;
    background-color: #e9ecef;
    color: #495057;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.tree-header.active .part-count {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* 商品格子展示区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #f8f9fa;
}

.content-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.content-subtitle {
    color: #6c757d;
    font-size: 13px;
}

/* 文件1的返回按钮样式 - 基础目录专用 */
.basic-back-button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
    text-decoration: none;
}

.basic-back-button:hover {
    background-color: #2980b9;
}

/* 商品卡片网格 */
.products-grid {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    align-content: start;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.product-image {
    height: 180px;
    background-color: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    width: 100%;
    height: 100%;
}

.image-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.4;
}

.product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #3498db;
    font-size: 14px;
    margin-bottom: 8px;
}

.product-name {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
    flex: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-specs {
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-category {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #6c757d;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.category-badge {
    padding: 2px 8px;
    background-color: #f0f8ff;
    color: #3498db;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

/* 商品详情页 */
.product-detail {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.detail-code {
    font-family: 'Courier New', monospace;
    color: #3498db;
    font-weight: 600;
    font-size: 16px;
}

.detail-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.detail-image-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.detail-image-wrapper {
    width: 100%;
    max-width: 400px;
    cursor: pointer;
    position: relative;
}

.detail-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.detail-image-wrapper:hover .detail-image {
    transform: scale(1.02);
}

.detail-info-section {
    display: flex;
    flex-direction: column;
}

.info-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.info-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid #f8f9fa;
}

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

.info-table td {
    padding: 10px 0;
}

.info-label {
    font-weight: 600;
    color: #333;
    width: 100px;
    padding-right: 15px;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-size: 14px;
}

.specs-box {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-top: 5px;
    border-left: 3px solid #3498db;
}

.specs-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 14px;
}

.specs-content {
    line-height: 1.5;
    color: #333;
    font-size: 13px;
    white-space: pre-line;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.empty-state p {
    font-size: 14px;
    max-width: 500px;
    margin-bottom: 20px;
}

/* 图片放大模态框 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.modal-close {
    position: absolute;
    top: -30px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 3px;
}

.modal-close:hover {
    color: #ff6b6b;
}

/* 图片加载指示器 */
.image-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.image-loading i {
    font-size: 36px;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

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

/* 页脚样式 */
footer {
    padding: 15px 20px;
    text-align: center;
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 12px;
    border-top: 1px solid #dee2e6;
}

/* 文件1的响应式设计 */
@media (max-width: 1200px) {
    .detail-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .main-area {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 250px;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .tree-container {
        max-height: 200px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .nav-tabs {
        flex-direction: column;
        width: 100%;
    }
    
    .top-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ==========================================================================
   文件2的样式开始 - 整机目录
   ========================================================================== */

/* 整机选择面板 - 保持文件2原来的布局 */
.machine-selector {
    padding: 25px;
    overflow-y: auto;
    background-color: white;
    display: block;
    width: 100%;
    flex: 1;
}

.selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.selector-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.selector-stats {
    background-color: var(--light-color);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-light);
}

/* 整机网格 */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.machine-card {
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.machine-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.machine-card.active {
    border-color: var(--primary-color);
}

.machine-icon-section {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.machine-icon {
    font-size: 48px;
    color: white;
    opacity: 0.9;
}

.machine-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.machine-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.machine-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
    flex: 1;
}

.machine-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-light);
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 16px;
}

.stat-label {
    font-size: 12px;
    margin-top: 2px;
}

/* 整机配件目录容器 */
.machine-parts-container {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.machine-parts-container.active {
    display: flex;
}

/* 整机目录控制栏 */
.machine-controls {
    padding: 15px 30px;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.current-machine {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 250px;
}

.current-machine i {
    color: var(--primary-color);
    font-size: 20px;
}

.machine-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.machine-info p {
    font-size: 13px;
    color: var(--text-light);
}

/* 文件2的搜索框样式 - 整机目录专用（放大版本） */
.machine-search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.machine-search-box input {
    width: 100%;
    padding: 14px 25px 14px 50px;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background-color: white;
    color: var(--text-color);
    font-size: 16px;
    height: 50px;
}

.machine-search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 125, 255, 0.15);
}

.machine-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #7b8a9e;
    font-size: 18px;
}

/* 文件2的操作按钮样式 - 整机目录专用 */
.action-button {
    padding: 12px 24px;
    background-color: #e9ecef;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    text-decoration: none;
    border: none;
    height: 50px;
}

.action-button:hover {
    background-color: #dee2e6;
    transform: translateY(-2px);
}

/* 整机目录返回选择按钮 */
.machine-back-button {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    height: 50px;
}

.machine-back-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* 整机目录主内容区 */
.machine-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 整机树形目录 */
.machine-tree-container {
    width: var(--sidebar-width);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px;
    background-color: #fcfdfe;
    transition: width 0.3s;
}

.machine-tree-container.collapsed {
    width: 0;
    padding: 0;
    border-right: none;
    overflow: hidden;
}

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

.machine-tree-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.toggle-machine-tree {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.machine-tree {
    list-style: none;
}

.machine-tree-node {
    margin-bottom: 5px;
}

.machine-tree-item-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.machine-tree-item-header:hover {
    background-color: #f1f5f9;
}

.machine-tree-item-header.active {
    background-color: #e0f2fe;
    color: var(--primary-color);
    font-weight: 600;
}

.machine-tree-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    transition: transform 0.2s;
}

.machine-tree-toggle.collapsed {
    transform: rotate(-90deg);
}

.machine-tree-icon {
    margin-right: 10px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.machine-tree-label {
    flex: 1;
    font-size: 15px;
}

.machine-tree-count {
    background-color: #e2e8f0;
    color: #475569;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.machine-tree-children {
    list-style: none;
    padding-left: 32px;
    margin-top: 5px;
    display: none;
}

.machine-tree-children.expanded {
    display: block;
}

.machine-tree-child-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.machine-tree-child-item:hover {
    background-color: #f1f5f9;
}

.machine-tree-child-item.active {
    background-color: #e0f2fe;
    color: var(--primary-color);
    font-weight: 500;
}

.machine-item-icon {
    margin-right: 10px;
    color: var(--text-light);
    font-size: 12px;
}

.machine-item-label {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 配件卡片展示区 */
.parts-grid-container {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.parts-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.parts-grid-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.parts-grid-subtitle {
    color: var(--text-light);
    font-size: 15px;
}

.parts-count {
    background-color: var(--light-color);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-light);
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* 配件卡片 */
.part-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.part-card.active {
    border: 2px solid var(--primary-color);
}

.part-image-section {
    height: 200px;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.part-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.3s ease;
}

.part-card:hover .part-image {
    transform: scale(1.05);
}

.part-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.part-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.part-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.part-name {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.part-specs {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.part-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: var(--text-light);
}

.part-old-code {
    font-family: 'Courier New', monospace;
}

.part-brand {
    font-weight: 500;
}

/* 配件详情页 */
.part-detail-container {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.part-detail-container.active {
    display: flex;
}

.part-detail-header {
    padding: 20px 30px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.part-detail-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.part-detail-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

.detail-actions {
    display: flex;
    gap: 10px;
}

.detail-action-btn {
    padding: 10px 18px;
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
}

.detail-action-btn:hover {
    background-color: #e9edf2;
}

.detail-action-btn.primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.detail-action-btn.primary:hover {
    background-color: var(--secondary-color);
}

.part-detail-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* 文件2的详情图片样式 */
.detail-image-section.file2 {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.detail-image-wrapper.file2 {
    width: 100%;
    max-width: 450px;
    cursor: pointer;
    position: relative;
}

.detail-image.file2 {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.detail-image-wrapper.file2:hover .detail-image.file2 {
    transform: scale(1.02);
}

.zoom-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.detail-image-wrapper.file2:hover .zoom-hint {
    opacity: 1;
}

/* 文件2的信息卡片样式 */
.info-card.file2 {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
}

.info-card.file2 h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.info-table.file2 {
    width: 100%;
    border-collapse: collapse;
}

.info-table.file2 tr {
    border-bottom: 1px solid #f8f9fa;
}

.info-table.file2 tr:last-child {
    border-bottom: none;
}

.info-table.file2 td {
    padding: 12px 0;
}

.info-label.file2 {
    font-weight: 600;
    color: var(--text-color);
    width: 120px;
    padding-right: 15px;
    font-size: 15px;
}

.info-value.file2 {
    color: var(--text-color);
    font-size: 15px;
}

.code-highlight {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.specs-content.file2 {
    line-height: 1.7;
    color: var(--text-color);
    font-size: 15px;
    white-space: pre-line;
}

/* 导航按钮 */
.part-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.nav-btn {
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 文件2的图片加载指示器 */
.image-loading.file2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    width: 100%;
    height: 100%;
}

.image-loading.file2 i {
    font-size: 36px;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

/* 文件2的图片放大模态框 */
.image-modal.file2 {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-modal.file2.active {
    display: flex;
}

.modal-content.file2 {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image.file2 {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
    transition: transform 0.3s;
}

.modal-close.file2 {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.modal-close.file2:hover {
    color: #ff6b6b;
}

.modal-zoom-controls {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.zoom-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.zoom-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.modal-download {
    position: absolute;
    bottom: -50px;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-download:hover {
    background-color: var(--secondary-color);
}

/* 文件2的加载指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* 文件2的页脚样式 */
footer {
    padding: 20px 30px;
    text-align: center;
    background-color: var(--light-color);
    color: var(--text-light);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
}

/* 文件2的响应式设计 */
@media (max-width: 1200px) {
    .part-detail-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .machine-grid, .parts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .machine-main-content {
        flex-direction: column;
    }
    
    .machine-tree-container {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 300px;
    }
    
    .machine-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .current-machine, .machine-search-box {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .machine-grid, .parts-grid {
        grid-template-columns: 1fr;
    }
    
    .part-detail-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .detail-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .part-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .selector-header, .parts-grid-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}