:root {
    --ios-blur: blur(25px);
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    
    /* 核心风格配色 */
    --k-pink: #ffd1dc; /* 你原本聊天的粉色 */
    --k-theme-dark: #b19cd9; /* 你原本桌面的粉色渐变 */
    --k-text: #666; /* 聊天文字颜色 */
    --k-bubble-user: #e3f2fd; /* 用户气泡 */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body, html {
    width: 100vw !important; 
    height: 100vh;
    margin: 0; 
    padding: 0;
    overflow: hidden; 
    position: fixed; /* 强力锁定防止整体偏移 */
    touch-action: pan-y; /* 只允许纵向滚动，禁止横向手势 */
    overscroll-behavior-x: none; /* 禁用横向越界滚动效果 */

    /* --- 桌面默认壁纸设置 --- */
/* 修正后的唯一路径：去掉多余的点，合并蒙版 */
    background: linear-gradient(rgba(0,0,0,0.005), rgba(0,0,0,0.005)), 
                url('assetsUI/bj.jpg') no-repeat center center fixed;
    
    /* 强制铺满 */
    background-size: cover !important;
    background-color: #2c2c2c; 
}
/* 全覆盖锁屏：高级感毛玻璃 + 呼吸灯提示 */
#lock-screen {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    
    /* 锁屏壁纸：确保 sp.jpg 文件存在 */
    background-image: url('assetsUI/sp.jpg'); 
    background-size: cover;
    background-position: center;
    background-color: #fdf2f4; /* 即使图片没加载，也会显示这个粉色底 */

    /* 关键：z-index 必须是全场最高 */
    z-index: 999999 !important; 
    
    display: flex !important; /* 强制显示容器 */
    flex-direction: column; 
    align-items: center; 
    justify-content: space-between;
    padding: 100px 0 60px;
    
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s;
    cursor: pointer;
}
/* 解锁状态：向上滑走 */
#lock-screen.unlocked { 
    transform: translateY(-100%); 
    opacity: 0;
    pointer-events: none; /* 解锁后不挡住下面的点击 */
}

/* 锁屏大时间：使用你喜欢的泛光效果 */
#lock-time { 
    font-size: 120px; 
    font-weight: 100; /* 极细字体更高级 */
    color: #fffdfd; 
    text-shadow: 0 0 20px rgba(255, 182, 193, 0.836);
    letter-spacing: 2px
    
}

.lock-date { 
    font-size: 18px; 
    color: #fffdfd; 
    font-weight: 100; /* 极细字体更高级 */
    margin-top: -10px; 
    text-shadow: 0 0 20px rgb(255, 182, 193);
    letter-spacing: 2px;
    /* --- 核心添加：确保水平居中 --- */
    text-align: center;      /* 文字本身居中 */
    width: 100%;            /* 占满宽度以确保居中参考点正确 */
    margin-left: auto;      /* 自动外边距辅助 */
    margin-right: auto;     /* 自动外边距辅助 */
}

/* 解锁文字：添加呼吸灯动画 */
.unlock-text { 
    color: #ffffff; 
    font-size: 20px;
    letter-spacing: 4px; 
    font-weight: 200; /* 极细字体更高级 */
     text-shadow: 0 0 20px rgb(255, 125, 145);
    text-transform: uppercase;
    animation: blink 3.5s infinite ease-in-out; 
    /* --- 添加这两行 --- */
    margin-bottom: 190px; /* 数值越大，越往下去 */
    position: relative;
    bottom: -10px;        /* 或者用相对定位微调位置 */
    /* --- 核心添加：确保水平居中 --- */
    text-align: center;      /* 文字本身居中 */
    width: 100%;            /* 占满宽度以确保居中参考点正确 */
    margin-left: auto;      /* 自动外边距辅助 */
    margin-right: auto;     /* 自动外边距辅助 */
}
/* 呼吸灯动画：让文字忽明忽暗 */
@keyframes blink {
    0%, 100% { opacity: 0.3; transform: scale(0.98); }
    50% { opacity: 0.8; transform: scale(1); }
}

/* 桌面上的隐藏小锁屏键 */
.lock-mini-btn {
    position: absolute; top: 60px; right: 20px;
    width: 25px; height: 25px; background: rgba(255,255,255,0.4);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 12px; opacity: 0.6;
}

