/**
 * BookmarkHub - 样式表
 * 
 * 目录结构:
 * ├── 1. 全局样式重置 (line ~15)
 * ├── 2. CSS变量定义 (line ~60)
 * ├── 3. 基础布局 - Header (line ~170)
 * ├── 4. 基础布局 - Main (line ~400)
 * ├── 5. 组件样式
 * │   ├── 按钮 (line ~310)
 * │   ├── 分类标签 (line ~425)
 * │   ├── 书签卡片 (line ~690)
 * │   ├── 分页控件 (line ~1070)
 * │   ├── 模态框 (line ~1150)
 * │   └── Toast通知 (line ~1400)
 * ├── 6. 隐私空间样式 (line ~1450)
 * ├── 7. 响应式设计
 * │   ├── 768px 平板适配 (line ~1780)
 * │   └── 480px 手机适配 (line ~2030)
 * ├── 8. 背景图片模式 (line ~2380)
 * └── 9. 视图切换/排序控件 (line ~2900)
 * 
 * 更新日期: 2024
 */

/* ========== 1. 全局样式重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 允许输入框选择文本 */
input, textarea, [contenteditable] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* 全局样式和移动端优化 */
html, body {
    overflow-x: hidden;
    position: relative;
    touch-action: manipulation; /* 防止双击缩放等手势 */
}

body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; /* 防止滚动链 */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 强制禁用书签卡片的所有默认触摸行为 */
.bookmark-card,
.bookmark-card-wrapper {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -webkit-user-drag: none !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    touch-action: manipulation !important; /* 允许基本操作但禁用长按菜单 */
}

/* 允许按钮正常交互 */
.bookmark-actions,
.bookmark-action {
    touch-action: manipulation !important;
    pointer-events: auto !important;
}

/* CSS 变量定义 */
:root {
    /* 品牌色 - 渐变主题色 */
    --brand-gradient-start: #667eea;
    --brand-gradient-end: #764ba2;
    --brand-gradient: linear-gradient(135deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%);
    --brand-shadow: rgba(102, 126, 234, 0.3);
    --brand-light: rgba(102, 126, 234, 0.08);
    --brand-border: rgba(102, 126, 234, 0.12);
    
    /* 功能色 */
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --secondary-color: #FFC107;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FF9800;
    --info-color: #00BCD4;
    
    /* 文字颜色 */
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-disabled: #BDBDBD;
    --text-on-brand: #ffffff;
    
    /* 背景色 */
    --background: #FAFAFA;
    --background-gradient: linear-gradient(180deg, #f5f7ff 0%, #ffffff 30%, #fafbff 100%);
    --surface: #FFFFFF;
    --surface-variant: #F5F5F5;
    
    /* 边框和圆角 */
    --border-color: #E0E0E0;
    --border-light: #F0F0F0;
    --border-radius: 12px;
    --border-radius-small: 8px;
    
    /* 阴影 */
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 24px rgba(0,0,0,0.2);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    --error: #F44336;
    --error-dark: #d32f2f;
    --on-error: #FFFFFF;
    --outline-variant: #E0E0E0;
    --header-bg: #6c757d;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #FFFFFF;
        --text-secondary: #BDBDBD;
        --text-disabled: #757575;
        
        --background: #121212;
        --surface: #1E1E1E;
        --surface-variant: #2D2D2D;
        
        --border-color: #404040;
    }
}


.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: var(--brand-gradient);
    border-bottom: none;
    box-shadow: 0 4px 20px var(--brand-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo i {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.95);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Header 内按钮特殊样式 */
.header-actions .btn-outline {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    backdrop-filter: blur(10px);
}

.header-actions .btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.header-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.header-actions .btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.header-actions .btn-primary {
    background: #ffffff;
    color: #667eea;
    border: none;
    font-weight: 600;
}

.header-actions .btn-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Header工具按钮折叠容器 - 居右显示 */
.header-tools-collapse {
    position: relative !important;
    display: inline-flex;
    align-items: center;
    margin-left: auto; /* 自动推到右侧 */
    /* 确保定位稳定，不受背景模式影响 */
    z-index: 201; /* 提高z-index，确保容器和弹框都在最上层 */
}

/* Header工具折叠按钮 */
.header-tools-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    z-index: 101;
    position: relative;
}

.header-tools-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.header-tools-toggle i {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
}

/* 展开状态 - 图标旋转 */
.header-tools-collapse:not(.collapsed) .header-tools-toggle i {
    transform: rotate(90deg);
}

/* Header工具弹框 - 从右侧展开 */
.header-tools-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0; /* 改为right: 0，从右侧对齐 */
    left: auto; /* 取消left */
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    z-index: 200; /* 提高z-index，确保在所有弹框之上 */
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px) scale(0.95); /* 改为向右移动 */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: nowrap;
    min-width: max-content;
    /* 确保定位稳定，不受背景模式影响 */
    position: absolute !important;
    /* 确保内容不被裁剪 */
    overflow: visible !important;
}

/* 展开状态下，降低工具按钮的z-index，避免覆盖弹框按钮 */
.header-tools-collapse:not(.collapsed) .header-tools-toggle {
    z-index: 1 !important;
    pointer-events: auto !important;
}

/* 展开状态下，在工具按钮下方创建一个不可见的区域，避免阻挡弹框按钮的点击 */
.header-tools-collapse:not(.collapsed) .header-tools-toggle::after {
    content: '';
    position: absolute;
    bottom: -100px; /* 延伸到弹框下方 */
    left: 0;
    right: 0;
    height: 100px;
    pointer-events: none !important; /* 确保这个区域不阻挡点击 */
    z-index: -1;
    background: transparent;
}

/* 隐私空间header工具按钮样式 */
.privacy-actions .header-tools-toggle {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.privacy-actions .header-tools-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 展开状态 */
.header-tools-collapse:not(.collapsed) .header-tools-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1); /* 展开时回到原位置 */
    pointer-events: auto !important; /* 确保弹框可以接收点击事件 */
}

/* 展开状态下，确保按钮可以点击，并且z-index足够高 */
.header-tools-collapse:not(.collapsed) .header-tools-popup .btn {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    z-index: 10 !important;
    position: relative !important;
}

/* 展开状态下，第一个按钮需要更高的z-index，避免被工具按钮遮挡 */
.header-tools-collapse:not(.collapsed) .header-tools-popup .btn:first-child {
    z-index: 15 !important;
    position: relative !important;
}

/* 折叠状态 */
.header-tools-collapse.collapsed .header-tools-popup {
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px) scale(0.95); /* 改为向右移动 */
    pointer-events: none;
}

/* 弹框中的按钮样式 */
.header-tools-popup .btn {
    margin: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2) !important;
    position: relative !important;
    z-index: 10 !important; /* 提高按钮的z-index */
    min-height: 36px !important;
    padding: 0.6rem 1rem !important;
    width: auto !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
}

/* 确保按钮内部所有元素不阻止点击 */
.header-tools-popup .btn *,
.header-tools-popup .btn i,
.header-tools-popup .btn span {
    pointer-events: none !important;
    user-select: none !important;
    position: relative;
    z-index: 2;
}

