:root {
            --nav-width: 15%;
            --content-width: 85%;
            --shadow-color: rgba(0,0,0,0.1);
            --card-bg: #ffffff;
        }
        
        /* 修复布局的核心代码 */
        .main-content {
            display: flex;
            gap: 30px;
            position: relative;
        }
        
        .site-info {
            flex: 1;
            min-width: 70%; /* 100% - 30% */
        }
    
        /* 新版轮播容器 */
        .gallery-container {
            position: relative;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 8px 30px var(--shadow-color);
            margin-bottom: 30px;
        }

        .carousel-wrapper {
            display: flex;
            /*transition: transform 0.5s ease;*/
            transition: none; /* 移除默认过渡效果 */
        }

        .carousel-slide {
            flex: 0 0 100%;
            position: relative;
            padding-top: 56.25%;
        }

        .carousel-slide img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* 轮播控制器 */
        .carousel-controls {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
        }

        .carousel-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: rgba(255,255,255,0.5);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .carousel-dot.active {
            background: #fff;
            transform: scale(1.2);
        }

/* 当只有一个轮播项时 */
.carousel-wrapper:not(:has(.carousel-slide:nth-child(2))) {
    overflow: visible;
    transform: none !important;
}

/* 单图时隐藏控制元素 */
.carousel-wrapper:not(:has(.carousel-slide:nth-child(2))) .carousel-controls,
.carousel-wrapper:not(:has(.carousel-slide:nth-child(2))) .carousel-nav {
    display: none !important;
}

/* 强制显示单张图片 */
.carousel-wrapper:not(:has(.carousel-slide:nth-child(2))) .carousel-slide {
    opacity: 1 !important;
    transform: none !important;
    position: static;
    flex: 1;
}
    
    
        /* 侧边栏宽度调整 */
        .detail-sidebar {
            /*flex: 0 0 30% !important;
            padding-left: 25px;
            margin-left: 25px;
            
            
            
            flex: 0 0 30%;
            position: sticky;
            top: 20px;
            height: calc(100vh - 60px);
            overflow-y: auto;
            padding-left: 30px;
            border-left: 1px solid #eee;*/
            
            
    width: 30%;
    padding-left: 25px;
    margin-left: 25px;
    border-left: 1px solid #eee;

        }

    /* 网站网格系统 */
.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 15px;
    width: 100%;
}
    
    /* 网站卡片自适应规则 */
.website-card {
    /* 保留已有样式 */
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: #2c3e50;
    min-width: 0;
    
    /* 容器查询设置 */
    container-type: inline-size;
    container-name: card;
}
    
    /* 卡片内容自适应 */
.website-card span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0; /* 解决flex文本溢出问题 */
}

.website-card img {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-right: 12px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
    
        /* 悬空卡片样式 */
        .card-style {
            /*background: var(--card-bg);
            border-radius: 16px;
            box-shadow: 0 6px 20px var(--shadow-color);
            padding: 20px;
            margin-bottom: 25px;
            transition: transform 0.3s ease;*/
            
            
            background: white;
            border-radius: 12px;
            box-shadow: 0 6px 20px rgba(0,0,0,0.08);
            padding: 20px;
            margin-bottom: 25px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .card-style:hover {
            /*transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);*/
            
            
            
            transform: translateY(-3px);
            box-shadow: 0 10px 30px rgba(0,0,0,0.12);
        }

        .related-sites {
            border-top: 3px solid #3498db;
        }

        .popular-sites {
            border-top: 3px solid #e74c3c;
        }

        .sidebar-ad {
            border-top: 3px solid #2ecc71;
            padding: 15px !important;
        }

        /* 标题样式 */
        .card-title {
            font-size: 1.2em;
            color: #2c3e50;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
/* 当卡片容器宽度 < 100px 时隐藏图片 */
@container card (max-width: 100px) {
    .website-card img {
        display: none !important;
    }
    
    .website-card span {
        width: 100%;
        text-align: center;
        padding: 0 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
    
    
    
    /* 响应式优化 */
@media (max-width: 1200px) {
    .website-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    }
}
        /* 响应式调整 */
        @media (max-width: 940px) {
            .card-style {
                margin: 15px;
                padding: 15px;
            }
            
            .detail-sidebar {
                border-left: none;
                margin-left: 0;
            }
        }
    
    /* 精确的媒体查询 */
        @media (max-width: 800px) {
            .detail-sidebar {
                display: none !important;

                width: 100%;
                margin-left: 0;
                padding-left: 0;
                border-left: none;
            }

            .site-info {
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 auto;
                text-align: center;
            }

            .main-content {
                flex-direction: column;
            }
            
            .website-grid {
                grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            }
        }
    
    
    /* 防止超小屏幕布局错乱 */
@media (max-width: 480px) {
    .website-card {
        flex-direction: column;
        text-align: center;
    }

    .website-card img {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    
    .website-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}s