/* ============================
/* 核心：左上角返回按钮 */
/* ============================
   /* ============================
   1. 极简悬浮返回键 (只在左上角)
   ============================ */
#app-back-btn {
    position: absolute;
    /* 避开顶部的状态栏（25px） */
    top: 55px; 
    left: 20px;
    z-index: 10001; /* 确保在 iframe 之上 */
    
    /* 变成一个精致的小圆球 */
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.6); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

/* ============================
   精准对齐的悬浮返回键
   ============================ */
#app-back-btn {
    position: fixed;
    top: calc(15px + var(--safe-top)); 
    left: 20px;
    z-index: 100000;
    
    width: 34px;  /* 稍微缩小一点，更精致 */
    height: 34px;
    
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 50%;
    
    /* 核心对齐逻辑 */
    display: flex; 
    justify-content: center; 
    align-items: center;
    
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* 核心：取消之前可能存在的 padding 干扰 */
    padding: 0 !important;
}

/* 核心：视觉对齐的小箭头 */
#app-back-btn::after {
    content: '';
    width: 9px;  /* 奇数像素有时比偶数更容易在视觉上对齐中心 */
    height: 9px;
    
    /* 增加线宽到 2.5px，增强质感 */
    border-left: 2.5px solid #ffb6c1; 
    border-bottom: 2.5px solid #ffb6c1;
    
    /* 旋转 */
    transform: rotate(45deg); 
    
    /* 【灵魂手术】视觉补偿：
       因为箭头开口向右，视觉重心在左，所以我们要手动向右挪动 1.5 到 2 像素 */
    margin-left: 2.5px; 
    margin-top: 0.5px; /* 如果觉得上下也不对，可以微调这里 */
}

/* 增加触摸时的丝滑反馈 */
#app-back-btn:active {
    transform: scale(0.88);
    background: rgba(255, 255, 255, 1);
}

/* ============================
   2. 彻底去掉下方的灰色条
   ============================ */
.home-bar {
    display: none !important; /* 强制消失，不留痕迹 */
}

/* 修正 iframe 内部边距，防止内容被挡住 */
#app-frame {
    width: 100%; 
    height: 100%;
    border: none;
   padding-top: 0px !important;  
    box-sizing: border-box;
    background: transparent !important;
}

/* ============================
   2. 点击时的动态反馈 
   ============================ */
#global-back-btn:active {
    transform: scale(0.92); 
    background: rgba(255, 255, 255, 1); 
    box-shadow: 0 2px 6px rgba(0,0,0,0.05); 
    transition: transform 0.1s ease-out; 
}

#global-back-btn::before {
    content: ''; 
    display: inline-block;
    width: 9px; height: 9px;
    border-left: 2.5px solid currentColor; 
    border-bottom: 2.5px solid currentColor;
    transform: rotate(45deg); 
    margin-right: -2px; 
}

/* App 容器层级 */
#app-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #ffffff; /* 或者你想要的颜色 */
    z-index: 10000; 
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
    pointer-events: none; 
}
#app-overlay.open { 
    transform: translateY(0); 
    pointer-events: auto; 
}

/* ============================
   2. 主桌面与布局核心修改区域
   ============================ */
.iphone-screen {
    position: relative;
    width: 100%; 
    height: 100%;
    
    /* --- 核心修改：删掉原来的渐变色，改为透明 --- */
    background: transparent !important; 
    
    display: flex; 
    flex-direction: column;
    z-index: 100; 
}
.status-bar {
    height: 44px;
    padding: var(--safe-top) 25px 0;
    display: flex; justify-content: space-between; align-items: center;
    color: white; font-size: 15px; font-weight: 600;
    position: fixed; /* 必须是 fixed */
    top: 0;
    width: 100%;
    z-index: 9999 !important; /* 给最高优先级，确保电量显示出来 */
    background: transparent; /* 保持透明，或者加微弱的毛玻璃 */
}

/* 调整了桌面的 Grid 布局 */
/* 桌面容器：使用网格布局 */
/* 桌面容器：优化手机端的间距 */
.desktop {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr); 
    gap: 8px;          /* 间距从 10px 缩小到 8px，防止拥挤 */
    padding: 10px;     
    padding-top: 50px; 
    position: relative;
    box-sizing: border-box;
    height: calc(100vh - 110px); 
}

