/* =========================================================
   车型对比：对比页 + 悬浮栏 + 加入对比按钮
   ========================================================= */

:root {
    --io-compare-primary: #2563eb;
    --io-compare-primary-dark: #1d4ed8;
    --io-compare-border: #e5e7eb;
    --io-compare-muted: #6b7280;
    --io-compare-bg: #f8fafc;
}

.io-compare-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px 100px;
    color: #111827;
}

.io-compare-crumb {
    margin-bottom: 14px;
    color: var(--io-compare-muted);
    font-size: 13px;
}

.io-compare-crumb a {
    color: inherit;
    text-decoration: none;
}

.io-compare-crumb a:hover {
    color: var(--io-compare-primary);
}

.io-compare-crumb span {
    margin: 0 6px;
}

.io-compare-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.io-compare-subtitle {
    margin: 0 0 22px;
    color: var(--io-compare-muted);
    font-size: 14px;
}

.io-compare-notice {
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 14px;
}

.io-compare-notice--warn {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.io-compare-summary {
    margin-bottom: 20px;
    padding: 22px 24px;
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f7ff 100%);
    box-shadow: 0 8px 24px rgba(79, 70, 229, .06);
}

.io-compare-summary-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #1e3a8a;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .01em;
}

.io-compare-summary-star {
    color: #1d4ed8;
    font-size: 22px;
    line-height: 1;
}

.io-compare-summary p {
    margin: 0;
    color: #334155;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.9;
}

.io-compare-summary-name {
    color: #2563eb;
    font-weight: 700;
}

.io-compare-summary-highlight {
    color: #ef4444;
    font-weight: 800;
}

/* 空状态 */
.io-compare-empty {
    padding: 80px 24px;
    border: 1px solid var(--io-compare-border);
    border-radius: 16px;
    background: #fff;
    text-align: center;
}

.io-compare-empty-icon {
    margin-bottom: 12px;
    font-size: 48px;
}

.io-compare-empty h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.io-compare-empty p {
    margin: 0 auto 22px;
    max-width: 520px;
    color: var(--io-compare-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* 对比表格 */
.io-compare-swipe-hint {
    display: none;
}

.io-compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .08);
}

.io-compare-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    font-variant-numeric: tabular-nums;
}

.io-compare-table th,
.io-compare-table td {
    padding: 14px;
    border: 0;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    vertical-align: middle;
    font-size: 15px;
    line-height: 1.5;
}

/* 最后一列不再画右边线，避免与外框重叠 */
.io-compare-table th:last-child,
.io-compare-table td:last-child {
    border-right: 0;
}

/* 最后一行不再画底边线 */
.io-compare-table tbody tr:last-child th,
.io-compare-table tbody tr:last-child td {
    border-bottom: 0;
}

/* 车型头部整行保持纯白，作为视觉锚点 */
.io-compare-table thead th,
.io-compare-table .cmp-car-head th {
    background: #fff !important;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.io-compare-table thead .io-compare-field,
.io-compare-table thead .param-label {
    background: #fff !important;
    color: #6b7280;
}

/* 第一列：参数名，浅灰底、左对齐、吸顶 */
.io-compare-table .io-compare-field,
.io-compare-table .param-label {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 150px;
    min-width: 130px;
    background: #f9fafb !important;
    color: #374151 !important;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.io-compare-table thead .io-compare-field {
    z-index: 3;
}

/* 数据列：极淡科技蓝底、居中、深色 15px */
.io-compare-table tbody td {
    background: #f0f7ff !important;
    color: #111827 !important;
    font-size: 15px;
    font-weight: 500;
}

.io-compare-table tbody tr:hover td {
    background: #e8f2ff !important;
}

/* 参考价格：核心决策点，红色加大加粗 */
.io-compare-table tbody tr.io-compare-row-price td {
    color: #e53935 !important;
    font-size: 18px;
    font-weight: bold;
}

.io-compare-car-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.io-compare-car-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 80px;
    overflow: hidden;
    border-radius: 10px;
    background: #f3f4f6;
}

.io-compare-car-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.io-compare-car-noimg {
    color: #9ca3af;
    font-size: 12px;
}

.io-compare-car-name {
    max-width: 220px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.io-compare-car-brand {
    color: var(--io-compare-muted);
    font-size: 12px;
}



.io-compare-actions {
    white-space: nowrap;
}

.io-compare-detail-btn,
.io-compare-remove,
.io-compare-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: .2s;
}

.io-compare-btn,
.io-compare-detail-btn {
    border: 1px solid var(--io-compare-primary);
    background: var(--io-compare-primary);
    color: #fff;
}

.io-compare-btn:hover,
.io-compare-detail-btn:hover {
    border-color: var(--io-compare-primary-dark);
    background: var(--io-compare-primary-dark);
    color: #fff;
}

.io-compare-remove {
    margin-left: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: var(--io-compare-muted);
}

.io-compare-remove:hover {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #dc2626;
}

/* 加入对比按钮（车型详情页 / 旧类名兼容） */
.io-button--compare,
.io-btn-compare {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding: 9px 18px;
    border: 1px solid var(--io-compare-primary);
    border-radius: 999px;
    background: #fff;
    color: var(--io-compare-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.io-button--compare:hover,
.io-btn-compare:hover,
.io-button--compare.is-selected,
.io-btn-compare.is-selected {
    border-color: var(--io-compare-primary);
    background: var(--io-compare-primary);
    color: #fff;
}

/* 底部悬浮栏 */
.io-compare-bar {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 9999;
    width: min(680px, calc(100% - 32px));
    visibility: hidden;
    opacity: 0;
    transform: translate(-50%, 140%);
    transition: transform .25s ease, opacity .25s ease, visibility .25s;
}

.io-compare-bar.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, 0);
}

