/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #1E80FF 0%, #0066FF 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 导航标签 */
.tabs {
    display: flex;
    gap: 8px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.tab:hover {
    background: #f5f7fa;
    color: #1E80FF;
}

.tab.active {
    background: #1E80FF;
    color: white;
}

.tab svg {
    flex-shrink: 0;
}

/* 内容面板 */
.content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-height: 500px;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 搜索区域 */
.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #1E80FF;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.primary {
    background: #1E80FF;
    color: white;
}

.btn.primary:hover {
    background: #0066FF;
}

.filter-options {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f5f7fa;
    border-radius: 8px;
}

.filter-options label {
    font-size: 14px;
    color: #666;
}

.filter-options select {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* 搜索结果 */
.results-container {
    min-height: 300px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #999;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.result-item {
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: #1E80FF;
    box-shadow: 0 4px 12px rgba(30, 128, 255, 0.15);
}

.result-item .code {
    font-size: 16px;
    font-weight: 600;
    color: #1E80FF;
    margin-bottom: 4px;
}

.result-item .name {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.result-item .spec {
    font-size: 13px;
    color: #999;
}

/* BOM结构 */
.bom-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f5f7fa;
    border-radius: 8px;
}

.bom-selector select {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.bom-tree {
    min-height: 400px;
}

.bom-node {
    padding: 12px 16px;
    border-left: 3px solid #1E80FF;
    background: #f5f7fa;
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
    margin-left: 20px;
}

.bom-node.child {
    border-left-color: #52c41a;
    background: #f6ffed;
}

.bom-node .node-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.bom-node .node-info {
    font-size: 13px;
    color: #666;
}

/* 审批流程 */
.approval-list {
    margin-bottom: 30px;
}

.approval-list h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.approval-items {
    min-height: 100px;
}

.approval-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.approval-btn:hover {
    border-color: #1E80FF;
    background: #f5f7fa;
}

.approval-btn .icon {
    font-size: 24px;
}

.approval-btn .text {
    font-size: 15px;
    color: #333;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background: rgba(30, 128, 255, 0.1);
    color: #1E80FF;
}

.stat-icon.green {
    background: rgba(82, 196, 26, 0.1);
    color: #52c41a;
}

.stat-icon.orange {
    background: rgba(250, 173, 20, 0.1);
    color: #faad14;
}

.stat-icon.purple {
    background: rgba(114, 46, 209, 0.1);
    color: #722ed1;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 13px;
    color: #999;
}

.recent-updates h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

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

.recent-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1E80FF;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: auto;
}

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

.modal-header h2 {
    font-size: 18px;
    color: #333;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #f5f7fa;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 100px;
    color: #999;
    font-size: 14px;
}

.detail-value {
    flex: 1;
    color: #333;
    font-size: 14px;
}

/* 加载动画 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

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

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #1E80FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: 16px;
    color: #666;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 20px 16px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1 1 40%;
    }

    .search-box {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
