:root {
        --bg-a: #ffffff;
        --bg-b: #f6f8fc;
        --card: rgba(255, 255, 255, 0.62);
        --text: #121418;
        --muted: #5e6775;
        --dock: rgba(255, 255, 255, 0.48);
        --dock-border: rgba(255, 255, 255, 0.35);
        --shadow-1: 0 6px 16px rgba(15, 23, 42, 0.12),
          0 1px 2px rgba(15, 23, 42, 0.08);
        --shadow-2: 0 10px 24px rgba(15, 23, 42, 0.16),
          0 2px 6px rgba(15, 23, 42, 0.1);
        --shadow-3: 0 16px 32px rgba(15, 23, 42, 0.2),
          0 4px 10px rgba(15, 23, 42, 0.12);
        --shadow: var(--shadow-1);
        --radius: 22px;
        --base-size: 15px;
        --label-weight: 600;
        --title-weight: 700;
        --dynamic-text: #0f172a;
        --dynamic-placeholder: #64748b;
      }
      html.dark {
        --bg-a: #121622;
        --bg-b: #171e2a;
        --card: rgba(18, 28, 44, 0.7);
        --text: #f4f7fb;
        --muted: #b0b8c6;
        --dock: rgba(26, 32, 42, 0.7);
        --dock-border: rgba(255, 255, 255, 0.12);
        --shadow-1: 0 6px 16px rgba(0, 0, 0, 0.38), 0 1px 2px rgba(0, 0, 0, 0.22);
        --shadow-2: 0 12px 26px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.28);
        --shadow-3: 0 18px 36px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.32);
        --shadow: var(--shadow-1);
      }
      * {
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
      }
      body {
        margin: 0;
        font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
        color: var(--text);
        min-height: 100vh;
        font-size: var(--base-size);
        transition: background 0.35s ease, color 0.35s ease;
      }
      #iosBg {
        background: linear-gradient(180deg, var(--bg-a), var(--bg-b));
        overflow: hidden;
      }
      html.dark #iosBg {
        background: linear-gradient(180deg, var(--bg-a), var(--bg-b));
      }
      #iosBg .glow {
        position: absolute;
        pointer-events: none;
        width: 780px;
        height: 780px;
        border-radius: 50%;
        filter: blur(90px);
        opacity: 0.85;
        mix-blend-mode: screen;
        animation: glow-drift 28s ease-in-out infinite alternate;
        will-change: transform;
      }
      #iosBg .g1 {
        top: -12%;
        left: -6%;
        background: radial-gradient(circle, rgba(125, 190, 255, 0.55), transparent 65%);
        animation-duration: 30s;
      }
      #iosBg .g2 {
        top: 4%;
        right: -10%;
        background: radial-gradient(circle, rgba(155, 245, 210, 0.5), transparent 64%);
        animation-duration: 34s;
      }
      #iosBg .g3 {
        bottom: -12%;
        right: 8%;
        width: 860px;
        height: 860px;
        background: radial-gradient(circle, rgba(255, 150, 165, 0.5), transparent 66%);
        animation-duration: 32s;
      }
      #iosBg .g4 {
        bottom: 6%;
        left: 14%;
        width: 720px;
        height: 720px;
        background: radial-gradient(circle, rgba(150, 200, 255, 0.42), transparent 64%);
        animation-duration: 26s;
      }
      #iosBg .g5 {
        top: 40%;
        left: 52%;
        width: 640px;
        height: 640px;
        background: radial-gradient(circle, rgba(255, 200, 140, 0.38), transparent 66%);
        animation-duration: 36s;
      }
      html.dark #iosBg .glow {
        opacity: 0.55;
        mix-blend-mode: screen;
      }
      html.dark #iosBg .g1 {
        background: radial-gradient(circle, rgba(110, 170, 255, 0.28), transparent 68%);
      }
      html.dark #iosBg .g2 {
        background: radial-gradient(circle, rgba(120, 220, 190, 0.25), transparent 68%);
      }
      html.dark #iosBg .g3 {
        background: radial-gradient(circle, rgba(255, 130, 150, 0.24), transparent 70%);
      }
      html.dark #iosBg .g4 {
        background: radial-gradient(circle, rgba(120, 165, 230, 0.22), transparent 70%);
      }
      html.dark #iosBg .g5 {
        background: radial-gradient(circle, rgba(255, 170, 130, 0.2), transparent 70%);
      }
      @keyframes glow-drift {
        0% {
          transform: translate3d(0, 0, 0) scale(1);
        }
        50% {
          transform: translate3d(18px, -22px, 0) scale(1.03);
        }
        100% {
          transform: translate3d(-16px, 18px, 0) scale(1.06);
        }
      }
      input::placeholder,
      textarea::placeholder {
        color: var(--dynamic-placeholder);
      }
      body.bold {
        --label-weight: 700;
        --title-weight: 800;
      }
      header {
        padding: 28px 22px 6px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
      }
      .title-wrap {
        display: grid;
        gap: 6px;
      }
      h1 {
        margin: 0;
        font-size: 26px;
        letter-spacing: 0.3px;
        font-weight: var(--title-weight);
      }
      p {
        margin: 6px 0 0;
        color: var(--muted);
        font-size: 14px;
      }
      .grid {
        display: flex;
        flex-direction: column;
        gap: 18px;
        padding: 18px 22px 120px;
      }
      .category-card {
        width: 100%;
        max-width: 100%;
        border-radius: 18px;
        padding: 12px 12px;
        box-shadow: none;
        background: var(--card);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
        position: relative;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        padding-bottom: 14px !important;
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
      }
      .category-card.nav-active {
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), var(--shadow-2);
      }
      html.dark .category-card.nav-active {
        box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.35), var(--shadow-2);
      }
      .view-card .grid {
        display: grid;
        grid-template-columns: repeat(var(--card-cols, 1), minmax(0, 1fr));
        gap: 18px;
        align-items: stretch;
      }
      .view-card .category-card {
        align-items: center;
        padding: 16px;
      }
      .view-card .category-title {
        margin: 0 auto 10px;
        position: relative;
        z-index: 2;
      }
      .view-card .category-spacer {
        height: 20px;
      }
      .view-card .category-title {
        pointer-events: none;
      }
      .view-card .card-page .app {
        position: relative;
        z-index: 3;
      }
      .view-card .card-hover-label {
        z-index: 120;
      }
      .view-card .category-grid {
        display: grid;
        align-items: start;
        justify-items: center;
        padding: 10px 6px 14px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: calc(var(--icon-size, 56px) + 22px);
        justify-content: center;
        gap: var(--grid-gap, 18px);
      }
      .view-card .icon-label-capsule {
        margin-top: 3px;
      }
      .view-card .app:hover .icon {
        transform: scale(1.18);
      }
      .card-pages {
        width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
        position: relative;
      }
      .card-pages-track {
        display: flex;
        width: 100%;
        transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
      }
      .card-page {
        min-width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--grid-gap, 18px);
        justify-items: center;
        grid-auto-rows: calc(var(--icon-size, 56px) + 22px);
        padding: 40px 6px 8px;
        overflow: visible;
      }
      .card-compact .icon-label-capsule {
        display: none !important;
      }
      .card-compact .category-grid,
      .card-compact .card-page {
        grid-auto-rows: calc(var(--icon-size, 56px) + 10px);
      }
      .card-hover-label {
        position: absolute;
        bottom: calc(100% + 4px);
        left: 50%;
        transform: translateX(-50%) translateY(4px);
        padding: 4px 10px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.55);
        color: #ffffff;
        font-size: 11px;
        line-height: 1;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 60;
        transition: opacity 0.2s ease, transform 0.2s ease;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
      }
      html.dark .card-hover-label {
        background: rgba(0, 0, 0, 0.5);
      }
      .card-compact .app:hover .card-hover-label {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
      }
      .card-compact .app {
        overflow: visible !important;
      }
      .card-compact .app.fisheye-active .card-hover-label {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
      }
      html.dark .category-card {
        background: var(--card);
        border: 1px solid rgba(255, 255, 255, 0.08);
      }
      .category-title {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 16px;
        border-radius: 999px;
        font-size: calc(var(--base-size) * 0.85);
        font-weight: var(--label-weight);
        min-width: 80px;
        background: rgba(15, 23, 42, 0.36);
        color: #ffffff;
        margin: 0;
        transition: all 0.25s ease;
        white-space: nowrap;
        width: fit-content;
        gap: 6px;
      }
      html.dark .category-title {
        background: rgba(255, 255, 255, 0.18);
        color: #ffffff;
      }
      .category-lock {
        font-size: 12px;
        line-height: 1;
      }
      .category-grid {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: var(--grid-gap, 18px);
        flex: 1;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 12px 14px 16px;
        justify-content: flex-start;
        width: 100%;
        margin: 0;
        pointer-events: auto;
      }
      .category-grid::-webkit-scrollbar {
        display: none;
      }
      .pagination-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
      }
      .pagination-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.4);
        transition: all 0.3s ease;
      }
      .pagination-dot.active {
        width: 20px;
        background: rgba(255, 255, 255, 0.85);
      }
      html.dark .pagination-dot {
        background: rgba(148, 163, 184, 0.4);
      }
      html.dark .pagination-dot.active {
        background: rgba(255, 255, 255, 0.9);
      }
      .page-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        height: 30px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.4);
        background: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        display: grid;
        place-items: center;
        color: #0f172a;
        cursor: pointer;
        transition: all 0.3s ease;
      }
      html.dark .page-arrow {
        background: rgba(15, 23, 42, 0.6);
        color: #f8fafc;
        border-color: rgba(255, 255, 255, 0.15);
      }
      .page-arrow.left {
        left: 10px;
      }
      .page-arrow.right {
        right: 10px;
      }
      .page-arrow.hidden {
        opacity: 0;
        pointer-events: none;
      }
      .app {
        text-decoration: none;
        color: inherit;
        text-align: center;
        display: grid;
        gap: 6px;
        justify-items: center;
        position: relative;
        overflow: visible !important;
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
      }
      .is-editing .category-grid,
      .is-editing .category-card,
      .is-editing .dock-grid,
      .is-editing .dock-item,
      .app-unlocked .category-grid,
      .app-unlocked .category-card,
      .app-unlocked .dock-grid,
      .app-unlocked .dock-item {
        pointer-events: auto !important;
        user-select: auto !important;
        -webkit-user-drag: element !important;
        cursor: grab !important;
      }
      .is-editing .category-grid:active,
      .is-editing .dock-grid:active,
      .app-unlocked .category-grid:active,
      .app-unlocked .dock-grid:active {
        cursor: grabbing !important;
      }
      .is-editing .icon {
        position: relative;
        z-index: 100;
      }
      .icon,
      .icon img {
        -webkit-user-drag: none;
      }
      .mode-sort .icon:hover,
      .mode-sort .app:hover .icon {
        transform: none !important;
        box-shadow: none !important;
      }
      body.mode-sort {
        scrollbar-width: none;
      }
      body.mode-sort::-webkit-scrollbar {
        display: none;
      }
      .mode-sort .category-grid {
        min-height: 50px;
      }
      .mode-sort .category-grid {
        min-height: 50px;
      }
      .mode-sort .app {
        transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
        will-change: transform;
      }
      .mode-sort .icon {
        transition: none !important;
      }
      .mode-sort .icon {
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        -webkit-box-reflect: none !important;
      }
      .mode-sort .dock-tooltip,
      .mode-sort .dock-label-capsule,
      .mode-sort .icon-label-capsule {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
      }
      .mode-sort .dock-item .icon {
        -webkit-box-reflect: none !important;
      }
      .mode-sort .app:not(.sortable-drag) {
        transform: none !important;
      }
      .mode-sort .app:not(.sortable-drag) .icon {
        transform: none !important;
        transition: none !important;
      }
      .mode-sort .app,
      .mode-sort .icon,
      .mode-sort .icon-item,
      .mode-sort .category-grid,
      .mode-sort .dock-grid,
      .mode-sort .category-card {
        pointer-events: auto !important;
        user-select: none !important;
        -webkit-user-drag: none !important;
        cursor: grab !important;
      }
      .mode-sort .dock-item {
        transform: translateY(0) scale(1) !important;
      }
      .mode-sort #dock-container,
      .mode-sort #dockGrid {
        pointer-events: auto !important;
      }
      .mode-sort .sortable-ghost {
        background: rgba(255, 255, 255, 0.45) !important;
        border: 2px dashed rgba(255, 255, 255, 0.6) !important;
        border-radius: 16px;
        opacity: 0.7 !important;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
      }
      .mode-sort .sortable-ghost .icon,
      .mode-sort .sortable-ghost .icon-label-capsule,
      .mode-sort .sortable-ghost .dock-tooltip,
      .mode-sort .sortable-ghost .label,
      .mode-sort .sortable-ghost img,
      .mode-sort .sortable-ghost svg,
      .mode-sort .sortable-ghost button {
        opacity: 0 !important;
        visibility: hidden !important;
      }
      html.dark .mode-sort .sortable-ghost {
        background: rgba(15, 23, 42, 0.5) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
        opacity: 0.75 !important;
      }
      .mode-sort .sortable-drag {
        opacity: 1 !important;
        background: transparent !important;
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.18));
        transition: none !important;
        animation: none !important;
        will-change: transform;
      }
      .mode-sort .sortable-fallback {
        position: fixed !important;
        margin: 0 !important;
        background: transparent !important;
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
        filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.25));
        border-radius: 16px;
        pointer-events: none !important;
        cursor: grabbing !important;
        transition: none !important;
        z-index: 99999 !important;
        will-change: transform;
      }
      .mode-sort .sortable-drag .icon {
        animation: none !important;
        transform: translateY(-6px) scale(1.08) !important;
      }
      .mode-sort .icon-item {
        touch-action: none;
      }
      .is-editing .icon,
      .is-editing .app {
        transform: none !important;
        transition: none !important;
      }
      .sort-unlocked .edit-badge,
      .sort-unlocked .delete-badge {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
      }
      .sortable-ghost,
      .sortable-drag,
      .sortable-chosen {
        z-index: 9999 !important;
      }
      .sortable-ghost,
      .sortable-fallback {
        pointer-events: none !important;
      }
      .mode-sort .sortable-chosen {
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
        border-radius: 16px;
      }
      .sortable-fallback {
        pointer-events: none !important;
        cursor: grabbing !important;
      }
      .sortable-drag {
        cursor: grabbing !important;
      }
      .mode-sort .sortable-fallback,
      .mode-sort .sortable-ghost {
        pointer-events: none !important;
      }
      .is-editing * {
        pointer-events: auto !important;
        user-select: auto !important;
        -webkit-user-drag: none !important;
      }
      .is-editing .category-title-capsule {
        z-index: 9999;
        cursor: grab;
      }
      .app-unlocked .category-grid,
      .app-unlocked .dock-grid,
      .app-unlocked .dock-item {
        user-select: auto !important;
        pointer-events: auto !important;
        cursor: grab;
      }
      .app-unlocked .category-grid:active,
      .app-unlocked .dock-grid:active,
      .app-unlocked .dock-item:active {
        cursor: grabbing;
      }
      .is-dragging .app:not(.sortable-drag) .icon {
        filter: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
      }
      .mode-sort .app:hover .icon-label-capsule {
        transform: none !important;
      }
      .is-dragging .app {
        opacity: 1;
      }
      .app-unlocked * {
        pointer-events: auto !important;
        user-select: none !important;
      }
      .icon {
        width: var(--icon-size, 40px);
        height: var(--icon-size, 40px);
        min-width: 32px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.86);
        border: 1px solid rgba(15, 23, 42, 0.16);
        box-shadow: var(--shadow);
        display: grid;
        place-items: center;
        font-size: 12px;
        font-weight: 700;
        color: #ffffff;
        overflow: visible;
        position: relative;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      }
      html.dark .icon {
        background: rgba(18, 28, 44, 0.72);
        border: 1px solid rgba(255, 255, 255, 0.14);
      }
      .icon.icon-fallback {
        font-size: calc(var(--icon-size, 40px) * 0.42);
        letter-spacing: 0.5px;
      }
      @keyframes jiggle {
        0% {
          transform: rotate(-1.5deg);
        }
        50% {
          transform: rotate(1.5deg);
        }
        100% {
          transform: rotate(-1.5deg);
        }
      }
      .jiggle .icon {
        animation: jiggle 0.2s ease-in-out infinite;
        transform-origin: 50% 60%;
      }
      .jiggle .icon:hover {
        transform: rotate(0deg);
      }
      .minus {
        position: absolute;
        left: 6px;
        top: 6px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #ff3b30;
        border: 2px solid #ffffff;
        box-shadow: 0 6px 12px rgba(16, 24, 40, 0.22);
        display: grid;
        place-items: center;
        color: #ffffff;
        font-weight: 700;
        font-size: 16px;
        border: none;
        cursor: pointer;
        z-index: 50;
        opacity: 0;
        pointer-events: none;
      }
      .edit-badge {
        position: absolute;
        right: 6px;
        top: 6px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #0a84ff;
        border: 2px solid #ffffff;
        box-shadow: 0 6px 12px rgba(16, 24, 40, 0.22);
        display: grid;
        place-items: center;
        color: #ffffff;
        font-weight: 700;
        font-size: 12px;
        border: none;
        cursor: pointer;
        z-index: 50;
        opacity: 0;
        pointer-events: none;
      }
        .edit-badge,
        .delete-badge {
          display: none !important;
        }
        .delete-bubble {
          position: absolute;
          left: 50%;
          bottom: -40px;
          transform: translateX(-50%);
          display: inline-flex;
          gap: 6px;
          padding: 6px 8px;
          border-radius: 999px;
          background: rgba(0, 0, 0, 0.75);
          color: #ffffff;
          font-size: 12px;
          z-index: 60;
          pointer-events: auto;
          backdrop-filter: blur(8px);
          -webkit-backdrop-filter: blur(8px);
          box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        }
        .delete-bubble button {
          border: none;
          background: transparent;
          color: #ffffff;
          font-weight: 600;
          padding: 2px 6px;
          border-radius: 999px;
          cursor: pointer;
        }
        .delete-bubble button.confirm {
          background: rgba(248, 113, 113, 0.2);
        }
        .delete-bubble button.cancel {
          background: rgba(148, 163, 184, 0.2);
        }
        .add-placeholder {
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          gap: 6px;
          cursor: pointer;
        }
        .add-placeholder .icon {
          border: 1px dashed rgba(148, 163, 184, 0.7);
          background: rgba(255, 255, 255, 0.25);
          color: #ffffff;
          font-size: 18px;
          font-weight: 600;
        }
        html.dark .add-placeholder .icon {
          border-color: rgba(148, 163, 184, 0.5);
          background: rgba(15, 23, 42, 0.4);
        }
        .category-add-card {
          min-height: 120px;
          display: flex;
          align-items: center;
          justify-content: center;
          padding: 20px 24px;
          border-radius: 22px;
          border: 1px dashed rgba(148, 163, 184, 0.6);
          background: rgba(255, 255, 255, 0.35);
          backdrop-filter: blur(14px);
          -webkit-backdrop-filter: blur(14px);
        }
        html.dark .category-add-card {
          border-color: rgba(148, 163, 184, 0.35);
          background: rgba(15, 23, 42, 0.45);
        }
        .category-add-card .add-category-btn {
          display: inline-flex;
          align-items: center;
          gap: 10px;
          padding: 10px 18px;
          border-radius: 999px;
          border: 1px solid rgba(255, 255, 255, 0.35);
          background: rgba(255, 255, 255, 0.35);
          color: #0f172a;
          font-weight: 600;
          cursor: pointer;
        }
        html.dark .category-add-card .add-category-btn {
          color: #f8fafc;
          background: rgba(15, 23, 42, 0.55);
          border-color: rgba(255, 255, 255, 0.15);
        }
        .dock-add-placeholder .icon {
          border: 1px dashed rgba(148, 163, 184, 0.7);
          background: rgba(255, 255, 255, 0.18);
          color: #ffffff;
          font-size: 18px;
          font-weight: 600;
        }
        html.dark .dock-add-placeholder .icon {
          border-color: rgba(148, 163, 184, 0.5);
          background: rgba(15, 23, 42, 0.4);
        }
      body.is-editing .app,
      body.is-deleting .app {
        animation: jiggle 0.2s ease-in-out infinite;
      }
      .rename-input {
        width: min(220px, 70vw);
        border: 1px solid rgba(148, 163, 184, 0.45);
        border-radius: 12px;
        padding: 4px 10px;
        font-size: 14px;
        background: rgba(255, 255, 255, 0.9);
      }
      html.dark .rename-input {
        background: rgba(15, 23, 42, 0.8);
        border-color: rgba(148, 163, 184, 0.3);
        color: #ffffff;
      }
      .editable {
        border-bottom: 1px dashed rgba(71, 85, 105, 0.6);
      }
      html.dark .editable {
        border-bottom-color: rgba(226, 232, 240, 0.6);
      }
      @keyframes wiggle {
        0% {
          transform: translateZ(0) rotate(0deg);
        }
        25% {
          transform: translateZ(0) rotate(-1.5deg);
        }
        50% {
          transform: translateZ(0) rotate(0deg);
        }
        75% {
          transform: translateZ(0) rotate(1.5deg);
        }
        100% {
          transform: translateZ(0) rotate(0deg);
        }
      }
      .sort-unlocked .icon {
        animation: wiggle 0.3s ease-in-out infinite;
        transform-origin: 50% 60%;
      }
      .sort-unlocked .sortable-drag .icon {
        animation: none !important;
      }
      .toast {
        position: fixed;
        top: 84px;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        padding: 8px 14px;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.85);
        color: #ffffff;
        font-size: 13px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 120;
      }
      .toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }
      body.modal-open {
        overflow: hidden;
      }
      body.scroll-locked {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
      }
      #settingsModal .sheet h2,
      #settingsModal .sheet .field label,
      #settingsModal .sheet .settings-row > span {
        color: #000000 !important;
        font-weight: var(--label-weight) !important;
      }
      html.dark #settingsModal .sheet h2,
      html.dark #settingsModal .sheet .field label,
      html.dark #settingsModal .sheet .settings-row > span {
        color: #f8fafc !important;
        font-weight: var(--label-weight) !important;
      }
      .edit-toolbar {
        position: fixed;
        top: 16px;
        left: 16px;
        right: 16px;
        z-index: 210;
        display: none;
        align-items: center;
        justify-content: flex-end;
        padding: 10px 14px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.45);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
      }
      html.dark .edit-toolbar {
        background: rgba(2, 6, 23, 0.6);
        border-color: rgba(148, 163, 184, 0.25);
      }
      .edit-toolbar.active {
        display: flex;
      }
      .icon .lock {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.6);
        display: grid;
        place-items: center;
      }
      .icon .lock svg {
        width: 11px;
        height: 11px;
        fill: #ffffff;
      }
      .icon img {
        width: 72%;
        height: 72%;
        object-fit: contain;
        display: block;
        border-radius: 16px;
        image-rendering: -webkit-optimize-contrast;
      }
      @media (hover: hover) {
        .app:hover .icon {
          transform: scale(1.15);
          box-shadow: 0 16px 36px rgba(16, 24, 40, 0.2);
        }
      }
      .icon-label-capsule {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 40px;
        height: calc(var(--base-size) * 1.2);
        background-color: rgba(15, 23, 42, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 9999px;
        padding: 2px 8px;
        margin-top: 4px;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.15);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
      }
      html.dark .icon-label-capsule {
        background-color: rgba(255, 255, 255, 0.22) !important;
        border-color: rgba(255, 255, 255, 0.28);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
      }
      .icon-label-text {
        color: #ffffff !important;
        font-size: calc(var(--base-size) * 0.7) !important;
        font-weight: var(--label-weight) !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
      }
      html.dark .icon-label-text {
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
      }
      .app:hover .icon-label-capsule {
        transform: scale(1.05);
        transition: transform 0.2s ease;
      }
      .dock {
        position: fixed;
        left: 50%;
        bottom: 24px;
        transform: translateX(-50%);
        width: max-content;
        max-width: 90vw;
        padding: 18px 24px;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.24);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
        overflow: visible;
      }
      html.dark .dock {
        background: rgba(20, 26, 36, 0.65) !important;
        border-color: rgba(255, 255, 255, 0.16);
      }
      .dock::-webkit-scrollbar {
        display: none;
      }
      .dock-empty {
        min-height: 100px;
      }
      .mode-sort .dock-full {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.55);
        border-color: rgba(239, 68, 68, 0.35);
      }
      .sort-unlocked #dock-container {
        min-height: 110px !important;
      }
      .dock-grid {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        flex-wrap: nowrap;
        width: max-content;
        overflow: visible;
      }
      .dock-add-placeholder .icon {
        color: rgba(248, 250, 252, 0.9);
      }
      .dock-item {
        width: 60px;
        height: 60px;
        aspect-ratio: 1 / 1;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        position: relative;
        overflow: visible;
        z-index: 2;
        transition: transform 0.2s ease-out;
      }
      @media (max-width: 640px) {
        .dock {
          max-width: 94vw;
          padding: 10px 12px;
          overflow-x: hidden;
        }
        .dock-grid {
          width: 100%;
          justify-content: space-evenly;
          gap: 10px;
        }
        .dock-item {
          width: clamp(40px, 12vw, 56px);
          height: clamp(40px, 12vw, 56px);
        }
        .dock-item .icon {
          padding: 8px;
        }
      }
      .dock-item .minus,
      .dock-item .edit-badge {
        z-index: 3;
      }
      .dock-item .icon {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        border-radius: 16px;
        padding: 10px;
        background: transparent;
        box-shadow: 0 8px 18px rgba(16, 24, 40, 0.18);
        -webkit-box-reflect: below 4px linear-gradient(transparent, rgba(255, 255, 255, 0.12));
        transition: background-color 0.2s ease;
      }
      .dock-item:hover .icon {
        background: rgba(255, 255, 255, 0.5);
      }
      .dock-item .icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 16px;
      }
      .dock .label {
        display: none;
      }
      .dock .icon-label-capsule {
        display: none;
      }
      .dock-label-capsule {
        position: absolute;
        bottom: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%) translateY(6px);
        padding: 4px 10px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.35);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #ffffff;
        font-size: 11px;
        line-height: 1;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 60;
        transition: opacity 0.2s ease, transform 0.2s ease;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
        transform: translateX(-50%) translateY(6px) translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
      }
      html.dark .dock-label-capsule {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(255, 255, 255, 0.22);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
      }
      .dock-item:hover .dock-label-capsule {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
      }
      
      .is-editing .dock .label,
      .is-deleting .dock .label {
        display: none;
      }
      .dock-placeholder {
        min-width: 240px;
        height: 64px;
        padding: 0 16px;
        border-radius: 16px;
        border: 1px dashed rgba(148, 163, 184, 0.6);
        color: #64748b;
        background: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: grid;
        place-items: center;
        cursor: pointer;
        font-size: 12px;
        text-align: center;
      }
      html.dark .dock-placeholder {
        border-color: rgba(148, 163, 184, 0.3);
        color: #e2e8f0;
        background: rgba(15, 23, 42, 0.5);
      }
      .dock-drop {
        border-color: rgba(59, 130, 246, 0.8);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
        transform: scale(1.02);
      }
      .actions {
        display: flex;
        gap: 10px;
      }
      .hidden {
        display: none;
      }
      }
      .page-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
      }
      .page-dot {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.6);
      }
      .page-dot.active {
        background: rgba(255, 255, 255, 1);
      }
      html.dark .page-dot {
        background: rgba(148, 163, 184, 0.5);
      }
      html.dark .page-dot.active {
        background: rgba(255, 255, 255, 0.9);
      }
      .select {
        position: relative;
      }
      .select-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        border-radius: 14px;
        border: 1px solid #cbd5e1;
        background: rgba(255, 255, 255, 0.9);
        color: #0f172a;
        cursor: pointer;
      }
      html.dark .select-btn {
        background: rgba(15, 23, 42, 0.8);
        color: #ffffff;
        border-color: rgba(148, 163, 184, 0.3);
      }
      .select-menu {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 8px);
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(226, 232, 240, 0.8);
        border-radius: 16px;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
        padding: 6px;
        display: none;
        z-index: 999 !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
      }
      html.dark .select-menu {
        background: rgba(15, 23, 42, 0.9);
        border-color: rgba(148, 163, 184, 0.3);
      }
      .select-menu.open {
        display: block;
      }
      .select-item {
        padding: 8px 10px;
        border-radius: 12px;
        cursor: pointer;
        color: #0f172a;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }
      html.dark .select-item {
        color: #ffffff;
      }
      .select-item:hover {
        background: rgba(59, 130, 246, 0.12);
      }
      .select-check {
        color: #2563eb;
        display: inline-flex;
      }
      .select-lock {
        margin-left: auto;
        color: #ef4444;
        font-size: 12px;
      }
      .select-manage {
        color: #2563eb;
      }
      .sheet.allow-overflow {
        overflow: visible;
      }
      .category-manager-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 12px;
      }
      .category-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 12px;
        border-radius: 14px;
        background: #f9fafb;
        border: 1px solid #e2e8f0;
      }
      .category-row .toggle {
        flex-shrink: 0;
      }
      html.dark .category-row {
        background: #1f2937;
        border-color: #334155;
      }
      .category-row:hover {
        background: #f1f5f9;
      }
      html.dark .category-row:hover {
        background: #111827;
      }
      .category-manager-list .category-name {
        color: #0f172a !important;
        font-weight: 700;
        opacity: 1 !important;
      }
      html.dark .category-manager-list .category-name {
        color: #f1f5f9 !important;
      }
      .category-actions {
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .icon-btn {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        border: none;
        display: grid;
        place-items: center;
        background: rgba(59, 130, 246, 0.12);
        color: #2563eb;
        cursor: pointer;
      }
      .icon-btn.danger {
        background: rgba(239, 68, 68, 0.15);
        color: #ef4444;
      }
      .icon-btn svg {
        width: 20px;
        height: 20px;
      }
      .btn {
        border: none;
        border-radius: 14px;
        padding: 10px 14px;
        font-size: 13px;
        cursor: pointer;
        background: rgba(255, 255, 255, 0.8);
        color: var(--text);
        box-shadow: 0 8px 20px rgba(16, 24, 40, 0.1);
        transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
      }
      .btn.primary {
        background: #0a84ff;
        color: #ffffff;
      }
      .theme-toggle {
        display: grid;
        place-items: center;
        cursor: pointer;
      }
      .theme-toggle svg {
        width: 22px;
        height: 22px;
        position: absolute;
        transition: opacity 0.25s ease, transform 0.25s ease;
      }
      .theme-toggle .sun {
        fill: #ffcc33;
        opacity: 1;
        transform: scale(1);
      }
      .theme-toggle .moon {
        fill: #7c6cff;
        opacity: 0;
        transform: scale(0.7);
      }
      .ios-bg {
        background: #ffffff;
      }
      html.dark .ios-bg {
        background: #111722;
      }
      .header-logo,
      .site-title,
      .category-card,
      .dock-container {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
      }
      input,
      textarea {
        user-select: text !important;
        -webkit-user-select: text !important;
      }
      .site-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 50;
        height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 24px;
        background: rgba(213, 220, 232, 0.72);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.28);
      }
      html.dark .site-header {
        background: rgba(20, 26, 36, 0.7);
        border-bottom: 1px solid rgba(255, 255, 255, 0.16);
      }
      .nav-header-bg {
        background: rgba(213, 220, 232, 0.72);
      }
      html.dark .nav-header-bg {
        background: rgba(20, 26, 36, 0.7);
      }
      #top-controls button {
        color: #0f172a;
      }
      #top-controls {
        align-items: center;
      }
      #top-controls button span,
      #top-controls button svg,
      #avatarText {
        color: #0f172a !important;
        filter: drop-shadow(0 1px 4px rgba(15, 23, 42, 0.25));
      }
      #top-controls .theme-toggle .sun {
        color: #facc15 !important;
        fill: #facc15;
        filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.4));
      }
      @media (max-width: 640px) {
        .mobile-preview-lock .app,
        .mobile-preview-lock .icon,
        .mobile-preview-lock .category-card,
        .mobile-preview-lock .dock-container,
        .mobile-preview-lock .category-title {
          -webkit-touch-callout: none;
          -webkit-user-select: none;
          user-select: none;
        }
      }
      #controlGroup.open {
        opacity: 1;
        pointer-events: auto;
        --tw-translate-y: 0px;
        --tw-scale-x: 1;
        --tw-scale-y: 1;
      }
      #menuToggle {
        z-index: 60;
      }
      #controlGroup {
        z-index: 50;
        opacity: 1;
        pointer-events: auto;
        transform: none;
      }
      #menuToggle.open [data-icon="menu"] {
        display: none;
      }
      #menuToggle.open [data-icon="close"] {
        display: block;
      }
      @media (max-width: 640px) {
        #controlGroup {
          top: calc(100% + 12px);
          right: 0;
          left: auto;
          opacity: 0;
          pointer-events: none;
          transform: translateY(8px) scale(0.96);
        }
        #loginBtn span,
        #registerBtn span {
          display: inline;
        }
      }
      @media (min-width: 768px) {
        #menuToggle {
          display: none;
        }
      }
      @media (max-width: 768px) {
        #viewToggleBtn {
          display: none !important;
        }
      }
      #avatarBtn {
        overflow: hidden;
        filter: none;
      }
      html.dark #top-controls button {
        color: #e2e8f0;
      }
      html.dark #top-controls button span,
      html.dark #top-controls button svg,
      html.dark #avatarText {
        color: #f8fafc !important;
        filter: drop-shadow(0 1px 4px rgba(255, 255, 255, 0.25));
      }
      html.dark #top-controls button:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.12);
      }
        .header-left {
          display: flex;
          align-items: center;
          gap: 8px;
          min-width: 0;
        }
      .title-group {
        display: flex;
        align-items: baseline;
        gap: 12px;
        min-width: 0;
      }
      .logo-mark {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: linear-gradient(135deg, #3b82f6, #60a5fa);
        color: #ffffff;
        display: grid;
        place-items: center;
        font-weight: 700;
        font-size: 18px;
        box-shadow: none;
        overflow: hidden;
      }
      .logo-mark.has-logo {
        background: transparent;
        position: relative;
        isolation: isolate;
      }
      .logo-mark.has-logo::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: rgba(255, 255, 255, 0.28);
        border: 1px solid rgba(255, 255, 255, 0.45);
        box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        z-index: 0;
      }
      html.dark .logo-mark.has-logo::before {
        background: rgba(15, 23, 42, 0.35);
        border-color: rgba(255, 255, 255, 0.18);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
      }
      .logo-mark img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        filter: none;
        box-shadow: none;
        background: transparent;
        mix-blend-mode: normal;
        position: relative;
        z-index: 1;
      }
      .logo-mark.has-logo img {
        object-fit: contain;
      }
      .site-title {
        font-size: calc(var(--base-size) * 1.35);
        font-weight: var(--title-weight);
        color: #0f172a;
        text-shadow: 0 2px 10px rgba(15, 23, 42, 0.22);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      html.dark .site-title {
        color: #f8fafc;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
      }
      .site-slogan {
        font-size: calc(var(--base-size) * 0.75);
        color: #5f6b7c;
        white-space: nowrap;
      }
      html.dark .site-slogan {
        color: #c0c8d6;
      }
      .mode-control {
        position: absolute;
        right: 0;
        top: 72px;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        opacity: 0;
        transform: translateY(-6px);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 9999;
        isolation: isolate;
        transform: translateY(-6px) translateZ(0);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }
      .mode-control.open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
      }
      html.dark .mode-control {
        background: rgba(15, 23, 42, 0.6);
        border-color: rgba(255, 255, 255, 0.12);
      }
      .mode-btn {
        border: none;
        background: transparent;
        color: #111827 !important;
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 999px;
        cursor: pointer;
        transition: all 0.2s ease;
        font-weight: 600 !important;
      }
      html.dark .mode-btn {
        color: #f1f5f9 !important;
      }
      .mode-btn.active {
        background: rgba(37, 99, 235, 0.35);
        color: #ffffff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
      }
      html.dark .mode-btn.active {
        background: rgba(37, 99, 235, 0.4);
        color: #ffffff;
      }
      @media (max-width: 640px) {
        .title-group {
          flex-direction: column;
          align-items: flex-start;
          gap: 4px;
        }
        .site-title {
          font-size: 18px;
        }
        .site-slogan {
          font-size: 11px;
        }
      }
      .header-right {
        display: flex;
        align-items: center;
        gap: 12px;
      }
      .main-content {
        padding-top: 160px;
      }
      .category-nav {
        display: flex;
        gap: 10px;
        align-items: center;
        overflow-x: auto;
        overflow-y: visible;
        white-space: nowrap;
        scrollbar-width: none;
        padding: 12px 18px;
        scroll-snap-type: none;
        scroll-behavior: auto;
      }
      .category-spacer {
        height: 24px;
        width: 100%;
      }
      .mode-sort .category-drag-handle {
        cursor: grab;
      }
      .category-card.category-empty {
        display: none;
      }
      #categoryNav {
        background-color: rgba(213, 220, 232, 0.72) !important;
        border: 1px solid rgba(255, 255, 255, 0.32);
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 18px;
      }
      html.dark #categoryNav {
        background-color: rgba(20, 26, 36, 0.7) !important;
        border-color: rgba(255, 255, 255, 0.16);
      }
      #categoryNav {
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
      }
      #categoryNav::-webkit-scrollbar {
        display: none;
      }
      .category-nav::-webkit-scrollbar {
        display: none;
      }
      .category-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(15, 23, 42, 0.12);
        padding: 6px 16px;
        border-radius: 999px;
        font-size: 14px;
        font-weight: 500;
        color: #334155;
        background: rgba(255, 255, 255, 0.4);
        cursor: pointer;
        position: relative;
        z-index: 1;
        transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, color 0.2s ease, background-color 0.2s ease;
        transform-origin: center center;
        will-change: transform;
        flex-shrink: 0;
      }
      .category-pill:hover {
        background: rgba(255, 255, 255, 0.75);
        transform: scale(1.25);
        z-index: 50;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
        color: #111827;
      }
      .category-pill.active {
        background: rgba(15, 23, 42, 0.9);
        color: #ffffff;
        border-color: transparent;
        box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2);
      }
      html.dark .category-pill {
        color: #e5e7eb;
        border-color: rgba(148, 163, 184, 0.35);
        background: rgba(255, 255, 255, 0.08);
      }
      html.dark .category-pill:hover {
        background: rgba(255, 255, 255, 0.16);
        color: #ffffff;
      }
      html.dark .category-pill.active {
        background: rgba(255, 255, 255, 0.92);
        color: #0f172a;
        border-color: transparent;
        box-shadow: 0 8px 16px rgba(15, 23, 42, 0.35);
      }
      .page-intro {
        padding-left: 24px;
        padding-right: 24px;
        margin-bottom: 12px;
      }
      html.dark .theme-toggle .sun {
        opacity: 0;
        transform: scale(0.7);
      }
      html.dark .theme-toggle .moon {
        opacity: 1;
        transform: scale(1);
        color: #818cf8;
        filter: drop-shadow(0 0 3px rgba(129, 140, 248, 0.5));
      }
      .modal {
        position: fixed;
        inset: 0;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 22px;
        background: transparent;
        z-index: 10000;
      }
      .modal .sheet {
        background-color: #ffffff !important;
      }
      html.dark .modal .sheet {
        background-color: rgba(15, 15, 18, 0.9) !important;
      }
      .modal label,
      .modal span,
      .modal p {
        color: #0f172a !important;
        font-weight: 500 !important;
        opacity: 1 !important;
      }
      html.dark .modal label,
      html.dark .modal span,
      html.dark .modal p {
        color: #ffffff !important;
        opacity: 1 !important;
      }
      .modal input,
      .modal textarea,
      .modal select {
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        background-color: #ffffff !important;
      }
      html.dark .modal input,
      html.dark .modal textarea,
      html.dark .modal select {
        border-color: #4b5563 !important;
        color: #ffffff !important;
        background-color: #1f2937 !important;
      }
      .modal input::placeholder,
      .modal textarea::placeholder {
        color: #94a3b8 !important;
        opacity: 1 !important;
      }
      html.dark .modal input::placeholder,
      html.dark .modal textarea::placeholder {
        color: #9ca3af !important;
        opacity: 1 !important;
      }
      .modal .btn.primary,
      .modal .btn.bg-blue-600,
      .modal button[type="submit"] {
        background-color: #2563eb !important;
        color: #ffffff !important;
        box-shadow: none !important;
      }
      .modal .btn.bg-slate-100 {
        color: #334155 !important;
        box-shadow: none !important;
        background-color: #f1f5f9 !important;
        opacity: 1 !important;
      }
      .modal.active {
        display: flex;
      }
      .modal-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 200;
      }
      .sheet {
        width: min(420px, 100%);
        background: rgba(255, 255, 255, 0.92);
        border-radius: 24px;
        padding: 20px;
        box-shadow: 0 18px 40px rgba(16, 24, 40, 0.22);
        border: 1px solid rgba(255, 255, 255, 0.6);
        transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
        position: relative;
        z-index: 201;
        max-height: 85vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
      }
      .sheet.glass {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
      }
      html.dark .sheet.glass {
        background: rgba(15, 15, 18, 0.85);
      }
      .modal-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
      }
      .modal-header h2 {
        margin: 0;
      }
      .back-btn {
        width: 32px;
        height: 32px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.6);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
      }
      html.dark .back-btn {
        background: rgba(0, 0, 0, 0.4);
        border-color: rgba(255, 255, 255, 0.12);
      }
      .sheet h2 {
        margin: 0 0 12px;
        font-size: calc(var(--base-size) * 1.15);
        font-weight: var(--title-weight);
      }
      .field {
        display: grid;
        gap: 6px;
        margin-bottom: 12px;
      }
      .field label {
        font-size: calc(var(--base-size) * 0.8);
        color: var(--muted);
        font-weight: var(--label-weight);
      }
      .field input {
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 14px;
        padding: 10px 12px;
        font-size: calc(var(--base-size) * 0.95);
        outline: none;
        background: rgba(255, 255, 255, 0.85);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-width: 0;
      }
      .field input[type="file"] {
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .toggle-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0 4px;
      }
      .toggle {
        position: relative;
        width: 48px;
        height: 28px;
      }
      .toggle input {
        opacity: 0;
        width: 0;
        height: 0;
      }
      .slider {
        position: absolute;
        inset: 0;
        background: #d5d7dc;
        border-radius: 999px;
        transition: 0.2s ease;
      }
      .slider::before {
        content: "";
        position: absolute;
        width: 24px;
        height: 24px;
        left: 2px;
        top: 2px;
        background: #ffffff;
        border-radius: 50%;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        transition: 0.2s ease;
      }
      .toggle input:checked + .slider {
        background: #34c759;
      }
      .toggle input:checked + .slider::before {
        transform: translateX(20px);
      }
      .sheet .footer {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 12px;
      }
      .settings-group {
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
      }
      .settings-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 10px 0;
        font-size: calc(var(--base-size) * 0.9);
      }
      .settings-row > span {
        font-weight: var(--label-weight);
      }
      .settings-row input[type="range"] {
        width: 160px;
        accent-color: #0a84ff;
      }
      .contact-pill {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        gap: 8px;
        padding: 6px 8px;
        border-radius: 18px;
        width: 100%;
        background: rgba(255, 255, 255, 0.6);
        color: #0f172a;
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(8px);
      }
      html.dark .contact-pill {
        background: rgba(15, 23, 42, 0.55);
        color: #f8fafc;
        border-color: rgba(255, 255, 255, 0.12);
        box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
      }
      .contact-hint {
        font-size: 12px;
        color: #64748b;
      }
      html.dark .contact-hint {
        color: #cbd5f5;
      }
      .contact-icon-btn {
        width: 100%;
        height: 44px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(15, 23, 42, 0.06);
        border: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
      }
      .contact-icon-btn img,
      .contact-icon-btn svg {
        width: 20px;
        height: 20px;
      }
      .contact-icon-btn:hover {
        transform: translateY(-1px) scale(1.03);
        box-shadow: 0 10px 18px rgba(15, 23, 42, 0.15);
      }
      html.dark .contact-icon-btn {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.12);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
      }
      .disabled {
        opacity: 0.5;
        pointer-events: none;
      }

      #avatarMenu {
        color: #0f172a;
        background: rgba(255, 255, 255, 0.94);
        border-color: rgba(15, 23, 42, 0.12);
      }
      #avatarMenu button,
      #avatarMenu div,
      #avatarMenu span {
        color: #0f172a !important;
      }
      #avatarMenu button:hover {
        background: rgba(15, 23, 42, 0.08) !important;
      }
      html.dark #avatarMenu {
        color: #f8fafc;
        background: rgba(15, 23, 42, 0.9);
        border-color: rgba(255, 255, 255, 0.14);
      }
      html.dark #avatarMenu button,
      html.dark #avatarMenu div,
      html.dark #avatarMenu span {
        color: #f8fafc !important;
        font-weight: 600;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
      }
      html.dark #avatarMenu button {
        background: rgba(147, 197, 253, 0.16) !important;
      }
      html.dark #avatarMenu button:hover {
        background: rgba(147, 197, 253, 0.28) !important;
      }
      html.dark #avatarMenu button:hover {
        background: rgba(255, 255, 255, 0.1) !important;
      }

      .url-row {
        display: flex;
        gap: 8px;
        align-items: center;
      }
      .protocol-toggle {
        display: inline-flex;
        border-radius: 12px;
        border: 1px solid rgba(15, 23, 42, 0.12);
        background: rgba(255, 255, 255, 0.7);
        overflow: hidden;
      }
      html.dark .protocol-toggle {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(15, 23, 42, 0.5);
      }
      .protocol-btn {
        border: none;
        padding: 8px 10px;
        font-size: 12px;
        cursor: pointer;
        background: transparent;
        color: #1f2937;
      }
      html.dark .protocol-btn {
        color: #e2e8f0;
      }
      .protocol-btn.active {
        background: #0f172a;
        color: #ffffff;
      }
      html.dark .protocol-btn.active {
        background: #e2e8f0;
        color: #0f172a;
      }

      /* Refined shadows: sharper, layered, less "blurry" */
      header,
      #categoryNav,
      .dock-container,
      .category-card,
      .sheet,
      .modal,
      .contact-pill {
        box-shadow: var(--shadow-1);
      }
      .icon-label-capsule,
      .contact-icon-btn {
        box-shadow: var(--shadow-1);
      }
      .app:hover .icon {
        box-shadow: var(--shadow-2);
      }
      .mode-sort .sortable-drag,
      .mode-sort .sortable-fallback {
        box-shadow: var(--shadow-3);
        filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.2));
      }
      .mode-sort .sortable-ghost {
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
      }
    
      [draggable="true"] {
        -webkit-user-drag: none !important;
      }
      .sortable-ghost {
        background: transparent !important;
        outline: none !important;
        border: 2px dashed rgba(255, 255, 255, 0.4) !important;
      }

      .is-visitor #settingsBtn,
      .is-visitor #sortLockBtn,
      .is-visitor #viewToggleBtn,
      .is-visitor #addBtn,
      .is-visitor #editToolbar,
      .is-visitor #modeControl,
      .is-visitor #avatarWrap {
        display: none !important;
      }
      .is-visitor .edit-badge,
      .is-visitor .delete-badge,
      .is-visitor .category-drag-handle {
        display: none !important;
      }

      @media (max-width: 640px) {
        .icon-btn {
          width: 44px;
          height: 44px;
          border-radius: 14px;
        }
        .btn {
          min-height: 44px;
        }
        .mode-btn {
          padding: 8px 12px;
          min-height: 36px;
        }
      }
