.form-group-single-item .list {
    max-height: 410px;
    overflow: auto;
}

/* Category Navigation Sidebar */
.category-nav-list {
    border-radius: 12px;
    overflow: hidden;
}

.category-nav-list .list-group-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    margin-bottom: -1px;
}

.category-nav-list .list-group-item:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.category-nav-list .list-group-item:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.category-nav-list .list-group-item:hover {
    background: #f8f9fa;
    border-color: var(--thm-color);
    transform: translateX(5px);
}

.category-nav-list .list-group-item.active {
    background: linear-gradient(135deg, var(--thm-color) 0%, #1F72C3 100%);
    color: #fff;
    border-color: var(--thm-color);
    transform: translateX(5px);
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: transparent;
    transition: all 0.3s ease;
}

.category-nav-list .list-group-item.active .category-icon {
    background: transparent;
}

.category-icon img,
.category-icon picture {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

.category-icon picture img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.category-name {
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
}

.category-nav-list .list-group-item:hover .category-name {
    color: var(--thm-color);
}

.category-nav-list .list-group-item.active .category-name {
    color: #fff;
}

/* Product Selection Tool Styles */

/* Introduction Section */
.selection-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 50px;
}

.selection-intro h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--thm-black);
    margin-bottom: 15px;
}

.selection-intro p {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
}

/* Comparison Tool Section */
.product-comparison-workspace {
    padding-top: var(--v2-section-padding-md);
}

.comparison-tool-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.comparison-tool-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--thm-black);
    margin-bottom: 10px;
}

.comparison-tool-section > p {
    color: #666;
    margin-bottom: 30px;
}

/* Product Selector */
.product-selector-row {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: flex-end;
}

.product-selector-list {
    display: flex;
    flex: 1;
    gap: 15px;
    align-items: flex-end;
    min-width: 0;
}

.product-selector {
    flex: 1;
    min-width: 0;
}

.product-selector label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--thm-black);
    margin-bottom: 8px;
}

.product-selector select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-selector select:focus {
    outline: none;
    border-color: var(--thm-color);
    box-shadow: 0 0 0 3px rgba(58, 151, 255, 0.1);
}

.compare-btn-wrapper {
    flex-shrink: 0;
}

.compare-btn {
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--thm-color) 0%, #1F72C3 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(58, 151, 255, 0.3);
    white-space: nowrap;
}

.compare-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(58, 151, 255, 0.4);
}

.compare-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Comparison Result Table */
.comparison-result {
    margin-top: 30px;
    min-width: 0;
    overflow: visible;
}

.comparison-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.comparison-table-scroll:focus-visible {
    outline: 3px solid rgba(var(--v2-primary-500-rgb), 0.24);
    outline-offset: 4px;
}

/* Comparison Toolbar */
.comparison-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comparison-toolbar-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.toolbar-btn {
    padding: 8px 16px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.toolbar-btn:hover {
    border-color: var(--thm-color);
    color: var(--thm-color);
}

.toolbar-btn.active {
    background: var(--thm-color);
    color: #fff;
    border-color: var(--thm-color);
}

.toolbar-btn i {
    font-size: 13px;
}

.comparison-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.comparison-info i {
    color: var(--thm-color);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e0e0e0;
    table-layout: fixed;
}

.comparison-table thead {
    background: linear-gradient(135deg, var(--thm-color) 0%, #1F72C3 100%);
    color: #fff;
}

.comparison-table thead th {
    padding: 20px 15px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.comparison-table thead th:first-child {
    text-align: left;
    width: 220px;
}

.comparison-table thead th:last-child {
    border-right: none;
}

.comparison-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.comparison-table tbody tr:hover {
    background: #f8f9fa;
}

.comparison-table tbody tr:last-child {
    border-bottom: none;
}

.comparison-table tbody td {
    padding: 15px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid #e0e0e0;
    position: relative;
}

.comparison-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--thm-black);
    background: #f8f9fa;
}

.comparison-table tbody td:last-child {
    border-right: none;
}

/* Highlight best value */
.comparison-table tbody td.best-value {
    background: rgba(58, 151, 255, 0.08);
    color: var(--thm-color);
    font-weight: 600;
}

.comparison-table tbody td.best-value::after {
    content: '★';
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--thm-color);
    font-size: 12px;
}

/* Different values highlight */
.comparison-table tbody tr.has-difference td:not(:first-child) {
    background: rgba(255, 193, 7, 0.05);
}

/* Hide rows that are the same when "show differences only" is active */
.comparison-table tbody tr.hide-same {
    display: none;
}