/* 移除伪元素，直接使用按钮本身接收点击 */
.header-tools-popup .btn::before {
    display: none !important;
}

/* 弹框中按钮的特殊样式 - 深色文字以适应白色背景 */
/* 使用更高的优先级确保样式不被覆盖 */
.header-tools-popup .btn-outline,
.header-tools-popup button.btn-outline,
.header-tools-popup #backupBtn,
.header-tools-popup #settingsBtn {
    background: rgba(102, 126, 234, 0.15) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: #4455c2 !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

.header-tools-popup .btn-outline:hover:not(:disabled),
.header-tools-popup button.btn-outline:hover:not(:disabled),
.header-tools-popup #backupBtn:hover:not(:disabled),
.header-tools-popup #settingsBtn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.25) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
    color: #3344b1 !important;
}

.header-tools-popup .btn-secondary,
.header-tools-popup button.btn-secondary,
.header-tools-popup #privacySpaceBtn {
    background: rgba(102, 126, 234, 0.2) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: #4455c2 !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

.header-tools-popup .btn-secondary:hover:not(:disabled),
.header-tools-popup button.btn-secondary:hover:not(:disabled),
.header-tools-popup #privacySpaceBtn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.3) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
    color: #3344b1 !important;
}

/* 背景模式下弹框按钮样式 - 确保文字清晰可见 */
body.has-background .header-tools-popup {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(102, 126, 234, 0.25) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

body.has-background .header-tools-popup .btn-outline,
body.has-background .header-tools-popup button.btn-outline,
body.has-background .header-tools-popup #backupBtn,
body.has-background .header-tools-popup #settingsBtn {
    background: rgba(102, 126, 234, 0.2) !important;
    border: 1px solid rgba(102, 126, 234, 0.35) !important;
    color: #3344b1 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
}

body.has-background .header-tools-popup .btn-outline:hover:not(:disabled),
body.has-background .header-tools-popup button.btn-outline:hover:not(:disabled),
body.has-background .header-tools-popup #backupBtn:hover:not(:disabled),
body.has-background .header-tools-popup #settingsBtn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.3) !important;
    border-color: rgba(102, 126, 234, 0.45) !important;
    color: #2233a0 !important;
}

body.has-background .header-tools-popup .btn-secondary,
body.has-background .header-tools-popup button.btn-secondary,
body.has-background .header-tools-popup #privacySpaceBtn {
    background: rgba(102, 126, 234, 0.25) !important;
    border: 1px solid rgba(102, 126, 234, 0.35) !important;
    color: #3344b1 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
}

body.has-background .header-tools-popup .btn-secondary:hover:not(:disabled),
body.has-background .header-tools-popup button.btn-secondary:hover:not(:disabled),
body.has-background .header-tools-popup #privacySpaceBtn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.35) !important;
    border-color: rgba(102, 126, 234, 0.45) !important;
    color: #2233a0 !important;
}

/* 隐私空间弹框按钮样式 - 确保文字清晰可见 */
.privacy-actions .header-tools-popup .btn-outline,
.privacy-actions .header-tools-popup button.btn-outline,
.privacy-actions .header-tools-popup #privacyBackupBtn,
.privacy-actions .header-tools-popup #privacySettingsBtn {
    background: rgba(102, 126, 234, 0.15) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    color: #4455c2 !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

.privacy-actions .header-tools-popup .btn-outline:hover:not(:disabled),
.privacy-actions .header-tools-popup button.btn-outline:hover:not(:disabled),
.privacy-actions .header-tools-popup #privacyBackupBtn:hover:not(:disabled),
.privacy-actions .header-tools-popup #privacySettingsBtn:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.25) !important;
    border-color: rgba(102, 126, 234, 0.4) !important;
    color: #3344b1 !important;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    transition: all 0.3s ease;
}

/* 搜索切换按钮 */
.search-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: scale(1.05);
}

/* 折叠状态 */
.search-container.collapsed .search-toggle-btn {
    display: flex;
}

.search-container.collapsed .search-input,
.search-container.collapsed .search-icon,
.search-container.collapsed .search-help-btn {
    display: none;
}

.search-container.collapsed {
    width: auto;
}

.search-input {
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-small);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.9rem;
    width: 300px;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.search-input:focus::placeholder {
    color: var(--text-secondary);
}

.search-help-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 10;
}

.search-help-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.search-help {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    margin-top: 0.5rem;
    display: none;
}

.search-help.show {
    display: block;
}

.search-help-content {
    padding: 1rem;
}

.search-help-content h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-help-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-help-content li {
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.search-help-content li:last-child {
    margin-bottom: 0;
}

.search-help-content strong {
    color: var(--text-primary);
}

.search-help-content code {
    background: var(--surface-variant);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    transition: var(--transition-fast);
}

.search-input:focus ~ .search-icon {
    color: var(--text-secondary);
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--surface-variant);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--surface-variant);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #D32F2F;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* 主要内容区域 */
.main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    min-height: calc(100vh - 80px);
}

/* 页面整体背景 */
.app {
    background: 
        radial-gradient(ellipse at 0% 0%, var(--brand-light) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(118, 75, 162, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(102, 126, 234, 0.04) 0%, transparent 50%),
        var(--background-gradient);
    min-height: 100vh;
}

/* 有背景图片时，隐藏 .app 的默认背景 */
body.has-background .app {
    background: transparent;
}

/* 分类筛选样式 */
.categories {
    position: fixed;
    left: 1rem;
    top: 100px;
    z-index: 100;
    margin-bottom: 0;
}

/* 折叠按钮 */
.category-collapse-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--brand-gradient);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px var(--brand-shadow);
    z-index: 100;
    position: relative;
}

.category-collapse-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--brand-shadow);
}

.category-collapse-toggle i {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
}

/* 展开状态 - 图标旋转 */
.categories:not(.collapsed) .category-collapse-toggle i {
    transform: rotate(180deg);
}

/* 分类弹框容器 */
.category-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 260px;
    max-width: 280px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    overflow: hidden;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* 展开状态 */
.categories:not(.collapsed) .category-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 弹框内容区域 */
.category-popup-content {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(70vh - 60px);
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
}

/* 弹框滚动条样式优化 */
.category-popup-content::-webkit-scrollbar {
    width: 6px;
}

.category-popup-content::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 3px;
}

.category-popup-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 3px;
}

.category-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.3);
}

/* 分类列表 - 竖向排列 */
.category-chips {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}

