/* settings.css */
/* 设置按钮样式 */
#settings-button {
    width: 50px;
    height: 50px;
    position: relative;
    z-index: 2000000;
    cursor: pointer;
    transition: 0.5s;
}

/* 移除原设置按钮图标样式 */
#settings-button i,
#settings-button i:before,
#settings-button i:after {
    display: none;
}

/* 设置按钮激活状态 */
#settings-button.on {
    background: rgba(255,255,255,1);
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    right: 380px; /* 与设置面板宽度匹配（324px内容+40px*2边距） */
}
/* 夜间模式下设置按钮样式 */
.dark-mode #settings-button i,
.dark-mode #settings-button i:before,
.dark-mode #settings-button i:after {
    background: #ffffff !important;
}

.dark-mode #settings-button.on i,
.dark-mode #settings-button.on i:before,
.dark-mode #settings-button.on i:after {
    background: #000000 !important;
}

/* 设置面板样式 - 修复初始显示异常并优化UI */
#settings-panel {
    width: 324px;
    padding: 0 40px;
    height: 100%;
    position: absolute;
    right: -417px; /* 关键修复：总宽度=337+40*2=417，完全隐藏在右侧 */
    left: auto; /* 清除左侧定位影响 */
    top: 0;
    z-index: 2000;
    background: rgba(255,255,255,0.97);
    transition: 0.3s all linear;
    /* 隐藏滚动条但保留滚动功能 */
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
}

#settings-panel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

#settings-panel.open {
    right: 0; /* 从右侧完全展开 */
    left: auto; /* 清除左侧定位 */
}

.dark-mode #settings-panel {
    background: rgba(30, 30, 30, 0.97);
}

/* 设置面板内容样式 - 优化UI */
.settings-section {
    margin: 30px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* 第一个区块顶部增加间距，避免贴近顶部 */
.settings-section:first-child {
    margin-top: 60px;
}

.dark-mode .settings-section {
    border-bottom-color: rgba(255,255,255,0.1);
}

.settings-section h3 {
    margin-bottom: 18px;
    color: #333;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

/* 为标题添加图标占位符，增强视觉层次 */
.settings-section h3:before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #3F9DFF;
    margin-right: 10px;
    border-radius: 2px;
}

.dark-mode .settings-section h3 {
    color: #ddd;
}

.setting-buttons {
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.setting-btn {
    background: rgba(0,0,0,0.06);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.setting-btn:hover {
    background: rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.setting-btn.active {
    background: #3F9DFF;
    color: white;
    box-shadow: 0 2px 5px rgba(63,157,255,0.3);
}

.dark-mode .setting-btn {
    background: rgba(255,255,255,0.1);
    color: #ddd;
}

.dark-mode .setting-btn:hover {
    background: rgba(255,255,255,0.2);
}

.dark-mode .setting-btn.active {
    background: #61a0ff;
    color: white;
}

/* 壁纸缩略图样式 - 优化UI */
.wallpaper-thumbs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0;
}

.wallpaper-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wallpaper-thumb:hover {
    transform: scale(1.05);
}

.wallpaper-thumb.selected {
    border-color: #3F9DFF;
    box-shadow: 0 0 0 2px rgba(63,157,255,0.3);
}

.custom-wallpaper-item {
    position: relative;
    display: inline-block;
}

.delete-wallpaper {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(255,0,0,0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0; /* 默认隐藏删除按钮 */
    pointer-events: none; /* 默认不响应点击 */
    z-index: 10; /* 确保在缩略图上方 */
}

.custom-wallpaper-item:hover .delete-wallpaper {
    opacity: 1; /* 鼠标悬停时显示 */
    pointer-events: auto; /* 鼠标悬停时允许点击 */
}

.delete-wallpaper:hover {
    background: rgba(255,0,0,1);
    transform: scale(1.1);
}

/* 壁纸容器样式 */
#wallpaper-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
    display: none;
}

/* 公告模块样式 */
.notice-section {
    margin: 15px 0;
    padding: 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.04);
    border-left: 3px solid #3F9DFF;
}

.notice-section h4 {
    margin: 0 0 8px 0;
    color: #3F9DFF;
    font-size: 15px;
}

.notice-section p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.dark-mode .notice-section {
    background: rgba(255,255,255,0.05);
}

.dark-mode .notice-section p {
    color: #bbb;
}

/* 响应式调整 */
@media (max-width: 640px) {
    #settings-panel {
        width: 227px;
        right: -267px; /* 移动端完全隐藏在右侧 */
        left: auto; /* 清除左侧定位 */
        padding: 0 20px;
    }
    
    #settings-button.on {
        right: 267px; /* 与移动端面板总宽度匹配（227px+20px*2） */
    }
}
    
    .settings-section {
        margin: 20px 0;
    }
    
    .settings-section:first-child {
        margin-top: 50px;
    }
}
.setting-btn.active {
    background: #3F9DFF;
    color: white;
}

.dark-mode .setting-btn.active {
    background: #3F9DFF;
    color: white;
}
/* 数据源管理按钮布局优化 */
.half-width-btn {
    flex: 1; /* 各占一半宽度 */
}

.grid-button-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 每行5个按钮 */
    gap: 8px; /* 按钮间距 */
}

.grid-btn {
    padding: 6px 0; /* 适当调整按钮内边距 */
    font-size: 13px; /* 调整字体大小 */
    text-align: center;
}

/* 确保选中状态在刷新后保持 */
.setting-btn.data-source-btn.active {
    background: #3F9DFF;
    color: white;
    box-shadow: 0 2px 5px rgba(63, 157, 255, 0.3);
}