/* 新增：卡片/小组件通用样式 */
.widget {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #ffb6c1; 
    overflow: hidden;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}.app-icon:active { transform: scale(0.92); transition: 0.1s; }

.icon-img {
    width: 46px;       /* 从 52px 缩小到 46px */
    height: 46px;      
    background: rgba(255, 255, 255, 0.4) !important;
    border-radius: 13px; /* 圆角同步微调 */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;      /* 内部边距缩小 */
    box-sizing: border-box;
    overflow: hidden;
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.desktop-img {
    width: 100%;
    height: 100%;
 object-fit: cover; /* 撑满方块 */
}
.app-label {
    margin-top: 4px;   
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    font-size: 10px;   /* 文字从 11px 缩小到 10px */
    color: rgb(255, 255, 255); 
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 0, 0, 0.3);
    -webkit-font-smoothing: antialiased;
}
.widget {
    font-family: -apple-system, "SF Pro Display", "PingFang SC", sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.85);
}
#back-to-lock-btn {
    position: absolute;
    top: 60px; 
    right: 20px;
    width: 20px; height: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    color: white; font-size: 10px;
    opacity: 0.5; 
    cursor: pointer;
    transition: 0.2s;
}
#back-to-lock-btn:hover { opacity: 1; }
/* 精准定位每一块内容 */

/* 顶部卡片：占满前两行 */
.top-card { grid-area: 1 / 1 / 3 / 5; }

/* 装饰图片：中间右侧 */
.deco-img { grid-area: 3 / 3 / 5 / 5; }

/* 音乐唱片：底部左侧 */
.music-widget { grid-area: 5 / 1 / 7 / 3;
padding: 10px
 }


/* 左侧四个图标定位 */
.i1 { grid-area: 3 / 1; }
.i2 { grid-area: 3 / 2; }
.i3 { grid-area: 4 / 1; }
.i4 { grid-area: 4 / 2; }

/* 右侧四个图标定位 */
.i5 { grid-area: 5 / 3; }
.i6 { grid-area: 5 / 4; }
.i7 { grid-area: 6 / 3; }
.i8 { grid-area: 6 / 4; }

/* 底部 Dock 保持不变 */
.dock {
margin: 0 15px calc(8px + var(--safe-bottom)); /* 减小底部间距 */
    height: 70px;      /* 从 75px 缩小到 70px */
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 22px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1); 
}
.icon-img-small {
    width: 44px;       /* 从 48px 缩小到 44px */
    height: 44px;
    background: rgba(20, 20, 20, 0.1) !important;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 7px; 
    box-sizing: border-box;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
/* 音乐唱片功能 */
/* 音乐卡片容器 */
.music-widget {
    position: relative;
    overflow: hidden;
    flex-direction: column !important;
    padding: 8px !important; /* 减小内边距，释放空间 */
}

/*1. 小旋转唱片：放在左上角，大小适中 */
.mini-disk {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    background: radial-gradient(circle, #444 20%, #111 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    z-index: 10;
    animation: diskRotate 5s linear infinite;
    animation-play-state: paused; /* 随音乐播放 */
}
/* 唱片中心的小点 */
.mini-disk::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 6px; height: 6px;
    background: #555;
    border-radius: 50%;
}
@keyframes diskRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* 歌词容器：只显示中间几行 */
.lyrics-container {
    overflow: hidden; 
    position: relative;
    height: 50px;      /* 从 60px 压缩到 50px */
    width: 100%;
    margin: 0 auto;
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
    display: flex;
    align-items: center;
}
/* 3. 右下角装饰字 (对应红字：有点透明度) */
.decor-text {
    position: absolute;
    bottom: 10px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none; /* 不干扰点击 */
}
.decor-text span {
    font-size: 10px;
    /* 1. 设置为半透明白，但在浅色背景下容易看不清 */
    color: rgba(255, 255, 255, 0.445); 
    
    /* 2. 核心：加上这行文字阴影，白色背景下也能勾勒出轮廓 */
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
    
    letter-spacing: 1px;
    font-family: sans-serif;
    line-height: 1.2;
}

/* 播放状态联动：唱片转动 */
.playing .mini-disk {
    animation-play-state: running;
}
/* 歌词无限滚动动画 */
.lyrics-scroll {
    font-size: 11px;   /* 歌词字号微调 */
    color: rgba(255, 255, 255, 0.8);
    margin: 6px 0;     /* 减小行间距 */
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    /* 动画名称 速度 线性播放 无限循环 */
    animation: lyric-move 20s linear infinite; 
    animation-play-state: paused; /* 默认暂停，播放时启动 */
}
/* 关键动画：从 0 滚到 总高度的一半 */
@keyframes lyric-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); } 
}

