/* ========== 全局重置 ========== */
        /* [兼容] 流式根字号：与全站一致，避免不同设备默认 16px 漂移 */
        :root {
            font-size: clamp(14px, 0.6vw + 11px, 18px);
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

body {
            background: #000000;
            color: #ffffff;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* ========== 顶部导航栏 ========== */
        .navbar {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }

        .navbar-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        /* 返回按钮 */
        .nav-back {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            cursor: pointer;
            color: #A0A0A0;
            font-size: 18px;
            text-decoration: none;
            transition: color 0.2s;
            user-select: none;
        }

        .nav-back:hover {
            color: #ffffff;
        }

        /* 面包屑导航 */
        .nav-breadcrumb {
            font-size: 14px;
            color: #A0A0A0;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .nav-breadcrumb span {
            color: #ffffff;
            font-weight: 600;
        }

        /* 导航右侧按钮组 */
        .navbar-right {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .nav-btn {
            font-size: 13px;
            color: #A0A0A0;
            background: transparent;
            border: 1px solid #2D2D2D;
            border-radius: 6px;
            padding: 7px 12px;
            cursor: pointer;
            transition: all 0.2s;
            user-select: none;
        }

        .nav-btn:hover {
            color: #ffffff;
            border-color: #555555;
        }


        /* ========== 主内容区 ========== */
        .main-content {
            flex: 1;
            min-width: 0;
        }

        /* 页面标题区 */
        .page-header {
            margin-bottom: 32px;
        }

        .page-title {
            font-size: 36px;
            font-weight: 700;
            color: #ffffff;
            margin-bottom: 8px;
        }

        .page-desc {
            font-size: 14px;
            color: #A0A0A0;
            line-height: 1.6;
        }

        /* ========== 链接列表 ========== */
        /* 列表表头 */
        .list-header {
            display: flex;
            align-items: center;
            padding: 10px 16px;
            border-bottom: 1px solid #2D2D2D;
        }

        .list-header-name {
            flex: 1;
            font-size: 12px;
            color: #A0A0A0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }


        .links-list {
            list-style: none;
        }

        /* 单行链接 */
        .link-row {
            display: flex;
            align-items: center;
            height: 56px;
            padding: 0 16px;
            background: #121212;
            border-bottom: 1px solid #2D2D2D;
            cursor: default;
            transition: background 0.15s, transform 0.18s ease;
        }

        .link-row:hover {
            background: #1A1A1A;
        }

        /* 圆形图标 */
        .link-icon {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 600;
            color: #ffffff;
            flex-shrink: 0;
            margin-right: 12px;
            user-select: none;
            line-height: 1;
        }

        .link-name-wrapper {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
        }

        .link-name {
            font-size: 14px;
            font-weight: 600;
            color: #ffffff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            cursor: pointer;
        }

        .link-name:hover {
            text-decoration: underline;
        }

        /* 删除按钮（管理模式下显示） */
        .link-delete {
            margin-left: 12px;
            padding: 4px 10px;
            font-size: 12px;
            color: #E57373;
            background: transparent;
            border: 1px solid #3D2020;
            border-radius: 6px;
            cursor: pointer;
            flex-shrink: 0;
            transition: all 0.2s;
        }

        .link-delete:hover {
            color: #EF9A9A;
            border-color: #5D3030;
        }

        /* ========== 文件夹行 ========== */
        /* 文件夹行尺寸与链接行完全一致 */
        .folder-row {
            display: flex;
            align-items: center;
            height: 56px;
            padding: 0 16px;
            background: #121212;
            border-bottom: 1px solid #2D2D2D;
            cursor: default;
            transition: background 0.15s, transform 0.18s ease;
        }

        .folder-row:hover {
            background: #1A1A1A;
        }

        /* 文件夹名称（不可点击，仅展示） */
        .folder-name-wrapper {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
        }

        .folder-name {
            font-size: 14px;
            font-weight: 600;
            color: #ffffff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* 三个点操作入口（文件夹 + 链接共用） */
        .folder-dots,
        .link-dots {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border-radius: 8px;
            flex-shrink: 0;
            color: #A0A0A0;
            font-size: 18px;
            letter-spacing: 2px;
            line-height: 1;
            user-select: none;
            transition: all 0.2s;
            touch-action: none;
        }

        /* hover 仅视觉反馈（提亮），不触发弹窗 */
        .folder-dots:hover,
        .link-dots:hover {
            color: #ffffff;
            background: #2D2D2D;
        }

        /* 长按中（待触发拖动）视觉反馈 */
        .folder-row.drag-ready,
        .link-row.drag-ready {
            background: #1E1E1E;
        }

        /* 拖动中行：拖起时轻微抬高、浮起阴影 */
        .folder-row.dragging,
        .link-row.dragging {
            opacity: 0.6;
            background: #1F1F1F;
            position: relative;
            z-index: 100;
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
        }

        /* 链接行三个点与名称靠右留出间距 */
        .link-row .link-dots {
            margin-left: 12px;
        }

        /* ========== 添加新链接弹窗 ========== */
        .add-link-inputs {
            flex: 1;
            display: flex;
            /* flexANI-direction: column; */
            gap: 12px;
            justify-content: center;
            overflow-y: auto;
        }

        .add-link-inputs .input-group {
            min-width: 0;
        }

        .add-link-title {
            font-size: 16px;
            font-weight: 600;
            color: #ffffff;
            margin-bottom: 16px;
        }

        .add-link-inputs {
            display: flex;
            gap: 12px;
            align-items: flex-end;
            flex-wrap: wrap;
        }

        /* 输入组 */
        .input-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex: 1;
            min-width: 180px;
        }

        .input-group label {
            font-size: 12px;
            color: #A0A0A0;
        }

        .input-group input {
            height: 40px;
            border: 1px solid #2D2D2D;
            border-radius: 8px;
            background: #0A0A0A;
            color: #ffffff;
            font-size: 14px;
            padding: 0 12px;
            outline: none;
            transition: border-color 0.2s;
        }

        .input-group input:focus {
            border-color: #555555;
        }

        .input-group input::placeholder {
            color: #555555;
        }

        /* 添加按钮 */
        .add-link-btn {
            height: 40px;
            padding: 0 24px;
            border: none;
            border-radius: 8px;
            background: #ffffff;
            color: #000000;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.2s;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .add-link-btn:hover {
            opacity: 0.85;
        }

        /* ========== 删除确认弹窗 ========== */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal-box {
            width: 400px;
            height: 200px;
            background: #121212;
            border: 1px solid #2D2D2D;
            border-radius: 12px;
            padding: 24px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        }

        .modal-title {
            font-size: 20px;
            font-weight: 600;
            color: #FFFFFF;
            margin: 0;
        }

        .modal-message {
            font-size: 14px;
            color: #A0A0A0;
            line-height: 1.6;
            flex: 1;
            display: flex;
            align-items: center;
            white-space: pre-line;
        }

        /* 按钮容器：确认在右，取消在左 */
        .modal-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-btn {
            width: 70px;
            height: 30px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: opacity 0.2s;
            white-space: nowrap;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .modal-btn:hover {
            opacity: 0.85;
        }

        .modal-btn.cancel {
            background: transparent;
            border: 1px solid #3D2020;
            color: #E57373;
        }

        .modal-btn.confirm {
            background: #FFFFFF;
            color: #000000;
            padding: 0 24px;
        }

        /* 左下角“不再提示” */
        .modal-remind {
            font-size: 12px;
            color: #777777;
            cursor: pointer;
            user-select: none;
            align-self: flex-start;
            margin-top: auto;
            padding: 2px 0;
            transition: color 0.2s;
            /* top: 5px; */
        }

        .modal-remind::before {
            content: '';
            display: inline-block;
            width: 14px;
            height: 14px;
            border: 1.5px solid #555555;
            border-radius: 3px;
            margin-right: 6px;
            vertical-align: -2px;
            text-align: center;
            line-height: 14px;
            font-size: 10px;
            color: #ffffff;
            transition: all 0.2s;
        }

        .modal-remind:hover {
            color: #A0A0A0;
        }

        .modal-remind:hover::before {
            border-color: #888888;
        }

        /* 选中状态：白框 + 绿色对号 + 文字变亮 */
        .modal-remind[data-checked="1"] {
            color: #ffffff;
        }

        .modal-remind[data-checked="1"]::before {
            content: '✓';
            background: #4CAF50;
            border-color: #4CAF50;
        }

        /* ========== 悬浮操作菜单（三个点点击） ========== */
        .action-menu {
            position: fixed;
            background: #1A1A1A;
            border: 1px solid #2D2D2D;
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
            z-index: 10000;
            display: none;
            overflow: hidden;
            min-width: 120px;
            padding: 4px 0;
        }

        .action-menu.active {
            display: block;
        }

        .action-menu-item {
            display: block;
            width: 100%;
            padding: 10px 16px;
            font-size: 13px;
            color: #A0A0A0;
            background: transparent;
            border: none;
            cursor: pointer;
            text-align: left;
            transition: all 0.15s;
            font-family: inherit;
        }

        .action-menu-item:hover {
            color: #ffffff;
            background: #2D2D2D;
        }

        .action-menu-item.danger {
            color: #E57373;
        }

        .action-menu-item.danger:hover {
            color: #EF9A9A;
            background: #3D2020;
        }

        /* ========== 新建/重命名文件夹悬浮窗 ========== */
        .folder-modal-input-group {
            flex: 1;
            display: flex;
            align-items: center;
        }

        .folder-modal-input-group label {
            font-size: 12px;
            color: #A0A0A0;
        }

        .folder-modal-input-group input {
            height: 40px;
            border: 1px solid #2D2D2D;
            border-radius: 8px;
            background: #0A0A0A;
            color: #ffffff;
            font-size: 14px;
            padding: 0 12px;
            outline: none;
            transition: border-color 0.2s;
            width: 100%;
        }

        .folder-modal-input-group input:focus {
            border-color: #555555;
        }

        .folder-modal-input-group input::placeholder {
            color: #555555;
        }

        /* ========== 移动目标列表 ========== */
        .move-target-list {
            flex: 1;
            overflow-y: auto;
            max-height: 260px;
            margin: 16px 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .move-target-item {
            padding: 10px 14px;
            font-size: 14px;
            color: #A0A0A0;
            background: #0A0A0A;
            border: 1px solid #2D2D2D;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .move-target-item:hover {
            color: #ffffff;
            border-color: #555555;
            background: #1A1A1A;
        }

        .move-target-item.disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }

        /* ========== 左侧树状导航栏 ========= */
        .page-wrap {
            width: 100%;
            padding: 40px 24px 60px;
            display: flex;
            flex-wrap: wrap;
            align-items: flex-start;
            gap: 24px;
        }

        .sidebar {
            width: 280px;
            flex-shrink: 0;
            background: #1A1A1A;
            border: 1px solid #2D2D2D;
            border-radius: 12px;
            padding: 18px 8px;
            position: sticky;
            top: 24px;
            align-self: flex-start;
            max-height: calc(100vh - 48px);
            overflow-y: auto;
            user-select: none;
        }

        .sidebar-title {
            font-size: 13px;
            color: #777777;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 0 12px 14px;
            border-bottom: 1px solid #2D2D2D;
            margin-bottom: 10px;
        }

        .sidebar-tree {
            display: flex;
            flex-direction: column;
        }

        .tree-node {
            width: 100%;
        }

        .tree-row {
            display: flex;
            align-items: center;
            height: 32px;
            padding-right: 8px;
            border-radius: 6px;
            cursor: pointer;
            color: #A0A0A0;
            font-size: 14px;
            transition: background 0.15s, color 0.15s;
            white-space: nowrap;
        }

        .tree-row:hover {
            background: #242424;
            color: #ffffff;
        }

        .tree-row-active {
            background: #24548E;
            color: #ffffff;
        }

        .tree-row-active:hover {
            background: #24548E;
        }

        .tree-caret {
            width: 18px;
            flex-shrink: 0;
            text-align: center;
            font-size: 10px;
            color: #707070;
            transition: color 0.15s;
        }

        .tree-row:hover .tree-caret {
            color: #A0A0A0;
        }

        .tree-icon {
            margin-right: 8px;
            font-size: 15px;
            flex-shrink: 0;
        }

        .tree-name {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tree-children {
            width: 100%;
        }

        .sidebar::-webkit-scrollbar {
            width: 8px;
        }

        .sidebar::-webkit-scrollbar-track {
            background: #121212;
            border-radius: 4px;
        }

        .sidebar::-webkit-scrollbar-thumb {
            background: #3A3A3A;
            border-radius: 4px;
        }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background: #555555;
        }

        /* ========== 响应式布局：两档断点（桌面端优先） ========== */
        /* [兼容] 超宽屏 (≥1600px)：内容封顶 1400px 居中 */
        @media (min-width:1600px) {
            .page-wrap {
                max-width: 1400px;
                margin: 0 auto;
            }
        }

        /* 中屏 (768px–1024px)：sidebar 缩窄至 220px，main 自适应 */
        @media (max-width:1024px) {
            .sidebar {
                width: 220px;
            }
        }

        /* 小屏 (<768px)：单列堆叠，sidebar 全宽置顶取消 sticky，main 全宽在下 */
        @media (max-width:768px) {
            .page-wrap {
                padding: 20px 16px 40px;
                gap: 16px;
            }

            .sidebar {
                width: 100%;
                flex-shrink: 1;
                position: static;
                max-height: none;
            }

            .main-content {
                width: 100%;
                flex: 1 1 100%;
            }

            .navbar {
                padding: 16px 16px;
            }

            .navbar-right {
                gap: 6px;
            }

            .nav-btn {
                padding: 6px 10px;
                font-size: 12px;
            }

            .page-title {
                font-size: 28px;
            }

            .page-header {
                margin-bottom: 20px;
            }

            /* 弹窗限宽防溢出 */
            .modal-box {
                width: min(400px, 92vw);
            }
        }

        /* [兼容] 小平板/大手机 (≤600px)：补一档，sidebar 紧凑 */
        @media (max-width:600px) {
            .page-wrap {
                padding: 16px 12px 32px;
                gap: 12px;
            }
            .navbar {
                padding: 12px 12px;
            }
            .nav-btn {
                padding: 5px 8px;
                font-size: 12px;
            }
        }

        /* 极窄屏 (≤480px)：进一步紧凑化 */
        @media (max-width:480px) {
            .page-wrap {
                padding: 16px 12px 32px;
            }

            .link-row,
            .folder-row {
                height: 52px;
                padding: 0 12px;
            }

            .modal-box {
                padding: 18px;
            }

            /* [兼容] 安全区：iPhone 底部不遮挡 */
            body {
                padding-bottom: env(safe-area-inset-bottom, 0px);
            }
        }

        /* [兼容] 触屏设备：关闭行 hover 粘滞高亮 */
        @media (hover: none) and (pointer: coarse) {
            .link-row:hover,
            .folder-row:hover {
                background: inherit;
                transform: none;
            }
        }

        /* [兼容] 图片防溢出兜底 */
        img {
            max-width: 100%;
            height: auto;
        }