
/* pinned tools */
.fav-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;

    padding-left: 15px;
    padding-right: 15px;
}
.fav-item {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    background: #f8f9fa;
}
.fav-item:hover {
    background: #e9ecef;
}

.dark-mode .fav-item {
    background: #343a40;
    color: #dee2e6;
}
.dark-mode .fav-item:hover {
    background: #495057;
}

.fav-thumbnail {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
}
.fav-name {
    font-size: 12px;
    margin-top: 1px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #f2798b;
    color: rgb(61, 53, 53);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1;
    cursor: pointer;
}
.fav-item:hover .delete-btn {
    opacity: 1;
}
.add-btn {
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    color: #6c757d;
    transition: all 0.2s;
}
.add-btn:hover {
    border-color: #495057;
    color: #212529;
}
.dark-mode .fav-item {
    background: #343a40;
    color: #dee2e6;
}
.dark-mode .add-btn:hover {
    border-color: #adb5bd;
    color: #dee2e6;
}

.add-icon {
    font-size: 24px;
    /* margin-bottom: 5px; */
}
.modal-content {
    border-radius: 10px;
}
.form-group {
    margin-bottom: 15px;
}

#recommendations { display: none; }  /* 隐藏推荐列表 */

/* 右侧推荐栏目容器 */
.right-sidebar-section {
    width: 99%;
    max-width: 400px;
    margin: 0 auto;
    padding: 10px;
    /* background: #f8f9fa; */
    background: rgba(254, 254, 254, 0.3);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.dark-mode .right-sidebar-section {
    background: rgba(25, 25, 25, 0.3);
}

.recommend-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    /* color: #343a40; */

    /* position: absolute;
    left: 50%;
    transform: translateX(-50%); */
}

/* 单个推荐项 */
.recommend-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.2s;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dark-mode .recommend-item {
    background: #343a40;
    color: #dee2e6;
}

.recommend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 第一行：Logo + 名称 */
.recommend-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.recommend-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 1px solid #eee;
}

