/* 新增：定义CSS变量，用于动态切换颜色 */
:root {
    --key-text-color: #000000;
    /* 默认按键数字颜色：黑色 */
    --dot-border-color: #000000;
    /* 默认指示点边框颜色：黑色 */

    /* 页面可用高度 */
    --HtmlCanUserHeight: 100vh;
    --HtmlCanUserWidth: 100vw;
}

/* 定义中文字体（指定支持的中文字符范围） */
@font-face {
    font-family: "文鼎PL简报宋";
    src: url("./font/文鼎PL简报宋.ttf") format("truetype");
    /* 仅匹配中文字符（Unicode范围） */
    unicode-range: U+4E00-U+9FFF, U+3400-U+4DBF, U+20000-U+2A6DF, U+2A700-U+2B73F, U+2B740-U+2B81F, U+2B820-U+2CEAF, U+F900-U+FAFF, U+2F800-U+2FA1F;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "文鼎PL简报宋";
    -webkit-tap-highlight-color: transparent;
    /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; */
}

body {
    height: var(--HtmlCanUserHeight);
    overflow: hidden;
    background: #ffffff;
    max-width: 428px;
    margin: 0 auto;
    position: relative;
}

/* 选择所有按钮，或指定类名的按钮 */
button,
.btn-no-default {
    /* 关键：取消点击时的默认外边框 */
    outline: none;
}

button::-moz-focus-inner,
.btn-no-default::-moz-focus-inner {
    /* 清除Firefox中按钮内部的默认内边距和边框 */
    border: 0;
    padding: 0;
}

button,
.btn-no-default {
    /* 取消移动端点击高亮（iOS/WebKit浏览器） */
    -webkit-tap-highlight-color: transparent;
    /* 可选：统一鼠标样式（非必须，按需添加） */
    cursor: pointer;
}

/* 锁屏界面 */
.lock-screen {
    width: 100%;
    height: 100%;
    background: url('./images/BiZhiBeiJing.jpg') center/cover no-repeat;
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

/* 状态栏 - 完全还原iPhone样式 */
.status-bar {
    position: relative;
    height: 6vh;
    padding: 0 7%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--key-text-color);
    font-size: 14px;
}

.status-bar-left {
    display: flex;
    gap: 4px;
}

.signal {
    width: 18px;
    height: 11px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 11'%3E%3Cpath fill='white' d='M1 8L3 11H5L2 7L1 8ZM7 5L9 8H11L8 4L7 5ZM13 2L15 5H17L14 1L13 2Z'/%3E%3C/svg%3E") no-repeat center;
}

.carrier {
    line-height: 1;
    font-size: 1.9vh;
}

.battery {
    width: 9vw;
    height: 2vh;
    position: relative;
    top: 0;
    left: 0;
    border-radius: 10px;
    text-align: center;
    margin-right: 2%;
    /* line-height: 3vh; */
    /* overflow: hidden; */
}

.BatteryLevel {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(9vw + .375rem);
    height: 2vh;
    text-align: center;
    line-height: 2.5vh;
    z-index: 1;
}

.battery_long {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 80%;
    height: 2vh;
    background: #bfffeb;
    border-radius: 15px 3px 3px 15px;
    z-index: -1;
}

.battery::before {
    content: '';
    position: absolute;
    width: 9vw;
    height: 2vh;
    border: 2px solid var(--dot-border-color);
    border-radius: 15px;
    /* box-sizing: border-box; */
    top: 0;
    left: 0;
}

/* .battery::after {
            content: '';
            position: absolute;
            width: 3px;
            height: 6px;
            background: var(--dot-border-color);
            border-radius: 0 2px 2px 0;
            top: 4px;
            right: 0;
        } */

/* 时间和日期区域 */
.time-container {
    padding: 0 20px 30px;
    text-align: center;
}

.time {
    font-size: 10vh;
    font-weight: 300;
    /* color: var(--key-text-color); */
    color: #000000;
    /* text-shadow: 0 1px 5px rgba(0, 0, 0, 0.74); */
}