.lyrics-scroll p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 10px 0;
    text-align: center;
    font-family: -apple-system, "SF Pro Text", sans-serif;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

@keyframes scrollLyrics {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

/* 进度条：底部泛光的细节 */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.315);
}

.progress-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6));
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); /* 泛光效果 */
    transition: width 0.5s;
}

/* 播放状态下启动动画 */
.playing .lyrics-scroll {
    animation-play-state: running;
}
/*音乐唱片功能结束

/* ============================
   顶部卡片区域专项样式
   ============================ */
/* ============================
   顶部卡片区域专项样式 - 手机适配优化版
   ============================ */
.top-profile-card {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* 压缩纵向高度，确保不挤占下方图标 */
    padding: 10px 13px !important; 
    margin-top: 35px !important;
    box-sizing: border-box;
    /* 限制最小高度防止内容重叠 */
    min-height: 180px; 
}

/* 头像：改用相对单位，确保在窄屏下自动缩小 */
.profile-avatar {
    width: 85px;  
    height: 85px;
    /* 手机端适配：如果屏幕太小则自动缩小头像 */
    max-width: 22vw;
    max-height: 22vw;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
    overflow: hidden;
    flex-shrink: 0; /* 禁止被挤压 */
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}

/* ID 样式：保留你原本的配色和阴影 */
.profile-id {
    font-size: 11px;
    color: rgba(252, 173, 186, 0.938);
    letter-spacing: 3px;
    font-weight: 480; 
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(255, 182, 193, 0.6);
}

/* 时间与日期容器 */
.profile-time-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

/* 核心：时间字体保留泛光，但增加大小自适应 */
.profile-time {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 200; 
    /* 动态字号：最小38px，随屏幕宽度缩放，最大58px */
    font-size: clamp(30px, 12vw, 58px); 
    color: #fff;
    line-height: 1.1;
    letter-spacing: 3px;
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.2),      
        0 0 10px rgba(255, 182, 193, 0.8), 
        0 0 20px rgba(255, 182, 193, 0.4);
}

.profile-date {
    font-size: 8px!important;
    color: rgba(255, 181, 193, 0.938);
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(255, 182, 193, 0.6);
    margin-top: -2px;
}

/* 签名：增加溢出隐藏，防止文字过长撑乱布局 */
.profile-signature {
    font-size: 8px!important;
    color: rgba(255, 159, 175, 0.938);
    margin-top: 10px;
    font-style: italic;
    width: 85%;
    text-align: center;
    /* 保持单行防止撑开卡片高度 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 5px rgba(255, 182, 193, 0.6);
    flex-shrink: 0;
    margin-top: -2px;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    /* 关键：保持比例切割，类似手机壁纸的效果 */
    object-fit: cover; 
    /* 如果你想让头像带一点点透明度融入背景，可以加这行 */
    /* opacity: 0.9; */


/* 顶部卡片区域功能结束


/* 照片
.deco-photo {
   border-radius: 18px !important; 
    background-image: url('assetsUI/kuroro.png'); 
    background-size: cover; 
    background-position: center;
    border: 1px solid rgb(255, 255, 255);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); /* 投影稍微收敛 */
    position: relative;
    overflow: hidden;
}


/* 可选：给照片加一个蒙版效果，让它和整体肤色更搭 */
.deco-photo::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.212); /* 淡淡的粉色滤镜 */
    pointer-events: none;
}
/* 状态栏自动变色 */
.status-bar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 15px;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999; /* 确保在最顶层 */

    /* --- 核心代码：智能反色 --- */
    color: #ffdede; /* 基准色设为白色 */
    text-shadow: 0 0 5px rgba(255, 182, 193, 0.6);
    mix-blend-mode: difference; 
}