/* BOM智能核对系统 - 样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2.5rem;
}

.header-text h1 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.header-text p {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.2rem;
}

.header-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 主容器 */
.main-container {
    display: flex;
    gap: 1.5rem;
    max-width: 1600px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-group {
    margin-bottom: 1.5rem;
}

.nav-group-title {
    font-size: 0.85rem;
    color: #999;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.3rem;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-svg-icon {
    flex-shrink: 0;
}

.nav-img-icon {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.nav-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.export-actions {
    margin-top: 0.5rem;
}

.export-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
}

/* 内容区域 */
.content-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 上传区域 */
.upload-section {
    margin-bottom: 1.5rem;
}

.upload-zone {
    border: 2px dashed #667eea;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.05);
}

.upload-zone:hover {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.05);
}

.upload-zone.dragover {
    border-color: #11998e;
    background: rgba(17, 153, 142, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.9rem;
    color: #666;
}

.file-list {
    margin-top: 1rem;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.file-card-icon {
    font-size: 1.5rem;
}

.file-card-info {
    flex: 1;
}

.file-card-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.2rem;
}

.file-card-size {
    font-size: 0.85rem;
    color: #999;
}

.file-card-remove {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

/* 操作栏 */
.action-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f1f2f6;
    color: #333;
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary:hover {
    background: #e8e9ed;
}

/* 结果区域 */
.result-section {
    margin-top: 2rem;
    position: relative;
}

/* 检查结论横幅 */
.conclusion-banner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.5s ease;
}

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

.conclusion-banner.pass {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: 2px solid #4CAF50;
}

.conclusion-banner.fail {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    border: 2px solid #F44336;
}

.conclusion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    min-width: 140px;
}

.conclusion-badge.pass {
    background: #4CAF50;
    color: #fff;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.conclusion-badge.fail {
    background: #F44336;
    color: #fff;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.conclusion-risk-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #555;
}

.conclusion-risk-label .risk-high {
    color: #D32F2F;
    font-weight: 700;
}

.conclusion-risk-label .risk-medium {
    color: #F57C00;
    font-weight: 700;
}

.conclusion-risk-label .risk-low {
    color: #388E3C;
    font-weight: 700;
}

.conclusion-summary-text {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    flex: 1;
}

/* AI水印 */
.ai-watermark {
    position: absolute;
    bottom: 16px;
    right: 20px;
    font-size: 0.75rem;
    color: #b0b0b0;
    font-weight: 500;
    letter-spacing: 0.15em;
    pointer-events: none;
    user-select: none;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.ai-watermark:hover {
    opacity: 1;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.stat-card.warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-item {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-item:hover {
    color: #667eea;
}

.tab-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.result-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.result-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.ok {
    background: #d4edda;
    color: #155724;
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.status-badge.error {
    background: #f8d7da;
    color: #721c24;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 1000px;
}

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

.modal-header h2 {
    font-size: 1.3rem;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* 存储器件库 */
.library-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.library-import {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.library-count {
    color: #666;
    font-size: 0.9rem;
}

.library-search input {
    padding: 0.6rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 250px;
}

.library-table-container {
    overflow-x: auto;
    max-height: 500px;
}

/* 变更项输入面板 */
.change-input-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: none;
}

.change-input-panel.show {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.input-mode-switch {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.mode-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.input-section {
    margin-bottom: 1.5rem;
}

.input-row {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.input-field {
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    flex: 1;
    min-width: 150px;
}

.input-field-small {
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100px;
}

.input-field:focus,
.input-field-small:focus {
    outline: none;
    border-color: #667eea;
}

.excel-upload-zone {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.05);
}

.excel-upload-zone:hover {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.05);
}

.excel-upload-zone .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.change-list-section {
    margin-top: 1.5rem;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.list-header h4 {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.change-list-container {
    overflow-x: auto;
    max-height: 400px;
}

.action-btn {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.action-btn:hover {
    background: #ff3838;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .input-row {
        flex-direction: column;
    }
    
    .input-field,
    .input-field-small {
        width: 100%;
    }
}

/* ========== Excel报告格式样式 ========== */

/* 概览标签 - 核对汇总Sheet */
.summary-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1F2937;
    padding: 1rem 0 0.5rem 0;
    border-bottom: 2px solid #4472C4;
    margin-bottom: 1rem;
}

.summary-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 1px solid #D9DEE7;
    border-radius: 4px;
    overflow: hidden;
}

.summary-stat-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid #D9DEE7;
}

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

.summary-stat-item.header-row {
    background: #4472C4;
}

.summary-stat-item.header-row .stat-item-label {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.summary-stat-item > span {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    border-right: 1px solid #D9DEE7;
    font-size: 0.95rem;
}

.summary-stat-item > span:last-child {
    border-right: none;
}

.stat-item-label {
    font-weight: 600;
    color: #333;
}

.stat-value-num {
    font-weight: 600;
    font-size: 1rem;
}

.stat-value-num.status-ok {
    color: #155724;
}

.stat-value-num.status-fail {
    color: #721C24;
}

.status-fail-label {
    color: #FFC7CE !important;
}

/* Excel风格表格行高亮 */
.result-table tr td.status-pass {
    color: #155724;
}

.result-table tr td.status-fail {
    color: #721C24;
    font-weight: 600;
}

.result-table tr td.status-warn {
    color: #856404;
}

/* 状态标签 - Excel风格 */
.status-pass {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #E2EFDA;
    color: #155724;
}

.status-fail {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #FFC7CE;
    color: #721C24;
}

.status-warn {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #FFEB9C;
    color: #856404;
}

/* 整机描述核对 - 证据列样式 */
.result-table td:last-child {
    line-height: 1.6;
}
