/* === 1. Block: Product List === */
.product-list {
    padding-top: 30px;
    padding-bottom: var(--space-3xl);
}

.product-list__filter {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.product-list__items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* === 2. Block: Product Card === */
.product-card {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2xl);
    padding: var(--space-lg) 0;
    border-bottom: 2px solid var(--color-border);
}

.product-card__info {
    flex: 0 0 280px;
}

.product-card__specs {
    margin-bottom: var(--space-md);
}

.product-card__spec {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-2xs);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

.product-card__spec-label {
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
    min-width: 20px;
}

.product-card__spec-value {
    color: var(--color-text-secondary);
}

.product-card__image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__image {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

/* === 3. Block: Spec Selector === */
.spec-selector {
    position: relative;
    display: inline-block;
}

.spec-selector__current {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
}

.spec-selector__value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-black);
    color: var(--color-text);
    font-family: var(--font-family);
    border-bottom: 3px solid var(--color-black);
    display: inline-block;
    line-height: 2;
}

.spec-selector__label {
    font-size: var(--font-size-lg);
    font-weight: bolder;
    color: black;
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    cursor: pointer;
}

.spec-selector__arrow {
    transition: transform var(--transition-fast);
    width: 15px;
    height: 15px;
    object-fit: contain;
    transform: rotate(-90deg);
}

.spec-selector--open .spec-selector__arrow {
    transform: rotate(90deg);
}

.spec-selector__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 150px;
    min-width: 260px;
    background-color: rgba(255, 255, 255, 95%);
    box-shadow: var(--shadow-dropdown);
    border-radius: var(--radius-md);
    z-index: var(--z-dropdown);
    max-height: 500px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 transparent;
}

.spec-selector__dropdown::-webkit-scrollbar {
    width: 2px;
}

.spec-selector__dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.spec-selector__dropdown::-webkit-scrollbar-thumb {
    background-color: #d0d0d0;
    border-radius: 1px;
}

.spec-selector__dropdown::-webkit-scrollbar-button {
    display: none;
    height: 0;
    width: 0;
}

.spec-selector__dropdown::-webkit-scrollbar-button:start:decrement,
.spec-selector__dropdown::-webkit-scrollbar-button:end:increment {
    display: none;
    height: 0;
}

.spec-selector--open .spec-selector__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.spec-selector__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: var(--font-size-base);
    color: var(--color-text);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-family: var(--font-family-en);
}

.spec-selector__option:hover {
    background-color: var(--color-bg-alt);
}

.spec-selector__option--active {
    font-weight: var(--font-weight-black);
}

.spec-selector__option-arrow {
    opacity: 0;
    transition: opacity var(--transition-fast);
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.spec-selector__option:hover .spec-selector__option-arrow {
    opacity: 1;
}

/* === 4. Block: Product Detail === */
.product-detail__hero {
    padding: var(--space-xl) 0 var(--space-lg);
}

.product-detail__model {
    font-family: var(--font-family-en);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-black);
    color: var(--color-text);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-xs);
}

.product-detail__subtitle {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

.product-detail__nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: var(--space-lg) 0;
}

.product-detail__nav-link {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    transition: color var(--transition-fast);
}

.product-detail__nav-link:hover {
    color: rgb(0, 0, 0);
}

/* Desktop nav arrows */
.nav-link__arrow {
    display: inline;
    width: 8px;
}

.nav-link__arrow--prev {
    margin-left: var(--space-2xs);
}

.nav-link__arrow--next {
    margin-left: var(--space-2xs);
}

.product-detail__section {
    padding: var(--space-md) 0;
}

.product-detail__desc {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: var(--line-height-loose);
    margin-bottom: var(--space-lg);
}

.product-detail__gallery {
    margin: var(--space-lg) 0;
}

.product-detail__gallery-main {
    width: 100%;
    height: 400px;
    object-fit: contain;
    margin-bottom: var(--space-md);
}

.product-detail__gallery-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
}

.product-detail__gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color var(--transition-fast);
}

.product-detail__gallery-dot--active {
    background-color: var(--color-text);
}

/* === 5. Block: Spec Table === */
.spec-table {
    width: 100%;
    border: 2px solid var(--color-border-table);
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-base);
}

.spec-table th,
.spec-table td {
    padding: 2px 10px;
    border: 2px solid var(--color-border-table);
    text-align: left;
    vertical-align: top;
}

.spec-table th {
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    padding: 10px 16px;
    text-align: center;
    white-space: nowrap;
}

.spec-table td {
    color: var(--color-text);
}

/* 紧凑型表格：移除 tbody 内部的水平边框 */
.spec-table--compact tbody td {
    border-top: none;
    border-bottom: none;
}

.spec-table--compact tbody tr:first-child td {
    border-top: 1px solid var(--color-border-table);
}

.spec-table--compact tbody tr:last-child td {
    border-bottom: 1 solid var(--color-border-table);
}

.spec-table--params {
    border: 2px solid var(--color-border-table);
    table-layout: fixed;
}

.spec-table--params td {
    border: none;
    padding: 2px 16px;
}

