/* Core Design System Tokens (Light Theme: Blue-White-Gray) */
:root {
    --bg-base: #f4f6fa;
    --bg-surface: rgba(255, 255, 255, 0.82);
    --bg-surface-glow: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 82, 204, 0.08);
    --border-color-glow: rgba(0, 82, 204, 0.25);
    
    /* Brand Accent Colors */
    --accent-primary: #0052cc;     /* Deep Cobalt Blue */
    --accent-secondary: #0066cc;   /* Active UI Blue */
    --accent-success: #00a86b;     /* Emerald Green */
    --accent-warning: #f59e0b;     /* Amber Yellow */
    --accent-error: #ef4444;       /* Crimson Red */
    
    /* Text Colors */
    --text-primary: #091e42;       /* Deep Navy Gray (Near Black) */
    --text-secondary: #495057;     /* Slate Gray */
    --text-muted: #7a869a;         /* Cool Muted Gray */
    
    /* Shadows & Transitions */
    --glow-shadow: 0 10px 30px rgba(0, 82, 204, 0.05);
    --box-shadow-soft: 0 8px 30px rgba(9, 30, 66, 0.06);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(233, 242, 255, 0.8) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(245, 243, 255, 0.5) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
}

/* Background grid overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 82, 204, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 82, 204, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    pointer-events: none;
    z-index: 0;
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1800px;
    margin: 0 auto;
    padding: 10px 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

/* Header */
.app-header {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 36px;
    filter: drop-shadow(0 4px 10px rgba(0, 82, 204, 0.25));
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 13px;
    color: var(--text-muted);
}

.version-badge {
    background: rgba(0, 82, 204, 0.06);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    border: 1px solid rgba(0, 82, 204, 0.15);
    margin-left: 6px;
    font-weight: 600;
}

.header-meta {
    display: flex;
    gap: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.meta-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.meta-dot.green {
    background-color: var(--accent-success);
    box-shadow: 0 0 6px var(--accent-success);
}

.meta-dot.blue {
    background-color: var(--accent-primary);
    box-shadow: 0 0 6px var(--accent-primary);
}

.meta-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
    margin-top: 10px;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.sidebar-panel {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0; /* Prevents flex items from expanding beyond parent */
    height: 100%;
}

/* Rows inside main panel */
.main-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.visualizer-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.visualizer-row > .visual-section,
.visualizer-row > #mujoco-card {
    flex: 1;
    flex-basis: 0;
    min-width: 0;
    margin-top: 0 !important; /* Override inline styles */
}

.results-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.single-col {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.single-col > #audit-card {
    margin-top: 0 !important; /* Override inline styles */
}

.divider-line {
    height: 1px;
    background: var(--border-color);
    margin: 10px 0;
}

@media (max-width: 1280px) {
    .dashboard-layout {
        flex-direction: column;
        align-items: stretch;
    }
    .sidebar-panel {
        width: 100%;
    }
    .visualizer-row, .results-row {
        flex-direction: column;
    }
    .results-row > .solver-progress-card {
        width: 100% !important;
    }
}

/* Cards (Glassmorphism Light) */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--box-shadow-soft);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-panel > .glass-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-scroll-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 6px;
}

.sidebar-footer-action {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    background: transparent;
    width: 100%;
}

