   :root {
             --font-main: 'PingFang SC', -apple-system, system-ui, sans-serif;
            --bg-panel: rgba(255, 255, 255, 0.05);
            
            --color-primary: #3b82f6;
            --color-primary-light: #60a5fa;
            --color-primary-dark: #2563eb;
            --color-danger: #ef4444;
            --color-warning: #f59e0b;
            --color-success: #10b981;
            --color-info: #6b7280;
            
            --bg-blur: 0px;
            --bg-opacity: 0.3;
            --bg-glass: rgba(255, 255, 255, 0.1);
            --bg-glass-border: rgba(255, 255, 255, 0.15);
            --bg-dark: #111111;
            --bg-darker: #0a0a0a;
            --bg-light: rgba(255, 255, 255, 0.05);
            
            
            --item-size: 82px;
            --panel-width: 500px;
            --search-bar-width: 540px;
            --search-bar-height: 50px;
            --time-size: 70px;
            --sidebar-width: 70px;
            
            --font-main: 'PingFang SC', -apple-system, system-ui, sans-serif;
            --font-serif: 'Georgia', serif;
            --font-mono: 'Courier New', monospace;
            --font-kai: 'LXGW WenKai', 'STKaiti', serif;
            
            --transition-fast: 0.15s ease;
            --transition-normal: 0.3s ease;
            --transition-slow: 0.5s ease;
            
            --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
            --shadow-md: 0 4px 8px rgba(0,0,0,0.2);
            --shadow-lg: 0 8px 16px rgba(0,0,0,0.3);
            --shadow-xl: 0 10px 30px rgba(0,0,0,0.5);
            --shadow-primary: 0 4px 15px rgba(59, 130, 246, 0.4);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            width: 100vw;
            height: 100vh;
            overflow: hidden;
            background: var(--bg-dark);
            color: #ffffff;
            font-family: var(--font-main);
            font-size: 14px;
            line-height: 1.5;
            transition: background-color var(--transition-slow);
             transition: font-family 0.3s ease;
        }

        #bg-layer {
            position: fixed;
            inset: 0;
            z-index: -2;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            transition: all 0.8s ease-in-out;
        }

        #bg-mask {
            position: fixed;
            inset: 0;
            z-index: -1;
            background: rgba(0, 0, 0, var(--bg-opacity));
            backdrop-filter: blur(var(--bg-blur));
            pointer-events: none;
        }

        #sidebar-toggle {
            position: fixed;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 20px;
            height: 60px;
            background: rgba(0, 0, 0, 0.7);
            border-radius: 0 10px 10px 0;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 101;
            transition: all var(--transition-normal);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-left: none;
        }
        
        #sidebar-toggle:hover {
            background: rgba(0, 0, 0, 0.9);
            width: 24px;
        }
        
        #sidebar-toggle i {
            font-size: 12px;
            opacity: 0.7;
            transition: all var(--transition-normal);
        }
        
        #sidebar-toggle:hover i {
            opacity: 1;
        }

        #sidebar {
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            width: var(--sidebar-width);
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(20px);
            border-right: 1px solid var(--bg-glass-border);
            z-index: 100;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 30px 0;
            transform: translateX(0);
            transition: transform var(--transition-normal);
        }
        
        #sidebar.hidden {
            transform: translateX(-100%);
        }
        
        main.sidebar-hidden {
            width: 100vw !important;
            margin-left: 0 !important;
        }

        .cat-item {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            margin-bottom: 20px;
            transition: all var(--transition-normal);
            color: rgba(255, 255, 255, 0.3);
            font-size: 1.1rem;
            position: relative;
            pointer-events: auto !important;
            user-select: none;
        }
        
        .cat-item.active {
            background: var(--color-primary);
            color: white;
            box-shadow: var(--shadow-primary);
        }

        .cat-item .cat-name {
            position: absolute;
            left: 50px;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(0, 0, 0, 0.8);
            padding: 5px 10px;
            border-radius: 6px;
            font-size: 0.75rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity var(--transition-fast);
            z-index: 102;
            font-family: var(--font-main);
        }
        
        .cat-item:hover .cat-name {
            opacity: 1;
        }
        
        .add-cat-btn {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            margin-top: auto;
            margin-bottom: 10px;
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.5);
            font-size: 1.2rem;
            transition: all var(--transition-normal);
        }
        
        .add-cat-btn:hover {
            background: var(--color-success);
            color: white;
            transform: scale(1.1);
        }

        main {
            height: 100vh;
            width: calc(100vw - var(--sidebar-width));
            margin-left: var(--sidebar-width);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 6vh 0;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: var(--color-info) transparent;
            transition: all var(--transition-normal);
        }

        main::-webkit-scrollbar {
            width: 6px;
        }

        main::-webkit-scrollbar-track {
            background: transparent;
        }

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

        #clock-area {
            text-align: center;
            margin-bottom: 40px;
            cursor: default;
            user-select: none;
            font-family: var(--font-main);
        }

        #time-text {
            
            line-height: 1;
            margin-bottom: 12px;
            font-size: var(--time-size);
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
            transition: font-size var(--transition-normal);
             font-family: var(--font-main);
    font-weight: 300;
        }

        #date-text {
            font-size: 0.95rem;
            font-family: var(--font-main);
            opacity: 0.8;
            font-weight: 300;
        }

        .search-container {
            width: 90%;
            max-width: var(--search-bar-width);
            margin-bottom: 60px;
            position: relative;
            z-index: 10;
            transition: all var(--transition-normal);
             font-family: var(--font-main);
        }

        .search-bar {
            background: var(--bg-glass);
            backdrop-filter: blur(25px);
            border-radius: 30px;
            border: 1px solid var(--bg-glass-border);
            display: flex;
            align-items: center;
            padding: 0 20px;
            transition: all var(--transition-normal);
            height: var(--search-bar-height);
            box-shadow: var(--shadow-md);
        }

        .search-bar:focus-within {
            background: rgba(255, 255, 255, 0.15);
            border-color: var(--color-primary);
            box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
            transform: translateY(-2px);
        }

        #cur-engine {
            width: 22px;
            height: 22px;
            cursor: pointer;
            margin-right: 15px;
            border-radius: 4px;
            transition: transform var(--transition-fast);
        }

        #cur-engine:hover {
            transform: scale(1.1);
        }

        #search-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: white;
            padding: 0;
            font-size: 1rem;
            height: 100%;
            font-family: var(--font-main);
        }

        #search-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        #grid {
              display: grid;
            grid-template-columns: repeat(auto-fill, minmax(var(--item-size), 1fr));
            gap: 25px;
            width: 100%;
            max-width: 1400px;
             padding: 16px 16px 144px;
            padding-bottom: 120px;
            transition: grid-template-columns var(--transition-normal);
            grid-template-columns: repeat(auto-fill, 64px);
        }

        .icon-item {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .icon-box {
            width: var(--item-size);
            height: var(--item-size);
            border-radius: 20px;
            background: var(--bg-glass);
            border: 1px solid var(--bg-glass-border);
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(10px);
            transition: all var(--transition-normal);
            cursor: pointer;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }

        .icon-box:hover {
            transform: translateY(-5px) scale(1.05);
            border-color: var(--color-primary);
            box-shadow: var(--shadow-lg);
        }

        /* 修复：编辑模式下子元素继承父元素拖拽光标，解决闪烁问题 */
        .editing .icon-box {
            cursor: inherit; /* 关键：继承.icon-item的grab/grabbing光标 */
        }

        .icon-name {
            margin-top: 10px;
            font-size: 0.75rem;
            opacity: 0.7;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: var(--item-size);
            text-align: center;
            transition: opacity var(--transition-fast);
            font-family: var(--font-main);
        }

        .icon-item:hover .icon-name {
            opacity: 1;
        }

        .icon-ico {
            width: 48px;
            height: 48px;
            object-fit: contain;
        }

        .folder-preview {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            padding: 12px;
            width: 100%;
            height: 100%;
        }

        .f-dot {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }

        #folder-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(20px);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity var(--transition-normal);
        }

        #folder-overlay.show {
            opacity: 1;
            display: flex;
        }

        .folder-card {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--bg-glass-border);
            padding: 40px;
            border-radius: 32px;
            width: 90%;
            max-width: 500px;
            position: relative;
            transform: translateY(20px);
            transition: transform var(--transition-normal);
            box-shadow: var(--shadow-xl);
        }

        #folder-overlay.show .folder-card {
            transform: translateY(0);
        }

        .folder-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .del-badge {
            position: absolute;
            top: -8px;
            right: -8px;
            width: 22px;
            height: 22px;
            background: var(--color-danger);
            color: white;
            border-radius: 50%;
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 100;
            border: 2px solid var(--bg-dark);
            font-size: 10px;
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .del-badge:hover {
            transform: scale(1.1);
            background: #ff2e4d;
        }

        .editing .del-badge {
            display: flex;
        }

        .editing .icon-box {
            animation: shake 0.4s infinite;
            border-style: dashed;
        }

        @keyframes shake {
            0%, 100% { transform: rotate(0); }
            25% { transform: rotate(1.5deg); }
            75% { transform: rotate(-1.5deg); }
        }

        #exit-edit-btn {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--color-danger);
            color: white;
            padding: 12px 30px;
            border-radius: 30px;
            display: none;
            cursor: pointer;
            z-index: 500;
            font-size: 0.9rem;
            border: none;
            box-shadow: var(--shadow-xl);
            transition: all var(--transition-normal);
        }

        #exit-edit-btn:hover {
            background: #ff2e4d;
            transform: translateX(-50%) translateY(-2px);
        }

        #side-panel {
            position: fixed;
            right: -600px;
            top: 0;
            bottom: 0;
            width: var(--panel-width);
            /*background: rgba(15, 15, 15, 0.98);*/
            backdrop-filter: blur(40px);
            border-left: 1px solid #333;
            z-index: 1000;
            transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            overflow: hidden;
            box-shadow: var(--shadow-xl);
        }

        #side-panel.open {
            right: 0;
        }