/* 视图控制区域 */
.category-popup .view-controls {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    background: rgba(102, 126, 234, 0.02);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 弹框中的批量操作按钮 */
.category-popup .batch-actions {
    margin-top: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

/* 折叠状态 - 隐藏弹框 */
.categories.collapsed .category-popup {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
}

.categories.collapsed .batch-actions {
    display: none !important;
}

/* 旧的内联样式隐藏（保持兼容） */
.categories.collapsed .category-chips {
    display: none;
}

.categories.collapsed .view-controls {
    display: none;
}

.chip {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #5a6a8a;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.08);
}

/* 弹框中竖向排列的chip样式 */
.category-popup .chip {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    padding: 0.65rem 1rem;
    border-radius: 8px;
}

.chip:hover {
    background: #ffffff;
    border-color: rgba(102, 126, 234, 0.3);
    color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateX(4px);
}

/* 弹框中的chip悬停效果 */
.category-popup .chip:hover {
    transform: translateX(4px);
    background: rgba(102, 126, 234, 0.05);
}

.chip.active {
    background: var(--brand-gradient);
    color: var(--text-on-brand);
    border-color: transparent;
    box-shadow: 0 4px 15px var(--brand-shadow);
}

/* 分类标签删除按钮 */
.category-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.category-name {
    flex: 1;
}

/* 重置所有可能的样式冲突 */
button.category-delete-btn {
    all: unset !important;
}

/* 强制隐藏删除按钮 - 默认状态 */
.chip.category-chip .category-delete-btn,
.category-chip .category-delete-btn {
    display: flex !important;
    background: none !important;
    border: none !important;
    color: inherit !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    padding: 2px !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.2s ease !important;
    margin-left: 2px !important;
    pointer-events: none !important;
    z-index: 10 !important;
    position: relative !important;
    transform: scale(0.8) !important;
}

/* 长按时显示删除按钮 - 最高优先级 */
.chip.category-chip.long-pressing .category-delete-btn,
.category-chip.long-pressing .category-delete-btn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: scale(1) !important;
}

/* 长按状态的视觉反馈 */
.category-chip.long-pressing {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 只在长按状态下才允许hover效果 */
.category-chip.long-pressing .category-delete-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
}

/* 只在长按状态下才允许active效果 */
.category-chip.long-pressing .category-delete-btn:active {
    background: rgba(255, 0, 0, 0.3);
    transform: scale(0.95);
}

/* 警告消息样式 */
.warning-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    color: #856404;
    margin-top: 1rem;
}

.warning-message i {
    color: #f39c12;
}

/* 危险按钮样式 */
.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
}

.chip.add-category {
    border-style: dashed;
    color: var(--primary-color);
}

.chip.add-category:hover {
    background: rgba(33, 150, 243, 0.1);
}

/* 批量操作按钮 */
.batch-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--outline-variant);
    display: flex;
    gap: 8px;
    align-items: center;
}

.batch-actions .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
    min-width: auto;
    height: auto;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 5px 10px;
}

.batch-actions .btn-danger {
    background: var(--error);
    color: var(--on-error);
    border: 1px solid var(--error);
}

.batch-actions .btn-danger:hover {
    background: var(--error-dark, #d32f2f);
    border-color: var(--error-dark, #d32f2f);
    transform: translateY(-1px);
}

.batch-actions .btn-danger:active {
    transform: translateY(0);
}

/* batch-actions 响应式样式已合并到主媒体查询区块 */

.chip.more-categories {
    color: var(--text-secondary);
    border-style: dashed;
    position: relative;
}

.chip.more-categories:hover {
    background: var(--surface-variant);
    color: var(--text-primary);
}

.category-count {
    font-size: 0.8em;
    opacity: 0.8;
}

/* 分类网格样式 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    font-size: 0.9rem;
}

.category-item:hover {
    background: var(--surface-variant);
    transform: translateY(-1px);
}

.category-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.category-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 书签网格样式 */
.bookmarks-container {
    position: relative;
}

.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    align-items: start; /* 确保卡片顶部对齐 */
}

/* 书签卡片样式 */
.bookmark-card {
    background: linear-gradient(145deg, var(--surface) 0%, #fafbff 100%);
    border: 1px solid var(--brand-border);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 200px;
    box-shadow: 0 2px 8px var(--brand-light);
}

.bookmark-card.has-image {
    padding: 0;
    position: relative;
}

.bookmark-card:not(.has-image) {
    padding: 0; /* 移除内边距，使用和有图片卡片相同的布局 */
    position: relative;
}

.bookmark-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.18);
    border-color: rgba(102, 126, 234, 0.3);
}

/* 书签图片样式 */
.bookmark-image {
    width: 100%;
    height: 120px; /* PC端固定高度 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* 无图片时的占位符 */
.bookmark-placeholder {
    width: 100%;
    height: 120px; /* 与图片相同高度 */
    background: #F5F5DC; /* 纯米色背景 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8B7355; /* 深一点的米色文字 */
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.bookmark-card-content {
    padding: 1.25rem; /* 减少内边距 */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 有图片的卡片内容区域样式 */
.bookmark-card.has-image .bookmark-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: none;
    color: white;
    padding: 2rem 1.25rem 1.25rem;
}

.bookmark-card.has-image .bookmark-title {
    color: white;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 1), 0 1px 2px rgba(0, 0, 0, 1), 0 0 1px rgba(0, 0, 0, 1);
    font-weight: 700;
}

.bookmark-card.has-image .bookmark-description {
    color: rgba(255, 255, 255, 0.98);
    min-height: 2.55em; /* 保持固定高度 */
    text-shadow: 0 2px 6px rgba(0, 0, 0, 1), 0 1px 3px rgba(0, 0, 0, 1), 0 0 1px rgba(0, 0, 0, 1);
    font-weight: 500;
}

.bookmark-card.has-image .bookmark-category {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-primary) !important;
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: none;
    z-index: 20;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bookmark-card.has-image .bookmark-meta span:last-child {
    color: rgba(255, 255, 255, 0.8);
}

.bookmark-card.has-image .bookmark-action {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bookmark-card.has-image .bookmark-action:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* 无图片卡片也使用相同的覆盖层布局 */
.bookmark-card:not(.has-image) .bookmark-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: none;
    color: white;
    padding: 2rem 1.25rem 1.25rem;
}

.bookmark-card:not(.has-image) .bookmark-title {
    color: white;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 1), 0 1px 2px rgba(0, 0, 0, 1), 0 0 1px rgba(0, 0, 0, 1);
    font-weight: 700;
}

.bookmark-card:not(.has-image) .bookmark-description {
    color: rgba(255, 255, 255, 0.98);
    min-height: 2.55em; /* 保持固定高度 */
    text-shadow: 0 2px 6px rgba(0, 0, 0, 1), 0 1px 3px rgba(0, 0, 0, 1), 0 0 1px rgba(0, 0, 0, 1);
    font-weight: 500;
}

.bookmark-card:not(.has-image) .bookmark-action {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bookmark-card:not(.has-image) .bookmark-action:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.bookmark-card:not(.has-image) .bookmark-category {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-primary) !important;
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bookmark-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.bookmark-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.bookmark-favicon img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

.bookmark-content {
    flex: 1;
    min-width: 0;
}

.bookmark-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.bookmark-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    min-height: 2.55em; /* 固定高度，相当于2行文字的高度 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookmark-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* 右对齐 */
    font-size: 0.75rem;
    color: var(--text-disabled);
    margin-top: auto; /* 推到底部 */
    position: relative;
}