.glass-card:hover {
    border-color: rgba(0, 82, 204, 0.15);
    box-shadow: 0 12px 40px rgba(9, 30, 66, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.header-num {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(0, 82, 204, 0.06);
    padding: 4px 8px;
    border-radius: 6px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Form Elements */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea {
    width: 100%;
    min-height: 80px;
    background: #ffffff;
    border: 1px solid rgba(0, 82, 204, 0.12);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13.5px;
    resize: vertical;
    transition: var(--transition-smooth);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

/* Drag Drop Zone */
.drag-drop-zone {
    border: 2px dashed rgba(0, 82, 204, 0.15);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    transition: var(--transition-smooth);
}

.drag-drop-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 82, 204, 0.02);
}

.zone-icon {
    font-size: 24px;
    filter: drop-shadow(0 4px 6px rgba(0, 82, 204, 0.15));
}

.zone-text {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, #0077ff 0%, #0052cc 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.15);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 82, 204, 0.3);
}

.btn-secondary {
    background: #ffffff;
    color: var(--accent-primary);
    border: 1px solid rgba(0, 82, 204, 0.15);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
    background: rgba(0, 82, 204, 0.04);
    color: var(--accent-primary);
}

.btn-block {
    width: 100%;
}

.btn-pulse {
    animation: pulsing-glow-blue 3s infinite;
}

@keyframes pulsing-glow-blue {
    0% {
        box-shadow: 0 4px 15px rgba(0, 82, 204, 0.15);
    }
    50% {
        box-shadow: 0 4px 25px rgba(0, 82, 204, 0.4);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 82, 204, 0.15);
    }
}

.btn-preset {
    background: #ffffff;
    border: 1px solid rgba(0, 82, 204, 0.1);
    color: var(--text-secondary);
    text-align: left;
    justify-content: flex-start;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
}

.btn-preset:hover, .btn-preset.active {
    background: rgba(0, 82, 204, 0.05);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-badge {
    font-size: 9.5px;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 700;
    margin-right: 6px;
}

.btn-badge.err {
    background: rgba(0, 168, 107, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(0, 168, 107, 0.2);
}

.btn-badge.robotis {
    background: rgba(0, 82, 204, 0.08);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 82, 204, 0.18);
}

.btn-badge.ind {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Presets Group */
.presets-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.presets-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.preset-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Video Preview Container */
.video-preview-container {
    position: relative;
    width: 100%;
    flex: 1.1;
    min-height: 120px;
    height: auto;
    background-color: #fafbfc;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

#video-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.vlm-status-inline-container {
    margin-top: -6px;
    margin-bottom: 12px;
    display: flex;
}

.vlm-status-inline {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: #4a5568;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.vlm-status-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-warning);
}

.status-indicator-dot.pulsing {
    animation: status-pulse 1.5s infinite;
}

.status-indicator-dot.green {
    background-color: var(--accent-success);
    box-shadow: 0 0 6px var(--accent-success);
}

.status-indicator-dot.blue {
    background-color: var(--accent-primary);
    box-shadow: 0 0 6px var(--accent-primary);
}

.status-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Chart Container */
.chart-container {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    flex: 0.9;
    min-height: 110px;
    height: auto;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.chart-legend {
    display: flex;
    gap: 12px;
}

.legend-item {
    font-size: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-color {
    width: 10px;
    height: 3px;
    border-radius: 1px;
    display: inline-block;
}

.legend-color.cyan { background-color: var(--accent-primary); }
.legend-color.purple { background-color: var(--accent-secondary); }

#chart-canvas {
    width: 100% !important;
    height: 100% !important;
    flex: 1;
    min-height: 0;
    display: block;
}

/* Parameters Grid */
.params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.param-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.param-icon {
    font-size: 20px;
}

.param-info {
    display: flex;
    flex-direction: column;
}

.param-name {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.param-val {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Solver Nodes Tree */
.solver-progress-card {
    gap: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.solver-nodes-tree {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    padding-left: 20px;
    padding-right: 6px;
    padding-bottom: 24px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Vertical line connecting nodes */
.solver-nodes-tree::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 28px;
    bottom: 25px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-primary) 0%, rgba(0, 82, 204, 0.05) 100%);
    z-index: 0;
}

.tree-branches {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    position: relative;
    z-index: 1;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
}

.tree-node.active {
    background: rgba(0, 82, 204, 0.02);
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(0, 82, 204, 0.1);
}

.tree-node.success {
    background: rgba(0, 168, 107, 0.03);
    border-color: var(--accent-success);
}

.tree-node.failed {
    background: rgba(239, 68, 68, 0.03);
    border-color: var(--accent-error);
    animation: shake 0.3s ease;
}

.node-badge {
    background: rgba(0, 82, 204, 0.05);
    color: var(--accent-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    width: 55px;
    text-align: center;
}

.tree-node.success .node-badge {
    background: rgba(0, 168, 107, 0.15);
    color: var(--accent-success);
}

.node-details {
    flex-grow: 1;
}

.node-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.node-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.node-status-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.node-status-light.idle { background-color: #e2e8f0; }
.node-status-light.active {
    background-color: var(--accent-primary);
    box-shadow: 0 0 6px var(--accent-primary);
    animation: pulse-active 1s infinite;
}
.node-status-light.success {
    background-color: var(--accent-success);
    box-shadow: 0 0 6px var(--accent-success);
}
.node-status-light.failed {
    background-color: var(--accent-error);
    box-shadow: 0 0 6px var(--accent-error);
}

/* BOM Tables */
.bom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.header-main-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pricing-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.toggle-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
}

/* Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-primary);
}

input:checked + .slider:before {
    transform: translateX(14px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* BOM Table Wrapper */
.bom-table-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.bom-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.bom-table th {
    background: rgba(0, 82, 204, 0.03);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
}

.bom-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.bom-table tr:hover td {
    background: rgba(0, 82, 204, 0.01);
    color: var(--text-primary);
}

/* Price column toggling */
.price-col {
    transition: var(--transition-smooth);
}

.hide-prices .price-col {
    display: none;
}

.bom-summary-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

.summary-specs {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-specs strong {
    color: var(--text-primary);
}

.badge-neutral {
    background: rgba(0, 82, 204, 0.05);
    color: var(--accent-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.badge-success {
    background: rgba(0, 168, 107, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(0, 168, 107, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.summary-cost {
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-cost strong {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--accent-primary);
    text-shadow: 0 2px 4px rgba(0, 82, 204, 0.1);
}

.bom-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 82, 204, 0.15);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-smooth);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 82, 204, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 82, 204, 0.5);
}

/* ==========================================================================
   RE-DESIGNED MUJOCO SIMULATION AUDIT CARD (PREMIUM HUD & INSTRUMENT STYLE)
   ========================================================================== */

/* 头部状态微章 */
.mujoco-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.header-main-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sim-status-badge {
    padding: 4px 10px;
    background: rgba(0, 82, 204, 0.08);
    border: 1px solid rgba(0, 82, 204, 0.15);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
    transition: all 0.3s ease;
}
.sim-status-badge.running {
    background: rgba(255, 170, 0, 0.1);
    border-color: rgba(255, 170, 0, 0.3);
    color: #cc8800;
    animation: status-pulse-yellow 1.5s infinite alternate;
}
.sim-status-badge.passed {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: #1e7e34;
}

/* 重新排版的 Grid 布局 */
.mujoco-layout-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
    gap: 12px;
    width: 100%;
    margin-top: 10px;
    flex: 1;
    min-height: 0;
}

/* HUD 物理面板 */
.mujoco-hud-dashboard {
    grid-column: 1;
    grid-row: 1;
    background: #1e222b;
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 0;
}
.hud-title {
    font-size: 11px;
    font-weight: 700;
    color: #8f9cae;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    margin-bottom: 4px;
}
.hud-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}
.hud-item:last-child {
    border-bottom: none;
}
.hud-label {
    font-size: 11px;
    color: #a0aec0;
}
.hud-val {
    font-family: 'Consolas', monospace;
    font-size: 12px;
    font-weight: bold;
    color: #00f2fe;
    text-shadow: 0 0 5px rgba(0, 242, 254, 0.5);
}
.hud-val.warning {
    color: #ffd200;
    text-shadow: 0 0 5px rgba(255, 210, 0, 0.5);
}
.hud-val.success {
    color: #00ff87;
    text-shadow: 0 0 5px rgba(0, 255, 135, 0.5);
}

/* 仿真日志终端 */
.mujoco-console-wrapper {
    grid-column: 1;
    grid-row: 3;
    background: #181b22;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}
.console-header {
    background: #252a35;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.console-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.console-dot.red { background-color: #ff5f56; }
.console-dot.yellow { background-color: #ffbd2e; }
.console-dot.green { background-color: #27c93f; }
.console-title {
    font-size: 10px;
    font-family: 'Consolas', monospace;
    color: #a0aec0;
    margin-left: 6px;
}
.console-body {
    flex: 1;
    padding: 8px 12px;
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: #e2e8f0;
    line-height: 1.4;
    overflow-y: auto;
    background: #181b22;
    text-align: left;
}
.console-footer-action {
    background: #1d212b;
    padding: 6px 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 38px;
}
.console-footer-action .btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 82, 204, 0.2);
}

/* 校验成功徽章样式 */
.success-badge-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #28a745;
    text-shadow: 0 0 8px rgba(40, 167, 69, 0.2);
}
.badge-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #28a745;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
}

/* 三维仿真视口容器 */
.mujoco-viewport-wrapper {
    grid-column: 2;
    grid-row: 1 / span 3;
    position: relative;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid rgba(0, 82, 204, 0.1);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.viewport-hud-toolbar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 82, 204, 0.15);
    border-radius: 30px;
    padding: 3px 6px;
    display: flex;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.08);
    width: max-content;
    white-space: nowrap;
}
.toolbar-btn {
    border: none;
    background: transparent;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}
.toolbar-btn:hover {
    background: rgba(0, 82, 204, 0.06);
    color: var(--accent-primary);
}
.toolbar-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 82, 204, 0.2);
}

.viewport-canvas-container {
    flex-grow: 1;
    position: relative;
    background: #fafbfc;
    display: block;
    height: 100%;
}
.viewport-3d-pane {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #0c1524; /* Slate deep blue workspace */
    overflow: hidden;
}

/* 新增 2D 监控面板与 Canvas 暗色样式 */
.mujoco-2d-panel {
    grid-column: 1;
    grid-row: 2;
    background: #181b22;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}
.mujoco-2d-panel .panel-header {
    background: #252a35;
    padding: 4px 12px;
    font-size: 10px;
    color: #a0aec0;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mujoco-2d-panel canvas {
    flex-grow: 1;
     width: 100%;
     height: calc(100% - 20px);
     background: #0f141c;
     display: block;
}
#mujoco-viewport-canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.three-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-heading);
    pointer-events: none;
}

@keyframes status-pulse-yellow {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 5px rgba(255, 170, 0, 0.2); }
    to { box-shadow: 0 0 12px rgba(255, 170, 0, 0.5); }
}

/* --- Engineering Audit and System Integration Styles --- */
.audit-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    background: rgba(0, 82, 204, 0.04);
    color: var(--accent-primary);
}