.panel-nav {
    width: 120px;
    /* 强化玻璃拟态，与侧边栏/搜索栏风格统一 */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08); /* 弱化边框，更细腻 */
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    /* 增加内阴影，提升立体感 */
    box-shadow: inset 1px 0 3px rgba(0, 0, 0, 0.1);
}

.p-nav-item {
    padding: 16px 10px; /* 增加上下内边距，提升点击区域 */
    font-size: 0.75rem; /* 微调文字大小，更协调 */
    text-align: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5); /* 降低默认文字透明度，突出激活态 */
    transition: all var(--transition-normal); /* 改用正常过渡，动画更顺滑 */
    border-radius: 8px; /* 增加圆角，与整体圆角设计统一 */
    margin: 0 8px; /* 左右留白，避免贴边 */
    position: relative;
    overflow: hidden; /* 配合伪元素动效 */
}

/* 增加 hover/active 前置光效，提升交互质感 */
.p-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--color-primary);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    opacity: 0;
}

.p-nav-item i {
    display: block;
    font-size: 1.3rem; /* 放大图标，提升视觉焦点 */
    margin-bottom: 8px; /* 增加图标与文字间距 */
    transition: all var(--transition-normal);
}

/* hover 状态：提亮颜色、轻微上浮、显示光效 */
.p-nav-item:hover {
    background: rgba(255, 255, 255, 0.06); /* 加深hover背景，更明显 */
    color: rgba(255, 255, 255, 0.9); /* 提亮文字 */
    transform: translateY(-2px); /* 轻微上浮，有呼吸感 */
}