.io-compare-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px 12px 20px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 50px rgba(37, 99, 235, .18);
    backdrop-filter: blur(12px);
}

.io-compare-bar__info {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: #1f2937;
    font-size: 14px;
}

.io-compare-bar__count {
    color: var(--io-compare-primary);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.io-compare-bar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.io-compare-bar__clear {
    padding: 6px 8px;
    border: 0;
    background: none;
    color: var(--io-compare-muted);
    font-size: 13px;
    cursor: pointer;
}

.io-compare-bar__clear:hover {
    color: #dc2626;
}

.io-compare-bar__go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    background: var(--io-compare-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: .2s;
}

.io-compare-bar__go:hover {
    background: var(--io-compare-primary-dark);
    color: #fff;
}

.io-compare-bar__go.is-disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* 留白放在页脚内部：页脚背景延伸到底部，避免页脚后出现灰色空带 */
body.has-compare-bar .io-site-footer {
    padding-bottom: 100px !important;
}

@media (max-width: 768px) {
    .io-compare-page {
        padding: 20px 16px 110px;
    }

    .io-compare-title {
        font-size: 24px;
    }

    .io-compare-summary {
        padding: 16px 18px;
        border-radius: 14px;
    }

    .io-compare-summary-label {
        margin-bottom: 8px;
        font-size: 17px;
    }

    .io-compare-summary-star {
        font-size: 19px;
    }

    .io-compare-summary p {
        font-size: 14px;
        line-height: 1.8;
    }

    .io-compare-swipe-hint {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 0 10px;
        padding: 0 2px;
        color: #94a3b8;
        font-size: 12px;
    }

    .io-compare-swipe-hint[hidden] {
        display: none;
    }

    .io-compare-swipe-text {
        flex: none;
        white-space: nowrap;
    }

    .io-compare-swipe-track {
        flex: 1;
        height: 4px;
        overflow: hidden;
        border-radius: 999px;
        background: #e5e7eb;
    }

    .io-compare-swipe-thumb {
        display: block;
        width: 30%;
        height: 100%;
        border-radius: 999px;
        background: #93c5fd;
        transition: transform .12s linear;
    }

    .io-compare-table-wrap,
    .io-compare-page .cmp-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 90px;
        scroll-padding-right: 12px;
        scrollbar-width: none;
    }

    .io-compare-table-wrap::-webkit-scrollbar,
    .io-compare-page .cmp-table-wrap::-webkit-scrollbar {
        display: none;
    }

    .io-compare-table,
    .io-compare-page .cmp-table {
        min-width: 600px !important;
        table-layout: auto;
        border-collapse: separate;
        border-spacing: 0;
    }

    .io-compare-table th {
        font-size: 13px;
    }

    .io-compare-table tbody td {
        font-size: 15px;
    }

    .io-compare-car-col {
        width: calc(100vw - 110px);
        min-width: max(200px, 50vw);
        box-sizing: border-box;
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }

    .io-compare-table .io-compare-field,
    .io-compare-table .param-label {
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
        box-sizing: border-box;
        padding: 16px 8px;
        position: sticky;
        left: 0;
        z-index: 2;
        background: #f9fafb !important;
        box-shadow: 2px 0 6px rgba(15, 23, 42, .04);
        text-align: left;
        font-size: 12px;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: keep-all;
    }

    .io-compare-table thead .io-compare-field,
    .io-compare-table thead .param-label {
        z-index: 3;
    }

    body.has-compare-bar .io-site-footer {
        padding-bottom: 120px !important;
    }

    .io-compare-bar {
        bottom: 12px;
    }

    .io-compare-bar__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .io-compare-bar__info,
    .io-compare-bar__actions {
        justify-content: center;
    }

    .io-compare-bar__go {
        flex: 1;
    }
}

/* =========================================================
   对比页：表格最后一行“其他参数”纯功能标签
   ========================================================= */
.io-compare-table tbody td.io-compare-other-cell {
    text-align: left;
    vertical-align: top;
}

.io-compare-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.io-compare-tag {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    padding: 4px 8px;
    overflow: hidden;
    border-radius: 4px;
    background: #dbeafe;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.io-compare-tags-toggle {
    display: none;
    align-items: center;
    gap: 4px;
    margin: 6px 0 0;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
}

@media (max-width: 768px) {
    .io-compare-tags.collapsed .io-compare-tag:nth-child(n+7) {
        display: none;
    }

    .io-compare-tags-toggle {
        display: inline-flex;
    }
}

/* =========================================================
   参数表字体规范：参考“摩托范”
   ========================================================= */
.io-compare-table .io-compare-field,
.io-compare-table .param-label {
    color: #333333 !important;
    font-size: 16px;
    font-weight: 600;
}

.io-compare-table tbody td {
    color: #666666 !important;
    font-size: 14px;
    font-weight: 400;
}

.io-compare-table tbody tr.io-compare-row-price td {
    color: #ff4d00 !important;
    font-size: 18px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .io-compare-table th,
    .io-compare-table td {
        padding: 10px 8px;
    }

    .io-compare-table .io-compare-field,
    .io-compare-table .param-label {
        color: #333333 !important;
        padding: 12px 8px;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
    }

    .io-compare-table tbody td {
        color: #666666 !important;
        padding: 10px 8px;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.5;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .io-compare-table tbody tr.io-compare-row-price td {
        color: #ff4d00 !important;
        font-size: 16px;
        font-weight: bold;
    }

    .io-compare-car-name {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.4;
    }
}