.recommend-name {
    font-weight: bold;
    font-size: 15px;
    /* color: #212529; */
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 第二行：简介 */
.recommend-desc {
    font-size: 13px;
    /* color: #6c757d; */
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* 限制2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 刷新按钮 */
.refresh-btn {
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s;
    /* 确保按钮靠右 */
    /* margin-left: auto;  */
}

.refresh-btn:hover {
    color: #007bff;
    transform: rotate(180deg);
}

.dark-mode .refresh-btn:hover {
    color: #dee2e6;
}

/* 通用右侧栏样式 */
.right-sidebar {
    width: 95%;
    max-width: 400px;
    margin: 0 auto;
    padding: 15px;
    /* background: #f8f9fa; */
    background: rgba(248, 248, 248, 0.2);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* 
.sidebar-section {
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 20px;
} */

.right-sitebar-section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    /* color: #343a40; */
}

/* 新闻项样式 */
.news-item {
    padding: 10px 0;
    border-bottom: 1px dashed #e9ecef;
    transition: all 0.2s;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dark-mode .news-item {
    background: #343a40;
    color: #dee2e6;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: rgba(0,0,0,0.8);
}

.dark-mode .news-item:hover {
    background: rgba(255,255,255,0.1);
}

.news-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 5px;
}

.news-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 8px;
    flex-shrink: 0;
}

.news-title {
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* 限制2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* color: #212529; */
}


.news-meta {
    font-size: 12px;
    color: #6c757d;
    text-align: right;
    margin-top: 3px;
}

/* 隐藏的数据源 */
#newsData { display: none; }

/* 热门分类容器 */
.categories-section {
    /* background: #f8f9fa; */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 20px;
}

.dark-mode .categories-section {
    background: #343a40;
    color: #dee2e6;
}

/* 分类标签样式 */
.categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    background: white;
    border: 1px solid #dee2e6;
    color: #495057;
    font-size: 13px;
    white-space: nowrap; /* 禁止换行 */
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.dark-mode .category-tag {
    background: #495057;
    color: #dee2e6;
    border-color: #535557;
}

.category-tag:hover {
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    color: #212529;
}
.dark-mode .category-tag:hover {
    border-color: #495057;
    box-shadow: 0 2px 8px rgba(255,255,255,0.1);
    transform: translateY(-1px);
    color: #dee2e6;
    border-color: #adb5bd;
}

/* 隐藏的数据源 */
#categoriesData { display: none; }

/* 搜索样式 */
.search-container {
    max-width: 600px;
    margin: 4px auto;
    font-family: Arial, sans-serif;
    margin-bottom: 5px;
}

.engine-options {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.engine-option {
    cursor: pointer;
    color: #555;
    padding-bottom: 3px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.dark-mode .engine-option {
    color: #dee2e6;
}

.engine-option.active {
    font-weight: bold;
    color: #5961f9;
    border-bottom: 2px solid #5961f9;
}

.dark-mode .engine-option.active {
    color: #dee2e6;
    border-bottom: 2px solid #dee2e6;
}

.search-box {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.dark-mode .search-box {
    border: 1px solid #495057;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 16px;
}

.dark-mode .search-input {
    background: #343a40;
    color: #dee2e6;
}

.search-button {
    /* background: #f8f9fa; */
    border: none;
    padding: 0 20px;
    cursor: pointer;
    color: #555;
}

.dark-mode .search-button {
    background: #495057;
    color: #dee2e6;
}

.search-button:hover {
    background: #f0f0f0;
}

.dark-mode .search-button:hover {
    background: #343a40;
    color: #dee2e6;
}

.popular-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.keyword {
    display: inline-block;
    padding: 5px 12px;
    /* background: #f5def7; */
    border-radius: 16px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.keyword:hover {
    color: #007bff;
}

.dark-mode .keyword:hover {
    background: #495057;
    color: #dee2e6;
}

.text-purple {
    color: #5961f9;
}

/* 网址卡片 */
.site-card {
  border: 1px solid rgba(128, 0, 128, 0.2);
  border-radius: 8px;
  padding: 12px;
  transition: background-color 0.2s ease;
  height: 100%;
  cursor: pointer;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.site-card:hover {
  /* background-color: rgba(128, 0, 128, 0.05); */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.site-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 限制 2 行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.875rem;
}
.btn-top {
  background: white;
  border: 1px solid rgba(128, 0, 128, 0.5);
  color: purple;
  padding: 2px 5px;
  display: flex;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1;
  cursor: pointer;

}
.site-card:hover .btn-top {
  opacity: 1;
  /* display: inline-block; */
}

.site-name:hover {
    color: #5961f9;
}

/* 页面中分类 */
.category-title {
    font-size: 18px !important;
    font-weight: bold;
    color: white;
    background: #6e48aa;
    box-shadow: 0 2px 4px rgba(79, 16, 75, 0.5);
}



/* 主内容区域 */
.main-content {
    padding: 20px;
}



/* 左侧内容 新 */

/* 侧边栏样式 */
.sidebar {
    position: sticky; /* 初始为绝对定位 */
    top: 80px; /* 初始距离顶部300px */
    left: 0;
    width: 250px;
    height: calc(100vh - 70px); /* 高度计算 */
    overflow-y: auto;
    z-index: 1000;
}

/* 当页面滚动时的固定定位样式 */
.sidebar.fixed {
    position: fixed;
    top: 70px; /* 固定在头部导航栏下方 */
    /* 重新计算高度 */
    height: calc(100vh - 70px); 
}

.sidebar-header {
    padding: 0 20px 15px;
    border-bottom: 1px solid #e1e5eb;
    margin-bottom: 15px;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-item {
    margin-bottom: 2px;
    width: 100%;
}

.category-link {
    display: block;
    padding: 10px 20px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.category-link:hover,
.category-link.active {
    background: rgba(110, 72, 170, 0.1);
    color: var(--primary-color);
}

.category-link.active:after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
    body {
        padding-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: none;
    }
    
    .sidebar.active {
        transform: translateX(0);
        display: block;
        position: fixed;
        height: auto;
        left: 10px;
        top: 140px;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .main-content {
        padding: 20px;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        left: 10px;
        top: 10px;
        z-index: 1010;
        background: white;
        border: none;
        width: 40px;
        height: 40px;
        margin-top: 80px;
        border-radius: 50%;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
}



.category-section {
    /* margin-bottom: 40px; */
}

.category-section-title {
    color: var(--primary-color);
    /* margin-bottom: 20px; */
    padding-bottom: 10px;
}

.category-section-title-text {
    border-bottom: 2px solid #6e48aa;
}