.tab-btn.active {
    background: rgba(0, 82, 204, 0.08);
    color: var(--accent-primary);
}

.audit-tab-content {
    display: none;
    transition: var(--transition-smooth);
}

.audit-tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.audit-table th {
    background: rgba(0, 82, 204, 0.02);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.audit-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.audit-table tr:hover {
    background: rgba(0, 82, 204, 0.01);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10.5px;
}

.badge-status.safe {
    background: rgba(0, 168, 107, 0.1);
    color: var(--accent-success);
}

.badge-status.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.badge-status.critical {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-error);
}

/* Electrical Grid */
.electrical-audit-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .electrical-audit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.electrical-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.electrical-item.highlight {
    border-color: rgba(0, 168, 107, 0.3);
    background: rgba(0, 168, 107, 0.01);
}

.electrical-item .label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.electrical-item .value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.electrical-item.highlight .value {
    color: var(--accent-success);
}

.checklist-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.checklist-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.checklist-content {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
    margin-bottom: 15px;
}

.cable-specs-box {
    background: rgba(0, 82, 204, 0.02);
    border-left: 3px solid var(--accent-primary);
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    line-height: 1.5;
}

/* Alternatives tab */
.alternatives-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.axis-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.axis-selector-wrapper label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.selection-justification-box {
    background: rgba(0, 82, 204, 0.02);
    border-radius: 8px;
    padding: 14px;
    border: 1px solid var(--border-color);
}

