/* =========================================
   3D 悬浮图案 · 液态水晶透镜 App 图标系统
   ========================================= */
.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    position: relative;
    transition: transform 0.25s var(--smooth-ease);
    width: 100%;
    height: 100%;
}

.app-tight-top,
.app-tight-bottom {
    justify-content: center !important;
    padding: 0 !important;
}

.app-item:active .app-icon {
    transform: scale(0.92);
}

/* =========================================================
   visionOS 空间计算级 · 顶级微晶玻璃图标系统
   ========================================================= */
.app-icon {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    
    /* 克制纯净的高透底色 */
    background: rgba(255, 255, 255, 0.035) !important;
    
    /* 空间光学透镜物理折射 */
    backdrop-filter: url(#lens-refraction) blur(1.5px) saturate(180%);
    -webkit-backdrop-filter: url(#lens-refraction) blur(1.5px) saturate(180%);
    
    /* 0.3px 极细光学微晶光边 */
    border: 0.5px solid rgba(255, 255, 255, 0.18) !important;
    border-top: 0.75px solid rgba(255, 255, 255, 0.4) !important;

    /* 双层微晶内发光 + 空间悬浮大投影 */
    box-shadow: 
        inset 0 0.8px 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 2px 0 rgba(255, 255, 255, 0.08),
        0 14px 32px -6px rgba(0, 0, 0, 0.45);

    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 顶部精密光学反光斜条 */
.app-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    border-radius: 17px 17px 50px 50px / 17px 17px 20px 20px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.0) 100%
    );
    pointer-events: none;
}

/* 高定纯线条艺术符号容器 (放大至 40px，兼具大气与优雅呼吸感) */
.floating-glyph {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: transform 0.22s ease;
}

.floating-glyph svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.25s ease;
}

/* 高定主线条 */
.stroke-primary {
    stroke: #F0F0F5 !important;
    stroke-width: 1.35 !important;
    fill: none !important;
    transition: stroke 0.25s ease;
}

/* 次级辅助细线 */
.stroke-secondary {
    stroke: rgba(240, 240, 245, 0.45) !important;
    stroke-width: 1.05 !important;
    fill: none !important;
    transition: stroke 0.25s ease;
}

/* 负空间修饰点 */
.fill-solid {
    fill: #F0F0F5 !important;
    stroke: none !important;
    transition: fill 0.25s ease;
}

/* 现代先锋十字星芒 */
.star-solid-translucent {
    stroke: #F0F0F5 !important;
    stroke-width: 1.1 !important;
    stroke-linecap: round;
    fill: none !important;
    opacity: 0.9;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.6)) !important;
    transition: all 0.25s ease;
}

/* 判定为深色背景：高定纯白/银灰细线 */
.adaptive-dark .stroke-primary {
    stroke: #FFFFFF !important;
}
.adaptive-dark .stroke-secondary {
    stroke: rgba(255, 255, 255, 0.45) !important;
}
.adaptive-dark .fill-solid {
    fill: #FFFFFF !important;
}
.adaptive-dark .star-solid-translucent {
    stroke: #FFFFFF !important;
}
.adaptive-dark .floating-glyph svg {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.75)) !important;
}
.adaptive-dark .app-label,
.adaptive-dark.app-label {
    color: rgba(255, 255, 255, 0.85) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85) !important;
}

/* 判定为浅色背景：高定碳黑细线 */
.adaptive-light .stroke-primary {
    stroke: #1E1E24 !important;
}
.adaptive-light .stroke-secondary {
    stroke: rgba(30, 30, 36, 0.4) !important;
}
.adaptive-light .fill-solid {
    fill: #1E1E24 !important;
}
.adaptive-light .star-solid-translucent {
    stroke: #1E1E24 !important;
}
.adaptive-light .floating-glyph svg {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18)) !important;
}
.adaptive-light .app-label,
.adaptive-light.app-label {
    color: #1E1E24 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9) !important;
}

