/* 供应门户 · supply-portal.css · 工业采购风格 */
:root {
    --sp-orange: #ea580c;
    --sp-orange-deep: #c2410c;
    --sp-orange-soft: #fff7ed;
    --sp-blue: #1e40af;
    --sp-dark: #0b1426;
    --sp-ink: #0f172a;
    --sp-ink-2: #334155;
    --sp-muted: #64748b;
    --sp-line: #e5e7eb;
    --sp-line-soft: #f1f5f9;
    --sp-bg: #f5f7fa;
    --sp-card: #ffffff;
    --sp-radius: 14px;
    --sp-shadow: 0 4px 16px rgba(15,23,42,.05);
    --sp-shadow-hover: 0 14px 40px rgba(234,88,12,.18);
}

/* ======= 页面容器 ======= */
.supply-page { background: var(--sp-bg); }

/* ======= Hero ======= */
.sp-hero {
    position: relative;
    overflow: hidden;
    padding: 3.25rem 0 3.5rem;
    color: #fff;
    background:
        radial-gradient(ellipse 60% 50% at 80% 30%, rgba(255,255,255,.08), transparent 55%),
        linear-gradient(120deg, #0b1426 0%, #1e3a8a 45%, #ea580c 100%);
}
.sp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.5), transparent 80%);
}
.sp-hero-inner { position: relative; z-index: 1; }
.sp-hero-tag {
    display: inline-block;
    padding: .3rem .9rem;
    border-radius: 999px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}