.selection-justification-box h3 {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 6px;
}

.selection-justification-box p {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.alt-list-section h3 {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.alt-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.alt-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-smooth);
}

.alt-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.05);
}

.alt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alt-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.alt-card-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.alt-card-specs {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.alt-card-diffs {
    display: flex;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
}

.diff-badge {
    padding: 2px 6px;
    border-radius: 4px;
}

.diff-badge.better {
    background: rgba(0, 168, 107, 0.1);
    color: var(--accent-success);
}

.diff-badge.worse {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-error);
}

.diff-badge.neutral {
    background: #f1f5f9;
    color: var(--text-secondary);
}

/* Integration guide */
.integration-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .integration-guide-grid {
        grid-template-columns: 1fr;
    }
}

.guide-col h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.guide-code-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
    max-height: 250px;
    overflow-y: auto;
}

.code-header {
    background: #0f172a;
    border-radius: 8px 8px 0 0;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e2e8f0;
    font-size: 11px;
    font-family: monospace;
    font-weight: bold;
    border-bottom: 1px solid #1e293b;
}

.code-pre {
    margin: 0;
    background: #0f172a;
    border-radius: 0 0 8px 8px;
    padding: 16px;
    overflow-x: auto;
    max-height: 205px;
}

#guide-ros-code {
    font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    font-size: 11px;
    color: #38bdf8; /* sky blue code */
    line-height: 1.5;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

/* Beautiful editable inputs for Parameter Cards */
.param-input {
    background: rgba(9, 30, 66, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-primary);
    width: 100%;
    box-sizing: border-box;
    transition: var(--transition-smooth);
    margin-top: 4px;
}

