/* 全局样式 */
body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f5f5f5;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    min-height: 100vh;
}

/* 头部样式 */
.app-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #2c80b9;
    padding-bottom: 15px;
}

h1 {
    color: #2c80b9;
    margin: 0;
    font-size: 28px;
}

.header-description {
    margin: 10px 0 0;
    color: #666;
}

/* 产品选择区域 */
.product-selection {
    margin-bottom: 30px;
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.product-card {
    flex: 1;
    min-width: 250px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-card.selected {
    border-color: #2c80b9;
    background-color: #f0f7ff;
}

.product-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.product-manufacturer {
    color: #666;
    font-size: 14px;
}

.product-action {
    margin-top: 10px;
    font-size: 12px;
    color: #2c80b9;
}

/* 已选产品区域 */
.selected-products {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
}

.selected-products h3 {
    margin-top: 0;
    color: #2c80b9;
}

.selected-products-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.selected-product {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.selected-product-name {
    font-weight: bold;
    margin-right: 5px;
}

.selected-product-manufacturer {
    color: #666;
    font-size: 12px;
}

.remove-product-btn {
    margin-left: 10px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
}

.remove-product-btn:hover {
    color: #e74c3c;
}

.clear-selection-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.clear-selection-btn:hover {
    background-color: #e9e9e9;
}

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

.selected-products-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* 参数类别选项卡 */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
}

.tab-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background-color: #e9e9e9;
}

.tab-btn.active {
    background-color: #2c80b9;
    color: white;
    border-color: #2c80b9;
}

/* 对比结果区域 */
.comparison-empty {
    text-align: center;
    padding: 40px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.comparison-legend {
    display: flex;
    margin-bottom: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.legend-color {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 4px;
}

.legend-color.best-value {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.legend-text {
    font-size: 12px;
    color: #666;
}

.parameter-category {
    margin-bottom: 30px;
}

.category-title {
    color: #2c80b9;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 20px;
    table-layout: fixed;
}

.parameter-name-header {
    width: 20%;
    text-align: left;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border-bottom: 2px solid #ddd;
}

.product-header {
    text-align: center;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border-bottom: 2px solid #ddd;
}

.product-header-name {
    font-weight: bold;
}

.product-header-details {
    font-size: 12px;
    color: #666;
}

.parameter-row:nth-child(even) {
    background-color: #f9f9f9;
}

.parameter-name {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.parameter-value {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    word-wrap: break-word;
}

.parameter-value.best-value {
    background-color: #d4edda;
    font-weight: bold;
}

/* PDF下载区域 */
.pdf-download-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.pdf-download-section h3 {
    margin-top: 0;
    color: #2c80b9;
}

.pdf-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdf-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pdf-product-name {
    font-weight: bold;
}

.pdf-download-link {
    padding: 5px 10px;
    background-color: #2c80b9;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
}

.pdf-download-link:hover {
    background-color: #236a9c;
}

/* 页脚样式 */
.app-footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
    color: #999;
    font-size: 12px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 50px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-card {
        min-width: 100%;
    }
    
    .comparison-table {
        font-size: 12px;
    }
    
    .parameter-name-header,
    .product-header,
    .parameter-name,
    .parameter-value {
        padding: 8px 10px;
    }
}