.date {
    font-size: 2vh;
    color: var(--key-text-color);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* 底部快捷方式 */
.lock-bottom {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    margin-top: auto;
}

.lock-shortcut {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.lock-shortcut svg {
    width: 28px;
    height: 28px;
}

.shortcut-icon {
    width: 100%;
    height: 100%;
}

/* 密码输入区域 */
.password-section {
    position: absolute;
    top: calc(44px + 10vh + 2vh + 30px + 4vh);
    left: 0;
    width: 100%;
    padding: 0 20px;
}

.password-title {
    color: var(--key-text-color);
    text-align: center;
    font-size: 2vh;
    margin-bottom: 1vh;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.password-dots {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
}

/* 关键修改：使用CSS变量控制指示点边框颜色 */
.password-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--dot-border-color);
    transition: all 0.2s ease;
}

.password-dot.filled {
    background: var(--key-text-color);
    transform: scale(1.1);
}

/* 错误提示：初始隐藏，显示时block */
.error-message {
    color: #ff3b30;
    text-align: center;
    font-size: 15px;
    height: 20px;
    margin-bottom: 10px;
    opacity: 0;
    display: none;
    transition: opacity 0.2s ease;
}

.error-message.show {
    opacity: 1;
    display: block;
}

/* iPhone风格数字键盘 */
.num-keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

/* 关键修改：使用CSS变量控制按键数字颜色 */
.key {
    width: 10vh;
    margin: 2% 3%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.688);
    backdrop-filter: blur(2px);
    border: none;
    color: var(--key-text-color);
    /* 动态颜色变量 */
    font-size: 32px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(98, 98, 98, 0.3);
    transition: all 0.15s ease;
}

.key:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.key.delete {
    font-size: 24px;
}

/* 底部滑动条 */
.slide-indicator {
    width: 60px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 0 auto 15px;
}

/* 桌面界面 */
.desktop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--HtmlCanUserHeight);
    /* background: url(https://c-ssl.duitang.com/uploads/blog/202309/16/jJS10WAJseOoWL3.jpg); */
    background-size: cover;
    backdrop-filter: blur(5px);
    background-position: center;
    z-index: 50;
    display: none;
}

/* 伪元素作为背景层 */
.desktop::before {
    content: "";
    /* 伪元素必须有content */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 背景图 */
    background-image: url('./images/BiZhiBeiJing.jpg');
    background-size: cover;
    /* 背景图透明度 */
    /* opacity: 0.5;  */
    /* filter: blur(1px); */
    /* 确保背景在内容下方 */
    z-index: -1;
}

/* .battery_long {
            width: 80%;
            height: 100%;
            background: var(--key-text-color);
            border-radius: 0 5px 5px 0;
        } */

/* 桌面状态栏（深色） */
.desktop .status-bar {
    /* background: #f5f5f7; */
    color: #000;
    font-weight: 700;
}

.desktop .signal,
.desktop .battery::before,
.desktop .battery::after {
    /* filter: invert(1); */
}

/* Swiper 桌面滑动 */
.swiper-container {
    width: 100%;
    height: calc(100% - 20vh);
    /* 减去状态栏和dock */
    /* margin-top: 44px; */
}

.swiper-slide {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
}

/* 应用图标网格 */
.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* border-radius: 50%; */
    border-radius: 10px;
    overflow: hidden;
    padding: 5px 0;
}

.app-icon img {
    width: 13vw;
    height: 13vw;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(88, 88, 88, 0.1);
    background-color: #fff;
}

.app-name {
    font-size: 1.8vh;
    font-weight: 500;
    color: #000;
    margin-top: 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 20vw;
    margin-top: 1.2vh;
}

/* iPhone底部Dock栏 */
.dock {
    position: absolute;
    bottom: 2vh;
    left: 5%;
    width: 90%;
    height: 10vh;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    background: rgba(255, 255, 255, 0.615);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 5%;
    box-shadow: 0 2px 2px #e7e7e7;
}

.dock-app {
    width: 8vh;
    height: 8vh;
    border-radius: 10px;
    /* background: #fff; */
    display: flex;
    align-items: center;
    justify-content: center;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); */
}