.param-input:hover {
    border-color: var(--accent-secondary);
    background: rgba(9, 30, 66, 0.08);
}

.param-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: #ffffff;
    box-shadow: 0 0 5px rgba(0, 82, 204, 0.15);
}

/* Select dropdown specific styling */
select.param-input {
    appearance: none;
    cursor: pointer;
    padding-right: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%25230052cc' d='M1 3l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}


/* ==========================================================================
   ADDED FOR MANUFACTURING AND SUPPLIER ROUTING SUPPORT (TABBED WORKSPACE)
   ========================================================================== */

/* --- Workspace Tabs Layout --- */
.workspace-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 4px;
}

.workspace-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: var(--transition-smooth);
    border-bottom: 3px solid transparent;
}

.workspace-tab-btn:hover {
    color: var(--accent-primary);
    background: rgba(0, 82, 204, 0.04);
}

.workspace-tab-btn.active {
    color: var(--accent-primary);
    border-bottom: 3px solid var(--accent-primary);
    background: rgba(0, 82, 204, 0.06);
}

.workspace-tab-content {
    display: none;
}

.workspace-tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    animation: fadeInTab 0.35s ease-out;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Card 07: Manufacturing Layout --- */
.mfg-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mfg-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mfg-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.mfg-input-group select, 
.mfg-input-group input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition-smooth);
}

.mfg-input-group select:focus, 
.mfg-input-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.15);
}

/* Progress bar container */
.mfg-progress-wrapper {
    margin: 16px 0;
    background: rgba(9, 30, 66, 0.03);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

.mfg-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    margin-bottom: 6px;
    font-weight: 500;
}

.mfg-progress-bar-bg {
    height: 8px;
    background: rgba(9, 30, 66, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.mfg-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

#supplier-card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.supplier-bom-section {
    flex: 1.1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#supplier-bom-table-wrapper {
    display: block !important;
    flex: 1;
    min-height: 0;
    overflow-y: auto !important;
    position: relative;
    padding-right: 4px;
}

#supplier-bom-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-surface-glow, #ffffff);
    border-bottom: 2px solid var(--border-color);
}

.supplier-orders-section {
    flex: 0.9;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Card 08: Supplier Orders Layout */
.supplier-orders-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.supplier-order-card {
    background: var(--bg-surface-glow);
    border: 1px solid var(--border-color-glow);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--box-shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.supplier-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(9, 30, 66, 0.08);
}

.supplier-order-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.supplier-order-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-primary);
}

.supplier-order-contact {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.supplier-order-items {
    list-style: none;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.supplier-order-items li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(9, 30, 66, 0.04);
}

.supplier-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto;
}

.supplier-order-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-error);
}

/* Fixed styles for dynamic tables */
.bom-table th, .bom-table td {
    padding: 10px 12px;
}

/* Tab 1 Layout: Left-Right column */
.tab1-layout {
    display: flex;
    gap: 12px;
    width: 100%;
    flex: 1;
    min-height: 0;
}
.tab1-left-col {
    width: 40%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 0;
}
.tab1-left-col > .visual-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tab1-left-col > .solver-progress-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tab1-right-col {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.tab1-right-col > #mujoco-card {
    margin-top: 0 !important;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab 2 Layout: Balanced Two-column */
.tab2-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    flex: 1;
    min-height: 0;
}
.tab2-left-col {
    width: 49%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.tab2-right-col {
    width: 49%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.tab2-right-col > #audit-card {
    margin-top: 0 !important;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Responsive adjustments */
@media (max-width: 1280px) {
    .tab1-layout, .tab2-layout {
        flex-direction: column;
    }
    .tab1-left-col, .tab2-left-col, .tab2-right-col {
        width: 100%;
    }
}

/* --- High-end Lock Mask for Pending Steps --- */
#mujoco-card[data-status="locked"] {
    display: flex !important;
    position: relative;
    pointer-events: none;
    min-height: 500px;
}
#mujoco-card[data-status="locked"]::after {
    content: "🔒 等待智能选型解算锁定 BOM 以唤起仿真验证...";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 8px;
    z-index: 10;
    border: 2px dashed rgba(0, 82, 204, 0.2);
    box-shadow: inset 0 0 40px rgba(0, 82, 204, 0.05);
}

