/*
 * 博客侧边栏样式
 * 可在分类页、文章页、搜索页等复用
 */

/* ==================== 侧边栏 ==================== */
.vc-category-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

/* 侧边栏小部件通用样式 */
.vc-sidebar-widget {
    background: var(--vc-white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.vc-widget-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--vc-text-dark);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--vc-border);
    position: relative;
}

.vc-widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(135deg, var(--vc-primary) 0%, var(--vc-primary-dark) 100%);
}

/* ==================== 最新文章 ==================== */
.vc-recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vc-recent-post-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--vc-border);
}

.vc-recent-post-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.vc-recent-post-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.vc-recent-post-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.vc-recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vc-recent-post-item:hover .vc-recent-post-thumb img {
    transform: scale(1.1);
}

.vc-recent-post-content {
    flex: 1;
    min-width: 0;
}

.vc-recent-post-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.vc-recent-post-title a {
    color: var(--vc-text-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.vc-recent-post-title a:hover {
    color: var(--vc-primary);
}

.vc-recent-post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--vc-text-light);
}

.vc-recent-post-meta svg {
    flex-shrink: 0;
    color: var(--vc-primary);
}

/* ==================== 商家展示位 ==================== */
.vc-ad-widget {
    transition: all 0.3s;
}

.vc-ad-content {
    position: relative;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vc-bg-light);
    border-radius: 12px;
    overflow: hidden;
}

.vc-ad-content img {
    width: 100%;
    height: auto;
    display: block;
}

.vc-ad-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.vc-ad-placeholder svg {
    color: var(--vc-text-light);
    opacity: 0.3;
    margin-bottom: 16px;
}

.vc-ad-placeholder p {
    font-size: 16px;
    font-weight: 600;
    color: var(--vc-text-light);
    margin: 0 0 8px 0;
}

.vc-ad-placeholder span {
    font-size: 13px;
    color: var(--vc-text-light);
    opacity: 0.7;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 992px) {
    .vc-ad-widget {
        position: static;
    }
}

@media (max-width: 480px) {
    .vc-sidebar-widget {
        padding: 20px;
    }
    
    .vc-recent-post-thumb {
        width: 70px;
        height: 70px;
    }
    
    .vc-recent-post-title {
        font-size: 14px;
    }
}

/* ==================== 作者信息卡片（文章侧边栏） ==================== */
.vc-author-info-card .vc-author-card-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.vc-author-info-card .vc-author-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--vc-bg-light, #F8F9FA);
}

