/* ========================================
   智仪全球 - 产品对比页面样式
   ======================================== */

.breadcrumb {
    background: #f5f7fa;
    padding: 12px 0;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}
.breadcrumb a { color: #1a73e8; text-decoration: none; }

.compare-main { padding: 32px 0 60px; background: #f8f9fb; min-height: 70vh; }

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.compare-header h1 { font-size: 28px; margin-bottom: 8px; }
.compare-header p { color: #666; font-size: 15px; }
.compare-actions { display: flex; gap: 12px; }

/* 对比栏 */
.compare-bar {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.compare-bar-items {
    display: flex;
    gap: 12px;
    flex: 1;
    overflow-x: auto;
    flex-wrap: wrap;
}
.compare-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f0f4ff;
    border-radius: 8px;
    font-size: 13px;
    color: #1a73e8;
    font-weight: 500;
    max-width: 240px;
}
.compare-bar-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.compare-bar-item button {
    border: none;
    background: none;
    color: #ff3d00;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}
.compare-bar-empty {
    color: #aaa;
    font-size: 14px;
    padding: 8px 0;
}
.compare-go-btn { white-space: nowrap; }
.compare-go-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 空状态 */
.compare-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.compare-empty h2 { font-size: 22px; margin: 16px 0 8px; }
.compare-empty p { color: #888; font-size: 15px; }
.compare-empty a { color: #1a73e8; }
.compare-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
}
.compare-step {
    text-align: center;
}
.compare-step .step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    margin: 0 auto 8px;
}
.compare-step .step-text { font-size: 13px; color: #666; }
.compare-arrow { font-size: 24px; color: #ccc; }

/* 对比结果表 */
.compare-result-table-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
.compare-result-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.compare-result-table th,
.compare-result-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    font-size: 14px;
    vertical-align: middle;
    word-wrap: break-word;
}
.compare-result-table th {
    background: #f8f9fb;
    font-weight: 600;
    color: #333;
}
.compare-result-table .param-col {
    text-align: left;
    font-weight: 600;
    color: #555;
    background: #fafbfc;
    width: 140px;
    min-width: 140px;
    position: sticky;
    left: 0;
    z-index: 1;
}
.compare-result-table .product-col {
    min-width: 200px;
}
.compare-result-table .product-header {
    padding: 20px 16px;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
}
.compare-result-table .product-header .ph-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4ff;
    border-radius: 8px;
    font-size: 40px;
}
.compare-result-table .product-header .ph-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.compare-result-table .product-header .ph-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
    line-height: 1.4;
}
.compare-result-table .product-header .ph-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}
.compare-result-table .product-header .ph-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}
.compare-result-table .product-header .ph-action-btn {
    padding: 4px 10px;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    background: #fff;
    color: #1a73e8;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}
.compare-result-table .product-header .ph-action-btn:hover {
    background: #1a73e8;
    color: #fff;
}
.compare-result-table .product-header .ph-remove {
    position: absolute;
    top: 8px;
    right: 8px;
}
.compare-result-table .price-cell {
    color: #ff5722;
    font-weight: 700;
    font-size: 16px;
}
.compare-result-table .price-cell .wholesale-price {
    color: #00c853;
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}
.compare-result-table .stock-in { color: #00c853; font-weight: 600; }
.compare-result-table .stock-out { color: #ff3d00; }
.compare-result-table .highlight-best { background: #e8f5e9; font-weight: 600; }
.compare-result-table .highlight-low { background: #fce4ec; }
.compare-result-table .tier-cell {
    font-size: 12px;
    text-align: left;
}
.compare-result-table .tier-cell .tier-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}
.compare-result-table .tier-cell .tier-row.active {
    color: #ff5722;
    font-weight: 600;
}
.compare-result-table .cert-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.compare-result-table .cert-tag {
    padding: 2px 8px;
    background: #e8f5e9;
    border-radius: 4px;
    font-size: 11px;
    color: #2e7d32;
}

/* 对比操作栏 */
.compare-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

/* 添加产品区 */
.compare-add-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.compare-add-section h3 { font-size: 16px; margin-bottom: 16px; }
.compare-search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.compare-search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
.compare-search-box input:focus { border-color: #1a73e8; }
.compare-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.compare-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.compare-search-item:hover { border-color: #1a73e8; background: #f8f9ff; }
.compare-search-item.added { opacity: 0.5; cursor: default; }
.compare-search-item .csi-icon { font-size: 28px; }
.compare-search-item .csi-info { flex: 1; min-width: 0; }
.compare-search-item .csi-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-search-item .csi-price { font-size: 13px; color: #ff5722; font-weight: 600; }

/* 推荐区 */
.compare-recommend {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.compare-recommend h3 { font-size: 16px; margin-bottom: 16px; }
.recommend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.recommend-card {
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.recommend-card:hover { border-color: #1a73e8; box-shadow: 0 2px 8px rgba(26,115,232,0.1); }
.recommend-card .rc-icon { font-size: 32px; margin-bottom: 8px; }
.recommend-card .rc-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recommend-card .rc-price { font-size: 14px; color: #ff5722; font-weight: 600; }

/* 对比摘要 */
.compare-summary {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.compare-summary h3 { font-size: 16px; margin-bottom: 16px; }
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.summary-card {
    padding: 16px;
    border-radius: 8px;
    background: #f8f9fb;
    text-align: center;
}
.summary-card.best { background: #e8f5e9; border: 2px solid #00c853; }
.summary-card .sc-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.summary-card .sc-value { font-size: 15px; font-weight: 700; color: #1a1a2e; }
.summary-card .sc-product { font-size: 12px; color: #666; margin-top: 4px; }

/* 响应式 */
@media (max-width: 768px) {
    .compare-header h1 { font-size: 22px; }
    .compare-header { flex-direction: column; }
    .compare-actions { width: 100%; }
    .compare-actions .btn { flex: 1; }
    .compare-steps { flex-direction: column; gap: 12px; }
    .compare-arrow { transform: rotate(90deg); }
    .compare-result-table-wrapper { overflow-x: auto; }
    .compare-search-box { flex-direction: column; }
}