#audit-card[data-status="locked"] {
    display: flex !important;
    position: relative;
    pointer-events: none;
    min-height: 400px;
}
#audit-card[data-status="locked"]::after {
    content: "🔒 等待动力学校验通过以生成审计与集成报告...";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 8px;
    z-index: 10;
    border: 2px dashed rgba(0, 82, 204, 0.2);
    box-shadow: inset 0 0 40px rgba(0, 82, 204, 0.05);
}

/* ==========================================================================
   TAB 3: CAPP DUAL COLUMNS AND TIMELINE STYLES
   ========================================================================== */

/* 双栏排版 */
.tab3-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 100%;
    min-height: 0;
}
.tab3-left-col {
    width: 50%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    min-height: 0;
}
.tab3-left-col > #mfg-card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tab3-right-col {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    min-height: 0;
}
.tab3-right-col > #mfg-3d-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab 3 内部子容器弹性与滚动 */
.mfg-results-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-right: 4px;
}
.mfg-viewer-wrapper {
    flex: 1;
    min-height: 150px;
    height: auto !important;
}
.mfg-steps-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    display: block !important; /* 防止 flex 布局对里面的工序步骤产生意想不到的拉伸 */
}

/* 零件行高亮交互 */
#mfg-parts-tbody tr {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#mfg-parts-tbody tr:hover {
    background: rgba(0, 82, 204, 0.05) !important;
    box-shadow: inset 2px 0 0 var(--accent-primary);
}
#mfg-parts-tbody tr.active-part {
    background: rgba(0, 82, 204, 0.08) !important;
    font-weight: 500;
    box-shadow: inset 4px 0 0 var(--accent-primary);
}
#mfg-parts-tbody tr.mfg-detail-row:hover {
    background: transparent !important;
    box-shadow: none !important;
}

/* 3D 看图器控制按钮 */
.mfg-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.viewer-controls {
    display: flex;
    gap: 6px;
}
.viewer-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.viewer-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.viewer-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* CAPP 时间线结构 */
.capp-timeline {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeInTab 0.3s ease-out;
}
.setup-group {
    border-left: 2px solid rgba(0, 82, 204, 0.15);
    padding-left: 15px;
    margin-left: 8px;
    position: relative;
}
.setup-group::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.2);
}
.setup-title {
    font-size: 12.5px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
}
.step-item {
    background: var(--bg-surface-glow);
    border: 1px solid var(--border-color-glow);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: transform 0.2s ease;
}
.step-item:hover {
    transform: translateX(4px);
    border-color: rgba(0, 82, 204, 0.15);
}
.step-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.step-op-code {
    font-family: monospace;
    font-size: 10px;
    font-weight: bold;
    color: var(--accent-primary);
    background: rgba(0, 82, 204, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    align-self: flex-start;
}
.step-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.step-tool {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.tool-badge {
    background: rgba(255, 170, 0, 0.08);
    border: 1px solid rgba(255, 170, 0, 0.2);
    color: #cc8800;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 10px;
}
.step-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}
.step-params {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Consolas', monospace;
}
.step-time {
    font-size: 11px;
    font-weight: bold;
    color: var(--text-primary);
}

@media (max-width: 1280px) {
    .tab3-layout {
        flex-direction: column;
    }
    .tab3-left-col {
        width: 100%;
    }
}

.tab4-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
}
.tab4-layout > #supplier-card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}


/* ==========================================
   08 BOM Manufacturing & Tool Details Drawer Styles
   ========================================== */
.bom-mfg-detail-row {
    background: rgba(12, 21, 36, 0.4) !important;
}

.bom-mfg-detail-row td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.btn-bom-toggle:hover {
    background: rgba(0, 104, 183, 0.1) !important;
    color: var(--accent-primary) !important;
    border-color: rgba(0, 104, 183, 0.2) !important;
    box-shadow: 0 0 8px rgba(0, 104, 183, 0.15);
}

.bom-mfg-detail-box {
    animation: slideDownFade 0.25s ease-out;
}

.bom-mfg-op-item {
    transition: all 0.2s ease;
}

.bom-mfg-op-item:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    transform: translateX(2px);
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SVG 矢量图标通用高级过渡样式 */
.svg-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.2px;
    fill: none;
    vertical-align: middle;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease;
}

/* 悬停微动画：产生极具高级质感的微动作 */
button:hover .svg-icon,
.bom-mfg-op-item:hover .svg-icon,
tr:hover .svg-icon {
    transform: scale(1.15) rotate(3deg);
    stroke: var(--accent-primary);
}

.step-item:hover .svg-icon {
    transform: scale(1.12);
    stroke: var(--accent-primary);
}