.sp-hero-title {
    font-size: clamp(1.8rem, 3.8vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 .75rem;
    letter-spacing: -.5px;
}
.sp-hero-title .o { color: #fcd34d; }
.sp-hero-desc { margin: 0 0 1.5rem; font-size: .98rem; opacity: .88; }
.sp-hero-stats {
    display: flex; gap: 2rem;
}
.sp-hero-stat { text-align: left; }
.sp-hero-stat strong {
    display: block; font-size: 1.7rem; font-weight: 800;
    background: linear-gradient(135deg, #fff, #fed7aa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sp-hero-stat span { font-size: .75rem; opacity: .7; letter-spacing: .5px; }

/* Hero 右侧分类快速入口 */
.sp-hero-right {
    position: absolute;
    right: 2rem; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: .5rem;
}
.sp-hero-chip {
    padding: .5rem .9rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
    transition: all .2s;
}
.sp-hero-chip:hover {
    background: #ea580c; border-color: #ea580c;
    box-shadow: 0 6px 18px rgba(234,88,12,.4);
    color: #fff; transform: translateX(-4px);
}

/* ======= 分类墙 ======= */
.sp-cat-wall {
    background: var(--sp-card);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}
.sp-cat-wall-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; padding-bottom: .75rem;
    border-bottom: 2px solid var(--sp-line-soft);
}
.sp-cat-wall-head h3 {
    margin: 0; display: flex; align-items: center; gap: .6rem;
    font-size: 1.1rem; font-weight: 800;
}
.sp-cat-wall-head h3 i {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--sp-orange); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .95rem;
}
.sp-cat-wall-head p { margin: 0; font-size: .78rem; color: var(--sp-muted); }
.sp-cat-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .6rem .4rem;
}
.sp-cat-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: .7rem .85rem;
    border-radius: 10px;
    background: var(--sp-orange-soft);
    border: 1px solid transparent;
    text-decoration: none; color: var(--sp-ink-2);
    font-size: .88rem; font-weight: 600;
    transition: all .18s;
    position: relative;
}
.sp-cat-item .name { flex: 1; }
.sp-cat-item .count {
    font-size: .7rem; color: var(--sp-muted);
    background: rgba(0,0,0,.05);
    padding: .1rem .45rem; border-radius: 999px; margin-right: .3rem;
}
.sp-cat-item:hover {
    background: #fff;
    border-color: rgba(234,88,12,.25);
    color: var(--sp-orange);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(234,88,12,.1);
}
.sp-cat-item:hover .count { background: #ea580c; color: #fff; }

/* ======= 面包屑 ======= */
.sp-breadcrumb {
    font-size: .82rem; color: var(--sp-muted); margin-bottom: 1rem;
    display: flex; flex-wrap: wrap; gap: .35rem;
}
.sp-breadcrumb a { color: var(--sp-muted); text-decoration: none; }
.sp-breadcrumb a:hover { color: var(--sp-orange); }
.sp-breadcrumb .sep { opacity: .4; }

/* ======= 供应卡片网格 ======= */
.sp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.sp-card {
    background: var(--sp-card);
    border-radius: var(--sp-radius);
    overflow: hidden;
    box-shadow: var(--sp-shadow);
    text-decoration: none;
    color: inherit;
    display: flex; flex-direction: column;
    transition: transform .2s, box-shadow .2s;
    border: 1px solid transparent;
}
.sp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sp-shadow-hover);
    border-color: rgba(234,88,12,.2);
}
.sp-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #e8e8e8;
    overflow: hidden;
}
.sp-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.sp-card:hover .sp-card-media img { transform: scale(1.05); }
.sp-card-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #334155, #1e293b);
    color: rgba(255,255,255,.3);
    font-size: 2rem;
}
.sp-card-badge-top {
    position: absolute; top: .6rem; left: .6rem;
    background: var(--sp-orange); color: #fff;
    padding: .15rem .55rem; border-radius: 5px;
    font-size: .7rem; font-weight: 700;
}
.sp-card-badge-rec {
    position: absolute; top: .6rem; right: .6rem;
    background: var(--sp-blue); color: #fff;
    padding: .15rem .55rem; border-radius: 5px;
    font-size: .7rem; font-weight: 700;
}
.sp-card-body { padding: 1rem 1.1rem 1.15rem; flex: 1; display: flex; flex-direction: column; }
.sp-card-title {
    margin: 0 0 .4rem;
    font-size: .98rem; font-weight: 700;
    color: var(--sp-ink);
    line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sp-card:hover .sp-card-title { color: var(--sp-orange); }
.sp-card-summary {
    margin: 0 0 .55rem;
    font-size: .8rem; color: var(--sp-muted);
    line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sp-card-meta {
    margin-top: auto;
    display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem;
    padding-top: .6rem;
    border-top: 1px dashed var(--sp-line);
}
.sp-card-price {
    font-size: 1.15rem; font-weight: 800; color: var(--sp-orange);
    line-height: 1.1;
}
.sp-card-price small { font-size: .7rem; font-weight: 600; color: var(--sp-muted); margin-left: 2px; }
.sp-card-no-price { font-size: .82rem; font-weight: 600; color: var(--sp-ink-2); }
.sp-card-info { font-size: .72rem; color: var(--sp-muted); text-align: right; line-height: 1.5; }
.sp-card-info .co { color: var(--sp-ink-2); font-weight: 500; display: block; }

/* ======= 两栏布局（列表模式）======= */
.sp-2col {
    display: grid;
    grid-template-columns: minmax(0,1fr) 300px;
    gap: 1rem; align-items: start;
}
.sp-list-main { min-width: 0; }
.sp-side { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 1rem; }

/* 侧栏卡片 */
.sp-side-card {
    background: var(--sp-card);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    padding: 1rem 1.15rem;
}
.sp-side-title {
    font-size: .95rem; font-weight: 800;
    margin: 0 0 .8rem;
    display: flex; align-items: center; gap: .5rem;
}
.sp-side-title i { color: var(--sp-orange); font-size: .9rem; }
.sp-side-tag {
    display: inline-block;
    padding: .3rem .7rem; margin: .2rem;
    background: var(--sp-orange-soft);
    color: var(--sp-orange-deep);
    border-radius: 6px;
    font-size: .8rem; font-weight: 600;
    text-decoration: none;
    transition: all .15s;
}
.sp-side-tag:hover {
    background: var(--sp-orange); color: #fff;
    transform: translateY(-1px);
}
.sp-hot-list { list-style: none; padding: 0; margin: 0; }
.sp-hot-list li {
    display: flex; align-items: flex-start; gap: .5rem;
    padding: .45rem 0; border-bottom: 1px dashed var(--sp-line-soft);
    font-size: .85rem;
}
.sp-hot-list li:last-child { border-bottom: 0; }
.sp-hot-list .rank {
    width: 18px; height: 18px; border-radius: 4px;
    background: #e5e7eb; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 800; flex-shrink: 0; margin-top: 2px;
}
.sp-hot-list li:nth-child(-n+3) .rank { background: var(--sp-orange); }
.sp-hot-list a { flex: 1; color: var(--sp-ink); text-decoration: none; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-hot-list a:hover { color: var(--sp-orange); }
.sp-hot-list .price { font-size: .72rem; color: var(--sp-orange-deep); font-weight: 600; flex-shrink: 0; }

/* 分类导航侧栏 · 3级展开 */
.sp-cat-tree { list-style: none; padding: 0; margin: 0; }
.sp-cat-tree .sp-cat-root { margin-bottom: 2px; }

/* 一级 */
.sp-cat-tree > .sp-cat-root > a {
    display: flex; justify-content: space-between; align-items: center;
    padding: .55rem .8rem;
    color: var(--sp-ink); text-decoration: none;
    font-size: .88rem; font-weight: 700;
    border-radius: 8px;
    background: var(--sp-orange-soft);
    transition: all .15s;
}
.sp-cat-tree > .sp-cat-root > a:hover { background: #ffedd5; color: var(--sp-orange-deep); }
.sp-cat-tree > .sp-cat-root > a.active { background: var(--sp-orange); color: #fff; }
.sp-caret { font-size: .72rem; transition: transform .2s; opacity: .7; }
.sp-cat-root.is-open > a .sp-caret { transform: rotate(180deg); }

/* 二级容器 */
.sp-cat-l2 {
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s ease-out;
}
.sp-cat-root.is-open > .sp-cat-l2 { max-height: 600px; }

/* 二级网格：一行 5 个 */
.sp-cat-l2-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .3rem .5rem;
    padding: .5rem .4rem .55rem;
}
.sp-cat-l2-item {
    font-size: .8rem;
}
.sp-cat-l2-item > a {
    display: block;
    padding: .3rem .5rem;
    color: var(--sp-ink-2); text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all .15s;
    text-align: center;
    background: #fafafa;
    border: 1px solid transparent;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-cat-l2-item > a:hover {
    background: #fff; color: var(--sp-orange);
    border-color: rgba(234,88,12,.25);
}
.sp-cat-l2-item > a.active {
    background: #fff; color: var(--sp-orange);
    border-color: var(--sp-orange);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(234,88,12,.15);
}
.sp-cat-l2-item.is-current > a { color: var(--sp-orange-deep); font-weight: 700; }

/* 三级 */
.sp-cat-l3 { padding: .3rem 0 0; }
.sp-cat-l3-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .2rem;
}
.sp-cat-l3-grid a {
    display: block;
    padding: .2rem .35rem;
    font-size: .72rem;
    color: var(--sp-muted); text-decoration: none;
    border-radius: 4px;
    text-align: center;
    background: transparent;
    transition: all .12s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-cat-l3-grid a:hover { background: var(--sp-orange-soft); color: var(--sp-orange-deep); }
.sp-cat-l3-grid a.active {
    background: var(--sp-orange); color: #fff; font-weight: 700;
}

/* 响应式：侧栏窄时降为 3 列 */
@media (max-width: 1199.98px) {
    .sp-cat-l2-grid, .sp-cat-l3-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 列表页页头 */
.sp-list-head {
    background: var(--sp-card);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex; align-items: center; justify-content: space-between;
}
.sp-list-head h2 {
    margin: 0;
    font-size: 1.1rem; font-weight: 800;
    display: flex; align-items: center; gap: .5rem;
}
.sp-list-head h2 i { color: var(--sp-orange); }
.sp-list-back {
    font-size: .82rem; color: var(--sp-muted); text-decoration: none;
    font-weight: 600;
}
.sp-list-back:hover { color: var(--sp-orange); }

/* 空状态 */
.sp-empty {
    padding: 3rem 1rem; text-align: center; color: var(--sp-muted);
    background: var(--sp-card); border-radius: var(--sp-radius);
}
.sp-empty i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .4; }

/* ======= 分页 ======= */
.sp-pagination {
    background: var(--sp-card);
    padding: 1rem;
    border-radius: var(--sp-radius);
    margin-top: 1rem;
    text-align: center;
    box-shadow: var(--sp-shadow);
}

/* ======= 响应式 ======= */
@media (max-width: 1199.98px) {
    .sp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991.98px) {
    .sp-hero { padding: 2.25rem 0 2.5rem; }
    .sp-2col { grid-template-columns: 1fr; }
    .sp-side { position: static; }
    .sp-hero-right { display: none; }
    .sp-cat-list { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (max-width: 767.98px) {
    .sp-grid { grid-template-columns: 1fr; }
    .sp-hero-stats { gap: 1.25rem; flex-wrap: wrap; }
    .sp-cat-list { grid-template-columns: repeat(2, 1fr); }
    .sp-card-media { aspect-ratio: 16/10; }
}