.spec-table--params td:nth-child(odd) {
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    white-space: nowrap;
}

.spec-table--params td:nth-child(even) {
    color: var(--color-text);
    border-right: 2px solid var(--color-border-table);
}

.spec-table--params .spec-table__title-row td {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: var(--color-text);
    text-align: left;
    padding: 8px 16px;
    border-bottom: 2px solid var(--color-border-table);
    background-color: rgb(234, 234, 234);
}

.spec-table--params_odd {
    width: 20%;
}

.spec-table--params_even {
    width: 30%;
}

.spec-table--params_half {
    width: 50%;
}

.spec-table__title-row td {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: var(--color-text);
    text-align: left;
    padding: 8px 16px;
    border-bottom: 2px solid var(--color-border-table);
    background-color: rgb(234, 234, 234);
}

/* 确保紧凑型表格的标题行也有下边框 */
.spec-table--compact .spec-table__title-row td {
    border-bottom: 2px solid var(--color-border-table);
}

/* 第2列和第3列之间的垂直分割线 - 仅桌面端 tbody */
.spec-table__tbody--desktop td:nth-child(4n + 2) {
    border-right: 1px solid var(--color-border-table);
}

/* 机械性能参数表格 - 响应式 tbody 显示控制 */
.spec-table__tbody--mobile {
    display: none;
}

.spec-table__tbody--mobile_display {
    display: none;
}

.spec-table__tbody--desktop {
    display: table-row-group;
}

.spec-table--dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--space-2xl);
    border: none;
}

.spec-table--dual .spec-table__group {
    display: table;
    width: 100%;
}

/* === 6. Block: Case Detail (Product Cases) === */
.case-detail {
}

.case-detail__header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-lg);
}

.case-detail__header img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

/* View Case Button - Hidden on desktop */
.case-detail__view-btn {
    display: none;
}

.case-detail__info {
    margin-bottom: var(--space-lg);
}

.case-detail__info-item {
    display: flex;
    flex-wrap: nowrap;
    /*justify-content: space-around;*/
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-base);
    line-height: var(--line-height-loose);
}

.case-detail__info-label {
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
    flex-shrink: 0;
}

.case-detail__info-value {
    color: var(--color-text-secondary);
}

.case-detail__photos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.case-detail__photo {
    flex: 0 0 calc(25% - var(--space-sm) * 3 / 4);
    max-width: 280px;
    aspect-ratio: 4/3;
    overflow: hidden;
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-sm);
}

.case-detail__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === 7. Block: Case Photo Carousel === */
.case-detail__carousel-dots {
    display: none;
}


.case-detail__carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    padding: 0;
}

.case-detail__carousel-dot--active {
    background-color: var(--color-text);
}

/* ============================================
   Mobile Styles - Contact Page
   ============================================ */