.p-nav-item:hover i {
    color: var(--color-primary-light); /* 图标提前变浅蓝，过渡更自然 */
}

/* active 状态：主色文字、主色背景、固定光效、图标高亮 */
.p-nav-item.active {
    color: #ffffff; /* 纯文字，突出激活 */
    background: rgba(59, 130, 246, 0.12); /* 加深激活背景，提升辨识度 */
}

.p-nav-item.active::before {
    transform: translateY(0);
    opacity: 1; /* 显示左侧主色光条，明确激活状态 */
}

.p-nav-item.active i {
    color: var(--color-primary); /* 图标主色，视觉焦点 */
    transform: scale(1.05); /* 图标轻微放大，强化激活 */
}

/* 关闭按钮单独优化（底部按钮），适配危险操作视觉提示 */
.p-nav-item:last-child {
    margin-top: auto;
}
.p-nav-item:last-child:hover {
    background: rgba(239, 68, 68, 0.1); /* hover 偏红色背景，提示关闭操作 */
}
.p-nav-item:last-child:hover i,
.p-nav-item:last-child.active i {
    color: var(--color-danger); /* 关闭图标红色，与操作匹配 */
}
.p-nav-item:last-child.active::before {
    background: var(--color-danger); /* 关闭按钮激活光条红色 */
}

     
     
     

        .panel-content {
            flex: 1;
            padding: 25px;
            overflow-y: auto;
            display: none;
             font-family: var(--font-main);
        }

        .panel-content.active {
            display: block;
        }

        .panel-h {
            font-size: 0.75rem;
            color: var(--color-primary);
            margin-bottom: 15px;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1px;
            border-bottom: 1px solid #222;
            padding-bottom: 5px;
             font-family: var(--font-main);
        }

        .ctrl-row {
            margin-bottom: 15px;
        }

        .ctrl-label {
            display: block;
            font-size: 0.7rem;
            /*color: #888;*/
            margin-bottom: 5px;
            font-family: var(--font-main);
        }

        .ctrl-input {
            width: 100%;
            background: #222;
            border: 1px solid #444;
            color: #fff;
            padding: 10px;
            border-radius: 10px;
            outline: none;
            font-size: 0.85rem;
            transition: all var(--transition-fast);
        }

        .ctrl-input:focus {
            border-color: var(--color-primary);
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
        }

        .btn-m {
            padding: 8px 12px;
            background: #333;
            border: none;
            color: #eee;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.75rem;
            transition: all var(--transition-fast);
            font-family: var(--font-main);
        }

        .btn-m:hover {
            background: #444;
            transform: translateY(-1px);
        }

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

        .color-picker-wrapper {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
        }

        #bg-color-pick {
            width: 50px;
            height: 40px;
            border: none;
            background: none;
            cursor: pointer;
            border-radius: 6px;
            overflow: hidden;
        }

        .gradient-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
            gap: 10px;
            margin-top: 10px;
        }

        .grad-item {
            width: 100%;
            aspect-ratio: 1;
            border-radius: 10px;
            border: 2px solid transparent;
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .grad-item:hover {
            transform: scale(1.05);
        }

        .grad-item.active {
            border-color: var(--color-primary);
            box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
        }

        /* 修复：搜索引擎图标备用样式，解决加载失败布局错乱 */
        .eng-item img {
            width: 20px;
            height: 20px;
            display: block;
            background: #222; /* 备用背景色 */
            object-fit: contain; /* 图标居中适配 */
            border-radius: 4px;
        }

        .qrcode-container {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin-top: 20px;
        }

        .qrcode-item {
            text-align: center;
        }

        .qrcode-img {
            width: 140px;
            height: 140px;
            border-radius: 12px;
            border: 1px solid #444;
            margin-bottom: 8px;
            transition: transform var(--transition-normal);
        }

        .qrcode-img:hover {
            transform: scale(1.05);
        }

        .qrcode-label {
            font-size: 0.7rem;
            color: #aaa;
        }

        .cat-edit-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
            padding: 10px;
            background: #222;
            border-radius: 10px;
            transition: all var(--transition-fast);
        }

        .cat-edit-row:hover {
            background: #2a2a2a;
        }

        .cat-edit-emoji {
            width: 40px;
            height: 30px;
            background: #111;
            border: 1px solid #444;
            color: #fff;
            border-radius: 6px;
            font-size: 1rem;
            text-align: center;
        }

        .cat-edit-input {
            flex: 1;
            background: #111;
            border: 1px solid #444;
            color: #fff;
            padding: 8px;
            border-radius: 6px;
            font-size: 0.75rem;
        }

        .icon-type-selector {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 15px;
        }

        .icon-type-btn {
            padding: 10px;
            text-align: center;
            border-radius: 8px;
            cursor: pointer;
            background: #222;
            transition: all var(--transition-fast);
            font-size: 0.75rem;
        }

        .icon-type-btn.active {
            background: var(--color-primary);
        }

        #context-menu {
            position: fixed;
            display: none;
            /*background: #1a1a1a;*/
            border: 1px solid #333;
            border-radius: 12px;
            z-index: 2100;
            width: 130px;
            padding: 6px 0;
            box-shadow: var(--shadow-xl);
            animation: fadeIn 0.2s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(5px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .menu-opt {
            padding: 10px 15px;
            cursor: pointer;
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: all var(--transition-fast);
        }

        .menu-opt:hover {
            background: var(--color-primary);
        }

        #notification {
            position: fixed;
            top: 20px;
            right: 20px;
            background: var(--color-success);
            color: white;
            padding: 12px 20px;
            border-radius: 8px;
            box-shadow: var(--shadow-lg);
            z-index: 3000;
            display: none;
            align-items: center;
            gap: 10px;
            animation: slideInRight 0.3s ease;
        }

        @keyframes slideInRight {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        #loading {
            position: fixed;
            inset: 0;
            background: var(--bg-dark);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            transition: opacity 0.5s ease;
        }

        .spinner {
            width: 50px;
            height: 50px;
            border: 3px solid rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            border-top-color: var(--color-primary);
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        @media (max-width: 768px) {
            :root {
                --sidebar-width: 0;
                --panel-width: 90vw;
                --search-bar-width: 90%;
            }
            
            #sidebar-toggle {
                display: none;
            }
            
            #sidebar {
                transform: translateX(-100%);
            }
            
            #sidebar.show {
                transform: translateX(0);
            }
            
            main {
                width: 100vw;
                margin-left: 0;
            }
            
            #grid {
                grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
            }
            
            .qrcode-container {
                flex-direction: column;
                align-items: center;
            }
        }

        .tooltip {
            position: absolute;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 5px 10px;
            border-radius: 6px;
            font-size: 0.75rem;
            white-space: nowrap;
            z-index: 10000;
            pointer-events: none;
            opacity: 0;
            transition: opacity var(--transition-fast);
        }
        
        .sortable-ghost { opacity: 0.2; transform: scale(0.8); background: var(--color-primary) !important; border-radius: 20px; }
        .sortable-chosen { box-shadow: 0 0 20px var(--color-primary); }
        .editing .icon-item { cursor: grab; }
        .editing .icon-item:active { cursor: grabbing; }

        #quote-container {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            text-align: center;
            color: white;
            text-shadow: 0 2px 10px rgba(0,0,0,0.5);
            z-index: 10;
            max-width: 80%;
            transition: opacity 0.5s ease;
            pointer-events: none;
        }
        #quote-text {
            font-size: 0.75rem;
            font-weight: 500;
            margin-bottom: 5px;
        }
        #quote-author {
            font-size: 0.85rem;
            opacity: 0.8;
        }

        .modal-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.7);
            display: flex; align-items: center; justify-content: center;
            opacity: 0; pointer-events: none; transition: 0.3s; z-index: 1000;
        }
        .modal-overlay.active { opacity: 1; pointer-events: auto; }
        .modal-content {
            background: var(--bg-panel);
            padding: 30px; border-radius: 20px;
            border: 1px solid var(--bg-glass-border);
            backdrop-filter: blur(20px);
        }
        /* 弹窗样式 */