.dock-app img {
    width: 13vw;
    height: 13vw;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
}

/* 页面指示器 */
.page-dots {
    position: absolute;
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
}

.page-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
}

.page-dot.active {
    background: rgba(0, 0, 0, 0.6);
}

.time-status {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 44px;
    line-height: 44px;
    text-align: center;
}

.appPage {
    position: fixed;
    top: 0;
    left: 0;
    width: 13vw;
    height: 13vw;
    background: #fff;
    border-radius: 20%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 200;
    opacity: 0;
}

.openCurrentApp {
    /* transform: 'translate(-50%, -50%)'; */
    width: 100vw;
    height: var(--HtmlCanUserHeight);
    border-radius: 5%;
    transition: inherit 0.1s inherit;
    opacity: 1;

}

/* 1. 后台管理容器（核心：居中+不铺满+圆角） */
/* 1. 后台管理容器（核心：居中+不铺满+圆角） */
.app-background {
    position: fixed;
    top: 0;
    /* 上下留空，不贴边 */
    left: 0;
    right: 0;
    margin: 0;
    /* 水平居中 */
    width: 100vw;
    /* 宽度小于屏幕，不铺满 */
    height: var(--HtmlCanUserHeight);
    /* 高度小于屏幕 */
    background: rgba(0, 0, 0, 0.759);
    backdrop-filter: blur(10px);
    /* border-radius: 30px; */
    /* 大圆角，贴近原生 */
    /* box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); */
    z-index: 180;
    /* 层级：高于桌面(50)，低于APP页面(200) */
    display: none;
    overflow: hidden;
    opacity: 0;
    /* transition: opacity 0.3s ease; */
    transition: all 0.3s ease;
}

/* 后台容器显示状态 */
.app-background.show {
    display: block;
    opacity: 1;
}

/* 2. 已打开APP横向容器（支持左右滑动） */
.background-app-container {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--HtmlCanUserWidth);
    height: var(--HtmlCanUserHeight);
    display: flex;
    align-items: center;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 0 10vw;
    /* 左右各留10vw，让卡片居中且边距一致 */
    justify-content: flex-start;
    scroll-padding: 0 10vw;
    /* 滚动吸附时的内边距，确保最后一个卡片也能居中 */
}

/* 3. 后台APP卡片样式（与过渡动画尺寸匹配） */
.background-app-card {
    flex: 0 0 80vw;
    /* 固定宽度，不收缩不放大 */
    width: 80vw;
    height: 80%;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    scroll-snap-align: center;
    /* 卡片滑动后吸附到容器中心 */
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin: 0;
    /* 新增：确保滑动时不影响其他元素布局 */
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform: translateY(0);
    /* 初始位置 */
    /* 去掉自动居中的margin，由容器padding控制居中 */
}

/* 滑动过程中临时添加的类（用于动画过渡） */
.background-app-card.sliding {
    transition: none;
    /* 滑动时取消过渡，跟随手指实时变化 */
}

/* 卡片点击反馈 */
.background-app-card:active {
    transform: scale(0.98);
}

/* 完全可见时的激活状态（略大） */
.background-app-card.active {
    transform: scale(1.04);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    /* 增强阴影突出显示 */
}

/* 卡片内APP图标（顶部导航栏） */
.card-header {
    height: 50px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 10px;
}

.card-name {
    font-size: 16px;
    font-weight: 500;
    color: #000;
}

/* 卡片内APP内容区（模拟APP页面） */
.card-content {
    /* height: calc(100% - 50px); */
    height: 100%;
    display: flex;
    flex-direction: column;
    /* align-items: center;
            justify-content: center; */
    /* padding: 20px; */
}

/* 4. APP页面过渡动画基础样式（关键） */
.appPage {
    position: fixed;
    top: 0;
    left: 0;
    width: 13vw;
    height: 13vw;
    background: #fff;
    border-radius: 20%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 200;
    opacity: 0;
    /* 统一过渡属性，确保动画流畅 */
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease,
        border-radius 0.3s ease, opacity 0.3s ease;
}

