.disabled {
  /* 禁止鼠标点击、hover、跳转 */
  pointer-events: none;
  /* 置灰样式 */
  color: #999 !important;
  text-decoration: none;
  cursor: not-allowed;
}
.disabled::before {
    /* 灰色遮罩覆盖图片 */
    filter: grayscale(100%) brightness(0.8);
    /* 降低阴影弱化视觉层级 */
    box-shadow: 2px 2px 6px 1px rgb(0 0 0 / 20%);
}

.bg {
    position: fixed;
    height: 100vh;
    width: 100vw;
    user-select: none;
    -webkit-user-drag: none;
    z-index: -1;
}

.bg img {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    object-fit: cover;
    height: 100%;
    width: 100%;
    position: absolute;
    transition: opacity 0.3s ease;
    max-width: 100%;
}

*,
body,
html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

section {
    position: fixed;
    width: 100vw;
    height: 100vh;
    background-color: #afafaf1a;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 900;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 分页翻页按钮 */
.page-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease, background 0.3s ease, transform 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.page-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}
.page-btn:active {
    transform: translateY(-50%) scale(0.92);
}
.page-prev { left: 1rem; }
.page-next { right: 1rem; }

/* 视口：只显示当前页 */
.apps-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

/* 宽屏：原生 macOS Launchpad 4列布局 完全保留 */
.apps {
    display: flex;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    will-change: transform;
}

/* 每一页都是独立的 grid */
.apps-page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 4rem;
    align-content: center;
    justify-items: center;
    align-items: start;
    overflow: hidden;
}

/* 单个APP项：图标 + 外部文字 垂直排列 */
.apps a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    text-align: center;
    border: none;
    outline: none;
    padding-top: 2rem;
    padding-bottom: 2rem;
    width: 100%;
    transition: transform 0.25s ease;
}
.apps a:active {
    transform: scale(0.94);
}

/* 分页圆点指示器 */
.page-dots {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}
.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, width 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}
.page-dot.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}
.page-dot:hover {
    background: rgba(255, 255, 255, 0.75);
}

/* 单独控制图标尺寸与背景 */
.apps a::before {
    content: "";
    width: 7rem;
    height: 7rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
    box-shadow: 4px 4px 10px 2px rgb(0 0 0 / 45%);
    border-radius: 15%;
    background-color: #f5f5f5;
}

footer {
    position: fixed;
    bottom: 0;
    right: 2rem;
    /* width: 100vw; */
    height: 1.6rem;
    z-index: 999;
}
footer a {
    color: #fff;
    text-decoration: none;
    font-size: 0.6rem;
    border: none;
    outline: none;
}

/* 平板窄屏：iOS 桌面风格 */
@media (max-width: 1024px) {
    .apps-page {
        grid-template-columns: repeat(4, 1fr);
        padding: 2rem 1rem;
        gap: 1.5rem;
    }

    .apps a::before {
        width: 5rem;
        height: 5rem;
    }

    .apps a {
        font-size: 0.9rem;
        gap: 0.4rem;
    }

    .page-btn {
        width: 38px;
        height: 38px;
    }
    .page-prev { left: 0.5rem; }
    .page-next { right: 0.5rem; }

    .page-dots {
        bottom: 1.8rem;
    }
}

/* 手机小屏：iOS 紧凑桌面 */
@media (max-width: 480px) {
    .apps-page {
        grid-template-columns: repeat(4, 1fr);
        padding: 1.5rem 0.5rem;
        gap: 0.8rem 0.3rem;
    }

    .apps a::before {
        width: 3.8rem;
        height: 3.8rem;
    }

    .apps a {
        font-size: 0.8rem;
        gap: 0.3rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .page-btn {
        width: 34px;
        height: 34px;
        opacity: 0.85 !important;
    }
    .page-prev { left: 0.3rem; }
    .page-next { right: 0.3rem; }

    .page-dots {
        bottom: 1.2rem;
    }
}

/* 密码锁屏（盖住全部内容，z-index 高于 section 与聊天组件） */
.lock {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, #3b43b8 0%, #2a308d 42%, #141a52 100%);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.lock.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.lock-card {
    width: min(90vw, 340px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    padding: 2.2rem 1.8rem;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.lock-title {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}
.lock-sub {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    margin-bottom: 1.6rem;
}
.lock-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    outline: none;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}
.lock-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.lock-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
}
.lock-remember {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.9rem 0 1.2rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.lock-remember input {
    cursor: pointer;
}
.lock-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #4a52e0, #2a308d);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.lock-btn:hover { filter: brightness(1.1); }
.lock-btn:active { transform: scale(0.97); }
.lock-error {
    min-height: 1.2rem;
    margin-top: 0.8rem;
    color: #ff8f8f;
    font-size: 0.8rem;
}