/* AI 比价页：参考 OpenPrice 卡网商品页——左标题右统计、绿色筛选条、分组标题 + 表格 */
.price-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 28px 0;
}

/* ---------- 页头 ---------- */
.pc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.pc-head-text { min-width: 0; max-width: 860px; }
.pc-count {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(13, 54, 142, .25);
    transition: background .2s, transform .2s;
}
.pc-count:hover { color: #fff; background: var(--primary-hover); transform: translateY(-1px); }
.pc-count b { color: #FDE047; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pc-count-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.pc-count .fa-arrow-right { font-size: 14px; }

/* ---------- 绿色筛选条 ---------- */
.pc-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
    padding: 8px;
    border-radius: 14px;
    background: var(--brand);
}
.pc-bar-search,
.pc-bar-input {
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: var(--text-primary);
    font-size: 15px;
}
.pc-bar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 360px;
    min-width: 0;
    padding: 0 14px;
    color: var(--text-muted);
    cursor: text;
}
.pc-bar-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
}
.pc-bar-input {
    flex: 0 1 190px;
    min-width: 0;
    padding: 0 14px;
    outline: 0;
}
.pc-bar-sort { flex: 0 0 168px; }
.price-page .f-select-wrap { display: block; }
.price-page .f-select-trigger {
    height: 44px;
    border: 0;
    border-radius: 10px;
    padding: 0 14px;
    color: var(--text-primary);
    font-size: 15px;
}
.price-page .f-select-trigger.is-open { box-shadow: none; }
.pc-bar-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: none;
    width: 128px;          /* 固定宽度：查询中出现转圈图标时按钮不变宽，不挤左边输入框 */
    height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: var(--primary-dark);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
.pc-bar-go:hover { background: #071d4d; }
.pc-bar-go:disabled { opacity: .75; cursor: wait; }
.pc-bar-reset {
    flex: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: background .2s;
}
.pc-bar-reset:hover { background: rgba(255, 255, 255, .3); }
/* 筛选组在宽屏不占位，子元素直接参与条的排布；用 order 保持原来「排序 → 开始查价 → 重置」的顺序 */
.pc-bar-filters { display: contents; }
.pc-bar-go { order: 1; }
.pc-bar-reset { order: 2; }
.pc-bar-more { display: none; }
.btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .55);
    border-top-color: #fff;
    border-radius: 50%;
    animation: priceSpin .75s linear infinite;
}