/* APP全屏状态 */
.appPage.openCurrentApp {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    opacity: 1;
}

/* 5. 后台提示文字（滑动提示） */
.background-tip {
    position: fixed;
    bottom: 10vh;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #888;
    z-index: 170;
    display: none;
}

.background-tip.show {
    display: block;
}

/* iPhone风格系统通知栏 */
.notification-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 12px 16px;
    z-index: 300;
    /* 层级最高，覆盖所有内容 */
    pointer-events: none;
    /* 不影响下层点击 */
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(-100%);
    /* 默认隐藏在顶部 */
    opacity: 0;
}

/* 通知弹窗样式（iPhone原生风格） */
.notification {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    /* 自身可点击 */
}

/* 通知左侧APP图标 */
.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    /* iPhone图标圆角 */
    object-fit: cover;
    margin-right: 12px;
    background: #f5f5f7;
}

/* 通知中间内容区 */
.notification-content {
    flex: 1;
    overflow: hidden;
}

/* APP名称（标题） */
.notification-app {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 通知内容 */
.notification-text {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 通知右侧时间 */
.notification-time {
    font-size: 12px;
    color: #888;
    margin-left: 10px;
    white-space: nowrap;
}

/* 通知显示动画（从顶部滑入） */
.notification-container.show {
    transform: translateY(44px);
    /* 避开状态栏高度（44px） */
    opacity: 1;
}

/* 通知隐藏动画 */
.notification-container.hide {
    transform: translateY(-100%);
    opacity: 0;
}

/* 灵动岛样式 */
.Dynamic_Island {
    display: flex;
    align-items: center;
    position: fixed;
    top: 1vh;
    left: 31vw;
    min-width: 38vw;
    height: 4vh;
    background: #000;
    border-radius: 1.875rem;
    box-shadow: 0 .1875rem .3125rem #666666;
    transition: inherit 2s;
    animation: Dynamic_IslandAnimation 2s ease-in infinite both;
}

@keyframes Dynamic_IslandAnimation {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.Dynamic_Island_defaultTime {
    background: transparent;
    color: #bfffeb;
    line-height: 4vh;
    padding: 0 10%;
    font-size: 2.2vh;
    font-family: "微软雅黑";
    width: max-content;
}

.Dynamic_Island_eyes {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 5%;
    /* margin-top: 3%; */
}

.Dynamic_Island_eye {
    width: 1.5vh;
    height: 1.5vh;
    border-radius: 50%;
    background: #e8fff8;
    margin-right: 0.6vh;
}

.Dynamic_Island_eye_one {
    transition: ease-in 2s;
    animation: Dynamic_Island_eyeOneAnimation 2s ease-in 1s infinite forwards;
}

@keyframes Dynamic_Island_eyeOneAnimation {
    0% {
        transform: scale(1) translateX(0vh) translateY(0vh);
    }

    25% {
        transform: scale(1.05) translateX(0.3vh) translateY(0.3vh);
    }

    50% {
        transform: scale(1.1) translateX(0.6vh) translateY(0vh);
        opacity: 0.5;
    }

    75% {
        transform: scale(1.05) translateX(0.3vh) translateY(-0.3vh);
    }

    100% {
        transform: scale(1) translateX(0vh) translateY(0vh);
    }
}

.Dynamic_Island_eye_two {
    transition: ease-in 2s;
    animation: Dynamic_Island_eyeTwoAnimation 2s ease-in 2s infinite forwards;
}

@keyframes Dynamic_Island_eyeTwoAnimation {
    0% {
        transform: scale(1) translateX(0vh) translateY(0vh);
    }

    25% {
        transform: scale(1.05) translateX(0.3vh) translateY(0.3vh);
    }

    50% {
        transform: scale(1.1) translateX(0.6vh) translateY(0vh);
        opacity: 0.5;

    }

    75% {
        transform: scale(1.05) translateX(0.3vh) translateY(-0.3vh);
    }

    100% {
        transform: scale(1) translateX(0vh) translateY(0vh);
    }
}

.AppContentArea{
    width: 100%;
    height: var(--HtmlCanUserHeight);
}