/* ===== 产品中心页面 ===== */
.pp-page {
    padding: 100px 24px 4rem;
    background: #fafbfc;
    min-height: 100vh;
}

.pp-container {
    max-width: 1280px;
    margin: 0 auto;
}

/* 页面标题 */
.pp-header {
    text-align: center;
    margin-bottom: 60px;
}

.pp-header-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #2563eb;
    background: #eff6ff;
    padding: 6px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.pp-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.pp-header p {
    font-size: 1.05rem;
    color: #64748b;
    margin: 0;
}

.pp-empty {
    text-align: center;
    padding: 100px 20px;
    color: #94a3b8;
    font-size: 1.1rem;
}

/* ===== 产品卡片网格 ===== */
.pp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ===== 分页 ===== */
.pp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pp-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pp-page-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.pp-page-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.pp-page-ellipsis {
    color: #94a3b8;
    padding: 0 4px;
}

/* ===== 搜索 + 分类筛选工具栏 ===== */
.pp-toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.pp-search {
    display: flex;
    gap: 10px;
    max-width: 420px;
}

.pp-search-input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pp-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pp-search-btn {
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.pp-search-btn:hover {
    background: #1d4ed8;
}

/* 分类筛选 chips */
.pp-cats-wrap {
    position: relative;
}

.pp-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 左右渐隐提示（横向可滚动且未到头时显示，提示后面还有分类） */
.pp-cats-wrap::before,
.pp-cats-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 8px;
    width: 36px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pp-cats-wrap::before {
    left: 0;
    background: linear-gradient(to right, #fafbfc, rgba(250, 251, 252, 0));
}

.pp-cats-wrap::after {
    right: 0;
    background: linear-gradient(to left, #fafbfc, rgba(250, 251, 252, 0));
}

.pp-cats-wrap.has-left::before {
    opacity: 1;
}

.pp-cats-wrap.has-right::after {
    opacity: 1;
}

.pp-cat {
    padding: 8px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.pp-cat:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.pp-cat.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.pp-empty-back {
    display: inline-block;
    margin-top: 16px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.pp-empty-back:hover {
    text-decoration: underline;
}

/* ===== 产品卡片 ===== */
.pp-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.pp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border-color: #2563eb;
}

.pp-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.pp-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.pp-card:hover .pp-card-img img {
    transform: scale(1.05);
}

.pp-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(37, 99, 235, 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.pp-card-body {
    padding: 20px;
}

.pp-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pp-card-code {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 14px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.pp-card-more {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    transition: color 0.2s;
}

.pp-card:hover .pp-card-more {
    color: #1d4ed8;
}

/* ===== 产品详情面板（右侧滑入） ===== */
.pp-drawer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
}

.pp-drawer.active {
    pointer-events: auto;
}

.pp-drawer.closing {
    pointer-events: none;
}

.pp-drawer.closing .pp-drawer-backdrop {
    opacity: 0;
}

.pp-drawer.closing .pp-drawer-panel {
    transform: translateX(100%);
}

/* 遮罩 */
.pp-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.pp-drawer.active .pp-drawer-backdrop {
    opacity: 1;
}

/* 面板主体 */
.pp-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 72%;
    max-width: 1100px;
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.pp-drawer.active .pp-drawer-panel {
    transform: translateX(0);
}

/* 关闭按钮 */
.pp-drawer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 22px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.pp-drawer-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* 面板内容区（可滚动） */
.pp-drawer-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 40px 48px;
}

/* 抽屉打开时锁定底层页面滚动，避免穿透滚动 */
body.drawer-open {
    overflow: hidden;
    overscroll-behavior: contain;
}

/* ===== 第一行：图片 + 基本信息 ===== */
.pp-drawer-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}

.pp-drawer-img {
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    min-height: 300px;
}

.pp-drawer-img img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.pp-drawer-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pp-drawer-cat {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
    width: fit-content;
}

.pp-drawer-info h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 16px;
    line-height: 1.3;
}

.pp-drawer-model {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.pp-drawer-model span {
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.pp-drawer-model em {
    color: #334155;
    font-style: normal;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 600;
}

.pp-drawer-desc p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.9;
    margin: 0;
}

/* ===== 第二行起：产品信息 ===== */
.pp-drawer-specs {
    margin-top: 8px;
}

.pp-drawer-specs-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 24px;
}

.spec-group {
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.spec-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    letter-spacing: 0.5px;
}

/* 参数网格 */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: #fff;
}

.spec-item {
    display: flex;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
}

.spec-item:nth-child(even) {
    border-right: none;
}

.spec-item:last-child,
.spec-item:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
}

.spec-label {
    color: #64748b;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-right: 12px;
}

.spec-val {
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 600;
}

/* 移动端单列 */
@media (max-width: 768px) {
    .spec-grid {
        grid-template-columns: 1fr;
    }

    .spec-item {
        border-right: none;
    }

    .spec-item:nth-last-child(2):nth-child(odd) {
        border-bottom: 1px solid #f1f5f9;
    }

    .spec-item:last-child {
        border-bottom: none;
    }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .pp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .pp-drawer-panel {
        width: 85%;
    }

    .pp-drawer-body {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .pp-page {
        padding: 80px 16px 3rem;
    }

    .pp-header {
        margin-bottom: 36px;
    }

    .pp-header h2 {
        font-size: 1.75rem;
    }

    .pp-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pp-card-img {
        aspect-ratio: 16 / 10;
    }

    /* 搜索框占满一行 */
    .pp-search {
        max-width: 100%;
    }

    /* 分类芯片：移动端单行横向滚动，避免参差换行与溢位 */
    .pp-cats {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -4px;
        padding: 0 4px 8px;
        scrollbar-width: none;
    }

    .pp-cats::-webkit-scrollbar {
        display: none;
    }

    .pp-cat {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* 分页：单行可横向滚动，避免两行错位 */
    .pp-pagination {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .pp-pagination::-webkit-scrollbar {
        display: none;
    }

    .pp-page-btn {
        min-width: 34px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .pp-pagination .pp-page-ellipsis {
        flex-shrink: 0;
    }

    /* 面板全屏 */
    .pp-drawer-panel {
        width: 100%;
        max-width: 100%;
    }

    .pp-drawer-body {
        padding: 24px 20px;
    }

    .pp-drawer-top {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 28px;
        padding-bottom: 24px;
    }

    /* 移动端界面有限，隐藏产品详情图片，只显示文字信息 */
    .pp-drawer-img {
        display: none;
    }

    .pp-drawer-info h2 {
        font-size: 1.35rem;
    }

    .pp-drawer-close {
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .pp-header h2 {
        font-size: 1.5rem;
    }

    .pp-card-body {
        padding: 16px;
    }

    .pp-card-body h3 {
        font-size: 0.95rem;
    }

    .pp-drawer-body {
        padding: 20px 16px;
    }

    .pp-drawer-info h2 {
        font-size: 1.2rem;
    }

    .spec-table td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}
