        :root {
            --pri: #1D5BFF;
            --pri-l: #4C86FF;
            --pri-d: #0E4BC9;
            --pri-h: #4C86FF;
            --pri-bg: rgba(29, 91, 255, 0.08);
            --ok: #34c759;
            --warn: #ff9500;
            --err: #ff3b30;
            --info: #1D5BFF;
            --bg: #f2f2f7;
            --card: #ffffff;
            --line: #e5e5ea;
            --line-l: #f2f2f7;
            --t1: #1c1c1e;
            --t2: #3a3a3c;
            --t3: #8e8e93;
            --t4: #c7c7cc;
            --radius-sm: 8px;
            --radius: 12px;
            --radius-lg: 16px;
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.05);
            --shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 10px 24px -8px rgba(0, 0, 0, 0.10);
            --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06), 0 24px 54px -16px rgba(0, 0, 0, 0.20);
            --ring: 0 0 0 3px rgba(29, 91, 255, 0.14);
            color-scheme: light dark;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        /* 主题切换：整页快照交叉淡入，期间抑制各元素不一致的 transition，避免分批变色 */
        :root.theme-switching,
        :root.theme-switching *,
        :root.theme-switching *::before,
        :root.theme-switching *::after {
            transition: none !important;
        }
        @keyframes themeFadeIn { from { opacity: 0; } to { opacity: 1; } }
        ::view-transition-old(root) { animation: none; z-index: 1; }
        ::view-transition-new(root) { animation: themeFadeIn 0.24s ease both; z-index: 2; }
        a { text-decoration: none; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
            background: var(--bg);
            color: var(--t1);
            line-height: 1.6;
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        .app-container {
            display: flex;
            width: 100%;
            height: 100vh;
            overflow: hidden;
        }
        /* ========== Left Sidebar ========== */
        .sidebar {
            width: 230px;
            min-width: 230px;
            height: 100%;
            background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
            border-right: 1px solid #e2e8f0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: transform 0.3s ease, width 0.3s ease;
        }
        .sidebar-header {
            padding: 20px 18px 16px;
            border-bottom: 1px solid #e2e8f0;
            background: white;
        }
        .sidebar-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 4px;
        }
        .sidebar-logo {
            width: 40px;
            height: 40px;
            flex-shrink: 0;
        }
        /* 品牌标识（Cpydes 蓝 #1D5BFF · 纯扁平） */
        .brand-mark {
            width: 100%;
            height: 100%;
            display: block;
        }
        .sidebar-title {
            font-size: 17px;
            font-weight: 750;
            color: var(--t1);
            letter-spacing: -0.3px;
        }
        .sidebar-subtitle {
            font-size: 11.5px;
            color: var(--t3);
            margin-left: 50px;
            font-weight: 500;
        }
        .sidebar-search { padding: 14px 10px 10px; }
        .sidebar-search-box {
            display: flex;
            align-items: center;
            gap: 8px;
            height: 34px;
            padding: 0 12px;
            border: 1.5px solid #e2e8f0;
            border-radius: 8px;
            background: white;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .sidebar-search-box:focus-within {
            border-color: var(--pri);
            box-shadow: 0 0 0 3px rgba(29,91,255,0.08);
        }
        .search-icon-xs { font-size: 13px; color: var(--t3); pointer-events: none; }
        .sidebar-search-box input {
            flex: 1; border: none; outline: none; background: transparent;
            font-size: 13px; color: var(--t1);
        }
        .sidebar-search-box input::placeholder { color: var(--t3); }

        .cat-nav {
              flex: 1; overflow-y: auto; overflow-x: hidden;
              padding: 4px 4px 12px 2px; scrollbar-width: thin;
              scrollbar-color: rgba(29,91,255,0.15) transparent;
          }
        .cat-nav::-webkit-scrollbar { width: 5px; }
        .cat-nav::-webkit-scrollbar-track { background: transparent; }
        .cat-nav::-webkit-scrollbar-thumb { background: rgba(29,91,255,0.12); border-radius: 10px; }

        .cat-nav-all {
            display: flex; align-items: center; gap: 10px;
            padding: 11px 10px; border-radius: 9px; cursor: pointer;
            transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            margin-bottom: 4px; border: 2px solid transparent;
            position: relative; font-weight: 600; font-size: 13.5px; color: var(--t2);
        }
        .cat-nav-all:hover {
            background: white; border-color: #e2e8f0; transform: translateX(2px);
        }
        .cat-nav-all.active {
            background: linear-gradient(135deg, rgba(29,91,255,0.09), rgba(0,199,255,0.06));
            border-color: var(--pri); color: var(--pri-d);
            box-shadow: 0 2px 10px rgba(29,91,255,0.1);
        }
        .cat-nav-all.active::before {
            content: ''; position: absolute; left: -10px; top: 50%;
            transform: translateY(-50%); width: 3px; height: 60%;
            background: var(--pri); border-radius: 2px;
        }
        .nav-icon { font-size: 16px; width: 20px; text-align: center; }
        .nav-label { flex: 1; }
        .nav-badge {
            font-size: 11px; font-weight: 700; color: var(--t3);
            background: #e2e8f0; padding: 2px 8px; border-radius: 10px;
            min-width: 22px; text-align: center;
        }
        .cat-nav-all.active .nav-badge { background: rgba(29,91,255,0.15); color: var(--pri-d); }

        /* 流程文档入口（独立页面） */
        .cat-nav-process {
            display: flex; align-items: center; gap: 10px;
            padding: 11px 10px; border-radius: 9px; cursor: pointer;
            transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            margin-bottom: 4px; border: 2px solid transparent;
            position: relative; font-weight: 600; font-size: 13.5px; color: var(--t2); text-decoration: none;
        }
        .cat-nav-process:hover {
            background: white; border-color: #a7f3d0; transform: translateX(2px);
        }
        .cat-nav-process .nav-icon { color: #10b981; }
        .cat-nav-process:hover .nav-label { color: #059669; }

        .cat-nav-favorites {
            display: flex; align-items: center; gap: 10px;
            padding: 11px 10px; border-radius: 9px; cursor: pointer;
            transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            margin-bottom: 4px; border: 2px solid transparent;
            position: relative; font-weight: 600; font-size: 13.5px; color: var(--t2);
        }
        .cat-nav-favorites:hover {
            background: white; border-color: #fbbf24; transform: translateX(2px);
        }
        .cat-nav-favorites.active {
            background: linear-gradient(135deg, rgba(251,191,36,0.09), rgba(245,158,11,0.06));
            border-color: #f59e0b; color: #d97706;
            box-shadow: 0 2px 10px rgba(251,191,36,0.15);
        }
        .cat-nav-favorites.active::before {
            content: ''; position: absolute; left: -10px; top: 50%;
            transform: translateY(-50%); width: 3px; height: 60%;
            background: #f59e0b; border-radius: 2px;
        }
        .cat-nav-favorites.active .nav-badge { background: rgba(251,191,36,0.2); color: #d97706; }

        /* L1 Action Buttons */
        .nav-l1-actions {
            display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; flex-shrink: 0;
        }
        .nav-action-btn {
            width: 22px; height: 22px; border: none; border-radius: 5px;
            background: transparent; cursor: pointer; font-size: 11px;
            color: var(--t3); display: flex; align-items: center; justify-content: center;
            transition: background-color 0.15s, color 0.15s;
        }
        .nav-action-btn:hover { background: rgba(29,91,255,0.1); color: var(--pri); }
        .nav-action-btn.danger:hover { background: rgba(239,68,68,0.1); color: var(--err); }

        /* L2 Items */
        .cat-nav-l2 {
            display: flex; align-items: center; gap: 6px;
            padding: 8px 6px; border-radius: 7px; cursor: pointer;
            transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s; border: 1.5px solid transparent;
            background: #f8fafc; margin-bottom: 2px;
            font-size: 12.5px; font-weight: 550; color: var(--t2); position: relative;
        }
        .cat-nav-l2:last-child { margin-bottom: 0; }
        .cat-nav-l2:hover {
            background: white; border-color: rgba(29,91,255,0.12); transform: translateX(2px);
        }
        .cat-nav-l2:hover .nav-l1-actions { opacity: 1; }
        .cat-nav-l2.dragging { opacity: 0.4; }
        .cat-nav-l2.drag-over-sub { border-color: var(--pri); background: rgba(29,91,255,0.06); }
        .cat-nav-l2.active {
            background: linear-gradient(135deg, rgba(29,91,255,0.11), rgba(0,94,203,0.07));
            border-color: rgba(29,91,255,0.35); color: var(--pri-d); font-weight: 650;
            box-shadow: 0 1px 5px rgba(29,91,255,0.08);
        }
        .cat-nav-l2.active::before {
            content: ''; position: absolute; left: -8px; top: 50%;
            transform: translateY(-50%); width: 2.5px; height: 55%;
            background: var(--pri); border-radius: 2px;
        }
        .nav-dot-sm { display: none; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
        .nav-drag-sm {
            font-size: 10px; color: #d1d5db; cursor: grab;
            flex-shrink: 0; transition: color 0.15s;
        }
        .nav-drag-sm:hover { color: var(--pri); }
        .nav-drag-sm:active { cursor: grabbing; }
        .nav-name-sm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
        .nav-count-sm {
            font-size: 10.5px; font-weight: 650; color: var(--t3);
            background: #e2e8f0; padding: 1px 7px; border-radius: 7px; flex-shrink: 0;
        }
        .cat-nav-l2.active .nav-count-sm { background: rgba(29,91,255,0.18); color: var(--pri-d); }

        /* Sidebar Footer */
        .sidebar-footer { padding: 12px 14px; border-top: 1px solid #e2e8f0; background: white; }
        .add-cat-btn {
            width: 100%; height: 36px; border: 2px dashed #cbd5e1; border-radius: 8px;
            background: transparent; color: var(--t2); font-size: 13px; font-weight: 650;
            cursor: pointer; transition: all 0.2s;
            display: flex; align-items: center; justify-content: center; gap: 6px;
        }
        .add-cat-btn:hover { border-color: var(--pri); color: var(--pri); background: rgba(29,91,255,0.03); }

        /* Empty State in Sidebar */
        .sidebar-empty { text-align: center; padding: 30px 16px; color: var(--t3); }
        .sidebar-empty p { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
        .sidebar-empty small { font-size: 11.5px; }

        /* ========== Settings Modal ========== */
        .settings-dialog { width: 380px; max-width: 90vw; }
        .modal-foot { background: #fafbfc; }
        .settings-section {
            padding: 14px; margin-bottom: 10px; border-radius: 10px;
            background: #f8fafc; border: 1px solid #e2e8f0;
        }
        .settings-section:last-child { margin-bottom: 0; }
        .settings-section-title {
            font-size: 15px; font-weight: 700; color: var(--t1); margin-bottom: 6px;
        }
        .settings-section-desc {
            font-size: 12.5px; color: var(--t3); line-height: 1.5;
        }
        .danger-zone { background: #fef2f2; border-color: #fecaca; }
        /* ========== Main Content Area ========== */
        .main-area {
            flex: 1; display: flex; flex-direction: column;
            overflow: hidden; background: var(--bg);
            min-width: 0;
        }

        /* ========== Header ========== */
        .app-header {
            display: flex; align-items: center;
            justify-content: space-between;
            padding: 16px 16px;
            border-bottom: 1px solid var(--line);
            margin-bottom: 0; gap: 20px;
            flex-wrap: nowrap; min-height: 68px;
            position: relative; z-index: 100;
            background: rgba(255, 255, 255, 0.82);
            /* 不放 backdrop-filter：表头下方只有纯色页面背景，模糊它看不出差别，
               但每帧都要重新捕获并模糊一次背景，滚动时这是白白的主线程/GPU 开销 */
        }
        .app-header::before {
            content: '';
            position: absolute;
            width: 200px; height: 200px;
            right: 120px; top: -80px;
            background: radial-gradient(circle, rgba(29,91,255,0.10) 0%, transparent 70%);
            border-radius: 50%;
            pointer-events: none;
        }
        .app-header::after {
            content: '';
            position: absolute;
            width: 140px; height: 140px;
            right: 300px; bottom: -60px;
            background: radial-gradient(circle, rgba(0,199,255,0.08) 0%, transparent 70%);
            border-radius: 50%;
            pointer-events: none;
        }
        .header-greeting {
            display: flex; flex-direction: column; gap: 2px;
            min-width: 0; overflow: hidden;
            position: relative; z-index: 1;
        }
        .greeting-text {
            font-size: 15px; font-weight: 700; color: var(--t1);
            line-height: 1.3;
        }
        .greeting-date {
            margin-left: 10px;
            font-size: 12px; font-weight: 500; color: var(--t3);
            letter-spacing: 0.3px;
        }
        .greeting-quote {
            font-size: 12px; color: var(--t3);
            font-weight: 500;
            padding-left: 10px;
            border-left: 2px solid var(--line);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            min-width: 0;
        }
        .greeting-sub {
            display: flex; align-items: center; gap: 8px;
            margin-top: 3px;
            line-height: 1.3;
        }
        .greeting-stat {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 2.5px 10px 2.5px 8px;
            border-radius: 999px;
            font-size: 12px; font-weight: 500;
            border: 1px solid transparent;
            white-space: nowrap;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .greeting-stat:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }
        .greeting-stat strong {
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
        .greeting-stat .feather {
            width: 12px; height: 12px;
            flex-shrink: 0;
        }
        .greeting-stat-total {
            background: rgba(29, 91, 255, 0.08);
            border-color: rgba(29, 91, 255, 0.18);
            color: var(--pri);
        }
        .greeting-stat-fav {
            background: rgba(244, 63, 94, 0.07);
            border-color: rgba(244, 63, 94, 0.18);
            color: #f43f5e;
        }
        .greeting-stat-fav .feather {
            fill: currentColor;
        }
        .app-actions { display: flex; gap: 10px; align-items: center; position: relative; z-index: 1; }

        /* 头部账户区：点用户名进后台，只有点右侧图标才弹退出确认 */
        #libraryLockBtn .lock-out {
            display: inline-flex; align-items: center; justify-content: center;
            margin: -3px -6px -3px -2px; padding: 3px 6px;
            border-radius: var(--radius-sm);
            color: var(--t3);
            transition: background-color 0.15s ease, color 0.15s ease;
        }
        #libraryLockBtn .lock-out .feather,
        #libraryLockBtn .lock-out svg { margin-right: 0; }
        #libraryLockBtn .lock-out:hover { background: rgba(244, 63, 94, 0.12); color: #f43f5e; }

        /* ========== Buttons ========== */
        .btn {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 0 16px; height: 36px; border: none;
            border-radius: var(--radius-sm); font-size: 13.5px;
            font-weight: 600; cursor: pointer;
            transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; white-space: nowrap;
        }
        .btn:hover { transform: translateY(-1px); }
        .btn:active { transform: translateY(0); }
        .btn-primary {
            background: linear-gradient(135deg, var(--pri-h) 0%, var(--pri) 55%, #4C86FF 100%);
            color: white;
            box-shadow: 0 1px 2px rgba(29, 91, 255, 0.3), 0 5px 14px -4px rgba(29, 91, 255, 0.45);
        }
        .btn-primary:hover {
            background: linear-gradient(135deg, #2a96ff 0%, #0a7eff 55%, #1a90ff 100%);
            box-shadow: 0 2px 4px rgba(29, 91, 255, 0.32), 0 10px 22px -6px rgba(29, 91, 255, 0.5);
        }
        .btn-default {
            background: white; color: var(--t2); border: 1px solid var(--line);
        }
        .btn-default:hover { border-color: var(--pri); color: var(--pri); }
        .btn-danger {
            background: #fef2f2; color: var(--err);
            border: 1px solid transparent; font-size: 12.5px; height: 34px;
        }
        .btn-danger:hover { background: #fee2e2; }
        .theme-toggle {
            width: 36px; height: 36px; border: 1px solid var(--line);
            border-radius: var(--radius-sm); background: white;
            cursor: pointer; font-size: 16px;
            display: flex; align-items: center; justify-content: center;
            transition: border-color 0.15s, color 0.15s, background-color 0.15s;
        }
        .theme-toggle:hover { border-color: var(--pri); color: var(--pri); }
        /* ========== Main Card ========== */
        .main-card {
            background: var(--card); border-radius: 0;
            box-shadow: none; border: none;
            flex: 1; display: flex; flex-direction: column;
            overflow: hidden; min-height: 0;
        }

        #listArea {
            flex: 1; overflow-y: auto; overflow-x: auto; min-height: 0;
            /* 不用 transform: translateZ(0) 强推合成层：它会让 sticky 表头按整层重绘、
               文字在半像素上抖，滚动条也变涩；原生滚动路径本身最快 */
            /* 不写 scrollbar-gutter: stable —— 它会常年留出 8px 空槽，
               表格右边缘就出现一条没有滚动条的缺口；表头对齐改由 syncListHeadColumns()
               按实际 offsetWidth-clientWidth 镜像 */
            overscroll-behavior: contain;
        }
        #listArea::-webkit-scrollbar { width: 8px; height: 8px; }
        #listArea::-webkit-scrollbar-track { background: transparent; }
        #listArea::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
        #listArea::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

        /* ========== Toolbar ========== */
        .toolbar-area {
            display: flex; align-items: center; gap: 16px;
            padding: 16px 16px; border-bottom: 1px solid var(--line-l);
            flex-wrap: wrap; background: var(--card);
        }
        .search-box { flex: 1; min-width: 280px; position: relative; }
        .search-box input {
            width: 100%; height: 38px; padding: 0 14px 0 38px;
            border: 1px solid var(--line); border-radius: var(--radius-sm);
            font-size: 14px; color: var(--t1); background: var(--line-l);
            transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
        }
        .search-box input:focus {
            outline: none; border-color: var(--pri); background: white;
            box-shadow: var(--ring);
        }
        .search-icon {
            position: absolute; left: 12px; top: 50%;
            transform: translateY(-50%); color: var(--t3);
            font-size: 16px; pointer-events: none;
        }
        .stat-text { font-size: 13px; color: var(--t2); font-weight: 500; }
        .stat-text strong { color: var(--pri-d); font-weight: 700; }

        /* ========== Filter Bar ========== */
        .filter-bar {
            padding: 14px 16px; background: var(--line-l);
            border-bottom: 1px solid var(--line-l);
            display: flex; flex-direction: column; gap: 10px;
        }
        .filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .filter-label {
            font-size: 12px; font-weight: 700; color: var(--t3);
            text-transform: uppercase; letter-spacing: 0.8px; min-width: 50px;
        }
        .filter-tags { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
        .filter-tag {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 6px 14px; border-radius: 20px; font-size: 12.5px;
            font-weight: 600; cursor: pointer; transition: border-color 0.2s, color 0.2s, transform 0.2s, background-color 0.2s, box-shadow 0.2s;
            border: 1.5px solid var(--line); background: white;
            color: var(--t2); user-select: none;
        }
        .filter-tag:hover { border-color: var(--pri); color: var(--pri); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
        .filter-tag:hover .feather, .filter-tag:hover svg { filter: drop-shadow(0 1px 2px rgba(29,91,255,0.3)); }
        .filter-tag.active {
            background: var(--pri); color: white; border-color: var(--pri);
            box-shadow: 0 1px 2px rgba(29,91,255,0.3), 0 5px 14px -4px rgba(29,91,255,0.45);
        }
        .filter-tag.active:hover { box-shadow: 0 2px 4px rgba(29,91,255,0.32), 0 10px 22px -6px rgba(29,91,255,0.5); }

        /* ========== List Table ========== */
        /* 表头在滚动容器之外（#listHead），竖向滚动条只走数据行那一段。
           两表列宽靠 JS 镜像（syncListHeadColumns），表头表本身 table-layout: fixed */
        .list-head {
            --thead-bg: var(--line-l);
            --thead-line: var(--line);
            overflow: hidden;
            flex: 0 0 auto;
            /* 表体出现竖向滚动条时，右侧会让出实际滚动条宽度；表头用同样的内边距补齐，
               具体值由 syncListHeadColumns() 按 offsetWidth-clientWidth 实测写入。
               底色和分隔线画在这一层、通铺满宽，所以内缩的 8px 不会在右端露出缺口 */
            padding-right: 8px;
            background: var(--thead-bg);
            border-bottom: 1px solid var(--thead-line);
        }
        #dataTableHead { table-layout: fixed; }
        .list-table {
            --row-line: var(--line-l);
            width: 100%; min-width: 1100px; border-collapse: collapse; table-layout: auto;
        }
        /* 操作列：宽度贴合按钮实际内容（width:1px + nowrap 在 auto 布局下取按钮宽），
           未登录单按钮窄、登录多按钮自动变宽，并右对齐贴右缘 */
        .list-table th:last-child { width: 1px !important; text-align: center; white-space: nowrap; }
        .list-table td:last-child { width: 1px; white-space: nowrap; }
        .list-table thead {
            background: var(--thead-bg);
        }
        /* --thead-bg / --thead-line 定义在 .list-head 上（表头已移出滚动容器），
           分隔线由 .list-head 的 border-bottom 通铺，这里只负责格子底色 */
        .list-table thead th {
            background: var(--thead-bg);
        }
        .list-table th {
            padding: 10px 9px; text-align: left; line-height: 20px;
            font-size: 12px; font-weight: 700; color: var(--t3);
            text-transform: uppercase; letter-spacing: 0.7px; white-space: nowrap;
        }
        /* 行分隔线用 inset 阴影而不是 border-bottom：border-collapse 会把 1px 边框按 0.5px
           分给相邻两行，行距就变成 50.5/51 交替，每行落在不同的非整数物理像素上，
           滚动时整列会像锯齿一样细密地跳（这就是「看起来掉帧」的主因） */
        .list-table td {
            padding: 10px 9px; box-shadow: inset 0 -1px 0 var(--row-line);
            vertical-align: middle; font-size: 14.5px;
        }
        /* 操作列表头右对齐（与下方按钮一致） */
        /* 行高钉死为 52px：100%/125%/150% 缩放下都是整数物理像素（52/65/78），
           行网格不再逐行取整；同时不做 background transition，避免指针扫过时整列同时放动画 */
        .list-table tbody tr { height: 52px; cursor: default; }
        .list-table tbody tr:hover { background: rgba(29,91,255,0.035); box-shadow: inset 3px 0 0 var(--pri); }
        .list-table tbody tr:last-child td { box-shadow: none; }
        .list-table tbody tr.dragging { opacity: 0.4; background: #f0e6ff; }
        .list-table tbody tr.drag-over { border-top: 2px solid var(--pri); }

        /* ========== 虚拟滚动 / 滚动流畅度 ========== */
        /* 行上不使用 content-visibility：tr 的估算高度与真实行高不一致时，
           每行进视口都要改一次高度，反复触发布局与滚动锚定回弹；大数据集交给虚拟列表控制行数 */
        /* 虚拟滚动占位行：极简样式，确保高度精确 */
        .list-table tbody tr.virtual-spacer > td {
            padding: 0 !important;
            border: 0 !important;
            box-shadow: none !important;
            line-height: 0;
            /* 占位行是 colspan=9 的单格，会命中上面的 nth-child 列宽钉值；
               放开限制，让它只负责撑高度、不参与列宽计算 */
            min-width: 0;
            max-width: none;
        }
        /* 滚动进行中（JS 挂 .is-scrolling）：挂起行内按钮/标签的位移缩放动画。
           否则指针不动、行从指针下扫过，每扫过一行都要重放一遍 hover 动效，整列像在水上晃 */
        #listArea.is-scrolling .list-table tbody .fav-btn,
        #listArea.is-scrolling .list-table tbody .op-btn,
        #listArea.is-scrolling .list-table tbody .itag,
        #listArea.is-scrolling .list-table tbody .row-tag-toggle,
        #listArea.is-scrolling .list-table tbody .row-num {
            transition: none !important;
        }
        #listArea.is-scrolling .list-table tbody .fav-btn:hover,
        #listArea.is-scrolling .list-table tbody .op-btn:hover,
        #listArea.is-scrolling .list-table tbody .itag:hover,
        #listArea.is-scrolling .list-table tbody .row-tag-toggle:hover {
            transform: none;
            filter: none;
            box-shadow: none;
        }
        .row-num-cell {
            width: 50px; text-align: center; vertical-align: middle;
            user-select: none;
        }
        .row-num {
            display: inline-flex; align-items: center; justify-content: center;
            padding: 4px 10px;
            height: 28px; border-radius: 7px;
            font-size: 13px; font-weight: 700; color: var(--t3);
            background: transparent; transition: background-color 0.2s cubic-bezier(0.4,0,0.2,1), border-color 0.2s cubic-bezier(0.4,0,0.2,1), color 0.2s cubic-bezier(0.4,0,0.2,1);
            cursor: grab; border: 1.5px solid transparent;
            font-variant-numeric: tabular-nums; min-width: 22px;
        }
        .row-num:active { cursor: grabbing; }
        .row-num:hover {
            background: linear-gradient(135deg, rgba(29,91,255,0.07), rgba(0,199,255,0.04));
            border-color: rgba(29,91,255,0.15);
            color: var(--pri-d);
        }
        .drop-zone-area {
            text-align: center; padding: 12px; font-size: 12px;
            color: var(--t3); border: 2px dashed transparent;
            border-radius: 8px; transition: all 0.2s; margin: 4px 0;
        }
        #dataTableDropZone.drag-over .drop-zone-area {
            border-color: var(--pri); color: var(--pri);
            background: rgba(29,91,255,0.05); font-weight: 600;
        }
        .row-title {
            font-weight: 650; color: var(--t1);
            display: flex; align-items: center; gap: 6px;
            max-width: 100%; overflow: hidden;
        }
        .row-title > span:first-child {
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            flex: 1; min-width: 0;
        }
        .row-desc { color: var(--t3); font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .row-time { color: var(--t3); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
        /* auto 布局下：给长内容列设 max-width，既避免表格被长文本撑出横向滚动，又让操作列保持按钮宽度 */
        .list-table th:nth-child(3), .list-table td:nth-child(3) { max-width: 300px; }
        .list-table th:nth-child(4), .list-table td:nth-child(4) { max-width: 360px; }
        /* 各列钉最小宽（auto 布局下 width 会被表格整体缩放吃掉，min-width 才有效）。
           没有它时列宽由「当前渲染的那几十行」决定：窗口里有没有长标签行/长用户名，
           标签列就在 43↔127 之间跳、整张表宽 1182↔1274 跟着变，滚动时全表左右晃动。
           上限仍由 max-width 与单元格内 ellipsis 兜住，所以钉住后与全量渲染的观感一致。 */
        .list-table th:nth-child(1), .list-table td:nth-child(1) { min-width: 63px; }
        .list-table th:nth-child(2), .list-table td:nth-child(2) { min-width: 50px; }
        .list-table th:nth-child(3), .list-table td:nth-child(3) { min-width: 240px; max-width: 300px; }
        .list-table th:nth-child(4), .list-table td:nth-child(4) { min-width: 300px; max-width: 360px; }
        .list-table th:nth-child(5), .list-table td:nth-child(5) { min-width: 127px; max-width: 130px; }
        .list-table th:nth-child(6), .list-table td:nth-child(6) { min-width: 154px; max-width: 160px; }
        .list-table th:nth-child(7), .list-table td:nth-child(7) { min-width: 65px; max-width: 72px; }
        .list-table th:nth-child(8), .list-table td:nth-child(8) { min-width: 87px; }
        .row-cat-tag {
            display: inline-block; vertical-align: middle;
            font-size: 12px; padding: 5px 12px; border-radius: 13px;
            font-weight: 600; white-space: nowrap;
            max-width: 100%; overflow: hidden; text-overflow: ellipsis;
            line-height: 1.4;
        }
        /* 创建人：原本无任何样式，长用户名在窄列里会折成两行，行高立刻从 52 变 66.4 */
        .row-user-tag {
            display: inline-block; vertical-align: middle;
            white-space: nowrap; max-width: 100%;
            overflow: hidden; text-overflow: ellipsis;
        }
        /* ========== 标签展示与筛选（颜色由 hashTagColor 内联提供，--tc 供动效取色） ========== */
        .itag {
            display: inline-flex; align-items: center; gap: 4px;
            vertical-align: middle;
            font-size: 11px; padding: 3px 9px; border-radius: 999px;
            font-weight: 600; white-space: nowrap; flex-shrink: 0;
            line-height: 1.5; max-width: 130px; overflow: hidden;
            text-overflow: ellipsis;
            transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease, filter .18s ease;
        }
        /* 展示型标签（纯展示，不可点击筛选） */
        .itag:hover { transform: translateY(-1px) scale(1.04); filter: saturate(1.25) brightness(1.04); box-shadow: 0 4px 12px -4px var(--tc, rgba(0,0,0,.3)); }
        .itag:active { transform: translateY(0) scale(.97); }
        /* 左侧装饰圆点（用 currentColor 保持与标签同色，兼容无 color-mix 的老浏览器） */
        .itag-text.with-dot { display: inline-flex; align-items: center; gap: 5px; }
        .itag-text.with-dot::before {
            content: ''; width: 4px; height: 4px; border-radius: 50%;
            background: currentColor; flex-shrink: 0;
            box-shadow: 0 0 0 2.5px rgba(0,0,0,0.08), 0 0 5px currentColor;
        }
        .itag-ico { display: inline-flex; align-items: center; color: currentColor; opacity: .85; line-height: 0; }
        .itag-ico .feather, .itag-ico svg { width: 11px; height: 11px; }
        .itag-cnt {
            font-size: 9.5px; padding: 0 5px; border-radius: 999px;
            background: currentColor; color: #fff; font-weight: 700;
            line-height: 1.6; font-variant-numeric: tabular-nums; flex-shrink: 0;
        }
        .row-tags {
            display: flex; align-items: center; gap: 3px;
            flex-wrap: nowrap; overflow: hidden; max-width: 100%;
            /* 为悬停 scale 放大预留空间，避免被 overflow:hidden 方形裁切切平圆角 */
            padding: 3px 2px; margin: -3px -2px;
        }
        .row-tags-empty { color: var(--t3); }
        /* 折叠计数（多个标签仅显示首个时） */
        .row-tag-toggle {
            display: inline-flex; align-items: center; justify-content: center;
            min-width: 22px; height: 20px; padding: 0 7px;
            background: var(--line); color: var(--t2);
            border-radius: 999px; font-size: 11px; font-weight: 600;
            line-height: 1; flex-shrink: 0; cursor: pointer;
            font-variant-numeric: tabular-nums;
            transition: background-color .15s ease, color .15s ease, transform .15s ease;
        }
        .row-tag-toggle:hover { background: var(--pri); color: #fff; }
        .row-tag-toggle:active { transform: scale(.94); }
        .row-tags .row-tag { max-width: 78px; }
        .row-tags.has-more > .itag { cursor: pointer; }
        /* 展开全部标签的悬浮卡片 */
        .row-tags-popover {
            position: absolute; z-index: 900;
            max-width: 300px;
            background: var(--card); border: 1px solid var(--line);
            border-radius: 12px; box-shadow: var(--shadow-lg);
            padding: 12px;
            display: flex; flex-wrap: wrap; gap: 8px;
            animation: rowTagsPopIn .16s ease;
        }
        @keyframes rowTagsPopIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
        :root.dark-mode .row-tag-toggle { background: #1f2937; color: #9ca3af; }
        :root.dark-mode .row-tag-toggle:hover { background: var(--pri); color: #fff; }
        /* 顶部标签筛选栏已移除 */
        /* 搜索框标签下拉：输入 tag: 时展示候选标签 */
        .search-tag-dropdown {
            position: absolute; top: calc(100% + 6px); left: 0; right: 0;
            background: var(--card); border: 1px solid var(--line);
            border-radius: var(--radius); box-shadow: var(--shadow-lg);
            padding: 6px; z-index: 60; max-height: 320px; overflow-y: auto;
        }
        .search-tag-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 8px 12px; border-radius: 8px; cursor: pointer;
            font-size: 13.5px; font-weight: 600; transition: background-color 0.12s;
        }
        .search-tag-item:hover, .search-tag-item.active { background: var(--pri-bg); }
        .search-tag-item .tag-cnt {
            font-size: 11px; color: var(--t3); font-weight: 600;
            background: var(--line); border-radius: 999px; padding: 1px 8px;
            font-variant-numeric: tabular-nums;
        }
        .search-tag-empty { padding: 10px 12px; font-size: 13px; color: var(--t3); }
        .search-tag-hint {
            padding: 8px 12px 4px; font-size: 11.5px; color: var(--t3);
            border-top: 1px dashed var(--line); margin-top: 4px;
        }
        /* 编辑弹窗：标签 chip 输入框（回车/逗号添加，chip 可删除） */
        .tag-input {
            display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
            min-height: 42px; padding: 6px 10px;
            background: var(--bg); border: 1px solid var(--line);
            border-radius: var(--radius); cursor: text;
            transition: border-color .15s ease, box-shadow .15s ease;
        }
        .tag-input:focus-within { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(29,91,255,.15); }
        .tag-input-chips { display: flex; flex-wrap: wrap; gap: 6px; }
        .tag-input-chip {
            display: inline-flex; align-items: center; gap: 4px;
            font-size: 12px; font-weight: 600; line-height: 1.4;
            padding: 3px 6px 3px 10px; border-radius: 999px;
            animation: tagChipIn .16s cubic-bezier(.34,1.56,.64,1);
        }
        @keyframes tagChipIn { from { opacity: 0; transform: scale(.8) translateY(2px); } to { opacity: 1; transform: none; } }
        .tag-input-chip-x {
            display: inline-flex; align-items: center; justify-content: center;
            border: none; background: transparent; cursor: pointer;
            font-size: 11px; line-height: 1; padding: 0 2px; opacity: .55;
            border-radius: 50%; transition: opacity .15s ease, transform .15s ease, background-color .15s ease;
            color: inherit;
        }
        .tag-input-chip:hover .tag-input-chip-x { opacity: 1; }
        .tag-input-chip-x:hover { opacity: 1; transform: scale(1.15); background: rgba(0,0,0,.08); }
        .tag-input-field {
            flex: 1; min-width: 140px; border: none; outline: none;
            background: transparent; font-size: 13.5px; color: var(--t1);
            padding: 4px 0; font-family: inherit;
        }
        .tag-input-field::placeholder { color: var(--t3); }
        /* 编辑弹窗：标签匹配下拉（输入时弹出，悬浮于输入框下方，不占用排版空间） */
        .tag-group { position: relative; }
        .tag-suggest-box {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            z-index: 80;
            margin-top: 6px;
            padding: 8px;
            background: #fff;
            border: 1.5px solid #e5e7eb;
            border-radius: 10px;
            box-shadow: 0 12px 36px rgba(0,0,0,0.14);
            max-height: 264px;
            overflow-y: auto;
        }
        .tag-suggest-title {
            font-size: 12px; color: var(--t3); margin-bottom: 6px;
        }
        .tag-suggest-list { display: flex; flex-wrap: wrap; gap: 6px; }
        .tag-suggest-chip {
            border: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
            font-family: inherit;
            font-size: 12px; font-weight: 600;
            padding: 4px 10px; border-radius: 999px;
        }
        .tag-suggest-chip:hover { transform: translateY(-1px); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
        .tag-suggest-chip .tag-cnt { font-size: 10px; opacity: 0.7; margin-left: 3px; }
        :root.dark-mode .tag-suggest-box { background: #1e293b; border-color: #334155; }
        :root.dark-mode .itag { filter: brightness(1.35); }
        :root.dark-mode .itag:hover { filter: brightness(1.5) saturate(1.2); }
        :root.dark-mode .itag-cnt { color: #111827; }
        :root.dark-mode .filter-tag { background: #1f2937; border-color: #374151; }
        :root.dark-mode .filter-tag:hover { border-color: var(--pri); color: var(--pri); box-shadow: 0 3px 10px rgba(0,0,0,.35); }
        :root.dark-mode .search-tag-dropdown { background: #1f2937; border-color: #374151; }
        :root.dark-mode .search-tag-item:hover, :root.dark-mode .search-tag-item.active { background: rgba(59, 130, 246, 0.2); }
        :root.dark-mode .search-tag-item .tag-cnt { background: #374151; color: #9ca3af; }
        .row-ops {
            display: flex; gap: 4px; justify-content: flex-end;
            align-items: center; flex-wrap: nowrap; white-space: nowrap;
        }
        .op-btn {
            height: 32px; padding: 0 12px; border: none; border-radius: 7px;
            font-size: 13px; font-weight: 600; cursor: pointer;
            transition: transform 0.15s, background-color 0.15s; display: inline-flex;
            align-items: center; justify-content: center; gap: 4px;
            white-space: nowrap; flex-shrink: 0;
        }
        .op-btn:hover { transform: translateY(-1px); }
        .op-copy {
            background: #ecfdf5; color: #059669;
        }
        .op-copy:hover { background: #d1fae5; }
        .op-edit {
            background: #fffbeb; color: #d97706;
        }
        .op-edit:hover { background: #fef3c7; }
        .op-del {
            background: #fef2f2; color: #dc2626;
        }
        .op-del:hover { background: #fee2e2; }
        .fav-btn {
            width: 32px; height: 32px; border: none; border-radius: 8px;
            background: #f8fafc; font-size: 18px; cursor: pointer;
            transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            display: inline-flex; align-items: center; justify-content: center;
            color: #cbd5e1;
        }
        .fav-btn:hover { background: #fef3c7; transform: scale(1.15) rotate(5deg); }
        .fav-btn.active {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            color: #f59e0b;
        }
        /* 弹跳只在用户点击收藏时播放（JS 加 .fav-pop）：挂在 .active 上会让每次重渲染的已收藏行一起弹 */
        .fav-btn.fav-pop { animation: favPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
        @keyframes favPop {
            0% { transform: scale(0.8); } 50% { transform: scale(1.2); } 100% { transform: scale(1); }
        }
        .has-img-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            background: linear-gradient(135deg, #eff6ff, #dbeafe);
            color: #0369a1;
            padding: 4px 10px;
            border-radius: 12px;
            font-weight: 600;
            border: 1px solid rgba(14,165,233,0.15);
        }
        /* ========== Modal ========== */
        .modal-overlay {
            display: none; position: fixed; inset: 0; z-index: 999;
            align-items: center; justify-content: center;
        }
        .modal-overlay.show { display: flex; }
        .modal-backdrop {
            position: fixed; inset: 0;
            background: rgba(15, 23, 42, 0.45);
            backdrop-filter: blur(8px) saturate(1.2);
            -webkit-backdrop-filter: blur(8px) saturate(1.2);
        }
        .modal-dialog {
            position: relative; z-index: 1;
            width: 720px; max-width: 92vw; height: 85vh; max-height: 90vh;
            background: white; border-radius: 18px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 24px 64px -16px rgba(0, 0, 0, 0.28);
            display: flex; flex-direction: column;
            animation: modalIn 0.26s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .modal-dialog.modal-wide {
            width: 95%; max-width: 1200px; height: 85vh;
        }
        @keyframes modalIn {
            from { opacity: 0; transform: translateY(12px) scale(0.985); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .modal-head {
            display: flex; align-items: center;
            justify-content: space-between;
            padding: 14px 18px; border-bottom: 1px solid var(--line);
            background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
        }
        .modal-title { font-size: 17px; font-weight: 700; color: var(--t1); letter-spacing: 0.1px; }
        .modal-close {
            width: 32px; height: 32px; border: none; border-radius: 8px;
            background: var(--line-l); cursor: pointer; font-size: 16px;
            color: var(--t3); display: flex; align-items: center;
            justify-content: center; transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
        }
        .modal-close:hover { background: var(--line); color: var(--t1); transform: rotate(90deg); }
        .modal-body {
            padding: 12px 14px; overflow-y: auto; overflow-x: visible; flex: 1;
            display: flex; flex-direction: column; gap: 12px;
        }

        /* ========== Form ========== */
        .form-group { margin-bottom: 0; }
        .modal-body > .form-group:last-child { flex: 1; display: flex; flex-direction: column; min-height: 0; }
        /* 标题(弹性) + 分类(固定宽) 同行，标签单独一行全宽，为下方内容编辑区腾出更多垂直空间 */
        .modal-body .form-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 240px;
            gap: 12px;
            align-items: start;
        }
        @media (max-width: 640px) {
            .modal-body .form-row { grid-template-columns: 1fr; }
        }
        .form-label {
            display: block; font-size: 12px; font-weight: 700;
            color: var(--t2); margin-bottom: 7px;
            text-transform: uppercase; letter-spacing: 0.5px;
        }
        .form-input {
            width: 100%; height: 42px; padding: 0 14px;
            border: 1px solid var(--line); border-radius: var(--radius-sm);
            font-size: 14.5px; color: var(--t1); background: var(--line-l);
            transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
        }
        .form-input:focus {
            outline: none; border-color: var(--pri); background: white;
            box-shadow: var(--ring);
        }
        /* ========== 统一编辑器（前后端共用，样式提取到 css/editor.css） ========== */
        /* 工具栏、按钮、编辑区、源码模式、状态条、分段符/同段标记、Emoji 选择器、暗色模式
           均位于 css/editor.css，由前后端共同引用，保证视觉与维护一致 */
        .modal-foot {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 12px 18px;
            border-top: 1px solid var(--line);
            background: var(--line-l);
        }
        .toast-container {
            position: fixed;
            top: 24px;
            right: 24px;
            z-index: 99999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }
        .toast {
            background: var(--card);
            border-radius: 12px;
            padding: 12px 16px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 12px 32px -8px rgba(0, 0, 0, 0.22);
            border-left: 3px solid var(--pri);
            font-size: 13px;
            color: var(--t1);
            max-width: 360px;
            pointer-events: auto;
            animation: toastIn 0.25s ease;
            display: inline-flex;
            align-items: flex-start;
            gap: 8px;
            white-space: pre-wrap;
            word-break: break-word;
        }
        .toast svg {
            display: inline-block;
            flex-shrink: 0;
        }
        .toast.toast-ok { border-left-color: var(--ok); }
        .toast.toast-err { border-left-color: var(--err); }
        .toast.toast-warn { border-left-color: var(--warn); }
        @keyframes toastIn {
            from { opacity: 0; transform: translateX(20px); }
            to { opacity: 1; transform: translateX(0); }
        }
        /* ========== Confirm Dialog ========== */
        .confirm-overlay {
            display: none; position: fixed; inset: 0; z-index: 1001;
            align-items: center; justify-content: center;
        }
        .confirm-overlay.show { display: flex; }
        .confirm-box {
            background: white; border-radius: var(--radius-lg);
            padding: 28px; max-width: 380px; text-align: center;
            box-shadow: 0 24px 48px rgba(0,0,0,0.2);
            animation: confirmBoxFadeIn 0.18s ease;
        }
        /* 确认框只用淡入，不做位移/缩放，避免入场时图标位置发生移动 */
        @keyframes confirmBoxFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .confirm-icon { font-size: 44px; margin-bottom: 12px; }
        .confirm-msg { font-size: 15px; color: var(--t2); line-height: 1.6; margin-bottom: 20px; white-space: pre-line; }
        .confirm-actions { display: flex; gap: 10px; justify-content: center; }

        /* ========== Input Dialog (自定义输入框) ========== */
        .input-dialog-overlay {
            display: none; position: fixed; inset: 0; z-index: 1002;
            align-items: center; justify-content: center;
        }
        .input-dialog-overlay.show { display: flex; }
        .input-dialog-backdrop {
            position: absolute; inset: 0;
            background: rgba(15,23,42,0.4); backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }
        .input-dialog-box {
            position: relative; z-index: 1;
            background: white; border-radius: 14px; padding: 24px 28px;
            max-width: 400px; width: 90vw;
            box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.05) inset;
            animation: inputDialogIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
            border: 1px solid rgba(226,232,240,0.6);
        }
        @keyframes inputDialogIn {
            from { opacity: 0; transform: scale(0.95) translateY(-12px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            20% { transform: translateX(-8px); }
            40% { transform: translateX(8px); }
            60% { transform: translateX(-5px); }
            80% { transform: translateX(5px); }
        }
        .input-dialog-head {
            display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
        }
        .input-dialog-icon {
            font-size: 22px; width: 40px; height: 40px;
            display: flex; align-items: center; justify-content: center;
            background: linear-gradient(135deg, rgba(29,91,255,0.1), rgba(0,199,255,0.08));
            border-radius: 10px; flex-shrink: 0;
        }
        .input-dialog-title {
            font-size: 16px; font-weight: 700; color: var(--t1); line-height: 1.4;
        }
        .input-dialog-body { margin-bottom: 18px; }
        .input-dialog-field {
            width: 100%; height: 44px; padding: 0 16px;
            border: 1.5px solid #e2e8f0; border-radius: 9px;
            font-size: 14.5px; color: var(--t1); background: #f8fafc;
            transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s; outline: none; box-sizing: border-box;
        }
        .input-dialog-field:focus {
            border-color: var(--pri);
            box-shadow: 0 0 0 3px rgba(29,91,255,0.08); background: white;
        }
        .input-dialog-field::placeholder { color: var(--t3); }
        .input-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; }

        /* ========== Dedup Confirm Dialog (查重富信息确认框) ========== */
        .dedup-confirm-overlay {
            display: none; position: fixed; inset: 0; z-index: 1003;
            align-items: center; justify-content: center;
            background: rgba(15,23,42,0.5); backdrop-filter: blur(3px);
            -webkit-backdrop-filter: blur(3px);
            padding: 20px;
        }
        .dedup-confirm-overlay.show { display: flex; }
        .dedup-confirm-box {
            position: relative;
            background: var(--card); border-radius: 16px;
            width: 100%; max-width: 440px; max-height: 90vh;
            overflow: hidden; display: flex; flex-direction: column;
            box-shadow: 0 24px 60px rgba(0,0,0,0.25);
            animation: inputDialogIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .dedup-confirm-box.dedup-sev-high { border-top: 4px solid var(--err); }
        .dedup-confirm-box.dedup-sev-mid { border-top: 4px solid var(--warn); }
        .dedup-confirm-box.dedup-sev-low { border-top: 4px solid var(--pri); }
        .dedup-confirm-head {
            display: flex; align-items: center; gap: 12px;
            padding: 20px 24px 8px;
        }
        .dedup-confirm-icon { font-size: 30px; line-height: 1; }
        .dedup-confirm-title { font-size: 17px; font-weight: 700; color: var(--t1); }
        .dedup-confirm-body { padding: 4px 24px 18px; overflow-y: auto; flex: 1; }
        .dedup-confirm-target {
            font-size: 14px; color: var(--t2); line-height: 1.6; margin-bottom: 16px;
        }
        .dedup-confirm-label { color: var(--t3); }
        .dedup-confirm-link {
            font-weight: 600; color: var(--pri);
            background: var(--pri-bg); padding: 2px 8px; border-radius: 5px;
        }
        .dedup-confirm-stats { display: flex; gap: 12px; margin-bottom: 14px; }
        .dedup-stat-item {
            flex: 1; text-align: center; padding: 12px 8px;
            background: var(--bg); border-radius: 10px;
        }
        .dedup-stat-item .dedup-stat-num {
            font-size: 20px; font-weight: 700; color: var(--t1); line-height: 1.2;
        }
        .dedup-stat-item .dedup-stat-name { font-size: 12px; color: var(--t3); margin-top: 2px; }
        .dedup-confirm-bar {
            height: 8px; background: var(--line); border-radius: 4px;
            overflow: hidden; margin-bottom: 14px;
        }
        .dedup-confirm-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--pri), var(--warn), var(--err));
            border-radius: 4px; transition: width 0.4s ease;
        }
        .dedup-confirm-snip {
            padding: 10px 12px; background: var(--bg);
            border-left: 3px solid var(--warn); border-radius: 5px;
            font-size: 12.5px; color: var(--t2); line-height: 1.6;
            margin-bottom: 12px; word-break: break-all;
        }
        .dedup-confirm-hint { font-size: 12.5px; color: var(--t3); line-height: 1.5; }
        .dedup-confirm-actions {
            display: flex; gap: 8px; padding: 14px 24px 18px;
            border-top: 1px solid var(--line); background: var(--bg);
        }
        .dedup-confirm-actions .btn { flex: 1; }

        /* ========== Compare Overlay (文案对比视图) ========== */
        .compare-overlay {
            display: none; position: fixed; inset: 0; z-index: 1004;
            align-items: center; justify-content: center;
            background: rgba(15,23,42,0.5); backdrop-filter: blur(3px);
            -webkit-backdrop-filter: blur(3px);
            padding: 20px;
        }
        .compare-overlay.show { display: flex; }
        .compare-backdrop {
            position: absolute; inset: 0;
        }
        .compare-dialog {
            position: relative; z-index: 1;
            width: 95%; max-width: 1200px; height: 85vh; max-height: 90vh;
            background: var(--card); border-radius: var(--radius-lg);
            box-shadow: 0 24px 48px rgba(0,0,0,0.2);
            display: flex; flex-direction: column;
            animation: modalIn 0.25s ease;
            overflow: hidden;
        }
        .compare-modal-head {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 18px; border-bottom: 1px solid var(--line);
        }
        .compare-modal-title { font-size: 17px; font-weight: 700; color: var(--t1); }
        .compare-modal-body {
            flex: 1; overflow: hidden; padding: 16px;
        }
        .compare-modal-foot {
            display: flex; justify-content: flex-end; gap: 10px;
            padding: 12px 18px; border-top: 1px solid var(--line);
            background: var(--bg);
        }

        .compare-container {
            display: flex; gap: 0;
            width: 100%; height: 100%;
        }
        .compare-panel {
            flex: 1; display: flex; flex-direction: column;
            background: var(--card); border: 1px solid var(--line);
            border-radius: var(--radius); overflow: hidden;
            min-width: 0;
        }
        .compare-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 16px; background: var(--bg);
            border-bottom: 1px solid var(--line);
        }
        .compare-title { font-size: 14px; font-weight: 600; color: var(--t1); }
        .compare-cat {
            padding: 2px 10px; border-radius: 10px;
            font-size: 12px; font-weight: 600; color: #fff;
        }
        .compare-title-input {
            padding: 10px 16px; font-size: 14px; font-weight: 600;
            color: var(--t1); background: var(--card);
            border-bottom: 1px solid var(--line); word-break: break-all;
        }
        .compare-content {
            flex: 1; padding: 16px; overflow-y: auto;
            font-size: 13px; line-height: 1.6; color: var(--t2);
            background: var(--bg);
        }
        .compare-content img {
            max-width: 100%; height: auto; border-radius: 6px; margin: 4px 0;
        }
        .compare-footer {
            display: flex; align-items: center; justify-content: flex-end;
            padding: 10px 16px; background: var(--bg);
            border-top: 1px solid var(--line);
        }
        .compare-divider {
            display: flex; align-items: center; justify-content: center;
            width: 4px; background: var(--line); cursor: col-resize;
            position: relative; flex-shrink: 0;
        }
        .compare-divider:hover { background: var(--pri); }
        .compare-arrow {
            font-size: 18px; color: var(--t3);
            position: absolute; transform: rotate(90deg);
        }
        .compare-divider:hover .compare-arrow { color: var(--pri); }

        @media (max-width: 768px) {
            .compare-container { flex-direction: column; height: auto; }
            .compare-divider { width: 100%; height: 4px; cursor: row-resize; }
            .compare-arrow { transform: none; }
            .compare-dialog { width: 100%; height: 90vh; }
        }

        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.3);
            z-index: 99;
        }
        .sidebar-overlay.show {
            display: block;
        }
        .mobile-menu-btn {
            display: none;
            width: 36px;
            height: 36px;
            border: 1.5px solid var(--line);
            border-radius: 8px;
            background: white;
            cursor: pointer;
            font-size: 16px;
            align-items: center;
            justify-content: center;
        }
        @media (max-width: 900px) {
            .sidebar {
                position: fixed;
                left: 0;
                top: 0;
                bottom: 0;
                z-index: 100;
                transform: translateX(-100%);
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            }
            .sidebar.open {
                transform: translateX(0);
            }
            .mobile-menu-btn {
                display: flex;
            }
            .app-header {
                padding: 10px 12px;
                gap: 10px;
                min-height: 56px;
                flex-wrap: nowrap;
            }
            .header-greeting {
                flex: 1;
                min-width: 0;
            }
            .greeting-sub {
                display: none;
            }
            .greeting-text {
                font-size: 15px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                max-width: 140px;
            }
            .app-actions {
                gap: 6px;
                flex-shrink: 0;
            }
            .app-actions .btn {
                padding: 0 10px;
                height: 34px;
                font-size: 12.5px;
                gap: 4px;
            }
            .app-actions .btn .feather {
                width: 13px;
                height: 13px;
            }
            .theme-toggle {
                width: 34px;
                height: 34px;
                flex-shrink: 0;
            }
            .toolbar-area {
                padding: 12px;
                gap: 10px;
            }
            .search-box {
                min-width: 0;
                flex: 1;
            }
            .search-box input {
                height: 36px;
                font-size: 13.5px;
            }
            .stat-text {
                font-size: 12px;
                flex-shrink: 0;
                white-space: nowrap;
            }
            .filter-bar {
                padding: 12px;
                gap: 8px;
            }
            .filter-row {
                gap: 6px;
            }
            .filter-tags {
                gap: 5px;
            }
            .filter-tag {
                padding: 5px 10px;
                font-size: 12px;
            }
            .filter-label {
                font-size: 11px;
                min-width: auto;
                letter-spacing: 0.5px;
            }
            .top-cat-bar {
                padding: 8px 12px 0;
                gap: 8px;
            }
            .top-cat-tab {
                padding: 6px 12px;
                font-size: 12.5px;
                gap: 6px;
            }
            .top-cat-count {
                font-size: 10.5px;
                padding: 1px 7px;
            }
            .top-add-cat-btn {
                padding: 6px 10px;
                font-size: 12px;
            }
            .list-table {
                min-width: 900px;
            }
        }

        @media (max-width: 640px) {
            .sidebar {
                width: 280px;
                min-width: 280px;
            }
            .app-header {
                padding: 8px 10px;
                gap: 6px;
                min-height: 52px;
            }
            .greeting-text {
                font-size: 14px;
                max-width: 100px;
            }
            .app-actions {
                gap: 4px;
            }
            .app-actions .btn {
                padding: 0 8px;
                height: 32px;
                font-size: 12px;
                gap: 3px;
                border-radius: 7px;
            }
            .app-actions .btn .feather,
            .app-actions .btn svg {
                width: 14px;
                height: 14px;
            }
            .theme-toggle {
                width: 32px;
                height: 32px;
            }
            .toolbar-area {
                padding: 10px;
                gap: 8px;
                flex-wrap: wrap;
            }
            .search-box {
                min-width: 0;
                order: 1;
                flex: 1 1 100%;
            }
            .search-box input {
                height: 36px;
                font-size: 13px;
            }
            .stat-text {
                order: 2;
                width: 100%;
                text-align: left;
                font-size: 12px;
                padding-top: 6px;
                border-top: 1px dashed #e5e7eb;
            }
            .filter-bar {
                padding: 10px;
                gap: 8px;
            }
            .filter-row {
                flex-wrap: wrap;
                gap: 6px 4px;
            }
            .filter-label {
                flex: 0 0 100%;
                margin-bottom: 2px;
                font-size: 11px;
            }
            .filter-tags {
                flex: 1 1 100%;
                gap: 5px;
            }
            .filter-tag {
                padding: 5px 10px;
                font-size: 11.5px;
                gap: 4px;
            }
            .top-cat-bar {
                padding: 6px 10px 0;
                gap: 6px;
            }
            .top-cat-scroll {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
            }
            .top-cat-scroll::-webkit-scrollbar {
                display: none;
            }
            .top-cat-tab {
                padding: 5px 10px;
                font-size: 12px;
                gap: 5px;
            }
            .top-cat-count {
                font-size: 10px;
                padding: 1px 6px;
                min-width: 18px;
            }
            .top-add-cat-btn {
                padding: 5px 8px;
                font-size: 11.5px;
            }
            .list-table {
                min-width: 800px;
            }
            .list-table th,
            .list-table td {
                padding: 7px 6px;
                font-size: 13px;
            }
        }

        @media (max-width: 420px) {
            .app-header {
                padding: 8px;
                gap: 4px;
                min-height: 48px;
            }
            .mobile-menu-btn {
                width: 32px;
                height: 32px;
            }
            .greeting-text {
                font-size: 13px;
                max-width: 72px;
            }
            .app-actions {
                gap: 4px;
            }
            /* 极窄屏：次要操作按钮转为图标-only */
            .app-actions .btn {
                padding: 0 7px;
                height: 30px;
                font-size: 12px;
            }
            .app-actions .btn span {
                display: none;
            }
            .app-actions .btn .feather,
            .app-actions .btn svg {
                width: 16px;
                height: 16px;
            }
            .app-actions .btn.btn-primary {
                font-size: 0;
                padding: 0 9px;
            }
            .app-actions .btn.btn-primary .feather {
                width: 15px;
                height: 15px;
            }
            .theme-toggle {
                width: 30px;
                height: 30px;
            }
            .toolbar-area {
                padding: 8px;
                gap: 6px;
            }
            .search-box input {
                height: 34px;
                font-size: 13px;
                padding: 0 10px 0 34px;
            }
            .search-icon {
                left: 10px;
            }
            .filter-bar {
                padding: 8px;
            }
            .filter-tag {
                padding: 4px 9px;
                font-size: 11px;
            }
        }
        .empty-state {
            text-align: center;
            padding: 60px 24px;
        }
        .empty-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 88px;
            height: 88px;
            border-radius: 24px;
            background: var(--pri-bg);
            color: var(--pri);
            margin-bottom: 14px;
        }
        .empty-icon .feather,
        .empty-icon svg { width: 40px; height: 40px; }
        .empty-title {
            font-size: 17px;
            font-weight: 650;
            color: var(--t2);
            margin-bottom: 8px;
        }
        .empty-desc {
            font-size: 14px;
            color: var(--t3);
            margin-bottom: 20px;
        }
        .empty-action {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 10px 24px;
            background: rgba(29,91,255,0.05);
            color: var(--pri);
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            border: 1.5px dashed rgba(29,91,255,0.3);
        }
        .empty-action:hover {
            background: var(--pri); color: white; border-style: solid;
        }

        /* 本地图片占位符 */
        .local-image-placeholder {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 200px;
            height: 150px;
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            border: 2px dashed #f59e0b;
            border-radius: 8px;
            margin: 8px 0;
            cursor: pointer;
            transition: all 0.2s;
        }
        .local-image-placeholder:hover {
            background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
            transform: scale(1.02);
        }
        .placeholder-icon {
            font-size: 32px;
            margin-bottom: 8px;
        }
        .placeholder-text {
            font-size: 12px;
            color: #92400e;
            font-weight: 600;
            text-align: center;
        }
        .placeholder-btn {
            margin-top: 8px;
            padding: 6px 16px;
            background: #f59e0b;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }
        .placeholder-btn:hover {
            background: #d97706;
        }

        /* ========== Emoji 选择器样式已迁移到 css/editor.css ========== */

.cat-select-wrapper {
    position: relative;
    width: 100%;
}
.cat-select-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}
.cat-select-trigger:hover {
    border-color: #9ca3af;
    background: white;
}
.cat-select-wrapper.open .cat-select-trigger {
    border-color: #1D5BFF;
    box-shadow: 0 0 0 3px rgba(29,91,255,0.08);
    background: white;
}
.cat-select-left {
    display: flex; align-items: center; gap: 8px;
    flex: 1; min-width: 0; overflow: hidden;
}
.cat-select-dot {
    display: none !important;
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    box-shadow: 0 0 4px currentColor;
}
.cat-opt-dot,
.cat-opt-dot-sm {
    display: none !important;
}
.cat-select-text {
    font-size: 14px; font-weight: 550; color: var(--t1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-select-text.placeholder {
    color: #9ca3af;
    font-weight: 400;
}
.cat-select-arrow {
    font-size: 11px;
    color: #9ca3af;
    transition: transform 0.25s;
    margin-left: auto;
}
.cat-select-wrapper.open .cat-select-arrow {
    transform: rotate(180deg);
    color: #1D5BFF;
}
.cat-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12);
    z-index: 9999;
    overflow: hidden;
    animation: dropdownIn 0.2s;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.cat-select-wrapper.open .cat-select-dropdown {
    display: block;
}
.cat-dropdown-head {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafbfc;
}
.cat-dropdown-search {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    background: white;
}
.cat-dropdown-search:focus-within {
    border-color: #1D5BFF;
    box-shadow: 0 0 0 2px rgba(29,91,255,0.06);
}
.cat-dropdown-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 12.5px;
    color: #111827;
}
.cat-dropdown-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
}
.cat-opt-none {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}
.cat-opt-none:hover {
    background: #f8fafc;
}
.cat-opt-none.selected {
    background: linear-gradient(135deg, rgba(29,91,255,0.08), rgba(51,154,255,0.05));
    color: #1D5BFF;
}
.cat-opt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    border: 1.5px solid transparent;
    background: white;
}
.cat-opt-item:hover {
    background: #f8fafc;
    border-color: #f1f5f9;
}
.cat-opt-item.selected {
    background: linear-gradient(135deg, rgba(29,91,255,0.09), rgba(0,199,255,0.06));
    border-color: rgba(29,91,255,0.25);
}
.cat-opt-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}
.cat-opt-count {
    font-size: 10.5px;
    font-weight: 700;
    color: #9ca3af;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 8px;
}
.cat-opt-children {
    margin-left: 18px;
    padding-left: 10px;
    border-left: 2px solid #f1f5f9;
    margin-top: 2px;
    margin-bottom: 2px;
}
.cat-opt-child {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 1px;
    border: 1.5px solid transparent;
    background: #fafbfc;
}
.cat-opt-child:hover {
    background: white;
    border-color: #f1f5f9;
}
.cat-opt-child.selected {
    background: linear-gradient(135deg, rgba(29,91,255,0.1), rgba(0,94,203,0.07));
    border-color: rgba(29,91,255,0.25);
}
.cat-opt-name-sm {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 550;
    color: #4b5563;
}
.cat-opt-child.selected .cat-opt-name-sm {
    color: #1D5BFF;
    font-weight: 650;
}
.cat-opt-count-sm {
    font-size: 10px;
    font-weight: 650;
    color: #9ca3af;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 7px;
}
.cat-dropdown-foot {
    padding: 8px 12px;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
}
.cat-add-new-btn {
    width: 100%;
    height: 30px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 6px;
    background: transparent;
    color: #4b5563;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.cat-add-new-btn:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16,185,129,0.03);
}
:root.dark-mode {
    --pri: #818cf8;
    --pri-l: #a5b4fc;
    --pri-d: #6366f1;
    --pri-h: #a5b4fc;
    --pri-bg: rgba(99, 102, 241, 0.15);
    --ok: #34d399;
    --warn: #fbbf24;
    --err: #f87171;
    --info: #60a5fa;
    --bg: #0f172a;
    --card: #1e293b;
    --line: #334155;
    --line-l: #1e293b;
    --t1: #f1f5f9;
    --t2: #cbd5e1;
    --t3: #64748b;
    --t4: #475569;
    --ring: 0 0 0 3px rgba(129, 140, 248, 0.18);
}
:root.dark-mode body { background: var(--bg); }
:root.dark-mode .sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right-color: var(--line);
}
:root.dark-mode .sidebar-header,
:root.dark-mode .sidebar-footer {
    background: #1e293b;
    border-color: var(--line);
}
:root.dark-mode .sidebar-search-box {
    background: #0f172a;
    border-color: var(--line);
}
:root.dark-mode .cat-nav-l2 { background: #0f172a; }
:root.dark-mode .cat-nav-l2:hover { background: #1e293b; }
:root.dark-mode .app-header {
    background: linear-gradient(135deg, #1e293b 0%, #1a202c 50%, #1e1b4b 100%);
    border-color: var(--line);
}
:root.dark-mode .app-header::before {
    background: radial-gradient(circle, rgba(29,91,255,0.15) 0%, transparent 70%);
}
:root.dark-mode .app-header::after {
    background: radial-gradient(circle, rgba(0,199,255,0.1) 0%, transparent 70%);
}
:root.dark-mode .greeting-stat-total {
    background: rgba(51, 154, 255, 0.14);
    border-color: rgba(51, 154, 255, 0.3);
    color: var(--pri-l);
}
:root.dark-mode .greeting-stat-fav {
    background: rgba(251, 113, 133, 0.12);
    border-color: rgba(251, 113, 133, 0.3);
    color: #fb7185;
}
:root.dark-mode .toolbar-area,
:root.dark-mode .filter-bar {
    background: #1a202c;
    border-color: var(--line);
}
:root.dark-mode .btn-default,
:root.dark-mode .theme-toggle,
:root.dark-mode .filter-tag:not(.active) {
    background: #374151;
    border-color: var(--line);
    color: var(--t2);
}
:root.dark-mode .btn-default:hover,
:root.dark-mode .theme-toggle:hover,
:root.dark-mode .filter-tag:not(.active):hover {
    background: #475569;
    border-color: var(--pri);
    color: var(--pri-l);
}
:root.dark-mode .btn-primary {
    background: linear-gradient(135deg, #1D5BFF, #4C86FF);
    box-shadow: 0 2px 8px rgba(29, 91, 255, 0.3);
}
:root.dark-mode .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(29, 91, 255, 0.4);
}
:root.dark-mode .btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
:root.dark-mode .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
:root.dark-mode .op-copy {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
:root.dark-mode .op-copy:hover {
    background: rgba(16, 185, 129, 0.25);
}
:root.dark-mode .op-edit {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
:root.dark-mode .op-edit:hover {
    background: rgba(245, 158, 11, 0.25);
}
:root.dark-mode .op-del {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
:root.dark-mode .op-del:hover {
    background: rgba(239, 68, 68, 0.25);
}
:root.dark-mode .fav-btn {
    background: #1e293b;
    color: #64748b;
}
:root.dark-mode .fav-btn .feather { fill: currentColor; }
:root.dark-mode .fav-btn:hover {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}
:root.dark-mode .fav-btn.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15));
    color: #fbbf24;
}
:root.dark-mode .empty-action {
    background: rgba(29, 91, 255, 0.08);
    color: var(--pri-l);
    border-color: rgba(29, 91, 255, 0.3);
}
:root.dark-mode .empty-action:hover {
    background: var(--pri);
    color: white;
    border-color: var(--pri);
}
:root.dark-mode .add-cat-btn {
    border-color: #475569;
    color: var(--t3);
}
:root.dark-mode .add-cat-btn:hover {
    border-color: var(--pri);
    color: var(--pri-l);
    background: rgba(29, 91, 255, 0.08);
}
:root.dark-mode .nav-action-btn {
    color: var(--t3);
}
:root.dark-mode .nav-action-btn:hover {
    background: rgba(29, 91, 255, 0.15);
    color: var(--pri-l);
}
:root.dark-mode .nav-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--err);
}
:root.dark-mode .cat-nav-all {
    color: var(--t2);
}
:root.dark-mode .cat-nav-all:hover {
    background: #334155;
    border-color: var(--line);
}
:root.dark-mode .cat-nav-all.active {
    background: linear-gradient(135deg, rgba(29, 91, 255, 0.15), rgba(51, 154, 255, 0.1));
    border-color: var(--pri);
    color: var(--pri-l);
}
:root.dark-mode .cat-nav-all.active .nav-badge {
    background: rgba(29, 91, 255, 0.2);
    color: var(--pri-l);
}
:root.dark-mode .cat-nav-process:hover {
    background: #334155;
    border-color: rgba(16, 185, 129, 0.4);
}
:root.dark-mode .cat-nav-process:hover .nav-label {
    color: #34d399;
}
:root.dark-mode .nav-badge {
    background: #334155;
    color: #94a3b8;
}
:root.dark-mode .cat-nav-favorites:hover {
    background: #334155;
    border-color: rgba(251, 191, 36, 0.3);
}
:root.dark-mode .cat-nav-favorites.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border-color: #f59e0b;
    color: #fbbf24;
}
:root.dark-mode .cat-nav-favorites.active .nav-badge {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}
:root.dark-mode .nav-count-sm {
    background: #334155;
    color: #94a3b8;
}
:root.dark-mode .cat-nav-l2.active .nav-count-sm {
    background: rgba(29, 91, 255, 0.2);
    color: #4C86FF;
}
:root.dark-mode .has-img-badge {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(59, 130, 246, 0.1));
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}
:root.dark-mode .search-box input,
:root.dark-mode .form-input {
    background: #111827;
    color: var(--t1);
    border-color: var(--line);
}
/* 编辑器暗色模式样式由 css/editor.css 提供 */
:root.dark-mode .list-head {
    --thead-bg: #1f2937;
    --thead-line: #334155;
}
:root.dark-mode .list-table td {
    --row-line: #1f2937;
    color: var(--t2);
}
:root.dark-mode .modal-dialog { background: #1e293b; }
:root.dark-mode .modal-head,
:root.dark-mode .modal-foot {
    background: #1a202c;
    border-color: var(--line);
}
:root.dark-mode .modal-close { background: #334155; }
:root.dark-mode .confirm-box {
    background: #1e293b;
    border: 1px solid #334155;
}
:root.dark-mode .dedup-confirm-box {
    background: #1e293b;
    border: 1px solid #334155;
}
:root.dark-mode .dedup-confirm-actions {
    background: #0f172a;
    border-top-color: #334155;
}
:root.dark-mode .dedup-stat-item {
    background: #0f172a;
}
:root.dark-mode .dedup-confirm-bar {
    background: #334155;
}
:root.dark-mode .dedup-confirm-snip {
    background: #0f172a;
}
:root.dark-mode .compare-dialog { background: #1e293b; }
:root.dark-mode .compare-modal-head,
:root.dark-mode .compare-modal-foot { border-color: #334155; background: #1a202c; }
:root.dark-mode .compare-panel { background: #0f172a; border-color: #334155; }
:root.dark-mode .compare-header { background: #1e293b; border-bottom-color: #334155; }
:root.dark-mode .compare-title-input { background: #0f172a; border-bottom-color: #334155; color: var(--t1); }
:root.dark-mode .compare-content { background: #0f172a; color: var(--t2); }
:root.dark-mode .compare-footer { background: #1e293b; border-top-color: #334155; }
:root.dark-mode .compare-divider { background: #334155; }
:root.dark-mode .compare-divider:hover { background: var(--pri); }
:root.dark-mode .cat-select-trigger,
:root.dark-mode .cat-select-dropdown {
    background: #1e293b;
    border-color: var(--line);
}
:root.dark-mode .cat-dropdown-head,
:root.dark-mode .cat-dropdown-foot {
    background: #0f172a;
    border-color: #334155;
}
:root.dark-mode .cat-dropdown-search,
:root.dark-mode .cat-opt-item {
    background: #1e293b;
    border-color: transparent;
}
:root.dark-mode .cat-opt-item:hover {
    background: #334155;
    border-color: #475569;
}
:root.dark-mode .cat-opt-child {
    background: #0f172a;
}
:root.dark-mode .cat-opt-child:hover {
    background: #1e293b;
}
/* Emoji 选择器暗色模式由 css/editor.css 提供 */

/* ========== 快速预览浮层 ========== */
.preview-overlay { display:none; position:fixed; inset:0; z-index:9999; }
.preview-overlay.show { display:flex; align-items:center; justify-content:center; }
.preview-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.5); }
.preview-dialog { position:relative; width:90%; max-width:720px; max-height:80vh; background:#fff; border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,0.2); display:flex; flex-direction:column; overflow:hidden; z-index:1; }
.preview-head { display:flex; align-items:center; gap:12px; padding:18px 22px; border-bottom:1px solid #f3f4f6; flex-shrink:0; }
.preview-title { font-size:17px; font-weight:700; color:#111827; flex:1; }
.preview-meta { font-size:12.5px; color:#9ca3af; white-space:nowrap; }
.preview-close { width:32px; height:32px; border:none; background:#f3f4f6; border-radius:8px; cursor:pointer; font-size:15px; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition: all 0.2s ease; color: var(--t3); }
.preview-close:hover { background:#e5e7eb; color: var(--t1); transform: rotate(90deg); }
.preview-body { padding:20px 22px; overflow-y:auto; flex:1; min-height:100px; max-height:55vh; line-height:1.75; font-size:14.5px; color:#374151; word-break:break-word; }
.preview-body img { max-width:100%; max-height:320px; width:auto; height:auto; border-radius:8px; margin:8px 0; cursor:zoom-in; display:block; clear:both; }
.preview-foot { display:flex; justify-content:flex-end; gap:10px; padding:14px 22px; border-top:1px solid #f3f4f6; flex-shrink:0; }

/* 暗色模式 */
:root.dark-mode .preview-dialog { background:#1e293b; box-shadow:0 20px 60px rgba(0,0,0,0.5); }
:root.dark-mode .preview-head,
:root.dark-mode .preview-foot { border-color:#334155; }
:root.dark-mode .preview-title { color:#f1f5f9; }
:root.dark-mode .preview-meta { color:#94a3b8; }
:root.dark-mode .preview-body { color:#e2e8f0; }
:root.dark-mode .preview-close { background:#334155; color:#cbd5e1; }
:root.dark-mode .preview-close:hover { background:#475569; }

/* ========== 文案分段功能 ========== */
/* 分段信息横幅 */
.seg-info-banner { display:flex; align-items:center; gap:8px; padding:10px 14px; margin-bottom:14px; background:#f0f9ff; border:1px solid #bae6fd; border-radius:8px; color:#0369a1; font-size:13px; }
.seg-info-banner strong { color:#0c4a6e; font-weight:700; }
:root.dark-mode .seg-info-banner { background:#0c1e33; border-color:#1e3a5f; color:#7dd3fc; }
:root.dark-mode .seg-info-banner strong { color:#bae6fd; }

/* 分段卡片容器 */
.seg-cards-wrap { display:flex; flex-direction:column; gap:14px; }

/* 段间空行占位（还原用户在文案中排版的空行） */
.seg-blank-gap { width:100%; flex-shrink:0; pointer-events:none; }

/* 单个分段卡片 */
.seg-card { border:1px solid #e5e7eb; border-radius:10px; overflow:hidden; background:#fff; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.seg-card:hover { border-color:#7dd3fc; box-shadow:0 2px 8px rgba(29,91,255,0.08); }
:root.dark-mode .seg-card { background:#1e293b; border-color:#334155; }
:root.dark-mode .seg-card:hover { border-color:#38bdf8; box-shadow:0 2px 8px rgba(29,91,255,0.15); }

.seg-card-head { display:flex; align-items:center; gap:10px; padding:9px 12px; background:#f9fafb; border-bottom:1px solid #f3f4f6; }
:root.dark-mode .seg-card-head { background:#0f172a; border-bottom-color:#334155; }

.seg-badge { display:inline-flex; align-items:center; padding:2px 9px; background:#e0f2fe; color:#0E4BC9; border-radius:6px; font-size:12px; font-weight:600; flex-shrink:0; }
:root.dark-mode .seg-badge { background:#0c1e33; color:#4C86FF; }

.seg-meta { font-size:12px; color:#9ca3af; flex:1; }
:root.dark-mode .seg-meta { color:#94a3b8; }

.seg-copy-btn { display:inline-flex; align-items:center; gap:4px; padding:5px 10px; border:1px solid #1D5BFF; background:#1D5BFF; color:#fff; border-radius:6px; cursor:pointer; font-size:12px; font-weight:500; transition: all 0.2s ease; flex-shrink:0; }
.seg-copy-btn:hover { background:#0E4BC9; border-color:#0E4BC9; }
.seg-copy-btn:active { transform: scale(0.96); }

.seg-card-body { padding:12px 14px; line-height:1.75; font-size:14px; color:#374151; word-break:break-word; }
.seg-card-body img { max-width:100%; max-height:320px; width:auto; height:auto; border-radius:8px; margin:6px 0; }
:root.dark-mode .seg-card-body { color:#e2e8f0; }

/* 相邻图片横排显示（连续多张 img 包装到 img-group） */
#previewBody .img-group,
.seg-card-body .img-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: center;
    margin: 10px 0;
}
#previewBody .img-group img,
.seg-card-body .img-group img {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(50% - 4px) !important;
    width: auto !important;
    height: auto !important;
    max-height: 320px;
    object-fit: contain;
    border-radius: 8px;
    margin: 0;
    display: block;
}
#previewBody .img-group img + img + img,
.seg-card-body .img-group img + img + img {
    max-width: calc(33.333% - 6px);
}
#previewBody .img-group img + img + img + img,
.seg-card-body .img-group img + img + img + img {
    max-width: calc(25% - 6px);
}

/* 移动端响应式 */
@media (max-width: 640px) {
    .preview-foot { flex-wrap:wrap; gap:8px; }
    .preview-foot .btn { font-size:13px; padding:7px 11px; }
    .seg-card-head { flex-wrap:wrap; padding:8px 10px; }
    .seg-meta { flex-basis:100%; order:3; }
    .seg-card-body { padding:10px 12px; font-size:13.5px; }
}

/* ========== 图片墙/图库模式 ========== */
.gallery-overlay { display:none; position:fixed; inset:0; z-index:1060; }
.gallery-overlay.show { display:flex; align-items:center; justify-content:center; }
.gallery-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.6); }
.gallery-dialog { position:relative; width:92%; max-width:1100px; height:82vh; background:#fff; border-radius:16px; box-shadow:0 24px 70px rgba(0,0,0,0.25); display:flex; flex-direction:column; overflow:hidden; z-index:1; }
.gallery-head { display:flex; align-items:center; gap:12px; padding:16px 22px; border-bottom:1px solid #f3f4f6; flex-shrink:0; }
.gallery-title { font-size:17px; font-weight:700; color:#111827; }
.gallery-count { font-size:13px; color:#9ca3af; }
.gallery-close { width:32px; height:32px; border:none; background:#f3f4f6; border-radius:8px; cursor:pointer; font-size:15px; display:flex; align-items:center; justify-content:center; margin-left:auto; flex-shrink:0; transition: all 0.2s ease; color: var(--t3); }
.gallery-close:hover { background:#e5e7eb; color: var(--t1); transform: rotate(90deg); }
.gallery-toolbar { padding:10px 22px; border-bottom:1px solid #f3f4f6; flex-shrink:0; display:flex; align-items:center; gap:12px; }
.gallery-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s;
}
.gallery-search-box:focus-within {
    border-color: #1D5BFF;
    box-shadow: 0 0 0 3px rgba(29,91,255,0.1);
}
.gallery-search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    color: #374151;
}
.gallery-search-box input::placeholder {
    color: #9ca3af;
}
.gallery-toolbar select { height:36px; padding:0 12px; border:1px solid #e5e7eb; border-radius:8px; font-size:13.5px; color:#374151; background:#fff; outline:none; flex-shrink:0; }
.gallery-toolbar select:focus { border-color:#1D5BFF; box-shadow:0 0 0 3px rgba(29,91,255,0.1); }
.gallery-grid { flex:1; overflow-y:auto; padding:16px 22px; display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); grid-auto-rows:min-content; gap:14px; align-content:start; scrollbar-gutter:stable; }
.gallery-empty { flex:1; display:flex; align-items:center; justify-content:center; color:#9ca3af; }

/* 图片卡片 */
.gallery-card { background:#f9fafb; border:1px solid #f3f4f6; border-radius:12px; overflow:hidden; cursor:pointer; transition:transform 0.2s,box-shadow 0.2s; }
.gallery-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,0.1); }
.gallery-card-img-wrap { min-height:220px; overflow:hidden; background:#e5e7eb; display:flex; align-items:center; justify-content:center; }
.gallery-card-img-wrap img { max-width:100%; max-height:300px; width:auto; height:auto; object-fit:contain; display:block; }
.gallery-card-info { padding:10px 12px; }
.gallery-card-title { font-size:12.5px; font-weight:600; color:#374151; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gallery-card-tags { display:flex; align-items:center; gap:4px; flex-wrap:nowrap; overflow:hidden; margin-top:6px; padding:5px 4px; margin-left:-4px; margin-right:-4px; }
.gallery-tag-chip {
    display:inline-flex; align-items:center; gap:3px;
    font-size:10px; padding:2px 7px; border-radius:999px; font-weight:600;
    white-space:nowrap; max-width:90px; overflow:hidden; text-overflow:ellipsis;
    transition:transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .15s ease, filter .15s ease;
}
.gallery-tag-chip:hover { transform:translateY(-1px) scale(1.05); filter:brightness(1.06); box-shadow:0 2px 8px -2px var(--tc, rgba(0,0,0,.3)); }
.gallery-tag-more { font-size:10px; color:#9ca3af; background:#f1f5f9; border-radius:999px; padding:2px 6px; flex-shrink:0; font-weight:700; }
.gallery-card-cat { font-size:11px; color:#9ca3af; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* 加载更多提示 */
.gallery-load-more { grid-column:1 / -1; text-align:center; padding:16px 0 8px; color:#9ca3af; font-size:13px; }

/* 暗色模式 */
:root.dark-mode .gallery-dialog { background:#1e293b; box-shadow:0 24px 70px rgba(0,0,0,0.5); }
:root.dark-mode .gallery-head,
:root.dark-mode .gallery-toolbar { border-color:#334155; }
:root.dark-mode .gallery-title { color:#f1f5f9; }
:root.dark-mode .gallery-close { background:#334155; color:#cbd5e1; }
:root.dark-mode .gallery-close:hover { background:#475569; }
:root.dark-mode .gallery-toolbar select { background:#1e293b; border-color:#334155; color:#e2e8f0; }
:root.dark-mode .gallery-search-box { background:#1e293b; border-color:#334155; }
:root.dark-mode .gallery-search-box:focus-within { border-color:#1D5BFF; }
:root.dark-mode .gallery-search-box input { color:#e2e8f0; }
:root.dark-mode .gallery-search-box input::placeholder { color:#64748b; }
:root.dark-mode .gallery-grid { background:#0f172a; }
:root.dark-mode .gallery-card { background:#1e293b; border-color:#334155; }
:root.dark-mode .gallery-card:hover { box-shadow:0 8px 24px rgba(0,0,0,0.3); }
:root.dark-mode .gallery-card-img-wrap { background:#334155; }
:root.dark-mode .gallery-card-title { color:#e2e8f0; }
:root.dark-mode .gallery-card-cat { color:#64748b; }
:root.dark-mode .gallery-tag-more { background:#334155; color:#94a3b8; }

/* ========== 列表行选中态 ========== */
.row-selected { background:rgba(29,91,255,0.08) !important; }
.row-selected .row-num { background:linear-gradient(135deg,#1D5BFF,#4C86FF) !important; color:#fff !important; }
:root.dark-mode .row-selected { background:rgba(29,91,255,0.15) !important; }

/* ========== 搜索关键词高亮 ========== */
.hl-keyword { background:rgba(250,204,21,0.35); color:#92400e; border-radius:2px; padding:0 1px; font-weight:600; }
:root.dark-mode .hl-keyword { background:rgba(234,179,8,0.3); color:#fbbf24; }

/* ========== 顶部分类标签栏 ========== */
.top-cat-bar {
    padding: 10px 16px 0;
    background: white;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 12px;
}
.top-cat-scroll {
    flex: 1;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(29,91,255,0.2) transparent;
}
.top-cat-scroll::-webkit-scrollbar {
    height: 4px;
}
.top-cat-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.top-cat-scroll::-webkit-scrollbar-thumb {
    background: rgba(29,91,255,0.15);
    border-radius: 2px;
}
.top-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
}
.top-cat-tab:hover {
    background: #f8fafc;
    color: var(--pri);
}
.top-cat-tab.active {
    background: var(--pri-bg);
    color: var(--pri);
    font-weight: 700;
}
.top-cat-dot {
    display: none; /* 隐藏顶部标签分类前的颜色圆点 */
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.top-cat-name {
    line-height: 1;
}
.top-cat-count {
    font-size: 11.5px;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
    line-height: 1.4;
}
.top-cat-tab.active .top-cat-count {
    background: rgba(29,91,255,0.1);
    color: var(--pri);
}
.top-add-cat-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px dashed #cbd5e1;
    background: white;
    color: #64748b;
    align-self: flex-start;
    margin-top: 0;
}
.top-add-cat-btn:hover {
    border-color: var(--pri);
    color: var(--pri);
    background: rgba(29,91,255,0.04);
}
.top-sub-cat-bar {
    padding: 0 28px 10px;
    background: white;
    border-bottom: 1px solid #f3f4f6;
}
.top-sub-cat-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-top: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(29,91,255,0.2) transparent;
}
.top-sub-cat-scroll::-webkit-scrollbar {
    height: 3px;
}
.top-sub-cat-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.top-sub-cat-scroll::-webkit-scrollbar-thumb {
    background: rgba(29,91,255,0.12);
    border-radius: 2px;
}
.top-sub-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--t2);
    white-space: nowrap;
    flex-shrink: 0;
}
.top-sub-cat-tab:hover {
    border-color: var(--pri-l);
    color: var(--pri);
    background: white;
}
.top-sub-cat-tab.active {
    background: var(--pri-bg);
    color: var(--pri-d);
    border-color: var(--pri-l);
}
.top-sub-cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.top-sub-cat-count {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--t3);
}
.top-sub-cat-tab.active .top-sub-cat-count {
    color: var(--pri-d);
}

/* 顶部标签布局模式 */
.layout-top-tabs .mobile-menu-btn {
    display: none;
}
.layout-top-tabs .top-cat-bar {
    display: flex;
}
.layout-top-tabs .top-sub-cat-bar {
    display: none !important;
}
.layout-top-tabs .sub-cat-only-section {
    display: block;
}
.layout-top-tabs .sidebar-footer .add-cat-btn {
    display: none;
}
.layout-top-tabs .sidebar-footer .add-sub-cat-btn {
    display: flex;
}
.sidebar-footer .add-sub-cat-btn {
    display: none;
}

/* 暗色模式适配 */
:root.dark-mode .top-cat-bar,
:root.dark-mode .top-sub-cat-bar {
    background: #1e293b;
    border-color: #334155;
}
:root.dark-mode .top-cat-tab {
    background: transparent;
    color: #94a3b8;
}
:root.dark-mode .top-cat-tab:hover {
    background: #334155;
    color: var(--pri-l);
}
:root.dark-mode .top-cat-tab.active {
    background: rgba(29,91,255,0.15);
    color: var(--pri-l);
}
:root.dark-mode .top-cat-count {
    background: #334155;
    color: #94a3b8;
}
:root.dark-mode .top-cat-tab.active .top-cat-count {
    background: rgba(29,91,255,0.15);
    color: var(--pri-l);
}
:root.dark-mode .top-add-cat-btn {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}
:root.dark-mode .top-add-cat-btn:hover {
    border-color: var(--pri-l);
    color: var(--pri-l);
    background: rgba(29,91,255,0.08);
}
:root.dark-mode .top-sub-cat-tab {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}
:root.dark-mode .top-sub-cat-tab:hover {
    border-color: var(--pri-l);
    color: var(--pri-l);
    background: #1e293b;
}
:root.dark-mode .top-sub-cat-tab.active {
    background: rgba(29,91,255,0.15);
    color: var(--pri-l);
    border-color: var(--pri);
}
:root.dark-mode .top-sub-cat-count {
    color: #64748b;
}
:root.dark-mode .top-sub-cat-tab.active .top-sub-cat-count {
    color: var(--pri-l);
}

/* 设置对话框宽度 */
.modal-dialog.settings-dialog {
    width: 380px;
    max-width: 90vw;
}

/* ========== 文案库访问密码弹窗 ========== */
.lib-auth-overlay { z-index: 1100; }
.modal-dialog.lib-auth-dialog {
    width: 400px;
    max-width: 92vw;
    height: auto;
    max-height: none;
    overflow: visible;
}
.lib-auth-head {
    text-align: center;
    padding: 32px 28px 20px;
    background: linear-gradient(135deg, rgba(29,91,255,0.06), rgba(0,199,255,0.04));
    border-bottom: 1px solid #f3f4f6;
}
.lib-auth-icon {
    font-size: 52px;
    margin-bottom: 10px;
    line-height: 1;
}
.lib-auth-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--t1);
    margin-bottom: 6px;
}
.lib-auth-sub {
    font-size: 13px;
    color: var(--t2);
    line-height: 1.5;
}
.lib-auth-body {
    padding: 22px 28px 8px;
    /* 登录/注册两种模式堆叠在同一网格单元内，
       弹窗高度始终取两者中的较大值，切换模式时不跳动 */
    display: grid;
}
.lib-pwd-field {
    position: relative;
    display: flex;
    align-items: center;
}
.lib-pwd-input {
    padding-right: 46px;
    text-align: center;
    font-size: 15px;
    height: 46px;
}
.lib-pwd-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}
.lib-pwd-toggle:hover {
    background: #f3f4f6;
}
/* 登录/注册错误直接显示在输入框内（占位文案 + 高亮） */
.form-input.input-error {
    border-color: var(--err);
    background: #fef2f2;
}
.form-input.input-error::placeholder {
    color: var(--err);
    opacity: 1;
    font-weight: 600;
}
:root.dark-mode .form-input.input-error {
    background: rgba(239, 68, 68, 0.12);
}
.lib-auth-warn {
    color: #d97706;
    font-size: 12px;
    margin-top: 8px;
    text-align: center;
    font-weight: 600;
}
.lib-auth-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 28px 22px;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* 验证模式切换标签 */
.lib-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.lib-auth-tab {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--t3);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lib-auth-tab:hover {
    color: var(--t2);
    background: #f9fafb;
}
.lib-auth-tab.active {
    color: var(--pri);
    border-bottom-color: var(--pri);
    font-weight: 600;
}

/* 验证模式内容区 */
.lib-auth-mode {
    grid-area: 1 / 1;
    margin-top: 12px;
    visibility: hidden;
    /* 撑满堆叠单元，把登录模式多出的高度均匀分配到各元素之间，
       避免底部出现一整块空白 */
    display: flex;
    flex-direction: column;
}
.lib-auth-mode.is-active {
    visibility: visible;
    justify-content: space-between;
}
.lib-auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lib-auth-field {
    margin-bottom: 0;
}
.lib-auth-submit {
    width: 100%;
    margin-top: 12px;
}

/* 登录/注册模式切换的小文字链接 */
.lib-auth-switch-link {
    margin-top: 14px;
    text-align: center;
    font-size: 12.5px;
    color: var(--t3);
    line-height: 1.5;
}
.lib-auth-switch-link a {
    color: var(--pri);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    margin-left: 2px;
}
.lib-auth-switch-link a:hover {
    text-decoration: underline;
}

/* 暗色模式适配 */
:root.dark-mode .lib-auth-tabs {
    border-bottom-color: #334155;
}
:root.dark-mode .lib-auth-tab:hover {
    background: #334155;
}

/* ========== 文案库加密占位遮罩 ========== */
.lib-gate {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    text-align: center;
    padding: 20px;
}
.lib-gate-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: libGatePulse 2.5s ease-in-out infinite;
}
@keyframes libGatePulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.08); opacity: 1; }
}
.lib-gate-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--t1);
    margin-bottom: 8px;
}
.lib-gate-sub {
    font-size: 14px;
    color: var(--t2);
    margin-bottom: 24px;
}

/* 初始加载状态：隐藏主内容，防止闪屏 */
body.app-loading .app-container { display: none !important; }
body.app-loaded .lib-gate { display: none; }

/* 加载中动画 */
.lib-gate.loading .lib-gate-icon {
    animation: libGateSpin 1.2s linear infinite;
}
@keyframes libGateSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== 暗色模式适配 ========== */
:root.dark-mode .lib-auth-head {
    background: linear-gradient(135deg, rgba(29,91,255,0.1), rgba(0,199,255,0.06));
    border-bottom-color: #334155;
}
:root.dark-mode .lib-auth-dialog {
    background: #1e293b;
}
:root.dark-mode .lib-pwd-toggle:hover {
    background: #334155;
}
:root.dark-mode .lib-auth-foot {
    background: #161e2e;
    border-top-color: #334155;
}

/* ============ Feather Icons 样式优化 ============ */
.feather {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vertical-align: -0.125em;
}

.sidebar-logo .feather {
    width: 28px;
    height: 28px;
    color: var(--pri);
}

.nav-icon .feather {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.mobile-menu-btn .feather {
    color: var(--t1);
}

.greeting-text .feather {
    width: 16px;
    height: 16px;
    vertical-align: -2px;
}

.btn .feather {
    margin-right: 4px;
    vertical-align: -2px;
}

.theme-toggle .feather {
    width: 18px;
    height: 18px;
}

.filter-tag .feather {
    width: 12px;
    height: 12px;
    margin-right: 3px;
    vertical-align: middle;
}

.search-icon .feather {
    width: 16px;
    height: 16px;
}

.search-icon-xs .feather {
    width: 12px;
    height: 12px;
}

.modal-close .feather,
.preview-close .feather,
.gallery-close .feather {
    width: 18px;
    height: 18px;
}

/* .editor-btn / .emoji-close-btn 的 feather 图标尺寸由 css/editor.css 提供 */

.cat-select-arrow .feather {
    width: 14px;
    height: 14px;
    color: var(--t3);
}

.confirm-icon .feather {
    width: 32px;
    height: 32px;
    color: var(--warn);
}

.input-dialog-icon .feather {
    width: 28px;
    height: 28px;
    color: var(--pri);
}

.dedup-confirm-icon .feather {
    width: 28px;
    height: 28px;
}

.lib-auth-icon .feather {
    width: 36px;
    height: 36px;
    color: var(--pri);
}

.lib-pwd-toggle .feather {
    width: 18px;
    height: 18px;
    color: var(--t3);
}

.lib-gate-icon .feather {
    width: 48px;
    height: 48px;
    color: var(--pri);
}

.gallery-title .feather {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: middle;
}
:root.dark-mode .lib-gate {
    background: linear-gradient(135deg, #0f172a, #1e1b4b);
}

/* ========== 响应式适配 ========== */
@media (max-width: 480px) {
    .modal-dialog.lib-auth-dialog {
        width: 95vw;
    }
    .lib-auth-head {
        padding: 24px 20px 16px;
    }
    .lib-auth-body {
        padding: 18px 20px 6px;
    }
    .lib-auth-foot {
        padding: 12px 20px 18px;
    }
    .lib-auth-icon {
        font-size: 44px;
    }
    .lib-auth-title {
        font-size: 17px;
    }
    .lib-gate-icon {
        font-size: 52px;
    }
    .lib-gate-text {
        font-size: 19px;
    }
}

/* ========== Share Dialog (文案分享) ========== */
.share-overlay {
    display: none; position: fixed; inset: 0; z-index: 10000;
    align-items: center; justify-content: center;
    padding: 20px;
}
.share-overlay.show { display: flex; }
.share-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,23,42,0.55); backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.share-box {
    position: relative; z-index: 1;
    background: #ffffff; border-radius: 12px;
    width: 100%; max-width: 380px; max-height: 90vh;
    box-shadow: 0 16px 40px rgba(0,0,0,0.2);
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid rgba(226,232,240,0.6);
    animation: shareBoxIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes shareBoxIn {
    from { opacity: 0; transform: scale(0.96) translateY(-12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.share-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(29,91,255,0.08), rgba(0,199,255,0.06));
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.share-head-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1D5BFF, #4C86FF);
    border-radius: 8px; color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(29,91,255,0.3);
}
.share-head-title {
    font-size: 15px; font-weight: 600; color: var(--t1);
    line-height: 1.4; flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-close {
    width: 32px; height: 32px; border: none;
    background: rgba(243,244,246,0.8); border-radius: 8px;
    cursor: pointer; color: var(--t3);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; flex-shrink: 0;
}
.share-close:hover {
    background: #e5e7eb; color: var(--t1); transform: rotate(90deg);
}
.share-body {
    padding: 14px 16px;
    overflow-y: auto; overflow-x: visible;
    flex: 1;
}
.share-dialog { width: 100%; }

.share-config-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.share-section-title {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.share-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.share-form-group { margin-bottom: 10px; }
.share-form-group:last-child { margin-bottom: 0; }
.share-form-grid .share-form-group { margin-bottom: 0; }

.share-label {
    display: block; font-size: 11.5px; font-weight: 600;
    color: #64748b; margin-bottom: 5px;
}

.share-select, .share-input {
    width: 100%; height: 34px; padding: 0 10px;
    border: 1px solid #e2e8f0; border-radius: 6px;
    font-size: 13px; color: #0f172a;
    background: #f8fafc; outline: none;
    transition: all 0.2s; box-sizing: border-box;
    font-family: inherit;
}
.share-select:focus, .share-input:focus {
    border-color: var(--pri); background: #ffffff;
    box-shadow: 0 0 0 3px rgba(29,91,255,0.1);
}
.share-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 28px; cursor: pointer;
}
.share-input::placeholder { color: #94a3b8; }
.share-input[readonly] {
    background: #f8fafc; color: #334155; cursor: text;
}
.share-expires-custom, .share-maxviews-custom { margin-top: 6px; }

.share-actions {
    display: flex; justify-content: center; gap: 8px;
    padding-bottom: 2px;
}
.share-generate-btn {
    width: 100%; justify-content: center;
    height: 36px;
    font-size: 13px; font-weight: 600;
    border-radius: 6px;
}

.share-result {
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(16,185,129,0.02));
    border: 1px solid rgba(16,185,129,0.18);
    border-radius: 8px;
}

.share-result-header {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 10px;
}

.share-result-title {
    font-size: 12px; font-weight: 600;
    color: #059669;
}

.share-link-box {
    display: flex; gap: 6px; align-items: stretch;
}
.share-link-box .share-input {
    flex: 1; min-width: 0;
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
    font-size: 11.5px;
    background: #fff;
    border-color: #e2e8f0;
}
.share-link-box .btn {
    flex-shrink: 0; padding: 0 12px; height: 34px;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px;
}

.btn-sm {
    padding: 0 12px !important; height: 38px !important;
    font-size: 13px !important;
}

.share-info-text {
    margin-top: 8px; padding: 6px 8px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(16,185,129,0.15);
    border-radius: 5px;
    font-size: 11px; color: #047857;
    line-height: 1.5;
}
.share-info-text:empty { display: none; }

.share-qr-section {
    display: flex; flex-direction: column; align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(16,185,129,0.15);
}

.share-qr-wrap {
    background: #fff;
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.05);
}

.share-qr-img {
    display: block;
    width: 120px;
    height: 120px;
    image-rendering: pixelated;
}

.share-qr-tip {
    display: flex; align-items: center; gap: 5px;
    margin-top: 10px;
    font-size: 12px;
    color: #047857;
}

/* ========== 暗色模式 - Share Dialog ========== */
:root.dark-mode .share-box {
    background: #1e293b; border-color: #334155;
    box-shadow: 0 24px 70px rgba(0,0,0,0.5);
}
:root.dark-mode .share-head {
    background: linear-gradient(135deg, rgba(29,91,255,0.15), rgba(0,199,255,0.1));
    border-color: #334155;
}
:root.dark-mode .share-head-title { color: #f1f5f9; }
:root.dark-mode .share-close {
    background: #334155; color: #cbd5e1;
}
:root.dark-mode .share-close:hover {
    background: #475569; color: #f1f5f9;
}
:root.dark-mode .share-config-section {
    border-bottom-color: #334155;
}
:root.dark-mode .share-section-title {
    color: #94a3b8;
}
:root.dark-mode .share-label { color: #94a3b8; }
:root.dark-mode .share-select,
:root.dark-mode .share-input {
    background: #0f172a; border-color: #334155; color: #e2e8f0;
}
:root.dark-mode .share-select:focus,
:root.dark-mode .share-input:focus {
    border-color: #1D5BFF;
    box-shadow: 0 0 0 3px rgba(29,91,255,0.15);
    background: #1e293b;
}
:root.dark-mode .share-select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
:root.dark-mode .share-input::placeholder { color: #64748b; }
:root.dark-mode .share-input[readonly] {
    background: #0f172a; color: #cbd5e1;
}
:root.dark-mode .share-result {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.04));
    border-color: rgba(16,185,129,0.3);
}
:root.dark-mode .share-result-title { color: #6ee7b7; }
:root.dark-mode .share-link-box .share-input {
    background: #0f172a; border-color: #334155;
}
:root.dark-mode .share-info-text {
    background: rgba(15,23,42,0.6);
    border-color: rgba(16,185,129,0.25);
    color: #6ee7b7;
}
:root.dark-mode .share-qr-section {
    border-top-color: rgba(16,185,129,0.2);
}
:root.dark-mode .share-qr-wrap {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
}
:root.dark-mode .share-qr-tip { color: #6ee7b7; }

/* ========== 响应式 - Share Dialog ========== */
@media (max-width: 480px) {
    .share-overlay { padding: 12px; }
    .share-box { max-width: 100%; border-radius: 12px; }
    .share-head { padding: 14px 16px; }
    .share-body { padding: 16px; }
    .share-head-title { font-size: 15px; }
    .share-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 14px;
    }
    .share-link-box { flex-direction: column; }
    .share-link-box .btn { width: 100%; justify-content: center; }
    .share-generate-btn { width: 100%; }
}

/* ========== Announcement Modal（弹窗公告）========== */
.ann-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    align-items: center; justify-content: center;
}
.ann-overlay.show { display: flex; }
.ann-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}
.ann-dialog {
    position: relative; z-index: 1;
    width: 560px; max-width: 92vw;
    height: auto; max-height: 80vh;
    background: #fff; border-radius: var(--radius-lg);
    border-top: 3px solid #1D5BFF;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: annIn 0.25s ease;
}
@keyframes annIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ann-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
}
.ann-icon-wrap {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: rgba(29,91,255,0.1); color: #1D5BFF;
}
.ann-title {
    flex: 1; min-width: 0;
    font-size: 16px; font-weight: 700; color: var(--t1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ann-close {
    width: 30px; height: 30px; border: none; border-radius: 6px;
    background: #f3f4f6; cursor: pointer; flex-shrink: 0;
    color: var(--t3); display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.ann-close:hover { background: #e5e7eb; color: var(--t1); transform: rotate(90deg); }
.ann-body {
    padding: 4px 22px 16px;
    overflow-y: auto; flex: 1;
}
.ann-body p {
    margin: 0 0 10px;
    font-size: 14px; line-height: 1.7; color: var(--t2);
    word-break: break-word;
}
.ann-body p:last-child { margin-bottom: 0; }

/* 公告 Markdown 富文本 */
.ann-body h1, .ann-body h2, .ann-body h3, .ann-body h4, .ann-body h5, .ann-body h6 {
    margin: 14px 0 8px; font-weight: 700; color: var(--t1); line-height: 1.4;
    word-break: break-word;
}
.ann-body h1:first-child, .ann-body h2:first-child { margin-top: 2px; }
.ann-body h1 { font-size: 19px; }
.ann-body h2 { font-size: 17px; }
.ann-body h3 { font-size: 15.5px; }
.ann-body h4 { font-size: 14.5px; }
.ann-body h5, .ann-body h6 { font-size: 14px; }
.ann-body ul, .ann-body ol { margin: 0 0 10px; padding-left: 20px; }
.ann-body li {
    margin: 3px 0; font-size: 14px; line-height: 1.7; color: var(--t2);
    word-break: break-word;
}
.ann-body ul ul, .ann-body ol ol, .ann-body ul ol, .ann-body ol ul { margin-bottom: 0; }
.ann-body .md-task-list { list-style: none; padding-left: 4px; }
.ann-body .md-task-item { display: flex; align-items: flex-start; gap: 7px; }
.ann-body .md-task-item input[type="checkbox"] { margin-top: 5px; flex-shrink: 0; accent-color: var(--pri); }
.ann-body blockquote {
    margin: 0 0 10px; padding: 8px 12px;
    background: #f3f4f6; border-left: 3px solid var(--pri);
    border-radius: 6px;
}
.ann-body blockquote p { margin: 0; }
.ann-body code {
    padding: 2px 5px; background: #f1f5f9; border-radius: 4px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 12.5px; color: #e11d48; word-break: break-all;
}
.ann-body pre.md-code {
    margin: 0 0 10px; padding: 10px 12px;
    background: #0f172a; border-radius: 8px; overflow-x: auto;
}
.ann-body pre.md-code code {
    background: transparent; padding: 0; color: #e2e8f0; font-size: 12.5px; line-height: 1.6;
    font-family: Consolas, Monaco, "Courier New", monospace;
}
.ann-body .md-table-wrap { margin: 0 0 10px; overflow-x: auto; }
.ann-body .md-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ann-body .md-table th, .ann-body .md-table td {
    padding: 6px 10px; border: 1px solid var(--line); text-align: left;
    word-break: break-word;
}
.ann-body .md-table th { background: #f3f4f6; font-weight: 600; color: var(--t1); }
.ann-body hr { margin: 12px 0; border: none; border-top: 1px solid var(--line); }
.ann-body a { color: var(--pri); text-decoration: none; }
.ann-body a:hover { text-decoration: underline; }
.ann-body img { max-width: 100%; height: auto; border-radius: 8px; }
.ann-body mark { background: #fef08a; color: inherit; padding: 0 2px; border-radius: 3px; }
.ann-body del { color: var(--t3); }
.ann-foot {
    display: flex; justify-content: flex-end;
    padding: 12px 18px;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
}
.ann-foot .btn { min-width: 96px; }
.ann-pager {
    display: flex; align-items: center; justify-content: center;
    gap: 6px;
    padding: 8px 0 12px;
}
.ann-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #d1d5db; cursor: pointer;
    transition: all 0.2s ease;
}
.ann-dot:hover { background: #9ca3af; }
.ann-dot.active {
    background: var(--pri);
    transform: scale(1.25);
}

/* ========== 暗色模式 - Announcement Modal ========== */
:root.dark-mode .ann-dialog {
    background: #1e293b;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
:root.dark-mode .ann-title { color: #f1f5f9; }
:root.dark-mode .ann-close {
    background: #334155; color: #cbd5e1;
}
:root.dark-mode .ann-close:hover {
    background: #475569; color: #f1f5f9;
}
:root.dark-mode .ann-body p { color: #cbd5e1; }
:root.dark-mode .ann-foot {
    border-top-color: #334155; background: #0f172a;
}
:root.dark-mode .ann-dot { background: #475569; }
:root.dark-mode .ann-dot:hover { background: #64748b; }

/* 暗色模式 - 公告 Markdown 富文本 */
:root.dark-mode .ann-body li { color: #cbd5e1; }
:root.dark-mode .ann-body blockquote { background: #1e293b; border-left-color: var(--pri); }
:root.dark-mode .ann-body blockquote p { color: #cbd5e1; }
:root.dark-mode .ann-body code {
    background: #334155; color: #fda4af;
}
:root.dark-mode .ann-body pre.md-code { background: #0b1120; }
:root.dark-mode .ann-body pre.md-code code { color: #e2e8f0; }
:root.dark-mode .ann-body .md-table th, :root.dark-mode .ann-body .md-table td {
    border-color: #334155;
}
:root.dark-mode .ann-body .md-table th { background: #334155; }
:root.dark-mode .ann-body hr { border-top-color: #334155; }
:root.dark-mode .ann-body mark { background: #854d0e; color: #fef9c3; }
:root.dark-mode .ann-body del { color: #64748b; }

/* ========== 响应式 - Announcement Modal ========== */
@media (max-width: 480px) {
    .ann-dialog { width: 100%; max-width: 100%; border-radius: 12px; }
    .ann-head { padding: 14px 14px; }
    .ann-body { padding: 2px 16px 14px; }
    .ann-foot { padding: 10px 14px; }
    .ann-foot .btn { width: 100%; }
}