.bookmark-category {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--surface-variant);
    color: var(--text-secondary);
    z-index: 10;
}

.bookmark-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

/* PC端hover显示按钮 */
@media (min-width: 769px) {
    .bookmark-card:hover .bookmark-actions {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* PC端保持原有的覆盖层布局 */
    .bookmark-card.has-image .bookmark-card-content {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: none !important;
        color: white !important;
        padding: 2rem 1.25rem 1.25rem !important;
    }
    
    .bookmark-card:not(.has-image) .bookmark-card-content {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: none !important;
        color: white !important;
        padding: 2rem 1.25rem 1.25rem !important;
    }
    
    /* PC端图片填满整个卡片 */
    .bookmark-image {
        height: 100% !important; /* PC端图片填满整个240px */
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }
    
    .bookmark-placeholder {
        height: 100% !important; /* PC端占位符也填满整个240px */
    }
    
    /* PC端文字颜色 */
    .bookmark-card.has-image .bookmark-title {
        color: white !important;
        text-shadow: 0 3px 8px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 1), 0 1px 2px rgba(0, 0, 0, 1), 0 0 1px rgba(0, 0, 0, 1) !important;
        font-weight: 700 !important;
    }
    
    .bookmark-card.has-image .bookmark-description {
        color: rgba(255, 255, 255, 0.98) !important;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 1), 0 1px 3px rgba(0, 0, 0, 1), 0 0 1px rgba(0, 0, 0, 1) !important;
        font-weight: 500 !important;
    }
    
    .bookmark-card:not(.has-image) .bookmark-title,
    .bookmark-card:not(.has-image) .bookmark-description {
        color: white !important;
        text-shadow: 0 3px 8px rgba(0, 0, 0, 1), 0 2px 4px rgba(0, 0, 0, 1), 0 1px 2px rgba(0, 0, 0, 1), 0 0 1px rgba(0, 0, 0, 1) !important;
        font-weight: 700 !important;
    }
}

.bookmark-action {
    padding: 0.5rem;
    border: none;
    border-radius: var(--border-radius-small);
    background: var(--surface-variant);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmark-action:hover {
    background: var(--border-color);
}

.bookmark-action.delete:hover {
    background: var(--danger-color);
    color: white;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.empty-state p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04) 0%, rgba(118, 75, 162, 0.03) 100%);
    border-radius: var(--border-radius);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    background: rgba(255, 255, 255, 0.9);
    color: #5a6a8a;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.06);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--brand-gradient);
    color: var(--text-on-brand);
    border-color: transparent;
    box-shadow: 0 4px 12px var(--brand-shadow);
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 1rem;
}

.page-jump input {
    width: 60px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
}

.page-jump input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 分页响应式样式已合并到主媒体查询区块 */

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30000; /* 进一步提高z-index，确保在隐私空间之上 */
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 1rem;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    padding: 0.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-small);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--surface-variant);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 表单提示样式 */
.optional-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    font-weight: normal;
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.form-hint i {
    flex-shrink: 0;
}

/* 图片预览样式 */
.image-preview-container {
    position: relative;
    margin-top: 0.75rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--surface-variant);
    border: 1px solid var(--border-color);
}

.image-preview {
    width: 100%;
    max-width: 300px;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: var(--transition-fast);
}

.remove-image:hover {
    background: rgba(0, 0, 0, 0.8);
}


/* 颜色选择器样式 */
.color-picker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Toast 通知样式 */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    padding: 1rem 1.5rem;
    z-index: 1100;
    transform: translateX(100%);
    transition: var(--transition);
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.1rem;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.info .toast-icon {
    color: var(--info-color);
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* 隐私空间样式 */
.privacy-space {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 10000;
    overflow-y: auto;
}

.privacy-header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

.privacy-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.privacy-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.privacy-logo i {
    color: #64b5f6;
    font-size: 1.8rem;
}

.privacy-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

.privacy-actions .search-container {
    max-width: 350px;
    margin-right: auto;
}

.privacy-actions .search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.privacy-actions .search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.privacy-actions .search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #64b5f6;
}

.privacy-actions .search-help-btn {
    color: rgba(255, 255, 255, 0.7);
}

.privacy-actions .search-help-btn:hover {
    color: #64b5f6;
    background: rgba(255, 255, 255, 0.1);
}

/* 隐私空间搜索折叠按钮 */
.privacy-actions .search-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.privacy-actions .search-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 隐私空间按钮样式 */
.privacy-actions .btn-outline {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.privacy-actions .btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.privacy-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.privacy-actions .btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.privacy-actions .btn-primary {
    background: #64b5f6;
    border: none;
    color: #ffffff;
    font-weight: 600;
}

.privacy-actions .btn-primary:hover:not(:disabled) {
    background: #42a5f5;
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.4);
}

.privacy-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 120px);
}

.privacy-main .categories {
    position: fixed;
    left: 1rem;
    top: 100px;
    z-index: 100;
    margin-bottom: 0;
}

.privacy-main .chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.privacy-main .chip:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.privacy-main .chip.active {
    background: #64b5f6;
    border-color: #64b5f6;
    color: #fff;
}

/* 隐私空间折叠按钮 */
.privacy-main .category-collapse-toggle {
    background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
    box-shadow: 0 2px 8px rgba(100, 181, 246, 0.3);
}

.privacy-main .category-collapse-toggle:hover {
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.4);
}

/* 隐私空间折叠状态 */
.privacy-main .categories.collapsed {
    background: transparent;
    border: none;
    box-shadow: none;
}


/* 隐私空间模态框样式 */
.privacy-modal {
    max-width: 500px;
}

.privacy-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.privacy-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
}

.privacy-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--surface-variant);
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
}

.feature-item i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.privacy-setup {
    background: var(--surface-variant);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
}

.setup-info {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.setup-info i {
    color: var(--primary-color);
    margin-top: 0.125rem;
}

.setup-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
    background: var(--surface-variant);
}

.password-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: var(--border-radius-small);
    color: #d32f2f;
    font-size: 0.8rem;
}

.password-error i {
    font-size: 0.9rem;
}

/* 备份模态框样式 */
.backup-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.backup-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.backup-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.backup-options {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.import-area {
    margin-bottom: 1rem;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--surface-variant);
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
}

.privacy-password-input {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--surface-variant);
    border-radius: var(--border-radius);
}

.privacy-password-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.privacy-password-input input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    background: var(--surface);
    color: var(--text-primary);
}

