/**
 * PC端文章侧边栏样式
 *
 * @package HiTemp
 * @since 1.0.0
 */

/* 侧边栏容器 */
.article-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title i {
    color: #f66600;
}

/* 作者卡片 */
.author-card .author-info {
    text-align: center;
    margin-bottom: 20px;
}

.author-card .author-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.author-card .author-name {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
}

.author-card .author-bio {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.author-card .author-stats {
    display: flex;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.author-card .stat-item {
    text-align: center;
}

.author-card .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #f66600;
}

.author-card .stat-label {
    font-size: 13px;
    color: #94a3b8;
}

/* 推荐文章卡片样式（复用分类页面卡片） */
.recommended-cards {
    padding: 12px;
}

.recommended-cards .widget-title {
    padding: 0;
    margin: 0 0 16px;
}

.sidebar-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* 侧边栏推荐卡片样式 */
.recommended-cards .post-card {
    position: relative;
    border-radius: 16px;
    border: 2px solid transparent;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    background: #fff;
}

.recommended-cards .post-card:has(.product-tag-style1) {
    overflow: visible;
    padding-top: 8px;
}

.recommended-cards .post-card:has(.product-tag-style1) .post-card-link {
    margin-top: -8px;
}

.recommended-cards .post-card-link {
    display: block;
    text-decoration: none;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
}

.recommended-cards .post-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #f66600, transparent);
    border-radius: 3px;
    transition: transform 0.3s ease;
}

.recommended-cards .post-card:hover {
    border-color: #f66600;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.recommended-cards .post-card:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.recommended-cards .post-card:hover .post-thumbnail img {
    transform: none !important;
}

.recommended-cards .post-thumbnail {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 14px;
}

.recommended-cards .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8fafc;
    transition: transform 0.3s ease;
}

.recommended-cards .post-thumbnail .no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #94a3b8;
    font-size: 48px;
}

/* 产品标签 */
.recommended-cards .post-card .product-tag {
    position: absolute;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recommended-cards .post-card .product-tag i {
    font-size: 11px;
}

/* 样式1: 书签竖排 */
.recommended-cards .post-card .product-tag-style1 {
    top: -8px;
    right: 15px;
    border-radius: 0 0 4px 4px;
    padding: 10px 8px 12px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
}

.recommended-cards .post-card .product-tag-style1::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: inherit;
    border-top-width: 6px;
}

/* 样式2: 折纸效果 */
.recommended-cards .post-card .product-tag-style2 {
    top: 0;
    right: 0;
    border-radius: 0 14px 0 0;
    padding: 6px 12px 6px 16px;
    clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
}

.recommended-cards .post-card .product-tag-style2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.3) 50%);
}

/* 样式3: 斜角标签 */
.recommended-cards .post-card .product-tag-style3 {
    top: 12px;
    right: -30px;
    padding: 4px 35px;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 样式4: 边框镂空 */
.recommended-cards .post-card .product-tag-style4 {
    top: 10px;
    right: 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 样式5: 立体凸起 */
.recommended-cards .post-card .product-tag-style5 {
    top: 10px;
    right: 10px;
    border-radius: 4px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2), 0 4px 10px rgba(0,0,0,0.15);
}

/* 卡片底部信息栏 */
.recommended-cards .post-card .post-card-footer {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    z-index: 10;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(246, 102, 0, 0.3);
}

.recommended-cards .post-card .post-card-footer .post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgb(255 152 0 / 88%);
    backdrop-filter: blur(4px);
    padding: 12px 12px;
    border-radius: 12px 12px 0 0;
}

