/* 在CSS文件的最顶部添加 */
html {
    overflow-y: scroll;
}
a:hover{color:var(--primary-color) !important;}

/* 确保body正常 */
body {
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    margin-bottom: 60px;
}
/* 基础样式和变量 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

:root {
    --bg-color: #fafff3;        /* 页面背景色 */
    --primary-color: #128712;    /* 主色调 */
    --border-color: #128712;     /* 边框颜色 */
    --content-opacity: 0.8;
    --card-opacity: 1;
    --card-bg-color: #ffffff; /* 确保有这个变量 */
}

body {
    background-color: var(--bg-color);
    padding: 20px;
    color: var(--text-color);
    transition: all 0.3s ease;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 通用样式 */
.hidden {
    display: none !important;
}

.active {
    display: block !important;
}

/* 顶部信息栏 */
.top-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(transparent, var(--content-opacity));
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 20px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.time-weather {
    display: flex;
    gap: 15px;
    align-items: center;
}

.time {
    font-size: 15px;
    color: var(--text-color);
}

.weather {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-decoration: none;
}

.weather-icon {
    font-size: 16px;
}

/* 雪碧图基础样式 */
.site-icon.sprite-icon {
    width: 24px !important;
    height: 24px !important;
    background-image: url('./icons/pic_all.png') !important;
    background-repeat: no-repeat;
    background-size: auto 24px !important;
    background-position: 0 0 !important; /* 重置默认位置 */
}

.favorite-icon.sprite-icon {
    width: 24px !important;
    height: 24px !important;
    background-image: url('./icons/pic_all.png') !important;
    background-repeat: no-repeat;
    background-size: auto 24px !important;
    background-position: 0 0 !important; /* 重置默认位置 */
}

/* 现在设置具体的位置 - 水平排列，每个图标间隔30px */
.site-icon.sprite-baidu { background-position: 0 0; }
.site-icon.sprite-qq { background-position: -30px 0; }
.site-icon.sprite-163 { background-position: -60px 0; }
.site-icon.sprite-sina { background-position: -90px 0; }
.site-icon.sprite-weibo { background-position: -120px 0; }
.site-icon.sprite-taobao { background-position: -150px 0; }
.site-icon.sprite-jd { background-position: -180px 0; }
.site-icon.sprite-zhihu { background-position: -210px 0; }
.site-icon.sprite-bilibili { background-position: -240px 0; }
.site-icon.sprite-douyin { background-position: -270px 0; }
.site-icon.sprite-deepseek { background-position: -300px 0; }
.site-icon.sprite-tieba { background-position: -330px 0; }

/* 如果还有更多图标，可能需要调整间隔 */
.site-icon.sprite-qqv { background-position: -360px 0; }
.site-icon.sprite-wallstreetcn { background-position: -390px 0; }
.site-icon.sprite-qidian { background-position: -420px 0; }
.site-icon.sprite-anjuke { background-position: -450px 0; }
.site-icon.sprite-yoojia { background-position: -480px 0; }
.site-icon.sprite-sspai { background-position: -510px 0; }
.site-icon.sprite-sohu { background-position: -540px 0; }
.site-icon.sprite-doubao { background-position: -570px 0; }

/* 收藏图标使用相同的位置（因为雪碧图相同） */
.favorite-icon.sprite-baidu { background-position: 0 0; }
.favorite-icon.sprite-qq { background-position: -30px 0; }
.favorite-icon.sprite-163 { background-position: -60px 0; }
.favorite-icon.sprite-sina { background-position: -90px 0; }
.favorite-icon.sprite-weibo { background-position: -120px 0; }
.favorite-icon.sprite-taobao { background-position: -150px 0; }
.favorite-icon.sprite-jd { background-position: -180px 0; }
.favorite-icon.sprite-zhihu { background-position: -210px 0; }
.favorite-icon.sprite-bilibili { background-position: -240px 0; }
.favorite-icon.sprite-douyin { background-position: -270px 0; }
.favorite-icon.sprite-deepseek { background-position: -300px 0; }

/* 搜索区域 - 使用顶部信息栏的背景色 */
.search-container {
    background: rgba(255, 255, 255, var(--content-opacity)) !important;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 2000;
}

/* 应用卡片背景的所有元素 - 移除搜索区域和调色板 */
.category-section,
.dropdown-menu,
.left-category-tabs,
.category-tabs,
.favorite-management,
.add-favorite-form,
.favorite-actions,
.site-item,
.content-section {
    background-color: var(--card-bg-color);
    opacity: var(--card-opacity);
}

/* 确保交互性不受透明度影响 */
.site-item:hover,
.left-category-tab:hover,
.category-tab:hover {
    opacity: calc(var(--card-opacity) + 0.1); /* 悬停时稍微增加透明度 */
    transition: opacity 0.2s ease;
}

/* 网站项目卡片 */
.site-item {
    border: 1px solid var(--border-color, #e5e5e5);
}

/* 卡片透明度变量和应用 - 修复版 */
:root {
    --card-opacity: 1;
}

/* 卡片透明度变量和应用 - 不包含搜索框和调色板部分 */
:root {
    --card-opacity: 1;
    --card-bg-color: #ffffff;
}

/* 搜索框特殊处理 */
.search-input {
    background-color: #fafff3 !important;
    border: 2px solid var(--primary-color);
}

/* 搜索按钮 */
.search-btn {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.search-btn:hover {
    background-color: color-mix(in srgb, var(--primary-color) 80%, black 20%) !important;
    opacity: 1 !important;
}

/* 搜索引擎标签 */
.search-engine-item {
}

.search-engine-item:hover {
    background-color: #e9ecef !important;
}

.search-engine-item.active {
    border-bottom: 2px solid var(--primary-color);
}

.search-engine-item {
    padding: 6px 15px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s;
    font-size: 14px;
    color: #666;
    border: 1px solid transparent;
}

.search-engine-item:hover {
    background: #e9ecef;
    color: #333;
}

.search-engine-item.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: bold;
}
/* 确保搜索框内的文字保持不透明 */
.search-container *,
.search-header *,
.search-box *,
.search-input,
.search-engines *,
.search-engine-item {
    opacity: 1 !important;
    color: inherit !important;
}

/* 搜索建议面板保持完全不透明 */
.suggest-panel,
.suggest-item,
.suggest-panel * {
    opacity: 1 !important;
    background-color: white !important;
}

/* 其他卡片元素继续应用相同的规则 - 移除调色板 */
.category-section,
.dropdown-menu, 
.left-category-tabs,
.category-tabs,
.favorite-management,
.add-favorite-form,
.favorite-actions,
.site-item,
.content-section,
.favorites-list,
.favorite-item,
.sites-grid,
.category-content,
.left-categories,
.right-content,
.top-info-bar,
.dropdown-table .dropdown-cell {
    background-color: color-mix(in srgb, var(--card-bg-color) calc(var(--card-opacity) * 100%), transparent) !important;
    transition: background-color 0.3s ease;
}

/* 特殊背景色的元素 */
.category-tabs {
    background-color: color-mix(in srgb, #f8f8f8 calc(var(--card-opacity) * 100%), transparent) !important;
}

.category-tab.active {
    background-color: color-mix(in srgb, white calc(var(--card-opacity) * 100%), transparent) !important;
}

.favorite-management {
    background-color: color-mix(in srgb, #f8f9fa calc(var(--card-opacity) * 100%), transparent) !important;
}

/* 下拉菜单单元格 */
.dropdown-cell.bg1 {
    background-color: color-mix(in srgb, #f8f9fa calc(var(--card-opacity) * 100%), transparent) !important;
}

.dropdown-cell.bg2 {
    background-color: color-mix(in srgb, white calc(var(--card-opacity) * 100%), transparent) !important;
}

.dropdown-cell.bg3 {
    background-color: color-mix(in srgb, #f0f8ff calc(var(--card-opacity) * 100%), transparent) !important;
}

/* 确保所有文字保持清晰 */
.search-container *,
.category-section *,
.site-item *,
.left-categories *,
.right-content *,
.top-info-bar *,
.dropdown-menu *,
.favorite-item *,
.category-tabs * {
    opacity: 1 !important;
    color: inherit !important;
}

/* 搜索建议保持完全不透明 */
.suggest-panel,
.suggest-item,
.suggest-panel * {
    opacity: 1 !important;
    background-color: white !important;
}

/* 调色板内容保持不透明且独立背景 */
.color-palette-content,
.color-option,
.color-input-group,
.color-presets,
.bg-image-controls,
.opacity-slider-container,
.color-palette * {
    opacity: 1 !important;
    background-color: white !important;
}

/* 下拉菜单通用样式 */
/* 下拉菜单通用样式 - 统一翻译、邮箱、地图 */
.dropdown {
    position: relative;
    z-index: 3001;
}

.dropdown-btn {
    background: transparent;
    border: 0px solid var(--primary-color);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.dropdown-btn:hover {
    background: #e9ecef;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    background: transparent !important; /* 强制白色背景，不受卡片背景影响 */
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 3001;
    padding: 1px;
    min-width: 180px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* 左侧下拉菜单 */
.dropdown-left .dropdown-menu {
    left: 0;
}

/* 右侧下拉菜单 */
.dropdown-right .dropdown-menu {
    right: 0;
}

/* 表格样式 */
.dropdown-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e5e5;
    background: transparent  !important;
}

.dropdown-cell {
    padding: 4px 6px;
    text-align: center;
    border: 1px solid #e5e5e5;
    transition: all 0.3s;
    background: white !important;
}

.dropdown-cell .dropdown-item {
    display: block;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    padding: 4px 0;
    transition: all 0.3s;
    background: transparent !important;
}
.dropdown-cell .dropdown-item:hover {
    color: var(--primary-color);
    text-decoration: none;
    background: transparent !important;
}

/* 背景颜色交替 */
.dropdown-cell.bg1 {
    background-color: #f8f9fa !important;
}

.dropdown-cell.bg2 {
    background-color: #ffffff !important;
}

.dropdown-cell.bg3 {
    background-color: #f0f8ff !important;
}

.dropdown-cell:hover {
    background-color: #e9ecef !important;
}

/* ===== 调色板特殊样式 - 独立背景 ===== */
.color-dropdown {
    position: relative;
    z-index: 3001;
}

.color-btn {
    background: transparant;
    border: 0px solid var(--primary-color);
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.color-btn:hover {
    background: #e9ecef;
}

.color-palette {
    position: absolute;
    top: 100%;
    right: 0;
    background: white !important; /* 强制白色背景，不受卡片背景影响 */
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 3001;
    width: 400px;
    padding: 15px;
}

.color-dropdown:hover .color-palette {
    display: block;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

/* Logo图片样式 */
.logo-image {
    height: 46px; /* 根据你的图片尺寸调整 */
    width: auto; /* 保持图片原始宽高比 */
    display: block;
    transition: all 0.3s ease;
}
.logo-image:hover {
    transform: scale(1.00);
    opacity: 1; 
    filter: brightness(1.05); /* 轻微提亮 */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), #ffa726);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
}

.logo-text span {
    color: var(--primary-color);
}

.search-box {
    flex: 1;
    position: relative;
    z-index: 1;
}
.search-input {
    width: 100%;
    padding: 10px 80px 10px 16px;  /* 减小内边距 */
    border: 2px solid var(--primary-color);
    border-radius: 18px;         /* 稍微减小圆角 */
    font-size: 15px;             /* 减小字体大小 */
    outline: none;
    transition: all 0.3s;
    background: #fafff3;
}
.search-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

/* 修复搜索按钮样式 */
.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 20px;
    background: var(--primary-color) !important;
    color: white !important; /* 确保文字颜色为白色 */
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.search-btn:hover {
    background: color-mix(in srgb, var(--primary-color) 80%, black 20%) !important;
    color: white !important;
    transform: translateY(-50%) scale(1.05);
}

/* 搜索提示 */
.suggest-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 2001;
    max-height: 300px;
    overflow-y: auto;
}

.suggest-panel.show {
    display: block;
}

.suggest-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggest-item:hover {
    background: #f8f9fa;
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-icon {
    color: #999;
    font-size: 14px;
}

.suggest-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* 搜索引擎 */
.search-engines {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 0 10px;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 10;
}

/* 左侧分类 */
.left-categories {
    width: 130px;
    background: color-mix(in srgb, var(--card-bg-color) calc(var(--card-opacity) * 100%), transparent);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.left-category-tabs {
    display: flex;
    flex-direction: column;
}

.left-category-tab {
    padding: 13px 18px;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
}

.left-category-tab:hover {
    background: color-mix(in srgb, var(--primary-color) 5%, transparent) !important;
    color: var(--primary-color) !important;
}

.left-category-tab.active {
    color: var(--primary-color) !important;
    border-left: 3px solid var(--primary-color) !important;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent) !important;
}
/* active状态下图标的颜色 */
.left-category-tab.active i {
    color: var(--primary-color) !important;
}

.left-category-tab i {
    margin-right: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

/* 右侧内容区域 */
.right-content {
    flex: 1;
    background: color-mix(in srgb, var(--card-bg-color) calc(var(--card-opacity) * 100%), transparent);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 10;
}

/* 修复右侧标签背景色问题 - 关键修改 */
.category-tabs {
    display: flex;
    background: #f8f8f8; /* 保持标签栏背景 */
    border-bottom: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
    min-height: 40px; /* 确保高度适中 */
}

.category-tab {
    padding: 10px 18px;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.category-tab:hover {
    color: var(--primary-color);
}

.category-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background: #fff; /* 激活标签背景 */
}

/* 修复编辑模式按钮和搜索按钮的样式 */
.edit-mode-btn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 10px;
    background: var(--primary-color) !important; /* 确保背景色 */
    color: white !important; /* 确保文字颜色为白色 */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    font-weight: 500;
}

.edit-mode-btn:hover {
    background: color-mix(in srgb, var(--primary-color) 80%, black 20%) !important;
    color: white !important;
}

.edit-mode-btn.active {
    background: var(--primary-color) !important;
    opacity: 0.9;
    color: white !important;
}
/* 确保按钮文字在任何情况下都可见 */
.edit-mode-btn *,
.search-btn * {
    color: white !important;
    opacity: 1 !important;
}

/* 如果primary-color太浅，添加深色文字备用 */
@media (max-width: 768px) {
    .edit-mode-btn,
    .search-btn {
        color: white !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
}


/* 如果检测到primary-color太浅，使用深色版本 */
.search-btn,
.edit-mode-btn {
    background: var(--primary-color) !important;
    color: white !important;
}

/* 确保在浅色背景上按钮文字可见 */
body .search-btn,
body .edit-mode-btn {
    color: white !important;
    -webkit-font-smoothing: antialiased;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
/* 分类内容区域 - 修复背景色问题 */
.category-content {
    display: none;
    padding: 5px;
    background: transparent !important; /* 强制透明 */
}

.category-content.active {
    display: block;
}

/* ================================ */
/* 方案二：普通网站横向布局 + 分类名称 */
/* ================================ */

/* 分类行样式 */
.category-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.category-label {
    width: 80px;
    padding: 8px 0;
    font-size: 13px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    background: rgba(255, 102, 0, 0.1);
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 4px;
}

/* 最终优化方案 - 一行显示6-8个网站 */
/* 网格布局方案 - 更紧凑 */
.category-sites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* 自动填充 */
    gap: 6px;
    width: 100%;
}

.site-item {
    min-width: auto; /* 移除最小宽度限制 */
    max-width: none;
    width: 100%; /* 充满网格单元格 */
    margin: 0;
}
.category-sites {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.site-item {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border-radius: 4px;
    gap: 6px;
    background: transparant !important;
    border: 0px solid var(--card-bg-color);
    min-width: 120px; /* 足够紧凑 */
    max-width: 140px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 11px;
}

.site-item .site-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.site-item .site-name {
    font-size: 11px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-item:hover {
    background: transparant !important;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.site-item .favorite-indicator {
    position: static;  /* 改为静态定位 */
    transform: none;   /* 移除变换 */
    margin-left: auto; /* 靠右对齐 */
}

/* 删除或修改这个样式，因为它强制垂直布局 */
.sites-grid {
    display: flex;
    flex-wrap: wrap;    /* 改为水平换行 */
    gap: 10px;
    background: transparent !important;
    padding: 10px;
}

/* ================================ */
/* 网格布局方案 - 优化版 */
/* ================================ */
.category-section {
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 12px 24px;
    border: 1px solid var(--border-color);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.category-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
    padding: 3px 22px;
    background: rgba(255, 102, 0, 0.1);
    border-radius: 4px;
    border-left: 2px solid var(--primary-color);
    flex-shrink: 0;
}

.category-divider {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
    opacity: 0.3;
}

/* 网格布局核心样式 */
.category-sites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 9px;
    width: 100%;
}

.site-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border-radius: 4px;
    gap: 6px;
    background: transparant !important;
    border: 0px solid var(--card-bg-color); /* var(--card-bg-color)*/
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: auto; /* 移除最小宽度限制 var(--card-bg-color)*/
    max-width: none; /* 移除最大宽度限制 */
    width: 100%; /* 充满网格单元格 */
    margin: 0;
}

.site-item:hover {
    background: transparant !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.site-item .site-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.site-item .site-name {
    font-size: 15px;
    text-align: left;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.site-item .favorite-indicator {
    margin-left: auto;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* ================================ */
/* 收藏夹保持原有网格布局 */
/* ================================ */

.favorites-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
    background: transparent !important;
}

.favorite-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border-radius: 4px;
    position: relative;
    background: transparent !important;
    padding: 8px;
    min-height: auto;
}

.favorite-item:hover {
    transform: translateY(-3px);
}

.favorite-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    background-size: cover;
    background-position: center;
}

.favorite-name {
    text-align: center;
    line-height: 1.4;
    font-size: 14px; /* 从12px增加到14px */
    font-weight: 500; /* 增加一点字重，让文字更清晰 */
}

/* 收藏指示器样式 */
.favorite-indicator {
    position: absolute;
    top: 3px;
    right: 3px;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s;
    cursor: pointer;
}

/* 非编辑模式下的圆点样式 */
.favorite-indicator.dot {
    width: 6px;
    height: 6px;
    background-color: #ff6b6b;
    border: 1px solid rgba(255, 255, 255, 0.9);
    opacity: 1;
}

/* 编辑模式下的爱心样式 */
.favorite-indicator.heart {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #ccc; /* 默认灰色 */
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 关键修复：编辑模式下所有爱心都显示 */
body.edit-mode .favorite-indicator.heart {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* 非编辑模式下：未收藏的爱心隐藏，已收藏的显示圆点 */
body:not(.edit-mode) .favorite-indicator.heart:not(.favorited) {
    opacity: 0 !important;
    pointer-events: none !important;
}

body:not(.edit-mode) .favorite-indicator.heart.favorited {
    opacity: 0 !important; /* 隐藏爱心，显示圆点 */
    pointer-events: none !important;
}

/* 已收藏的爱心样式 */
.favorite-indicator.heart.favorited {
    color: #ff6b6b !important;
}

/* 悬停效果 */
.favorite-indicator.heart:hover {
    color: #ff6b6b;
    background: white;
    transform: scale(1.1);
}

/* 编辑模式样式 */
body.edit-mode .favorite-item {
    cursor: move;
    position: relative;
}

body.edit-mode .favorite-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.edit-mode .favorite-remove {
    opacity: 1;
    visibility: visible;
}

body:not(.edit-mode) .favorite-remove {
    opacity: 0;
    visibility: hidden;
}

/* 拖拽样式 */
.favorite-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.favorite-item.drag-over {
    border: 2px dashed var(--primary-color);
}

.favorite-item.drag-over-top::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.favorite-item.drag-over-bottom::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* 收藏管理 */
.favorite-management {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    display: none;
}

.edit-mode .favorite-management {
    display: block;
}

.add-favorite-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.add-favorite-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.add-favorite-btn {
    padding: 6px 12px;
    background: #e9ecef;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.add-favorite-btn:hover {
    background: #e9ecef;
}

.favorite-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.action-btn:hover {
    background: #5a6268;
}

.action-btn.delete {
    background: #dc3545;
}

.action-btn.delete:hover {
    background: #c82333;
}

.favorite-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #dc3545;
    opacity: 0;
    transition: all 0.3s;
    z-index: 10;
}

.favorite-remove:hover {
    background: white;
    transform: scale(1.1);
}

/* 空状态 */
.empty-favorites {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-favorites i {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--primary-color) !important; /* 从#ddd改为主色调 */
    transition: all 0.3s ease;
}

.empty-favorites p {
    font-size: 14px;
    margin: 0;
}

/* 拖动提示 */
.drag-hint {
    text-align: center;
    padding: 15px;
    color: #718096;
    font-size: 14px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    margin-top: 10px;
}

/* 调色板内容 */
.color-palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.color-palette-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.color-option {
    margin-bottom: 15px;
}

.color-option-title {
    font-size: 14px;
    margin-bottom: 8px;
    color: #555;
}

.color-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input {
    flex: 1;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.color-reset {
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.color-reset:hover {
    background: #5a6268;
}

.color-presets {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    margin-top: 6px;
}

.color-preset {
    width: 100%;
    height: 25px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-preset:hover {
    transform: scale(1.05);
}

.color-preset.active {
    border-color: #333;
}

/* 背景图片控制 */
.bg-image-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bg-image-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bg-image-input {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.bg-image-input::file-selector-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    margin-right: 8px;
}

.bg-image-remove {
    flex-shrink: 0;
    padding: 6px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.bg-image-remove:hover {
    background: #c82333;
}

.bg-image-options {
    margin-top: 8px;
}

.bg-option-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.bg-option-buttons {
    display: flex;
    gap: 5px;
}

.bg-option-btn {
    flex: 1;
    padding: 6px 4px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    transition: all 0.2s;
}

.bg-option-btn:hover {
    background: #e9ecef;
}

.bg-option-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.bg-opacity-control {
    margin-top: 10px;
}

.opacity-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.opacity-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #ddd !important; /* 确保滑块轨道可见 */
    outline: none;
    -webkit-appearance: none;
    border: none;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color) !important;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color) !important;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.opacity-slider::-webkit-slider-track {
    background: #ddd !important;
    height: 4px;
    border-radius: 2px;
}

.opacity-slider::-moz-range-track {
    background: #ddd !important;
    height: 4px;
    border-radius: 2px;
    border: none;
}
.opacity-value {
    font-size: 12px;
    color: #666;
    min-width: 35px;
    text-align: right;
}

.bg-image-preview {
    display: none;
}

.bg-preview-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.bg-preview-image {
    width: 100%;
    height: 60px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* 背景图片主题优化 */
body {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
}

/* 确保内容在背景图片上可读 */
.top-info-bar,
.search-container,
.left-categories,
.right-content {
    background-color: rgba(255, 255, 255, var(--content-opacity)) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 深色背景下的文字优化 */
body[style*="background-image"] .time,
body[style*="background-image"] .logo-text,
body[style*="background-image"] .category-tab {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 预设主题按钮的提示样式 */
.color-preset {
    position: relative;
}

.color-preset:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    margin-bottom: 5px;
}

/* 背景图片加载状态 */
.body-loading-bg {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .favorites-list {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 992px) {
    .favorites-list {
        grid-template-columns: repeat(4, 1fr);
    }
    .category-row {
        flex-direction: column;
        gap: 10px;
    }
    .category-label {
        width: 100%;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .favorites-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .left-categories {
        width: 100%;
        margin-bottom: 20px;
        z-index: 10;
    }
    
    .top-info-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .category-row {
        padding: 10px;
    }
}

/* 确保分类内容正确显示 */
.content-section {
    transition: opacity 0.3s ease;
}

.content-section.hidden {
    display: none !important;
}

.category-content {
    display: none;
}

.category-content.active {
    display: block;
}

/* 确保内容区域正确布局 */
.content-section {
    position: relative;
    width: 100%;
}

.category-content {
    width: 100%;
    position: relative;
}

/* 隐藏类应该完全隐藏元素 */
.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 显示的内容区域 */
.category-content:not(.hidden) {
    display: block; /* 或者 grid/flex，根据你的布局 */
    visibility: visible;
    opacity: 1;
}

/* 收藏指示器样式 */
.favorite-indicator {
    transition: all 0.3s ease;
}

.favorite-indicator.heart {
    cursor: pointer;
}

.favorite-indicator.heart.favorited {
    color: #ff4757;
}

.favorite-indicator.dot {
    width: 6px;
    height: 6px;
    background: #ff4757;
    border-radius: 50%;
}

/* 图标相关样式 */
.site-icon,
.favorite-icon {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* 普通网站图标尺寸 */
.site-icon {
    width: 16px !important;
    height: 16px !important;
    border-radius: 3px !important;
    flex-shrink: 0 !important;
}

/* 收藏网站图标尺寸 */
.favorite-icon {
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
}

/* 空白图标样式 */
.site-icon.no-icon,
.favorite-icon.no-icon {
    background-color: transparent !important;
    background-image: none !important;
}

/* 加载中状态 */
.icon-loading {
    background-color: transparent !important;
    background-image: none !important;
}/* 雪碧图容器 */
.sprite-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important; /* 确保没有背景色覆盖 */
}

/* 雪碧图图标 */
.sprite-icon {
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* 确保其他图标样式正确 */
.site-icon, .favorite-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* 收藏栏图标 */
.favorite-icon {
    width: 24px;
    height: 24px;
}

/* 网站列表图标 */
.site-icon {
    width: 32px;
    height: 32px;
}

.no-icon {
    background-color: #f0f0f0;
}

.icon-loading {
    background-color: #e0e0e0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}
.sprite-icon {
    background-repeat: no-repeat;
    flex-shrink: 0;
    border-radius: 4px;
}

/* 图标加载状态 */
.icon-loading {
    background: #f0f0f0;
    animation: pulse 1.5s ease-in-out infinite;
}

.no-icon {
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-icon::after {
    font-size: 16px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
/* 确保网站名称正常显示 */
.site-name,
.favorite-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 普通网站项目布局 */
.site-item {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 8px !important;
}

/* 收藏网站项目布局 */
.favorite-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px !important;
}