.vc-author-info-card .vc-author-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vc-author-info-card .vc-author-card-top {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.vc-author-info-card .vc-author-card-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.vc-author-info-card .vc-author-card-name a {
    color: var(--vc-text-dark, #1A1A1A);
    text-decoration: none;
    transition: color 0.3s;
}

.vc-author-info-card .vc-author-card-name a:hover {
    color: var(--vc-primary, #FF6A00);
}

.vc-author-info-card .vc-author-card-position {
    font-size: 14px;
    color: var(--vc-text-gray, #666666);
    margin: 0;
    line-height: 1.3;
}

.vc-author-info-card .vc-author-card-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--vc-border, #E5E5E5);
    border-bottom: 1px solid var(--vc-border, #E5E5E5);
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.vc-author-info-card .vc-author-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.vc-author-info-card .vc-author-stat-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--vc-primary, #FF6A00);
}

.vc-author-info-card .vc-author-stat-label {
    font-size: 13px;
    color: var(--vc-text-gray, #666666);
}

.vc-author-info-card .vc-author-stat-divider {
    color: var(--vc-border, #E5E5E5);
    font-size: 16px;
}

.vc-author-info-card .vc-author-card-bio-section {
    padding: 0;
}

.vc-author-info-card .vc-author-card-bio {
    font-size: 15px;
    line-height: 1.7;
    color: var(--vc-text-gray, #666666);
    margin: 0;
    text-align: left;
}

/* ==================== 自助广告位盒子 ==================== */
.vc-ad-self-widget {
    padding: 24px 20px;
}

.vc-ad-self-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.vc-ad-self-header svg {
    color: var(--vc-primary, #FF6A00);
    flex-shrink: 0;
}

.vc-ad-self-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--vc-text-dark, #222222);
    margin: 0;
}

.vc-ad-self-sub {
    font-size: 12px;
    color: var(--vc-text-gray, #666666);
    margin: 0 0 16px 0;
}

.vc-ad-self-slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.vc-ad-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 320 / 145;
    border: 1px dashed var(--vc-border, #E5E5E5);
    border-radius: 8px;
    background: #FAFAFA;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
    font-family: inherit;
}

.vc-ad-slot:hover {
    border-color: #FF6A00;
    background: rgba(255, 106, 0, 0.08);
}

.vc-ad-slot-ratio {
    font-size: 15px;
    font-weight: 700;
    color: var(--vc-text-dark, #222222);
}

.vc-ad-slot-label {
    font-size: 12px;
    color: var(--vc-text-gray, #666666);
}

.vc-ad-slot-filled {
    border: none;
    display: block;
    overflow: hidden;
}

.vc-ad-slot-filled img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vc-ad-self-footer {
    font-size: 12px;
    color: var(--vc-text-gray, #666666);
    border-top: 1px solid var(--vc-border, #E5E5E5);
    padding-top: 14px;
}

.vc-ad-self-footer strong {
    color: #FF6A00;
    font-size: 14px;
}

/* ==================== 广告购买模态框 ==================== */
.vc-ad-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vc-ad-modal.active {
    display: flex;
}

.vc-ad-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.vc-ad-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 26px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: vcAdModalIn 0.25s ease-out;
}

@keyframes vcAdModalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.vc-ad-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #F1F3F5;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.vc-ad-modal-close:hover {
    background: #E5E5E5;
    color: #333;
}

.vc-ad-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0 0 4px 0;
}

.vc-ad-modal-slot {
    font-size: 13px;
    color: #666;
    margin: 0 0 20px 0;
}

.vc-ad-form-group {
    margin-bottom: 18px;
}

.vc-ad-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.vc-ad-label .vc-required {
    color: #EF4444;
}

.vc-ad-label .vc-ad-optional {
    font-size: 12px;
    font-weight: 400;
    color: #999;
}

.vc-ad-upload {
    position: relative;
    display: block;
    border: 2px dashed #D5D9DE;
    border-radius: 10px;
    background: #F8F9FA;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.vc-ad-upload:hover {
    border-color: #FF6A00;
    background: #FFF7F0;
}

.vc-ad-upload input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.vc-ad-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 16px;
    text-align: center;
}

.vc-ad-upload-placeholder svg {
    color: #999;
}

.vc-ad-upload-placeholder p {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.vc-ad-upload-placeholder span {
    font-size: 12px;
    color: #999;
}

.vc-ad-upload-img {
    width: 100%;
    display: block;
}

.vc-ad-upload.has-image .vc-ad-upload-placeholder {
    display: none;
}

.vc-ad-form-group input[type="url"],
.vc-ad-form-group input[type="text"],
.vc-ad-form-group input[type="tel"],
.vc-ad-form-group input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D5D9DE;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.vc-ad-form-group input[type="url"]:focus,
.vc-ad-form-group input[type="text"]:focus,
.vc-ad-form-group input[type="tel"]:focus,
.vc-ad-form-group input[type="email"]:focus {
    outline: none;
    border-color: #FF6A00;
}

.vc-ad-stepper {
    display: flex;
    align-items: center;
    border: 1px solid #D5D9DE;
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}

.vc-ad-stepper button {
    width: 44px;
    height: 44px;
    border: none;
    background: #F8F9FA;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.vc-ad-stepper button:hover {
    background: #EFEFEF;
}

.vc-ad-stepper-val {
    width: 60px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #1A1A1A;
}

.vc-ad-price-box {
    background: #F8F9FA;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.vc-ad-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
    padding: 4px 0;
}

.vc-ad-price-total {
    border-top: 1px solid #E5E5E5;
    margin-top: 6px;
    padding-top: 10px;
    font-weight: 600;
    color: #333;
}

.vc-ad-price-total span:last-child {
    font-size: 20px;
    font-weight: 800;
    color: #10B981;
}

.vc-ad-note {
    font-size: 12px;
    line-height: 1.6;
    color: #888;
    background: #FFFBF5;
    border: 1px solid #FFE8D5;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 18px;
}

.vc-ad-note strong {
    color: #E55D00;
}

.vc-ad-submit-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: #10B981;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.vc-ad-submit-btn:hover {
    background: #0EA271;
}

.vc-ad-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vc-ad-success {
    text-align: center;
    padding: 20px 0 10px;
}

.vc-ad-success svg {
    color: #10B981;
    margin-bottom: 12px;
}

.vc-ad-success h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0 0 8px 0;
}

.vc-ad-success p {
    font-size: 13px;
    color: #666;
    margin: 4px 0;
}

.vc-ad-success-order strong {
    color: #1A1A1A;
}

@media (max-width: 480px) {
    .vc-ad-modal-content {
        padding: 22px 18px;
    }
}