#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.popup-container {
    background: var(--bg-card);
    border-radius: 15px;
    width: 80%;
    max-width: 1000px;
    height: 80%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.popup-container.maximized {
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0;
}

.popup-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
    cursor: move;
}

.popup-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.popup-controls {
    display: flex;
    gap: 10px;
}

.popup-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.popup-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

#popup-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

.popup-footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

.popup-url {
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 10px;
}
    
    /* 资源库样式 */
.resource-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
    background: #1a1a1a;
    border-radius: 10px;
}

.resource-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #222;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.resource-item:hover {
    background: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.resource-item.selected {
    border-color: var(--color-primary);
    background: rgba(66, 153, 225, 0.1);
}

.resource-item .select-checkbox {
    display: none;
    margin-right: 10px;
}

.resource-item.selected .select-checkbox {
    display: block;
    color: var(--color-primary);
}

.resource-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 12px;
    font-size: 1.2rem;
}

.resource-icon img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
}

.resource-info {
    flex: 1;
    min-width: 0;
}

.resource-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-desc {
    font-size: 0.7rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.resource-item:hover .resource-actions {
    opacity: 1;
}

.resource-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #333;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* 资源库搜索框 */
#resource-search {
    background: #222 !important;
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    padding: 0 10px !important;
}

/* 资源库空状态 */
.resource-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.resource-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* 添加按钮特殊样式 */
.add-tag-button {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0.8;
}

