/* 全局样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: transparent;
    color: #333;
    min-height: 100vh;
    position: relative;
    margin: 0;
    padding: 0;
}

/* 背景容器样式 - 调整z-index确保在最底层 */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 确保在最底层 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.5s ease;
    background-color: #f8f9fa;
    image-rendering: -webkit-optimize-contrast; /* 提高图片清晰度在Webkit浏览器 */
    image-rendering: crisp-edges; /* 提高图片清晰度 */
}

/* 侧边栏样式 */
.sidebar {
    background-color: var(--secondary-color);
    color: white;
    min-height: 100vh;
    padding: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 5; /* 确保在背景之上，但不高于主内容区 */
}

.sidebar h3 {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* 网站标题样式 */
#siteTitle {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

#siteTitle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.3);
}

#siteTitle:active {
    transform: scale(0.98);
}

#siteTitle::after {
    content: '双击进入管理';
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 9px;
    opacity: 0.6;
    color: rgba(255, 255, 255, 0.7);
}

.accordion-button {
    background-color: var(--dark-color) !important;
    color: white !important;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.accordion-body {
    background-color: #34495e;
    padding: 0;
}

.subcategory-item {
    padding: 8px 15px;
    color: white;
    display: block;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s;
}

.subcategory-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 主内容区样式 */
.main-content {
    padding: 0;
    background-color: rgba(255, 255, 255, 1); /* 完全不透明，避免背景干扰 */
    min-height: 100vh;
    position: relative;
    z-index: 10; /* 提高z-index确保在背景上方 */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1); /* 添加阴影，增强层次感 */
}

/* 搜索引擎选择器 */
.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-engines .btn-group {
    width: 100%;
}

.search-engines .btn {
    flex: 1;
    font-weight: bold;
}

.search-engines .btn.active {
    font-weight: bold;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.input-group {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#searchInput {
    border: 2px solid #ddd;
    height: 50px;
    font-size: 16px;
}

#searchButton {
    font-weight: bold;
    height: 50px;
    font-size: 16px;
}

/* 书签卡片样式 */
.bookmark-card {
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
    height: 100%;
    background-color: white; /* 使用完全不透明的白色背景 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.bookmark-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.bookmark-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.bookmark-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.bookmark-description {
    color: #555;
    font-size: 0.95rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
}

/* 管理页面样式 */
.category-item {
    background-color: #f8f9fa;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.subcategory-list {
    margin-top: 10px;
    padding-left: 20px;
}

.bookmark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.remove-btn {
    color: var(--danger-color);
    cursor: pointer;
    margin-left: 10px;
}

.edit-btn {
    color: var(--primary-color);
    cursor: pointer;
    margin-left: 10px;
}

/* 容器样式，确保内容在背景之上 */
.container, .container-fluid {
    position: relative;
    z-index: 10; /* 提高z-index与主内容区一致 */
}

/* 书签卡片内的链接样式 */
.bookmark-card .btn-primary {
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* 背景设置按钮样式 */
#bgSettingBtn {
    z-index: 1030;
    position: fixed;
    bottom: 20px;
    right: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

#bgSettingBtn:hover {
    opacity: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    #bgSettingBtn {
        bottom: 20px;
        right: 20px;
    }
}

/* 背景设置模态框样式 */
.modal-content {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

/* 颜色选择器样式 */
#bgColorPicker {
    height: 40px;
}

/* 登录页面样式 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.login-container h2 {
    margin-bottom: 30px;
    text-align: center;
}

.login-container .form-control {
    height: 46px;
} 