/**
 * 详情页侧边栏样式
 * 
 * @package Hurricane_Movie_2025
 * @version 1.0.0
 */

/* ==========================================================================
   侧边栏容器
   ========================================================================== */

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
    height: auto; /* 自动高度 */
    min-height: auto;
    max-height: none; /* 移除最大高度限制 */
    overflow: visible; /* 不显示滚动条 */
    align-self: start; /* 防止被拉伸 */
}

/* ==========================================================================
   侧边栏小工具
   ========================================================================== */

.detail-sidebar .sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    height: auto; /* 自动高度 */
    min-height: auto; /* 移除最小高度限制 */
    overflow: visible; /* 确保内容不被裁剪 */
}

.detail-sidebar .widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.detail-sidebar .widget-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-base);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.detail-sidebar .widget-title svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: var(--font-sm);
}

/* ==========================================================================
   电影推荐列表
   ========================================================================== */

.related-movies-list,
.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    height: auto; /* 自动高度 */
    overflow: visible; /* 确保内容不被裁剪 */
}

.sidebar-movie-item,
.sidebar-article-item {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.sidebar-movie-item:hover,
.sidebar-article-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* 缩略图 */
.sidebar-movie-item .movie-thumb,
.sidebar-article-item .article-thumb {
    flex-shrink: 0;
    width: 55px;
    height: 78px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: var(--bg-dark);
}

.sidebar-article-item .article-thumb {
    height: 42px;
}

.sidebar-movie-item .movie-thumb img,
.sidebar-article-item .article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-movie-item:hover .movie-thumb img,
.sidebar-article-item:hover .article-thumb img {
    transform: scale(1.05);
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* 评分徽章 */
.movie-score-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 6px;
    background: rgba(255, 193, 7, 0.95);
    color: #333;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
}

/* 信息区域 */
.sidebar-movie-item .movie-info,
.sidebar-article-item .article-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.sidebar-movie-item .movie-title,
.sidebar-article-item .article-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.sidebar-movie-item .movie-title a,
.sidebar-article-item .article-title a {
    color: var(--text-primary);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.sidebar-movie-item .movie-title a:hover,
.sidebar-article-item .article-title a:hover {
    color: var(--primary-color);
}

.sidebar-movie-item .movie-year,
.sidebar-article-item .article-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.sidebar-article-item .article-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.sidebar-article-item .article-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ==========================================================================
   热门排行榜
   ========================================================================== */

.hot-rank-list,
.hot-posts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: auto; /* 自动高度 */
    overflow: visible; /* 确保内容不被裁剪 */
}

.hot-rank-item,
.hot-post-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.hot-rank-item:hover,
.hot-post-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* 排名数字 */
.rank-number,
.post-rank {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    background: var(--bg-dark);
    color: var(--text-secondary);
}

.rank-number.top,
.post-rank.top {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* 排行榜缩略图 */
.rank-thumb {
    flex-shrink: 0;
    width: 35px;
    height: 50px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-dark);
}

.rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 排行榜信息 */
.rank-info,
.post-info {
    flex: 1;
    min-width: 0;
}

.rank-title,
.post-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px;
    line-height: 1.3;
}

.rank-title a,
.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.rank-title a:hover,
.post-title a:hover {
    color: var(--primary-color);
}

.rank-score,
.post-meta {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #f5b942;
}

.post-meta {
    color: var(--text-secondary);
}

.rank-score svg,
.post-meta svg {
    width: 12px;
    height: 12px;
}

/* ==========================================================================
   分类标签
   ========================================================================== */

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    height: auto;
    overflow: visible;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-tag:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.category-tag.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

.category-tag .tag-count {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 10px;
}

.category-tag.active .tag-count {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   标签云
   ========================================================================== */

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    height: auto;
    overflow: visible;
}

.tag-item {
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.tag-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* ==========================================================================
   分类列表
   ========================================================================== */

.category-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: auto;
    overflow: visible;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(4px);
}

.category-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.category-item .cat-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.category-item:hover .cat-name,
.category-item.active .cat-name {
    color: white;
}