.add-tag-button:hover {
    opacity: 1;
    transform: scale(1.05);
}

.add-tag-button .icon-box {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)) !important;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
}

.add-tag-button .icon-name {
    color: var(--color-primary);
    font-weight: bold;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 153, 225, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(66, 153, 225, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(66, 153, 225, 0);
    }
}

/* 分类切换时的动画 */
.cat-transition .add-tag-button {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.8;
        transform: translateY(0);
    }
}

/* 在编辑模式下，添加按钮的样式 */
.main-view.editing .add-tag-button {
    animation: none;
    opacity: 0.9;
}

.main-view.editing .add-tag-button:hover {
    opacity: 1;
}

/* 拖拽视觉反馈 */
.icon-item.drag-over {
    transform: scale(1.05);
    z-index: 10;
}

.icon-item.drag-over .icon-box {
    box-shadow: 0 0 0 3px var(--color-primary), 0 0 15px rgba(0, 150, 255, 0.5);
    border: 2px solid var(--color-primary);
}

.folder-item.drag-over .folder-preview {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 拖拽时的光标样式 */
.icon-item[draggable="true"] {
    cursor: grab;
}

.icon-item[draggable="true"]:active {
    cursor: grabbing;
}

/* 拖拽占位符 */
.sortable-ghost {
    opacity: 0.4;
    background: rgba(0, 150, 255, 0.1);
    border: 2px dashed var(--color-primary);
}

.sortable-chosen {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 文件夹预览改进 */
.folder-preview {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    margin: 0 auto;
}

.f-dot {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    transition: transform 0.2s;
}

.f-count {
    background: var(--color-primary) !important;
    color: white;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
     /* 右键菜单样式 */
#icon-context-menu {
    position: fixed;
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 8px 0;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    z-index: 10000;
    min-width: 160px;
    display: none;
    border: 1px solid rgba(255,255,255,0.1);
    animation: fadeIn 0.15s ease;
}

#icon-context-menu .context-item {
    padding: 10px 15px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    color: rgba(255,255,255,0.8);
}

#icon-context-menu .context-item:hover {
    background: var(--color-primary);
    color: white;
}

#icon-context-menu .context-item i {
    width: 16px;
    text-align: center;
}

#icon-context-menu .context-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 5px 0;
}
 