@media (max-width: 768px) {
    /* Mobile Spec Table Styles */
    .spec-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border: 1px solid var(--color-border-table);
    }

    .spec-table::-webkit-scrollbar {
        display: none;
    }
    .case-detail__info-item {
        flex-direction: column;
    }

    /* 缺陷检测及量化精度表格容器 - 隐藏移动端滚动条 */
    .product-detail__section > div[style*="overflow-x: auto"] {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .product-detail__section
    > div[style*="overflow-x: auto"]::-webkit-scrollbar {
        display: none;
    }

    /* 机械性能参数表格 - 移动端切换到2列 tbody */
    .spec-table__tbody--mobile {
        border: 1px solid var(--color-border-table);
        display: table-row-group;
    }

    .spec-table__tbody--desktop {
        display: none;
    }

    .spec-table__tbody--desktop_display {
        display: none;
    }

    /* 标题行加高 */
    .spec-table--params .spec-table__title-row td {
        font-size: var(--font-size-lg);
    }

    /* 移动端2列布局：标签列和值列宽度 */
    .spec-table__tbody--mobile td:first-child {
        font-weight: var(--font-weight-bold);
        color: var(--color-text);
        white-space: nowrap;
        width: 40%;
    }

    .spec-table__tbody--mobile td:last-child {
        color: var(--color-text);
        width: 60%;
    }

    /* 产品详情页 section 间距 - 移动端缩小 */
    .product-detail__section {
        padding: 10px 0;
    }

    .product-detail__section + .product-detail__section {
        border-top: none;
    }

    /* 缺陷检测及量化精度表格 - 移动端表头样式 */
    .spec-table--compact .spec-table__title-row td {
        font-size: var(--font-size-lg);
    }

    /* 缺陷检测及量化精度表格 - 滑动提示（使用伪元素） */
    /* 只在有 thead 的表格（缺陷检测及量化精度）上显示滑动提示 */
    .spec-table--compact:has(thead) .spec-table__title-row td::after {
        content: "< 左右滑动查看更多内容 >";
        display: block;
        font-size: var(--font-size-xs);
        color: rgb(83, 81, 81);
        font-weight: var(--font-weight-normal);
        margin-top: 4px;
        text-align: center;
        margin-right: 50%;
    }

    /* 缺陷定位精度表格 - 移动端样式 */
    .spec-table--compact tbody tr:nth-child(2) td,
    .spec-table--compact tbody tr:nth-child(3) td {
        border-bottom: 2px solid var(--color-border-table);
    }

    /* 缺陷定位精度表格 - 缩小右侧列 */
    .spec-table--compact tbody tr td:first-child {
        width: 35%;
    }

    .spec-table--compact tbody tr td:last-child {
        width: 65%;
    }

    /* Case Detail View Button - Show on mobile */
    .case-detail__view-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: var(--space-xs) var(--space-md);
        background-color: var(--color-text);
        color: var(--color-white);
        font-size: var(--font-size-sm);
        text-decoration: none;
        margin-left: auto;
    }

    .case-detail__header {
        justify-content: flex-start;
    }

    /* Product Detail Gallery - Smaller height on mobile */
    .product-detail__gallery-main {
        height: 200px;
    }

    /* Product Detail Page: Move nav to bottom on mobile */
    /* Make container flex to support order property */
    .product-detail__nav {
        order: 999;
        margin-top: 0;
        padding-top: var(--space-xs);
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: relative;
    }

    /* Apply flex layout to container on product detail page */
    body:has(.product-detail__nav) .container:has(.product-detail__nav) {
        display: flex;
        flex-direction: column;
    }

    .container {
        display: flex;
        flex-direction: column;
    }

    .case-detail__photos {
        display: flex;
        justify-content: start;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        position: relative;
        gap: 0;
        padding-bottom: 0;
        width: 100%;
    }

    .case-detail__photos::-webkit-scrollbar {
        display: none;
    }

    .case-detail__photo,
    .case-detail__photo .case-detail__photo--active {
        display: block;
        flex: 0 0 100%;
        max-width: 100%;
        min-width: 100%;
        width: 100%;
        aspect-ratio: 5/3;
        scroll-snap-align: start;
        overflow: hidden;
    }

    .case-detail__photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .case-detail__carousel-dots {
        display: flex;
        justify-content: center;
        gap: var(--space-xs);
        margin-top: var(--space-md);
    }

    .case-detail__carousel-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: rgba(0, 0, 0, 0.2);
        border: none;
        cursor: pointer;
        transition: background-color var(--transition-fast);
        padding: 0;
        display: block;
        /*text-decoration: none;*/
    }

    .case-detail__carousel-dot--active {
        background-color: var(--color-text);
    }

    /* Mobile nav links: full width with arrow on right */
    .product-detail__nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-md) 0;
        font-size: var(--font-size-base);
        color: var(--color-text);
        border-bottom: 2px solid var(--color-border);
    }

    .product-detail__nav-link:first-child {
        border-top: 1px solid var(--color-border);
    }

    .product-detail__nav-link:last-child {
        border-bottom: none;
    }

    /* Hide original arrows, add new right arrow */
    .product-detail__nav-link::after {
        content: ">";
        font-size: var(--font-size-lg);
        color: var(--color-text-muted);
        margin-left: var(--space-sm);
    }

    .product-list {
        padding-bottom: 0;
        padding-top: 10px;
    }

    .product-list__filter {
        margin-bottom: 0;
    }

    /* Product Card: Stack vertically on mobile */
    .product-card {
        flex-direction: column-reverse;
        gap: var(--space-lg);
        padding: var(--space-xl) 0;
    }

    .product-card__spec {
        margin-bottom: 0;
    }

    .product-card__info {
        flex: none;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .product-card__image-wrapper {
        flex: none;
        width: 100%;
    }

    .product-card__image {
        max-height: 200px;
    }

    /* Mobile Spec Selector Styles */
    .product-list__filter {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .spec-selector {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        position: relative;
    }

    .spec-selector__current {
        gap: var(--space-lg);
        justify-content: space-between;
        width: calc(100% + 2 * var(--container-padding));
        background-color: var(--color-white);
        position: relative;
        padding: 0 var(--container-padding) 8px;
        margin: 0 calc(-1 * var(--container-padding)) -8px;
    }

    .spec-selector__value {
        font-size: var(--font-size-xl);
        border-bottom: 2px solid var(--color-black);
        line-height: 1.8;
    }

    .spec-selector__label {
        font-size: var(--font-size-lg);
    }

    /* Mobile Product Card Button - Align to right */
    .product-card__btn {
        align-self: flex-end;
    }

    /* Mobile Spec Selector Dropdown - From selector position with overlay */
    .spec-selector__dropdown {
        position: absolute;
        top: 100%;
        left: calc(-1 * var(--container-padding));
        right: calc(-1 * var(--container-padding));
        width: calc(100% + 2 * var(--container-padding));
        max-height: calc(100vh - 200px);
        background-color: var(--color-white);
        z-index: 1001;
        border-radius: 0;
        box-shadow: none;
        padding: 8px var(--space-lg) var(--space-md);
    }

    .spec-selector__option {
        padding: var(--space-md) 0;
        border-bottom: 2px solid var(--color-border-light);
        font-size: var(--font-size-lg);
    }

    .spec-selector__option:last-child {
        border-bottom: none;
    }
}