/* ---------- 热门词 ---------- */
.pc-hot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}
.pc-hot-label { font-size: 14px; color: var(--text-muted); }
.price-hot-chip {
    padding: 5px 14px;
    font-size: 14px;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.price-hot-chip:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ---------- 结果区 ---------- */
.price-result-shell { margin-top: 28px; }
.price-progress { margin-bottom: 16px; }
.price-progress-head {
    display: flex;
    align-items: center;
    gap: 18px;
}
.price-progress-head h2 {
    flex: none;
    max-width: 50%;
    overflow: hidden;
    color: var(--primary);
    font-size: 26px;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.price-progress-line { flex: 1; height: 2px; background: #a1b9ee; }
.price-progress-head span { flex: none; color: var(--text-muted); font-size: 14px; }
.price-progress-head span strong { color: var(--text-primary); font-weight: 700; }
.price-progress-bar {
    height: 3px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: transparent;
}
.price-progress-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
    transition: width .25s ease, opacity .3s;
}
.price-progress:not(.is-loading) .price-progress-bar i { opacity: 0; }

.price-empty-state,
.price-loading {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    min-height: 240px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--text-muted);
    text-align: center;
}
.price-empty-state strong,
.price-loading strong { color: var(--text-primary); font-size: 18px; }
.price-loading::before {
    content: "";
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: priceSpin .8s linear infinite;
}

.price-table-wrap {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}
.price-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.price-table th {
    height: 56px;
    padding: 0 20px;
    text-align: left;
    color: var(--text-primary);
    background: var(--bg-page);
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}
.price-table th:nth-child(2) { width: 20%; }
.price-table th:nth-child(3) { width: 14%; }
.price-table th:nth-child(4) { width: 160px; }
.price-table td {
    height: 72px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 16px;
    vertical-align: middle;
}
.price-table tbody tr:hover td { background: #F8FAFF; }
.price-op { text-align: right; }
th.price-op { text-align: right; }
.price-name {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-primary);
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.price-brand {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 6px;
    object-fit: cover;
}
.price-value {
    color: var(--price);
    font-size: 19px;
    font-weight: 800;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.site-cell {
    display: inline-flex;
    vertical-align: middle;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}
.site-logo {
    width: 20px;
    height: 20px;
    border-radius: 7px;
    object-fit: cover;
    background: var(--border-light);
    flex-shrink: 0;
}
.site-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-muted);
    font-size: 14.5px;
}
.buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 20px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    color: var(--primary);
    background: #fff;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.buy-btn .fa-arrow-right { font-size: 14px; transition: transform .15s; }
.buy-btn:hover { color: #fff; background: var(--primary); }
.buy-btn:hover .fa-arrow-right { transform: translateX(2px); }
.buy-btn.is-disabled { border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.buy-btn.is-disabled:hover { background: #fff; color: var(--text-muted); }

@keyframes priceSpin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
    .pc-bar { flex-wrap: wrap; }
    .pc-bar-search { flex-basis: 100%; }
    .pc-bar-input { flex: 1 1 160px; }
}

@media (max-width: 900px) {
    .price-page { padding: 24px 16px 0; }
    .pc-head { flex-direction: column; align-items: flex-start; gap: 16px; }
    .pc-count { height: 42px; padding: 0 18px; font-size: 15px; }
    .pc-count b { font-size: 20px; }
}

@media (max-width: 640px) {
    .price-page { padding-top: 16px; }

    /* 搜索条：一行「搜索框 + 筛选 + 查价」，筛选项收进下面的面板 */
    .pc-bar { flex-wrap: wrap; gap: 10px 6px; margin-top: 0; padding: 10px 8px; border-radius: 14px; }
    .pc-bar-search { flex: 1 1 0; order: 0; padding: 0 12px; gap: 8px; }
    .pc-bar-more {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        order: 1;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 10px;
        background: rgba(255, 255, 255, .18);
        color: #fff;
        font-size: 16px;
        cursor: pointer;
    }
    .pc-bar-more[aria-expanded="true"] { background: rgba(255, 255, 255, .32); }
    /* 有筛选条件时右上角亮个小点，收起面板也知道结果被筛过 */
    .pc-bar-more.has-filter::after {
        content: "";
        position: absolute;
        top: 8px;
        right: 8px;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #FDE047;
    }
    .pc-bar-go { order: 2; width: auto; padding: 0 16px; white-space: nowrap; }
    .pc-bar-filters { display: none; }
    .pc-bar-filters.is-open {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
        gap: 10px 6px;
        flex-basis: 100%;
        order: 3;
    }
    .pc-bar-filters .pc-bar-input { width: 100%; padding: 0 12px; }
    #excludeKeyword { grid-column: 2 / 4; }
    .pc-bar-filters .pc-bar-sort { grid-column: 1 / 3; }
    .pc-bar-filters .pc-bar-reset { grid-column: 3; }

    /* 热门词：一行横向滑动，不折两行 */
    .pc-hot { flex-wrap: nowrap; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .pc-hot::-webkit-scrollbar { display: none; }
    .pc-hot-label { flex: none; font-size: 13px; }
    .price-hot-chip { flex: none; padding: 4px 12px; font-size: 13px; font-weight: 600; }
    .price-progress-head { flex-wrap: wrap; gap: 6px 12px; }
    .price-progress-head h2 { font-size: 21px; max-width: 100%; }
    .price-progress-head span { flex-basis: 100%; }
    .price-progress-line { display: none; }
    .price-table-wrap { border: 0; background: transparent; overflow: visible; }
    .price-table, .price-table tbody, .price-table tr, .price-table td { display: block; width: 100%; }
    .price-table thead { display: none; }
    .price-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #fff;
    }
    .price-table tr + tr { margin-top: 10px; }
    .price-table td { height: auto; padding: 0; border: 0; }
    .price-table td[data-label="商品名称"] { grid-column: 1 / -1; }
    .price-table td[data-label="平台"] { grid-column: 1 / -1; }
    .price-table td.price-op { text-align: right; }
    .buy-btn { height: 36px; padding: 0 14px; font-size: 15px; }
}