/* 强制模式支持 (Force Dark / Light / Custom) */
.force-dark .stroke-primary,
.force-dark .star-solid-translucent { stroke: #1E1E24 !important; }
.force-dark .stroke-secondary { stroke: rgba(30, 30, 36, 0.4) !important; }
.force-dark .fill-solid { fill: #1E1E24 !important; }
.force-dark .app-label { color: #1E1E24 !important; text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9) !important; }

.force-light .stroke-primary,
.force-light .star-solid-translucent { stroke: #FFFFFF !important; }
.force-light .stroke-secondary { stroke: rgba(255, 255, 255, 0.45) !important; }
.force-light .fill-solid { fill: #FFFFFF !important; }
.force-light .app-label { color: rgba(255, 255, 255, 0.85) !important; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85) !important; }

.force-custom .stroke-primary,
.force-custom .star-solid-translucent { stroke: var(--custom-icon-color, #ffffff) !important; }
.force-custom .stroke-secondary { stroke: var(--custom-icon-color, #ffffff) !important; opacity: 0.6; }
.force-custom .fill-solid { fill: var(--custom-icon-color, #ffffff) !important; }
.force-custom .app-label { color: var(--custom-icon-color, #ffffff) !important; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85) !important; }
/* Dock 栏图标 (强制锁定 1:1 正方形比例，彻底消除被压扁现象) */
.dock .app-item {
    height: 56px !important;
    width: 56px !important;
    min-width: 56px !important;
    flex-shrink: 0 !important;
}

.dock .app-icon {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    border-radius: 17px !important;
    aspect-ratio: 1 / 1 !important;
}

.dock .app-label {
    display: none !important;
}

.app-label {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    max-width: 64px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    letter-spacing: -0.1px;
    transition: all 0.25s ease;
    color: var(--app-name-color, inherit) !important;
}

/* 当开启自动检测时，App 名字随背景明暗自适应高灵敏变色 */
.adaptive-dark .app-label {
    color: rgba(255, 255, 255, 0.88) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85) !important;
}

.adaptive-light .app-label {
    color: #121216 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9) !important;
}
/* 浅色模式下分页指示点（pagination dots）显式适配 */
.phone-container.theme-light .pagination-dots .dot,
.phone-container.theme-light .dots-container .dot,
.phone-container.theme-light .pagination-dot {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 0.5px solid rgba(0, 0, 0, 0.15) !important;
}

.phone-container.theme-light .pagination-dots .dot.active,
.phone-container.theme-light .dots-container .dot.active,
.phone-container.theme-light .pagination-dot.active {
    background: #000000 !important;
    border-color: #000000 !important;
}

/* 全局编辑模式通知横幅样式（纯方形半透明矩形，背景加载指定图片，上移并渐显） */
.global-edit-toast {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px) scale(0.95);
    background: linear-gradient(rgba(10, 10, 12, 0.5), rgba(10, 10, 12, 0.5)), url('/assets/杂七杂八/编辑中弹窗.jpg');
    background-size: cover;
    background-position: center;
    border: 0.5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.global-edit-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}
.global-edit-toast svg { stroke: #fff; flex-shrink: 0; }

/* 浅色模式下分页添加按钮（add-page-btn）自适应样式 */
.phone-container.theme-light .add-page-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.02) 100%) !important;
    border: 0.5px solid rgba(0, 0, 0, 0.15) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.25) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
}
.phone-container.theme-light .add-page-btn svg {
    stroke: #000000 !important;
}

/* =========================================
   全新设计的精致分页指示点系统 (Noir Dots)
   ========================================= */
#dotsContainer,
.dots-container,
.pagination-dots {
    position: relative !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    height: 16px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3) !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: all 0.4s ease !important;
}

.phone-container.theme-light #dotsContainer,
.phone-container.theme-light .dots-container,
.phone-container.theme-light .pagination-dots {
    background: rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05) !important;
}

#dotsContainer .dot,
.dots-container .dot,
.pagination-dots .dot,
.pagination-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.35) !important;
    border: 0.5px solid rgba(0, 0, 0, 0.3) !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    display: inline-block !important;
    opacity: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.phone-container.theme-light #dotsContainer .dot,
.phone-container.theme-light .dots-container .dot,
.phone-container.theme-light .pagination-dots .dot,
.phone-container.theme-light .pagination-dot {
    background: rgba(0, 0, 0, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

#dotsContainer .dot.active,
.dots-container .dot.active,
.pagination-dots .dot.active,
.pagination-dot.active {
    width: 20px !important;
    height: 6px !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(255,255,255,0.5) !important;
}

.phone-container.theme-light #dotsContainer .dot.active,
.phone-container.theme-light .dots-container .dot.active,
.phone-container.theme-light .pagination-dots .dot.active,
.phone-container.theme-light .pagination-dot.active {
    background: #000000 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
}

/* 进入编辑模式（edit-mode）时，每个 App 图标边缘泛起轻盈淡雅的粉色发光 */
.phone-container.edit-mode .app-icon {
    box-shadow: 
        0 0 8px rgba(255, 150, 200, 0.2), 
        inset 0 0 4px rgba(255, 150, 200, 0.12),
        0 14px 32px -6px rgba(0, 0, 0, 0.45) !important;
    border-color: rgba(255, 180, 220, 0.22) !important;
}
/* 拖拽时跟随手指的浮空图标：固定定位、不占布局、不接收点击 */
.drag-avatar {
    position: fixed;
    left: 0;
    top: 0;
    margin: 0;
    z-index: 99999;
    pointer-events: none;
    transform-origin: center center;
    will-change: transform;
    opacity: 0.92;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.45));
}