.category-item .cat-count {
    padding: 2px 8px;
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.category-item.active .cat-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* ==========================================================================
   响应式设计 - 平板端
   ========================================================================== */

@media (max-width: 1024px) {
    .detail-sidebar {
        top: calc(60px + var(--spacing-md));
    }
}

/* ==========================================================================
   响应式设计 - 移动端
   ========================================================================== */

@media (max-width: 767px) {
    .detail-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
    
    .detail-sidebar .sidebar-widget {
        padding: var(--spacing-lg);
    }
    
    .detail-sidebar .widget-title {
        font-size: var(--font-lg); /* 放大标题 */
    }
    
    .detail-sidebar .widget-title svg {
        width: 20px;
        height: 20px;
    }
    
    /* 电影/文章推荐列表 - 移动端优化 */
    .related-movies-list,
    .related-articles-list {
        gap: var(--spacing-md); /* 增加间距 */
    }
    
    .sidebar-movie-item,
    .sidebar-article-item {
        padding: var(--spacing-sm); /* 增加内边距 */
        gap: var(--spacing-md); /* 图片和文字间距 */
        align-items: flex-start; /* 顶部对齐 */
    }
    
    .sidebar-movie-item .movie-thumb,
    .sidebar-article-item .article-thumb {
        width: 70px; /* 放大图片：50px → 70px */
        height: 100px; /* 按比例放大 */
        flex-shrink: 0; /* 防止图片被压缩 */
    }
    
    .sidebar-article-item .article-thumb {
        height: 53px; /* 文章缩略图也放大 */
    }
    
    .sidebar-movie-item .movie-info,
    .sidebar-article-item .article-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* 顶部对齐 */
        gap: 6px;
    }
    
    .sidebar-movie-item .movie-title,
    .sidebar-article-item .article-title {
        font-size: 15px; /* 放大文字：12px → 15px */
        line-height: 1.4;
        margin: 0; /* 移除多余边距 */
    }
    
    .sidebar-movie-item .movie-year,
    .sidebar-article-item .article-meta {
        font-size: 13px; /* 放大元信息：11px → 13px */
        margin: 0; /* 移除多余边距 */
    }
    
    .sidebar-article-item .article-meta svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }
    
    /* 热门排行榜 - 移动端优化 */
    .hot-rank-list,
    .hot-posts-list {
        gap: var(--spacing-sm); /* 增加间距 */
    }
    
    .hot-rank-item,
    .hot-post-item {
        padding: var(--spacing-sm); /* 增加内边距 */
        gap: var(--spacing-sm); /* 优化间距 */
        min-height: 60px; /* 设置最小高度 */
        align-items: flex-start; /* 顶部对齐，更整齐 */
    }
    
    .rank-number,
    .post-rank {
        width: 26px; /* 放大排名数字 */
        height: 26px;
        font-size: 14px;
        flex-shrink: 0;
        margin-top: 2px; /* 微调对齐 */
    }
    
    .rank-thumb {
        width: 45px; /* 放大缩略图：32px → 45px */
        height: 64px;
        flex-shrink: 0;
    }
    
    .rank-info,
    .post-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* 顶部对齐 */
        gap: 4px;
    }
    
    .rank-title,
    .post-title {
        font-size: 15px; /* 放大文字：12px → 15px */
        line-height: 1.4;
        margin: 0;
    }
    
    .rank-score,
    .post-meta {
        font-size: 13px; /* 放大元信息 */
        margin: 0;
    }
    
    .rank-score svg,
    .post-meta svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }
    
    /* 分类标签 - 移动端优化 */
    .category-tags {
        gap: var(--spacing-sm);
    }
    
    .category-tag {
        padding: 8px 14px; /* 增加内边距 */
        font-size: 14px; /* 放大文字：12px → 14px */
    }
    
    .category-tag .tag-count {
        font-size: 12px;
        padding: 2px 8px;
    }
    
    /* 标签云 - 移动端优化 */
    .tags-cloud {
        gap: var(--spacing-sm);
    }
    
    .tag-item {
        padding: 6px 12px; /* 增加内边距 */
        font-size: 13px; /* 放大文字：11px → 13px */
    }
    
    /* 分类列表 - 移动端优化 */
    .category-list {
        gap: var(--spacing-sm);
    }
    
    .category-item {
        padding: 12px 16px; /* 增加内边距 */
        min-height: 48px; /* 设置最小高度 */
    }
    
    .category-item .cat-name {
        font-size: 15px; /* 放大文字：13px → 15px */
    }
    
    .category-item .cat-count {
        font-size: 13px; /* 放大数字 */
        padding: 4px 10px;
    }
}

/* ==========================================================================
   打印样式
   ========================================================================== */

@media print {
    .detail-sidebar {
        display: none;
    }
}

