/* --- 全局与手机框架 --- */
:root {
    --primary-color: #1a73e8; /* 原生安卓蓝 */
    --bg-color: #ffffff;
    --text-color: #202124;
    --lock-screen-bg: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://source.unsplash.com/random/1080x1920/?nature,dark'); /* 随机深色壁纸 */
    --desktop-bg: url('https://source.unsplash.com/random/1080x1920/?abstract,blue'); /* 随机桌面壁纸 */
}

body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
}

.phone-frame {
    width: 360px;
    height: 760px;
    background: #111;
    border-radius: 36px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    padding: 12px;
    position: relative;
    box-sizing: border-box;
}

.notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background: #111;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 100;
}

.screen {
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

/* --- 核心层级管理 (Layer System) --- */
.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.fullscreen-layer {
    padding-top: 30px; /* 避开状态栏 */
    padding-bottom: 50px; /* 避开导航栏 */
    box-sizing: border-box;
}

/* Z-Index 定义：锁屏最高，应用其次，桌面最低 */
#lock-screen { z-index: 30; transform: translateY(0%); }
#app-container { z-index: 20; transform: translateY(100%); opacity: 0; pointer-events: none; background: var(--bg-color);}
#desktop { z-index: 10; }

/* 解锁状态：锁屏上滑 */
body.unlocked #lock-screen {
    transform: translateY(-100%);
}

/* 应用打开状态：应用容器滑入 */
body.app-open #app-container {
    transform: translateY(0%);
    opacity: 1;
    pointer-events: auto;
}

/* --- 系统 UI 栏 --- */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 500;
    color: white; /* 默认白色，适配深色锁屏和壁纸 */
    z-index: 50;
    mix-blend-mode: difference; /* 智能适配背景色 */
}

.status-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: rgba(0,0,0,0.05); /* 轻微底色 */
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
    color: var(--text-color);
}

.nav-btn {
    padding: 15px;
    cursor: pointer;
}
.nav-btn:active { color: var(--primary-color); }


/* --- 锁屏界面样式 --- */
#lock-screen {
    background: var(--lock-screen-bg);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    color: white;
    padding-top: 80px;
    padding-bottom: 40px;
}

.lock-time-container { text-align: center; }
#lock-time { font-size: 72px; font-weight: 300; line-height: 1; }
#lock-date { font-size: 18px; margin-top: 10px; opacity: 0.8; }

.lock-bottom-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    align-items: flex-end;
}

.lock-icon-btn {
    background: rgba(255,255,255,0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.unlock-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    opacity: 0.8;
    cursor: pointer;
}


/* --- 桌面样式 --- */
#desktop {
    background: var(--desktop-bg);
    background-size: cover;
    background-position: center;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 10px;
    padding: 30px 15px;
}

.app-icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.app-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%; /* 原生安卓常用圆形图标 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: white;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.app-name { color: white; font-size: 12px; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }


/* --- 应用容器 --- */
#app-frame {
    width: 100%;
    height: 100%;
    background: white;
}