/* Product Image in Table */
.product-image-cell {
    padding: 20px 15px !important;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-card img,
.product-card picture {
    width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    display: block;
}

.product-card picture img {
    width: 120px;
    height: auto;
    border-radius: 8px;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--thm-black);
    margin-bottom: 10px;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.product-action-btn {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.product-action-btn.view-detail {
    background: var(--thm-color);
    color: #fff;
    border: 2px solid var(--thm-color);
}

.product-action-btn.view-detail:hover {
    background: #1F72C3;
    border-color: #1F72C3;
    color: #fff;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
    display: block;
}

.empty-state h4 {
    font-size: 20px;
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 15px;
    color: #999;
}

/* Info Box */
.info-box {
    background: #e3f2fd;
    border-left: 4px solid var(--thm-color);
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.info-box h6 {
    font-size: 16px;
    font-weight: 600;
    color: var(--thm-black);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box ul {
    margin: 0;
    padding-left: 20px;
}

.info-box li {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

/* Responsive Design */
@media (max-width: 991px) {
    .selection-intro h2 {
        font-size: 28px;
    }

    .product-selector-row {
        flex-direction: column;
        align-items: stretch;
    }

    .product-selector-list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
        width: 100%;
    }

    .product-selector,
    .compare-btn-wrapper,
    .compare-btn {
        width: 100%;
    }

    .comparison-table {
        font-size: 14px;
    }

    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 12px 10px;
    }

    .product-card img,
    .product-card picture {
        width: 100px;
    }

    .product-card picture img {
        width: 100px;
    }
}

@media (max-width: 767px) {
    .selection-intro h2 {
        font-size: 24px;
    }

    .comparison-tool-section {
        padding: 20px 15px;
    }

    .comparison-table {
        font-size: 13px;
    }

    .product-card img,
    .product-card picture {
        width: 80px;
    }

    .product-card picture img {
        width: 80px;
    }

    .product-action-btn {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/*-------- 修复：确保本页面的 WOW 元素正确显示 --------*/
/* 之前为了优化首页 CLS，将所有 .wow 元素设置为 opacity: 0
   但这导致本页面的内容无法显示。这里覆盖该设置。 */

/* 页面特定：确保 Introduction Section 和 Comparison Tool Section 的内容可见 */
.selection-intro.wow {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.comparison-tool-section.wow {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* 确保子元素也可见 */
.selection-intro.wow *,
.comparison-tool-section.wow * {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ============================================================
   V2 Product Selector Overrides
   说明：
   - 侧边分类、对比工具和工具栏按钮统一到 V2 的浅底卡片语义。
   ============================================================ */

.category-nav-list .list-group-item,
.comparison-tool-section,
.comparison-table,
.comparison-toolbar {
    background: var(--v2-bg-primary);
    border-color: var(--v2-bg-divider);
    box-shadow: var(--v2-shadow-card);
}

.category-nav-list .list-group-item:hover {
    background: rgba(var(--v2-primary-500-rgb), 0.05);
    border-color: var(--v2-primary-500);
}

.category-nav-list .list-group-item.active,
.comparison-table thead,
.toolbar-btn.active {
    background: var(--v2-primary-500);
    color: var(--v2-text-inverse);
    border-color: var(--v2-primary-500);
}

.product-selector select,
.toolbar-btn {
    border-color: var(--v2-bg-divider);
    border-radius: var(--v2-radius-sm);
}

.product-selector select:focus,
.toolbar-btn:hover {
    border-color: var(--v2-primary-500);
    color: var(--v2-primary-500);
    box-shadow: 0 0 0 3px rgba(var(--v2-primary-500-rgb), 0.1);
}

/* ============================================================
   V2 Product Selector Final Alignment
   说明：
   - 当前产品对比页最大的遗留问题是左侧分类激活项仍带旧 list-group 分段圆角。
   - 这里把分类导航、选择器、对比表和工具栏统一成完整中卡/大卡节奏。
   ============================================================ */

.category-nav-list {
    gap: 10px;
}

.category-nav-list .list-group-item {
    margin-bottom: 10px;
    border: 1px solid var(--v2-bg-divider) !important;
    border-radius: var(--v2-radius-md) !important;
    box-shadow: none;
}

.category-nav-list .list-group-item:first-child,
.category-nav-list .list-group-item:last-child {
    border-radius: var(--v2-radius-md) !important;
}

.category-nav-list .list-group-item.active {
    background: var(--v2-primary-500);
    border-color: var(--v2-primary-500) !important;
    color: var(--v2-text-inverse);
    box-shadow: 0 14px 30px rgba(var(--v2-primary-500-rgb), 0.18);
}

.comparison-tool-section,
.comparison-tool,
.comparison-table,
.comparison-toolbar {
    border-radius: var(--v2-radius-lg);
}

.product-selector select,
.toolbar-btn {
    min-height: 42px;
    background: var(--v2-bg-primary);
    color: var(--v2-text-body);
}

.toolbar-btn.active {
    color: var(--v2-text-inverse);
}

.product-comparison-workspace .atf-widget,
.product-comparison-workspace .category-nav-list .list-group-item,
.product-comparison-workspace .comparison-tool-section,
.product-comparison-workspace .comparison-toolbar,
.product-comparison-workspace .comparison-table,
.product-comparison-workspace .empty-state,
.product-comparison-workspace .info-box,
.product-comparison-workspace .product-selector select,
.product-comparison-workspace .toolbar-btn {
    border-radius: 8px !important;
}

.product-comparison-workspace .compare-btn {
    background: var(--v2-primary-500, #2967D3) !important;
    border-radius: 22px !important;
    box-shadow: 0 10px 22px rgba(var(--v2-primary-500-rgb), 0.22);
}

.product-comparison-workspace .compare-btn:hover:not(:disabled) {
    background: var(--v2-primary-600, #1F5DBF) !important;
}

.product-comparison-workspace .compare-btn:disabled {
    background: var(--v2-bg-secondary, #F3F6FA) !important;
    box-shadow: none !important;
    color: var(--v2-text-tertiary, #A0A7B0) !important;
    opacity: 1 !important;
    transform: none !important;
}

.product-comparison-workspace .comparison-tool-section h3 {
    font-size: 24px;
    line-height: 32px;
    font-weight: 500;
}

.product-comparison-workspace .comparison-tool-section > p,
.product-comparison-workspace .empty-state p,
.product-comparison-workspace .info-box li {
    font-size: 16px;
    line-height: 24px;
}

.product-comparison-workspace .empty-state h4,
.product-comparison-workspace .info-box h6 {
    font-size: 20px;
    line-height: 28px;
    font-weight: 500;
}

.product-comparison-workspace + .atf-Subscribe-area .atf-subscribe-copy h3 {
    font-size: 24px;
    line-height: 32px;
    font-weight: 500;
}

.product-comparison-workspace + .atf-Subscribe-area .atf-subscribe-panel,
.product-comparison-workspace + .atf-Subscribe-area .atf-subscribe-form,
.product-comparison-workspace + .atf-Subscribe-area .atf-subscribe-input,
.product-comparison-workspace + .atf-Subscribe-area .atf-subscribe-btn {
    border-radius: 8px;
}

@media (max-width: 767px) {
    .product-comparison-workspace .comparison-tool-section h3,
    .product-comparison-workspace .empty-state h4,
    .product-comparison-workspace .info-box h6,
    .product-comparison-workspace + .atf-Subscribe-area .atf-subscribe-copy h3 {
        font-size: 20px;
        line-height: 28px;
        font-weight: 500;
    }

    .product-comparison-workspace .compare-btn {
        border-radius: 21px !important;
    }
}

/* Camera comparison responsive layout */
@media (max-width: 991px) {
    .product-comparison-workspace .atf-sidebar-widget {
        margin-bottom: 20px;
    }

    .product-comparison-workspace .category-nav-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        margin: 0;
        padding: 0 0 8px !important;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .product-comparison-workspace .category-nav-list::-webkit-scrollbar {
        display: none;
    }

    .product-comparison-workspace .category-nav-list .list-group-item {
        flex: 0 0 auto;
        min-width: 190px;
        margin: 0;
        padding: 10px 12px;
        scroll-snap-align: start;
    }

    .product-comparison-workspace .category-nav-list .category-icon {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }
}

@media (max-width: 767px) {
    .product-comparison-workspace.atf-section-padding {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .product-comparison-workspace > .container {
        max-width: 100%;
        padding-right: 16px;
        padding-left: 16px;
    }

    .product-comparison-workspace .comparison-tool-section {
        padding: 20px;
    }

    .product-comparison-workspace .product-selector-row {
        gap: 14px;
    }

    .product-comparison-workspace .product-selector-list {
        display: flex;
        gap: 10px;
        align-items: flex-end;
        width: 100%;
        padding-bottom: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scrollbar-color: rgba(var(--v2-primary-500-rgb), 0.35) transparent;
        scrollbar-width: thin;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .product-comparison-workspace .product-selector-list::-webkit-scrollbar {
        height: 4px;
    }

    .product-comparison-workspace .product-selector-list::-webkit-scrollbar-thumb {
        background: rgba(var(--v2-primary-500-rgb), 0.35);
        border-radius: 999px;
    }

    .product-comparison-workspace .product-selector-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .product-comparison-workspace .product-selector-list .product-selector {
        flex: 0 0 clamp(150px, 46vw, 180px);
        scroll-snap-align: start;
    }

    .product-comparison-workspace .product-selector select,
    .product-comparison-workspace .compare-btn {
        min-height: 44px;
    }

    .product-comparison-workspace .comparison-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .product-comparison-workspace .comparison-toolbar-left {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .product-comparison-workspace .comparison-toolbar-left .toolbar-btn {
        flex: 1 1 140px;
        min-height: 44px;
        white-space: normal;
    }

    .product-comparison-workspace .comparison-info {
        width: 100%;
    }

    .product-comparison-workspace .comparison-table {
        width: 720px;
        min-width: 720px;
        table-layout: fixed;
    }

    .product-comparison-workspace .comparison-table thead th:first-child,
    .product-comparison-workspace .comparison-table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        width: 150px;
        min-width: 150px;
    }

    .product-comparison-workspace .comparison-table thead th:first-child {
        z-index: 3;
        background: var(--v2-primary-500);
    }

    .product-comparison-workspace .comparison-table tbody td:first-child {
        background: var(--v2-bg-primary);
        box-shadow: 8px 0 12px -12px rgba(10, 33, 65, 0.45);
    }
}