.recommended-cards .post-card .post-card-footer .post-meta-views,
.recommended-cards .post-card .post-card-footer .post-meta-date {
    font-size: 12px;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.recommended-cards .post-card .post-card-footer .post-meta-views {
    flex: 1;
}

.recommended-cards .post-card .post-card-footer .post-meta-views i {
    font-size: 11px;
    color: #f66600;
}

.recommended-cards .post-card .post-card-footer .post-meta-date {
    text-align: right;
    white-space: nowrap;
}

.recommended-cards .post-card .post-card-footer .post-meta-date i {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

.recommended-cards .post-card .post-card-footer .post-meta-date .update-text {
    color: #ff5722;
}

.recommended-cards .post-card .post-card-footer .post-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f66600;
    padding: 14px 12px;
    border-radius: 0 0 12px 12px;
}

.recommended-cards .post-info-text {
    flex: 1;
    min-width: 0;
}

.recommended-cards .post-card .post-card-footer .post-info .post-info-text .post-category {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.recommended-cards .post-card .post-card-footer .post-info .post-info-text .post-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recommended-cards .post-card .post-card-footer .post-info .post-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    color: #f66600;
    font-size: 14px;
    margin-left: 8px;
}

/* 热门文章 */
.popular-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.popular-list li {
    margin-bottom: 12px;
}

.popular-list li:last-child {
    margin-bottom: 0;
}

.popular-list a {
    display: block;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.popular-list a:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.popular-list .article-title-line {
    font-size: 14px;
    font-weight: 500;
    color: #f66600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.popular-list a:hover .article-title-line {
    color: #d45a00;
}

.popular-list .article-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}

.popular-list .article-date {
    flex: 1;
}

.popular-list .article-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* 最新文章 */
.recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-list li {
    margin-bottom: 12px;
}

.recent-list li:last-child {
    margin-bottom: 0;
}

.recent-list a {
    display: block;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.recent-list a:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.recent-list .article-title-line {
    font-size: 14px;
    font-weight: 500;
    color: #f66600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.recent-list a:hover .article-title-line {
    color: #d45a00;
}

.recent-list .article-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
}

.recent-list .article-date {
    flex: 1;
}

.recent-list .article-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* 相关文章 */
.related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-list li {
    margin-bottom: 12px;
}

.related-list li:last-child {
    margin-bottom: 0;
}

.related-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.related-list a:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.related-list .related-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.related-list a:hover .related-title {
    color: #f66600;
}

.related-list .related-date {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

/* 分类列表 */
.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-list li {
    margin-bottom: 8px;
}

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.categories-list a:hover {
    background: #f8fafc;
}

.categories-list .cat-name {
    font-size: 14px;
    color: #334155;
}

.categories-list a:hover .cat-name {
    color: #f66600;
}

.categories-list .cat-count {
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 广告位 */
.sidebar-ad {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 3px;
    box-shadow: none;
    overflow: hidden;
}

.sidebar-ad .widget-title {
    padding: 0 0 8px;
    margin: 0;
    border-bottom: none;
}

.sidebar-ad .ad-content {
    display: block;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    padding: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    overflow: hidden;
}

.sidebar-ad.no-title .ad-content {
    padding: 4px;
}

.sidebar-ad .ad-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    border: none;
    padding: 0;
    box-sizing: border-box;
    object-fit: cover;
    overflow: hidden;
}

.sidebar-ad .ad-content img {
    border-radius: 12px;
    display: block;
}

.sidebar-ad a {
    display: block;
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-ad a:hover .ad-content,
.sidebar-ad:hover .ad-content {
    border-color: #f66600;
}

/* 标签云 */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags-cloud .tag-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    height: 24px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #c2410c;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #fed7aa;
    box-shadow: 0 2px 4px rgba(246, 102, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tags-cloud .tag-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.tags-cloud .tag-item:hover::before {
    left: 100%;
}

.tags-cloud .tag-item i {
    font-size: 11px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.tags-cloud .tag-item span {
    position: relative;
    z-index: 1;
}

.tags-cloud .tag-item:hover {
    background: linear-gradient(135deg, #f66600 0%, #ff8534 100%);
    color: #fff;
    border-color: #f66600;
    box-shadow: 0 4px 12px rgba(246, 102, 0, 0.3);
    transform: translateY(-2px);
}

.tags-cloud .tag-item:hover i {
    opacity: 1;
    transform: rotate(-15deg);
}

/* 响应式 */
@media (max-width: 1024px) {
    .article-sidebar {
        position: static;
    }
    
    .sidebar-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar-posts-grid {
        grid-template-columns: 1fr;
    }
}
