/* Column View Styles */
.column-view {
    padding: 60px 0 0 0;
    min-height: 100vh;
}

.column-container {
    display: grid;
    grid-template-columns: repeat(5, minmax(145px, 160px));
    gap: 4px;
    max-width: 730px;
    margin: 0 auto;
    padding: 0 16px;
    justify-content: center;
    position: relative;
}

/* Category Column */
.category-column {
    background: rgba(255, 255, 255, 0.02);
    min-height: 200px; /* 只在桌面端保持最小高度 */
    padding: 4px;
    position: relative;
}

/* Category illustration above the title */
.category-illustration {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 4px 0; /* full-width on desktop; centered via media rule on mobile */
    /* Make the illustration non-selectable/non-draggable */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.category-title {
    font-size: 12px;
    font-weight: 800;
    color: #000000;
    text-align: center;
    margin-bottom: 0px; /* 无间距 */
    letter-spacing: 0.5px;
    padding: 6px 0 0 0; /* 只保留上内边距，移除下内边距 */
    height: 20px; /* 固定标题高度确保对齐 */
    display: flex;
    align-items: flex-end; /* 向下对齐 */
    justify-content: center;
}

.category-projects {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Project Card in Column */
.column-project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
    padding: 24px 4px 0px 4px;
    transition: all 0.2s ease;
    /* Skip rendering offscreen cards where supported */
    content-visibility: auto;
    contain-intrinsic-size: 90px 160px;
}



.column-project-card.hide {
    display: none;
}

.column-project-image {
    width: 100%;
    height: 70px;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 4px;
    border: 1px solid #000;
}

.column-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Default: slightly desaturated and brighter */
    filter: saturate(0.6) brightness(1.1);
    transition: filter 0.2s ease;
    /* Hint the browser to skip offscreen work where supported */
    content-visibility: auto;
    contain-intrinsic-size: 70px 160px;
}

.column-project-card:hover .column-project-image img {
    /* Hover: show original image */
    filter: none;
}

.column-project-info {
    text-align: left;
}

.column-project-title {
    font-size: 12px;
    font-weight: 400;
    color: #000;
    margin: 0;
    line-height: 1.2;
}

/* Desktop-only lines (横线和竖线) - 只在901px以上显示5列布局 */
@media screen and (min-width: 901px) {
    /* Desktop: fix illustration height so headers align */
    .category-illustration {
        width: 100%;
        height: 100px; /* keep layout slot */
        object-fit: contain;
        margin: 0 0 2px 0; /* keep small flow gap */
        /* Visually move up a bit; keep position stable */
        transform: translateY(-48px) scale(1.25);
        transform-origin: top center;
    }

    /* Horizontal line across all columns under titles */
    .column-container::after {
        content: '';
        position: absolute;
        top: 128px; /* 4px (padding) + 100px (img) + 2px (gap) + 20px (title) + 2px (fine) */
        left: 0;
        right: 0;
        height: 2px;
        background: #000000;
        z-index: 10;
        pointer-events: none;
    }

    /* Vertical dividers between columns starting at the horizontal line */
    .category-column:not(:last-child)::before {
        content: '';
        position: absolute;
        top: 128px; /* align with horizontal line */
        right: -2px; /* half of the 4px gap */
        bottom: 0;
        width: 1.4px;
        background: #000000;
        z-index: 10;
        pointer-events: none;
    }
}

/* Responsive Design - 只有两种状态：5列(桌面)和1列(移动) */
@media (max-width: 900px) {
    .column-view {
        padding: 20px 0;
    }
    
    .column-container {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 20px;
        max-width: 500px;
        position: relative;
    }
    
    /* 移动端提示文字 */
    /* .column-container::before {
        content: "Tap to TOGGLE, Double Tap to FOCUS  ";
        font-family: "Barlow", serif;
        position: absolute;
        display: block;
        top: -22px;
        right: -14px;
        text-align: right;
        font-size: 10px;
        color: var(--color-text-grey);
        background: none;
        height: auto;
        width: auto;
        border-radius: 0;
    } */
    
    .category-column {
        padding: 16px 0 0 0; /* 只保留顶部padding */
        margin-bottom: 20px; /* 恢复正常间距 */
        min-height: auto; /* 移动端自适应高度 */
    }
    
    /* 移除桌面端的线条效果 */
    .column-container::after {
        display: none;
    }
    
    .category-column::before {
        display: none;
    }
    
    .category-title {
        font-size: 14px;
        margin-bottom: 2px;
        height: auto;
        /* padding-bottom: 4px; */
        font-weight: 600;
        border-bottom: 2px solid #000; /* 移动端标题下方的分割线 */
    }

    /* Illustration is half column width on mobile */
    .category-illustration {
        width: 50%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .column-project-card {
        padding: 2px 0;
        display: flex;
        gap: 10px;
        align-items: center;
        border-bottom: 1px solid #000;
    }
    
    /* 每个category的最后一个card下方2px的线 */
    .category-column .column-project-card:last-child {
        border-bottom: 2px solid #000;
        margin-bottom: 16px; /* 添加底部间距匹配padding */
    }
    
    .column-project-image {
        width: 140px;
        height: 42px;
        flex-shrink: 0;
        border: 1px solid #000;
    }

    /* On mobile, remove image filters to reduce GPU work */
    .column-project-image img {
        filter: none;
        content-visibility: auto;
        contain-intrinsic-size: 42px 140px;
    }
    
    .column-project-info {
        flex: 1;
    }
    
    .column-project-title {
        font-size: 13px;
    }
}

/* 极小屏幕优化 */
@media (max-width: 480px) {
    .column-container {
        padding: 0 15px;
        max-width: 460px;
    }
    
    .category-column {
        padding: 12px 0 0 0; /* 只保留顶部padding */
        margin-bottom: 20px; /* 恢复正常间距 */
        min-height: auto; /* 极小屏幕自适应高度 */
    }
    
    .column-project-card {
        padding: 2px 0;
        gap: 8px;
    }
    
    .column-project-image {
        width: 130px;
        height: 38px;
        border: 1px solid #000;
    }
    
    .column-project-title {
        font-size: 15px;
    }
    
    .category-title {
        font-size: 14px;
        margin-bottom: 2px;
        /* padding-bottom: 4px; */
        border-bottom: 2px solid #000; /* 确保极小屏幕也有标题下方的分割线 */
    }
    
    /* 每个category的最后一个card下方2px的线 - 极小屏幕 */
    .category-column .column-project-card:last-child {
        border-bottom: 2px solid #000;
        margin-bottom: 12px; /* 添加底部间距匹配padding */
    }
}

/* Filter Integration */
.column-project-card[data-digital],
.column-project-card[data-physical],
.column-project-card[data-xr],
.column-project-card[data-hcd] {
    /* Ensure all label attributes are available for filtering */
    position: relative;
}

/* Hide/Show animations */
.column-project-card {
    opacity: 1;
    transition: all 0.3s ease;
}

.column-project-card.hide {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
    margin: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

/* Hover filter effects for column view */
.column-project-card.fade-out {
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

/* 确保分割线不受任何效果影响 - 最强规则 */
/* 移除全局强制线条，改为每列标题下边框以适配插图动态高度 */

/* Empty category handling */
.category-column:has(.column-project-card:not(.hide)) .category-title {
    opacity: 1;
}

.category-column:not(:has(.column-project-card:not(.hide))) {
    opacity: 0.3;
}

/* 确保空column的竖线仍然可见 - 已合并到上面的最强规则中 */

.category-column:not(:has(.column-project-card:not(.hide))) .category-title {
    opacity: 0.5;
}
