/* ==========================================
   COMPONENTS COMBINED CSS FILE
   合并小型组件CSS文件以减少HTTP请求
   ========================================== */

/* BREADCRUMB COMPONENT */
/* 面包屑导航样式 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-separator {
    color: var(--text-muted);
    opacity: 0.6;
    font-size: 0.8rem;
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--theme-primary);
    background: var(--theme-primary-light);
    text-decoration: none;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* AD COMPONENT */
/* 广告组件样式 */
.ad-component {
    margin-bottom: 20px;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    transition: background-color 0.3s ease, transform 0.3s ease;
    padding: 20px;
}

.ad-component .widget-title {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.ad-component .widget-title i {
    color: var(--theme-primary);
}

.ad-banner {
    width: 100%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ad-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.ad-placeholder {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ad-placeholder:hover {
    background: var(--bg-glass-light);
    transform: translateY(-2px);
}

.ad-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
}

.ad-placeholder-content i {
    font-size: 3rem;
    color: var(--theme-primary-light);
    animation: pulse 2s infinite;
}

.ad-placeholder-content h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ad-placeholder-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.8;
}


/* SEARCH VALIDATION COMPONENT */
/* 搜索验证样式 */
.search-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* 搜索提示弹窗 */
.search-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.search-alert.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.search-alert-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    min-width: 250px;
    max-width: 400px;
}

.search-alert.error .search-alert-content {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.search-alert.success .search-alert-content {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}

.search-alert.warning .search-alert-content {
    border-color: #ca8a04;
    background: rgba(202, 138, 4, 0.1);
    color: #ca8a04;
}

/* 搜索结果网址图标样式 */
.search-website-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.search-result-card:hover .search-website-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.25);
}

.search-website-icon img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.search-website-icon i {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

/* SUBCATEGORY FILTERS */
/* 子分类筛选器样式 */
.subcategory-filters {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.subcategory-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.subcategory-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 50px;
    margin-left: 0px;
    position: relative; /* 为滑动指示器提供定位基准 */
}

/* 浅色模式下的特定背景色 */
.theme-light .subcategory-buttons,
.theme-auto.system-light .subcategory-buttons {
    background: #D7DEE5;
}

/* 移动悬停指示器 - 调整尺寸匹配按钮 */
.subcategory-buttons::before {
    content: '';
    position: absolute;
    top: 6px; /* 从容器padding开始 */
    left: calc(var(--hover-left, 0px) - 2px); /* 微调左偏移，修正位置 */
    width: var(--hover-width, 0px);
    height: calc(100% - 12px); /* 减去上下padding */
    background: rgba(42, 95, 245, 0.15);
    border-radius: 20px;
    transition: left 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.1s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    will-change: left, width, opacity; /* 启用硬件加速 */
}

/* JavaScript控制的移动指示器状态 */
.subcategory-buttons.has-hover::before {
    opacity: 1;
}

.subcategory-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px; /* 使用大圆角 */
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
    user-select: none;
    position: relative;
    z-index: 1; /* 确保按钮在指示器之上 */
    display: flex;
    align-items: center;
    gap: 4px; /* 图标和文字之间的间距 */
}

.subcategory-btn:hover {
    color: var(--theme-primary);
    /* 悬停效果由移动指示器处理，这里只改变文字颜色 */
}

.subcategory-btn.active {
    color: white;
    background: var(--theme-primary);
    border-radius: 20px;
    position: relative;
}

.subcategory-btn.active i {
    color: white; /* 确保图标也是白色 */
}

/* DYNAMIC CONTENT */
/* 动态内容加载样式 */
.dynamic-content-container {
    min-height: 400px;
    position: relative;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-spinner i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
    margin-right: 15px;
    color: var(--theme-primary);
}


.loading-text {
    font-size: 1rem;
    font-weight: 500;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--bg-glass);
    border-radius: 15px;
    border: 1px dashed var(--border-primary);
    margin: 20px 0;
}

.error-message i {
    font-size: 3rem;
    color: #dc2626;
    margin-bottom: 15px;
}

.error-message p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.retry-btn {
    margin-top: 20px;
    background: var(--theme-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.retry-btn:hover {
    background: var(--theme-primary-hover, var(--theme-primary));
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .subcategory-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .subcategory-buttons {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .search-alert {
        right: 10px;
        top: 10px;
    }
    
    .search-alert-content {
        min-width: 200px;
        max-width: calc(100vw - 40px);
    }
}