.backup-info {
    background: var(--surface-variant);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.backup-info h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.backup-info ul {
    margin: 0;
    padding-left: 1.5rem;
}

.backup-info li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.backup-info li:last-child {
    margin-bottom: 0;
}


/* ========== 响应式设计 - 768px ========== */
@media (max-width: 768px) {
    /* 移动端整体字体大小优化 */
    html {
        font-size: 14px;
    }
    
    body {
        font-size: 0.875rem;
    }
    
    /* 移动端：分类容器回到正常位置 */
    .categories,
    .privacy-main .categories {
        position: relative;
        left: auto;
        top: auto;
        margin-bottom: 1rem;
    }
    
    /* 主内容区域恢复正常padding */
    .main,
    .privacy-main {
        padding-left: 1rem;
    }
    
    /* 分类弹框移动端优化 */
    .category-popup {
        min-width: 240px;
        max-width: 280px;
        left: 0 !important;
        transform: translateY(-10px) scale(0.95);
        max-height: calc(100vh - 140px);
    }
    
    .categories:not(.collapsed) .category-popup {
        transform: translateY(0) scale(1);
    }
    
    .categories.collapsed .category-popup {
        transform: translateY(-10px) scale(0.95);
    }
    
    /* 弹框内容区域移动端优化 */
    .category-popup-content {
        padding: 0.75rem;
        overflow-y: auto;
        max-height: calc(100vh - 200px);
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    }
    
    /* 弹框中chip移动端优化 */
    .category-popup .chip {
        padding: 0.55rem 0.85rem;
        font-size: 0.8rem;
        border-radius: 6px;
    }
    
    /* 视图控制区域移动端优化 */
    .category-popup .view-controls {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    
    .category-popup .sort-select {
        font-size: 0.8rem;
        padding: 0.45rem 1.75rem 0.45rem 0.5rem;
    }
    
    .category-popup .view-btn {
        font-size: 0.8rem;
        padding: 0.45rem 0.65rem;
    }
    
    /* 批量操作 */
    .batch-actions {
        margin-top: 8px;
        padding-top: 8px;
    }
    
    .batch-actions .btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    /* 折叠按钮移动端优化 */
    .category-collapse-toggle {
        font-size: 0.8rem;
        padding: 0.45rem 0.85rem;
    }
    
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* 移动端header布局优化 */
    .header-actions {
        width: 100%;
        display: flex !important;
        flex-direction: row !important; /* 保持水平布局 */
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: flex-start; /* 默认左对齐 */
        align-items: center;
    }
    
    /* 移动端工具按钮容器居右 */
    .header-actions .header-tools-collapse {
        margin-left: auto !important;
        order: 999 !important; /* 确保在最后显示 */
    }
    
    /* 移动端工具按钮弹框优化 - 从右侧展开 */
    .header-tools-popup {
        flex-direction: column;
        min-width: 160px;
        max-width: 200px;
        top: calc(100% + 25px) !important; /* 增加距离，避免与按钮重叠 */
        right: 0 !important; /* 移动端也居右 */
        left: auto !important;
        transform: translateY(-10px) scale(0.95);
        z-index: 200 !important; /* 确保在所有弹框之上 */
    }
    
    /* 移动端移除toggle按钮的伪元素遮罩，防止阻挡点击 */
    .header-tools-collapse:not(.collapsed) .header-tools-toggle::after {
        display: none !important;
    }
    
    .header-tools-collapse:not(.collapsed) .header-tools-popup {
        transform: translateY(0) scale(1);
    }
    
    .header-tools-collapse.collapsed .header-tools-popup {
        transform: translateY(-10px) scale(0.95);
    }
    
    /* 移动端展开状态下，降低工具按钮的z-index，避免覆盖弹框按钮 */
    .header-tools-collapse:not(.collapsed) .header-tools-toggle {
        z-index: 1 !important;
        pointer-events: auto !important;
    }
    
    .header-tools-collapse:not(.collapsed) .header-tools-popup {
        transform: translateY(0) scale(1);
    }
    
    .header-tools-collapse.collapsed .header-tools-popup {
        transform: translateY(-10px) scale(0.95);
    }
    
    .header-tools-popup .btn {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        min-height: 44px !important;
        padding: 0.75rem 1rem !important;
        position: relative !important;
        flex: 1 1 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 移除伪元素，直接使用按钮本身接收点击 */
    .header-tools-popup .btn::before {
        display: none !important;
    }
    
    /* 移动端确保按钮内部元素不阻止点击 */
    .header-tools-popup .btn *,
    .header-tools-popup .btn i,
    .header-tools-popup .btn span {
        pointer-events: none !important;
        user-select: none !important;
        position: relative;
        z-index: 2;
    }
    
    /* 确保按钮本身可以点击 */
    .header-tools-popup .btn {
        z-index: 1;
    }
    
    /* 移动端弹框按钮文字确保清晰可见 */
    .header-tools-popup .btn-outline,
    .header-tools-popup button.btn-outline,
    .header-tools-popup #backupBtn,
    .header-tools-popup #settingsBtn,
    .privacy-actions .header-tools-popup .btn-outline,
    .privacy-actions .header-tools-popup #privacyBackupBtn,
    .privacy-actions .header-tools-popup #privacySettingsBtn {
        color: #4455c2 !important;
        font-weight: 600 !important;
        text-shadow: none !important;
    }
    
    .header-tools-popup .btn-secondary,
    .header-tools-popup button.btn-secondary,
    .header-tools-popup #privacySpaceBtn {
        color: #4455c2 !important;
        font-weight: 600 !important;
        text-shadow: none !important;
    }
    
    .search-container {
        width: auto;
        order: -1;
    }
    
    /* 移动端搜索框更小的按钮 */
    .search-toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    /* 移动端搜索交互优化：独占行模式 */
    /* 当搜索框展开时，它占满宽度，并隐藏同一行的其他按钮 */
    
    .header-actions {
        position: relative; /* 确保上下文 */
    }

    /* 展开状态：占满剩余空间 */
    .search-container:not(.collapsed) {
        width: 100%;
        flex: 1;
        order: -1; /* 保证在最前 */
    }

    /* 关键：当搜索框展开时，隐藏它后面的所有兄弟元素 */
    .search-container:not(.collapsed) ~ .header-tools-collapse,
    .search-container:not(.collapsed) ~ .btn {
        display: none !important;
    }
    
    /* 搜索框样式调整 */
    .search-input {
        width: 100%;
    }
    
    /* 隐私空间同理 */
    /* 注意：需要配合 HTML 结构调整，确保 search-container 是第一个子元素 */
    .privacy-actions .search-container:not(.collapsed) {
        width: 100% !important;
        flex: 1 !important;
    }
    
    .privacy-actions .search-container:not(.collapsed) ~ .header-tools-collapse,
    .privacy-actions .search-container:not(.collapsed) ~ .btn {
        display: none !important;
    }
    
    .header-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.375rem);
        justify-content: center;
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-help {
        left: -1rem;
        right: -1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .search-help-content {
        padding: 1rem;
        font-size: 0.8rem;
    }
    
    /* 隐私空间移动端优化 */
    .privacy-header-content {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 0 1rem !important;
    }
    
    .privacy-actions {
        width: 100% !important;
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
        justify-content: flex-start !important;
    }
    
    .privacy-actions .search-container {
        width: auto !important;
        order: -1 !important;
        max-width: none !important;
        margin-right: 0 !important;
    }
    
    /* 隐私空间适配 */
    .privacy-actions {
        width: 100% !important;
        flex-wrap: nowrap !important; /* 防止换行 */
        gap: 0.75rem !important;
        justify-content: flex-start !important;
    }
    
    .privacy-actions .btn {
        flex: 1 !important;
        min-width: calc(50% - 0.375rem) !important;
        justify-content: center !important;
        font-size: 0.85rem !important;
        padding: 0.6rem 0.8rem !important;
        order: 2 !important;
    }
    
    .main {
        padding: 1rem;
    }
    
    .privacy-main {
        padding: 1rem !important;
        margin: 0 !important;
    }
    
    .bookmarks-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 0.75rem;
    }
    
    /* 卡片包装器样式 */
    .bookmark-card-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* 描述框样式 */
    .bookmark-description-box {
        background: var(--surface);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 0.75rem;
        font-size: 0.85rem;
        line-height: 1.4;
        color: var(--text-secondary);
    }
    
    .category-chips {
        justify-content: center;
    }
    
    .category-collapse-toggle {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* 移动端折叠状态更紧凑 */
    .categories.collapsed {
        padding: 0.25rem 0;
        margin-bottom: 0.5rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .category-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
    
    /* 移动端防止默认长按行为 */
    .bookmark-card {
        -webkit-touch-callout: none !important; /* 禁用iOS长按弹出菜单 */
        -webkit-user-select: none !important; /* 禁用文本选择 */
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important; /* 禁用点击高亮 */
        -webkit-highlight: none !important;
    }
    
    .bookmark-card * {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    
    /* 移动端长按按钮功能 */
    .bookmark-actions {
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease !important;
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        z-index: 100 !important; /* 提高z-index */
        background: rgba(0, 0, 0, 0.8) !important; /* 增加背景透明度 */
        border-radius: var(--border-radius-small) !important;
        padding: 0.25rem !important;
        pointer-events: none !important; /* 默认不可点击 */
    }
    
    /* 长按显示按钮 */
    .bookmark-card.show-actions .bookmark-actions {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important; /* 显示时可点击 */
    }
    
    .bookmark-action {
        padding: 0.4rem !important;
        font-size: 0.8rem !important;
        background: rgba(255, 255, 255, 0.9) !important;
        color: var(--text-primary) !important;
        border: none !important;
        border-radius: var(--border-radius-small) !important;
        margin: 0 0.1rem !important;
        pointer-events: auto !important; /* 按钮可点击 */
    }
    
    .bookmark-action:hover {
        background: white !important;
    }
    
    /* 视图控件响应式 - 从分散位置合并 */
    .view-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.5rem;
    }
    
    .sort-select {
        flex: 1;
        max-width: 150px;
    }
    
    .bookmark-list-item {
        padding: 0.6rem 0.75rem;
    }
    
    .list-item-actions {
        opacity: 1;
    }
    
    .list-item-category {
        display: none;
    }
    
    /* 分页样式 */
    .pagination {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 0;
    }
    
    .pagination-info {
        text-align: center;
        font-size: 0.8rem;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .page-jump {
        margin: 0 0.5rem;
    }
    
    .page-jump input {
        width: 50px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    /* 设置页面 */
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .setting-item .btn {
        width: 100%;
        justify-content: center;
    }
    
    .settings-section {
        padding: 1rem;
    }
}

/* ========== 响应式设计 - 480px ========== */
@media (max-width: 480px) {
    .header-content {
        padding: 0.75rem;
    }
    
    .main {
        padding: 0.75rem;
    }
    
    /* 小屏幕弹框进一步优化 */
    .category-popup {
        min-width: 200px;
        max-width: 240px;
        max-height: calc(100vh - 120px);
    }
    
    /* 小屏幕弹框内容进一步优化 */
    .category-popup-content {
        padding: 0.6rem;
        overflow-y: auto;
        max-height: calc(100vh - 180px);
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    }
    
    .category-popup .chip {
        padding: 0.5rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .category-popup .view-controls {
        padding: 0.45rem 0.6rem;
        gap: 0.45rem;
    }
    
    .category-popup .sort-select {
        font-size: 0.75rem;
        padding: 0.4rem 1.5rem 0.4rem 0.45rem;
    }
    
    .category-popup .view-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.55rem;
    }
    
    .category-collapse-toggle {
        font-size: 0.75rem;
        padding: 0.4rem 0.7rem;
    }
    
    .bookmarks-grid {
        grid-template-columns: 1fr 1fr; /* 小屏幕两列显示 */
        gap: 0.75rem; /* 增加间距以适应新的布局 */
    }
    
    .bookmark-card {
        height: 0 !important;
        padding-bottom: 75% !important; /* 4:3 宽高比 (3/4 = 0.75) */
        position: relative !important;
        overflow: hidden !important;
        -webkit-touch-callout: none !important; /* 禁用iOS长按弹出菜单 */
        -webkit-user-select: none !important; /* 禁用文本选择 */
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important; /* 禁用点击高亮 */
        -webkit-highlight: none !important;
    }
    
    .bookmark-card * {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    .bookmark-image,
    .bookmark-placeholder {
        -webkit-touch-callout: none !important; /* 禁用长按菜单 */
        -webkit-user-select: none !important;
        -webkit-user-drag: none !important; /* 禁用拖拽 */
    }
    
    
    
    /* 移动端卡片内容 - 移除覆盖层 */
    .bookmark-card-content {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: none !important; /* 移除背景渐变 */
        color: white !important;
        padding: 0 !important; /* 移除内边距 */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 移动端文字颜色（覆盖层上的白色文字） */
    .bookmark-card .bookmark-title {
        color: white !important;
    }
    
    .bookmark-image {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        border-radius: var(--border-radius) !important;
    }
    
    /* 移动端占位符调整 */
    .bookmark-placeholder {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        border-radius: var(--border-radius) !important;
        background: #F5F5DC !important; /* 米色背景 */
    }
    
    /* 无图片卡片也移除覆盖层 */
    .bookmark-card:not(.has-image) .bookmark-card-content {
        background: none !important;
    }
    
    /* 无图片卡片的网站图标样式调整 */
    .bookmark-card:not(.has-image) .bookmark-favicon {
        background: rgba(139, 115, 85, 0.8) !important; /* 深一点的米色背景 */
    }
    
    .bookmark-card:not(.has-image) .bookmark-favicon i {
        color: white !important;
    }
    
    /* 无图片卡片的网站名颜色调整 */
    .bookmark-card:not(.has-image) .bookmark-title {
        color: #8B7355 !important; /* 深米色，在米色背景上更清晰 */
        text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5) !important; /* 白色阴影增加对比度 */
    }
    
    .bookmark-category {
        position: absolute !important;
        bottom: 0.75rem !important;
        right: 0.75rem !important;
        font-size: 0.55rem !important;
        padding: 0.15rem 0.35rem !important;
        line-height: 1.2 !important;
        background-color: rgba(255, 255, 255, 0.9) !important;
        color: var(--text-primary) !important;
        backdrop-filter: blur(4px) !important;
        z-index: 10 !important;
    }
    
    
    .bookmark-header {
        gap: 0.5rem !important;
        margin-bottom: 0.5rem !important;
        margin-top: auto !important; /* 推到底部 */
    }
    
    /* 移动端网站名显示在左下角 */
    .bookmark-header {
        position: absolute !important;
        bottom: 0.5rem !important;
        left: 0.5rem !important;
        margin: 0 !important;
        z-index: 5 !important;
        display: flex !important;
        align-items: center !important; /* 垂直居中对齐 */
        gap: 0.3rem !important; /* 稍微增加间距 */
        height: 20px !important; /* 固定高度，与图标一致 */
    }
    
    .bookmark-favicon {
        width: 20px !important;
        height: 20px !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 2px !important;
        flex-shrink: 0 !important; /* 防止图标被压缩 */
    }
    
    .bookmark-favicon img {
        width: 16px !important;
        height: 16px !important;
        border-radius: 2px !important;
    }
    
    .bookmark-favicon i {
        font-size: 12px !important;
        color: var(--text-secondary) !important;
    }
    
    /* 移动端标题显示为网站名，小字体 */
    .bookmark-title {
        display: flex !important; /* 使用flex以便更好对齐 */
        align-items: center !important; /* 垂直居中 */
        font-size: 0.55rem !important; /* 更小的字体 */
        color: white !important;
        margin: 0 !important;
        line-height: 1 !important; /* 减小行高 */
        font-weight: 400 !important; /* 减小字重 */
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7) !important; /* 文字阴影增加可读性 */
        white-space: nowrap !important; /* 防止换行 */
        overflow: hidden !important;
        text-overflow: ellipsis !important; /* 长文本显示省略号 */
        max-width: 80px !important; /* 减小最大宽度 */
        height: 20px !important; /* 与图标相同高度 */
    }
    
    
    /* 移动端文字样式调整 */
    .bookmark-title {
        font-size: 0.8rem !important; /* 减小标题字体 */
        line-height: 1.3 !important;
        -webkit-line-clamp: 1 !important; /* 移动端只显示1行标题 */
        margin-bottom: 0.25rem !important;
    }
    
    .bookmark-description {
        font-size: 0.7rem !important; /* 减小描述字体 */
        line-height: 1.4 !important;
        min-height: 2.1em !important; /* 调整固定高度 */
        margin-bottom: 0.5rem !important;
        -webkit-line-clamp: 2 !important;
    }
    
    /* 移动端整体字体大小优化 */
    html {
        font-size: 15px;
    }
    
    body {
        font-size: 0.9rem;
    }
    
    /* 移动端书签卡片字体优化 */
    .bookmark-card .bookmark-title {
        font-size: 0.85rem !important;
    }
    
    .bookmark-card .bookmark-url {
        font-size: 0.75rem !important;
    }
    
    .bookmark-card .bookmark-description {
        font-size: 0.75rem !important;
    }
    
    /* 移动端按钮字体优化 */
    .btn {
        font-size: 0.85rem;
    }
    
    /* 移动端header字体优化 */
    .header-content {
        font-size: 0.95rem;
    }
    
    .header-title {
        font-size: 1.15rem;
    }
    
    .bookmark-favicon {
        width: 18px !important;
        height: 18px !important;
    }
    
    /* 移动端描述框样式 - 透明背景 */
    .bookmark-description-box {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0.5rem 0 !important; /* 只保留上下内边距 */
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
        color: var(--text-secondary) !important;
    }
    
    /* 移动端长按按钮功能（480px以下）*/
    .bookmark-actions {
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease !important;
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        z-index: 10 !important;
        background: rgba(0, 0, 0, 0.7) !important;
        border-radius: var(--border-radius-small) !important;
        padding: 0.25rem !important;
    }
    
    /* 长按显示按钮 */
    .bookmark-card.show-actions .bookmark-actions {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important; /* 显示时可点击 */
    }
    
    .bookmark-action {
        padding: 0.4rem !important;
        font-size: 0.8rem !important;
        background: rgba(255, 255, 255, 0.9) !important;
        color: var(--text-primary) !important;
        border: none !important;
        border-radius: var(--border-radius-small) !important;
        margin: 0 0.1rem !important;
        pointer-events: auto !important; /* 按钮可点击 */
    }
    
    .bookmark-action:hover {
        background: white !important;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    /* 视图控件响应式 - 从分散位置合并 */
    .view-controls {
        gap: 0.5rem;
    }
    
    .sort-select {
        font-size: 0.8rem;
        padding: 0.4rem 1.5rem 0.4rem 0.5rem;
    }
    
    .view-btn {
        width: 28px;
        height: 28px;
    }
    
    /* 小屏幕折叠状态极致紧凑 */
    .categories.collapsed {
        padding: 0.25rem 0;
        margin-bottom: 0.5rem;
    }
    
    .categories.collapsed .category-collapse-toggle {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }
}

/* 应用设置样式 */
.background-preview {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
    background: var(--surface);
}

.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.preview-text {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.background-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.option-group {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--surface);
}

.radio-option:hover {
    background: var(--surface-variant);
}

.radio-option input[type="radio"] {
    margin-right: 0.75rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.option-content {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--background);
}

.form-input, .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.upload-info, .url-info {
    margin-top: 0.5rem;
}

.upload-info small, .url-info small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.background-settings {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface);
    margin-top: 1rem;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    min-width: 80px;
    font-weight: 500;
    color: var(--text-primary);
}

.range-input {
    flex: 1;
    margin: 0 0.5rem;
}

.range-input::-webkit-slider-track {
    background: var(--border-color);
    height: 4px;
    border-radius: 2px;
}

.range-input::-webkit-slider-thumb {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.range-input::-moz-range-track {
    background: var(--border-color);
    height: 4px;
    border-radius: 2px;
    border: none;
}

.range-input::-moz-range-thumb {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ========== 背景图片样式 - 简洁专业设计 ========== */

/* 背景应用到body */
body.has-background {
    position: relative;
}

body.has-background::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* 顶部导航栏 - 毛玻璃效果 */
body.has-background .header {
    background: linear-gradient(135deg, rgba(45, 55, 95, 0.95) 0%, rgba(65, 45, 85, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* 有背景时 Logo 样式 */
body.has-background .header .logo {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.has-background .header .logo i {
    color: #a0cfff;
}

/* 有背景时搜索框样式 - 使用 !important 确保优先级 */
body.has-background .header .search-input {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

body.has-background .header .search-input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.has-background .header .search-input:focus {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #333333 !important;
    text-shadow: none !important;
}

body.has-background .header .search-input:focus::placeholder {
    color: #999999 !important;
}

body.has-background .header .search-icon {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.has-background .header .search-input:focus ~ .search-icon {
    color: #667eea !important;
}

body.has-background .header .search-help-btn {
    color: rgba(255, 255, 255, 0.5) !important;
}

body.has-background .header .search-help-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

/* 有背景时 Header 按钮样式 - 使用 !important 确保优先级 */
body.has-background .header-actions .btn-outline {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

body.has-background .header-actions .btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

body.has-background .header-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

body.has-background .header-actions .btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25) !important;
}

body.has-background .header-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

body.has-background .header-actions .btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
    transform: translateY(-1px);
}

/* 主内容区域 - 保持原有布局，仅添加半透明背景 */
body.has-background .main {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0;
}

/* 分类标签 - 使用 !important 确保优先级 */
body.has-background .chip {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(102, 126, 234, 0.15) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    color: #333333 !important;
}

body.has-background .chip:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15) !important;
    color: #333333 !important;
}

body.has-background .chip.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35) !important;
    color: #ffffff !important;
}

/* 书签卡片 */
body.has-background .bookmark-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 255, 0.92) 100%);
    border: 1px solid rgba(102, 126, 234, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

body.has-background .bookmark-card:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(250, 252, 255, 0.98) 100%);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.2), 0 0 0 1px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.25);
}

/* 有背景时列表视图样式 */
body.has-background .bookmark-list-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 252, 255, 0.92) 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

body.has-background .bookmark-list-item:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

/* 有背景时分类区域 */
body.has-background .categories {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(248, 250, 255, 0.8) 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

body.has-background .category-collapse-toggle {
    backdrop-filter: blur(8px);
}

/* 有背景时折叠状态也保持透明 */
body.has-background .categories.collapsed {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* 有背景时分页区域 */
body.has-background .pagination {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(248, 250, 255, 0.8) 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

/* 搜索框 */
body.has-background .search-input {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.12);
}

body.has-background .search-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
}

/* 按钮 - 主内容区域 */
body.has-background .main .btn-outline {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333333;
}

body.has-background .main .btn-outline:hover {
    background: rgba(255, 255, 255, 1);
    color: #333333;
}

/* 模态框 */
body.has-background .modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* 分页控件 */
body.has-background .pagination {
    background: transparent;
}

/* 空状态 */
body.has-background .empty-state {
    background: transparent;
}

/* Toast 通知 */
body.has-background .toast {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 视图控件 */
body.has-background .view-toggle {
    background: rgba(255, 255, 255, 0.9);
}

body.has-background .sort-select {
    background: rgba(255, 255, 255, 0.95);
}

/* 列表视图项 */
body.has-background .bookmark-list-item {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
}

body.has-background .bookmark-list-item:hover {
    background: rgba(255, 255, 255, 1);
}

/* ========== 隐私空间保持原样 ========== */
body.has-background .privacy-space {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

body.has-background .privacy-header {
    background: rgba(0, 0, 0, 0.3) !important;
}

body.has-background .privacy-main {
    background: transparent !important;
}

body.has-background .privacy-space .chip,
body.has-background .privacy-space .bookmark-card,
body.has-background .privacy-space .bookmark-list-item,
body.has-background .privacy-space .search-input,
body.has-background .privacy-space .btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 隐私空间模态框 */
body.has-background #privacyPasswordModal .modal-content,
body.has-background #privacySettingsModal .modal-content {
    background: var(--surface) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ========== 深色模式适配 ========== */
@media (prefers-color-scheme: dark) {
    body.has-background .header {
        background: rgba(30, 30, 30, 0.9);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    body.has-background .main {
        background: rgba(30, 30, 30, 0.88);
    }
    
    body.has-background .chip {
    background: rgba(50, 50, 50, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    body.has-background .chip:hover {
        background: rgba(60, 60, 60, 1);
        color: #ffffff;
    }
    
    body.has-background .chip.active {
        color: #ffffff;
    }
    
    body.has-background .bookmark-card,
    body.has-background .bookmark-list-item {
        background: rgba(40, 40, 40, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    body.has-background .bookmark-card:hover,
    body.has-background .bookmark-list-item:hover {
        background: rgba(50, 50, 50, 1);
    }
    
    body.has-background .main .btn-outline {
        background: rgba(50, 50, 50, 0.95);
        border-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
    
    body.has-background .search-input {
        background: rgba(40, 40, 40, 0.95);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    body.has-background .btn-outline {
        background: rgba(50, 50, 50, 0.95);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    body.has-background .modal-content {
        background: rgba(35, 35, 35, 0.98);
    }
    
    body.has-background .toast {
        background: rgba(35, 35, 35, 0.98);
    }
    
    body.has-background .view-toggle {
        background: rgba(50, 50, 50, 0.9);
    }
    
    body.has-background .sort-select {
        background: rgba(50, 50, 50, 0.95);
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bookmark-card {
    animation: fadeIn 0.3s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-variant);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-disabled);
}

/* 隐私空间设置样式 */
.settings-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-section h3 i {
    color: var(--primary-color);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
}

.setting-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.setting-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.security-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
}

.info-item i {
    color: var(--primary-color);
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.info-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 设置页面响应式样式已合并到主媒体查询区块 */

/* ========== 视图切换和排序控件样式 ========== */
.view-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

.sort-control {
    position: relative;
}

.sort-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--border-radius-small);
    background: rgba(255, 255, 255, 0.9);
    color: #5a6a8a;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    transition: var(--transition-fast);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.08);
}

.sort-select:hover {
    border-color: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.sort-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.view-toggle {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: var(--border-radius-small);
    padding: 0.25rem;
    gap: 0.25rem;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.08);
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #8896ab;
    border-radius: calc(var(--border-radius-small) - 2px);
    cursor: pointer;
    transition: var(--transition-fast);
}

.view-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.view-btn.active {
    background: var(--brand-gradient);
    color: var(--text-on-brand);
    box-shadow: 0 2px 8px var(--brand-shadow);
}

/* ========== 列表视图样式 ========== */
.bookmarks-grid.list-view {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr); /* 桌面端3列 */
    gap: 0.5rem;
}

/* 列表视图响应式 */
@media (max-width: 1400px) {
    .bookmarks-grid.list-view {
        grid-template-columns: repeat(2, 1fr); /* 中等屏幕2列 */
    }
}

@media (max-width: 900px) {
    .bookmarks-grid.list-view {
        grid-template-columns: 1fr; /* 小屏幕单列 */
    }
}

.bookmark-list-item {
    display: flex;
    align-items: center;
        gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.06);
}

.bookmark-list-item:hover {
    border-color: rgba(102, 126, 234, 0.25);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.12);
    background: #ffffff;
    transform: translateY(-2px);
}

.list-item-favicon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
        justify-content: center;
    }
    
.list-item-favicon img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.list-item-favicon i {
    font-size: 16px;
    color: var(--text-secondary);
}

.list-item-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.list-item-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-category {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.list-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    transition: var(--transition-fast);
}

.bookmark-list-item:hover .list-item-actions {
    opacity: 1;
}

.list-item-actions .bookmark-action {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--surface-variant);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.list-item-actions .bookmark-action:hover {
    background: var(--primary-color);
    color: white;
}

.list-item-actions .bookmark-action.delete:hover {
    background: var(--danger-color);
}

/* 分类区域布局调整 */
.categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.category-chips {
    flex: 1;
    min-width: 0;
}

/* 响应式样式已合并到主媒体查询区块 (768px @ line ~1765, 480px @ line ~1997) */