/* 1. 选人遮罩 (完全恢复原样) */
#cp-selector-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    /* 恢复原来的半透明背景和模糊，确保它是全屏遮罩 */
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: none; /* 默认隐藏，非常重要 */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#cp-selector-overlay.active { opacity: 1; }

.cp-blue-glass {
    width: 320px;
    /* 恢复原来的背景设置，如果是蓝色玻璃风格请在这里调整，目前恢复为输入时的白色 */
    background: #fff; 
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding: 24px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#cp-selector-overlay.active .cp-blue-glass { transform: scale(1); }
.cp-blue-header { text-align: center; font-size: 18px; font-weight: 700; color: #333; margin-bottom: 20px; }

/* 2. 查手机全屏容器 */
#phone-system-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    cursor: pointer;
}
#phone-system-overlay.active { opacity: 1; }

/* 手机边框 */
.phone-bezel {
    width: 360px;
    height: 740px;
    max-height: 92vh;
    background: #f2f3f5; /* 海盐灰底色 */
    border-radius: 40px;
    box-shadow: 
        0 0 0 8px #1a1a1a,
        0 20px 50px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    user-select: none;
    cursor: default;
}

/* --- 3. 锁屏界面 (修复版：淡蓝背景 + 遮挡内部 + 修复壁纸) --- */
.lock-screen-panel {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    
    background-color: #e0e0e0; 
    
    /* 2. 壁纸属性：让 JS 设置的壁纸能覆盖掉上面的背景色 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* 3. 层级：确保它在所有内容（包括标题栏和底部Tab）之上 */
    z-index: 9999; 
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 顶部对齐 */
    padding-top: 100px; /* 时间位置下移一点，更协调 */
    
    /* 字体颜色：白色。如果淡蓝背景看不清，可以加一点文字阴影 */
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.1); 
    
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer; /* 提示可点击换图 */
    
    font-family:inherit; 
}

/* 即使没有壁纸，这个淡蓝背景也能保证看不到里面 */

/* 时间日期容器 */
.ls-clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 增加不可选中，防止误触 */
    user-select: none;
    pointer-events: none; 
}

/* 日期 (在上) */
.ls-date-header {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 5px;
    opacity: 0.95;
    letter-spacing: 1px;
}

/* 时间 (巨大) */
.ls-time-huge {
    font-size: 96px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -2px;
}

/* 加载动画 */
.lock-screen-loading {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex; align-items: center; gap: 8px;
    background: rgba(0,0,0,0.4);
    padding: 10px 20px;
    border-radius: 20px;
    color: #fff;
    pointer-events: none;
}
.lock-screen-loading.show { opacity: 1; }
.cp-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* --- 滑动条 (保持你原本的样式) --- */
.slider-container {
    position: absolute;
    bottom: 60px; /* 距离底部稍微高一点 */
    width: 80%;
    height: 55px;
    background: rgba(255, 255, 255, 0.3); /* 稍微增加一点不透明度 */
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 4px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    cursor: default;
}

.slider-text {
    position: absolute;
    width: 100%; text-align: center;
    font-size: 14px; color: rgba(255,255,255,0.95);
    pointer-events: none;
    letter-spacing: 1px;
}

.slider-knob {
    width: 47px; height: 47px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #333;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: grab;
    position: relative;
    z-index: 2;
}

/* 4. APP 主界面容器 */
.app-main-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: #F2F3F5; /* 整体海盐灰背景 */
}

/* 顶部标题栏 */
.cp-app-header {
    height: 70px;
    padding-top: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 15px; padding-right: 15px;
    background: #F2F3F5; /* 与背景同色 */
    flex-shrink: 0;
    position: relative;
    z-index: 20;
    color: #000;
}

.cp-header-title { font-size: 17px; font-weight: 600; color: #000; }

/* 按钮样式：去掉白色背景圆圈，改为透明 */
.cp-icon-btn {
    font-size: 18px;
    color: #333;
    cursor: pointer;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: transparent;  /* 透明 */
    transition: opacity 0.2s;
}
.cp-icon-btn:hover { opacity: 0.6; }

/* 内容滚动区 (列表) */
.cp-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0; /* 左右padding交给内部容器 */
    scrollbar-width: none; 
    -ms-overflow-style: none;
    position: relative;
}
.cp-content-area::-webkit-scrollbar { display: none; }

/* 详情页容器 */
.cp-detail-view {
    position: absolute;
    top: 0; 
    left: 0; width: 100%; 
    height: 100%;
    background: #F2F3F5;
    z-index: 25; /* 盖住 Header 和 TabBar */
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}
.cp-detail-view.active { transform: translateX(0); }
.cp-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 30px;
    scrollbar-width: none;
}

/* 5. 消息列表布局 (仿微信) */

/* 列表分组容器 */
.cp-list-group {
    background: #fff;
    border-radius: 12px;
    margin: 0 12px 12px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 列表单行 */
.cp-chat-card {
    display: flex; 
    align-items: center;
    padding: 16px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}
.cp-chat-card:active { background: #f5f5f5; }

/* 分割线：除了最后一个，都有底边框 */
.cp-chat-card:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: calc(100% - 76px); /* 留出头像宽度 */
    height: 1px;
    background: #f0f0f0;
}

.cp-card-avatar { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; margin-right: 12px; flex-shrink: 0; background: #eee; }
.cp-card-info { flex: 1; overflow: hidden; }
.cp-card-row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.cp-card-name { font-size: 16px; font-weight: 500; color: #000; }
.cp-card-time { font-size: 11px; color: #b2b2b2; }
.cp-card-preview { font-size: 13px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 备忘录/购物/抖音/搜索卡片 (保持圆角风格) */
.cp-memo-card, .cp-shop-card, .cp-tiktok-card, .cp-search-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin: 0 12px 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    cursor: pointer;
}

.cp-memo-card { border-left: 4px solid #999999; } /* 海盐蓝 */
.cp-memo-date { font-size: 11px; color: #aaa; font-weight: 600; text-transform: uppercase; }
.cp-memo-text { font-size: 14px; color: #444; line-height: 1.4; margin-top: 4px; }

/* 购物卡片 - 增加呼吸感优化版 */
.cp-shop-card { 
    display: flex; 
    align-items: center; 
    gap: 15px;         /* 图标与右侧文字的间距加大 */
    cursor: default; 
    
    /* 增加卡片内边距，整体更宽松 */
    padding: 18px;       
    
    background: #fff;
    border-radius: 12px;
    margin: 0 12px 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.cp-shop-icon { 
    width: 50px; 
    height: 50px; 
    background: #f0f0f0; 
    color: #333333; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 22px; 
    flex-shrink: 0;
}

.cp-shop-details { 
    flex: 1; 
    display: flex;
    flex-direction: column; /* 垂直排列 */
    
    /* ★★★ 核心修改：增加标题和价格之间的间距 ★★★ */
    gap: 8px;               
}

.cp-shop-title { 
    font-size: 15px; 
    font-weight: 600; 
    color: #333; 
    margin-bottom: 0; 
    
    /* ★★★ 核心修改：增加行高，防止多行文字挤在一起 ★★★ */
    line-height: 1.5;       
}

.cp-shop-price { 
    font-size: 16px; 
    font-weight: 700; 
    color: #333333; 
    font-family:inherit;
    letter-spacing: 0.5px;
}
/* 之前有的 .cp-shop-date 在JS里没用到，可以忽略或保留 */
.cp-shop-date { font-size: 11px; color: #999; display: none; }

.cp-tiktok-card { 
    background: #161823; /* 抖音深色背景 */
    color: #fff; 
    display: flex; 
    align-items: flex-start; /* 顶部对齐，防止高度拉伸导致封面居中奇怪 */
    gap: 12px; 
    border-radius: 8px; /* 圆角稍微小一点，更像视频卡片 */
    padding: 12px;      /* 增加内边距，不再挤压 */
    margin: 0 12px 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    position: relative;
}

.cp-tiktok-cover { 
    width: 60px;   /* 稍微加宽一点 */
    height: 80px;  /* 3:4 比例，更像视频封面 */
    background: #333; 
    border-radius: 4px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 24px; 
    color: #555; 
    flex-shrink: 0; /* ★★★ 核心修复：禁止缩放，防止被挤扁 ★★★ */
}

.cp-tiktok-info { 
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 80px; /* 跟封面图一样高 */
    overflow: hidden; 
    padding: 2px 0;
}

.cp-tiktok-desc { 
    font-size: 14px; 
    color: #eee; 
    line-height: 1.4; 
    display: -webkit-box;
    line-clamp: 2; /* 最多显示2行 */
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis; 
}

.cp-tiktok-tag {
    font-size: 12px;
    color: #999999; /* 抖音黄 */
    margin-top: auto; /* 推到底部 */
}

.cp-tiktok-like {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 16px;
}

.cp-search-card { display: flex; align-items: center; justify-content: space-between; }
.cp-search-left { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }
.cp-search-text { font-size: 14px; color: #333; }

/* 6. 底部导航栏 (修复选中颜色) */
.cp-tab-bar {
    height: 60px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 5px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.cp-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 50px;
    cursor: pointer;
    color: #ccc; /* 未选中颜色 */
    transition: color 0.2s;
}

/* ★★★ 核心修复：选中状态改为黑色，不要蓝色 ★★★ */
.cp-tab-item.active { 
    color: #333; 
}

.cp-tab-icon { font-size: 22px; }
.cp-tab-label { font-size: 10px; font-weight: 500; transform: scale(0.9); }

/* 页面切换 */
.cp-page-view { display: none; width: 100%; height: 100%; flex-direction: column; }
.cp-page-view.active { display: flex; }

/* --- 聊天详情 (微信气泡 + 海盐配色) --- */

.chat-detail-container { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    padding-bottom: 30px; 
    padding-top: 10px; 
}

.chat-msg-row {
    display: flex;
    width: 100%;
    margin-bottom: 5px;
    align-items: flex-start;
}
/* 左侧：别人 (你/User) - 白色气泡 */
.chat-msg-row.left { justify-content: flex-start; }
/* 右侧：自己 (Char/Owner) - 海盐绿气泡 */
.chat-msg-row.right { justify-content: flex-end; }

.chat-avatar-img {
    width: 40px; height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: cover;
}
.chat-msg-row.left .chat-avatar-img { margin-right: 10px; }
.chat-msg-row.right .chat-avatar-img { margin-left: 10px; order: 2; }

.chat-bubble-box {
    max-width: 70%;
    position: relative;
}
.chat-msg-row.right .chat-bubble-box { order: 1; text-align: right; }

.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    display: inline-block;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 左侧气泡：纯白 */
.chat-msg-left-bubble {
    background: #fff;
    color: #000;
}
/* 左侧小尾巴 */
.chat-msg-left-bubble::before {
    content: '';
    position: absolute;
    top: 14px; left: -6px;
    width: 0; height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #fff;
}

/* 右侧气泡：海盐绿 (微调过的微信绿，更柔和) */
.chat-msg-right-bubble {
    background: #e0e0e0; /* 海盐淡蓝 */
    color: #000;
}
/* 右侧小尾巴 */
.chat-msg-right-bubble::after {
    content: '';
    position: absolute;
    top: 14px; right: -6px;
    width: 0; height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #e0e0e0;
}

.chat-time-center { text-align: center; font-size: 12px; color: #ccc; margin: 15px 0; }

tiktok-detail-container {
    background: #000;
    height: 100%;
    display: flex; 
    flex-direction: column;
    position: relative;
    overflow: hidden; /* 禁止整体滚动，让内部滚动 */
}

/* 1. 视频区域 (固定高度，样式恢复简洁) */
.tt-video-placeholder {
    width: 100%; 
    height: 320px; /* 固定高度 */
    background: #1a1a1a; /* 保持原来的深灰色 */
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: #fff; 
    font-size: 40px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

/* 播放图标 */
#ttPlayIcon {
    opacity: 0.8;
    transition: opacity 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* 文字浮层 (打字机效果) */
.tt-video-text-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    padding: 30px;
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1.6;
    color: #fff;
    background: rgba(0,0,0,0.7); /* 轻微遮罩 */
    display: flex;
    align-items: center;
    text-align: left;
    white-space: pre-wrap;
    z-index: 5;
    font-family: inherit; 
    overflow-y: auto;
}

/* 2. 下方滚动内容区 (信息 + 评论) */
.tt-scroll-content {
    flex: 1;
    overflow-y: auto; /* 只有下面这部分滚动 */
    background: #000;
}

/* 视频信息 */
.tt-text-content {
    padding: 15px 15px 10px 15px;
}

.tt-title { 
    font-size: 16px; 
    font-weight: 700; 
    margin-bottom: 6px; 
    color: #fff;
}
.tt-desc { 
    font-size: 14px; 
    color: #ddd; 
    line-height: 1.4; 
    margin-bottom: 8px; 
}
.tt-tags { 
    color: #FACE15; 
    font-size: 13px; 
    font-weight: 600;
    margin-bottom: 12px; 
}
.tt-stats { 
    display: flex; 
    gap: 20px;
    color: #888; 
    font-size: 12px; 
}
.tt-stats span i { margin-right: 4px; }

/* 评论区 */
.tt-comment-section {
    padding-bottom: 30px;
}

.tt-cmt-header {
    font-size: 12px;
    color: #666;
    padding: 10px 15px;
}

.tt-cmt-list {
    padding: 0 15px;
}

.tt-comment-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    gap: 10px;
}

.tt-cmt-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #333;
    flex-shrink: 0;
}

.tt-cmt-content {
    flex: 1;
}

.tt-cmt-name {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.tt-cmt-text {
    font-size: 13px;
    color: #eee;
    line-height: 1.4;
}

.tt-cmt-like {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
}
.browser-detail-container { background: #fff; min-height: 100%; display: flex; flex-direction: column; }
.browser-bar { background: #f0f0f0; padding: 10px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; color: #333; font-size: 13px; border-bottom: 1px solid #ddd; }
.browser-content { padding: 0 15px; }
.browser-result-item { margin-bottom: 25px; }
.bri-title { font-size: 16px; color: #1a0dab; text-decoration: underline; margin-bottom: 4px; font-weight: 500; }
.bri-desc { font-size: 13px; color: #4d5156; line-height: 1.4; }

/* --- 论坛/贴吧详情页风格 (修复版) --- */
.cp-forum-container {
    background: #fff;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    color: #333;
    font-family: inherit; 
    position: relative;
    padding-bottom: 50px;
}

/* 1. 顶部楼主信息区 */
.forum-main-area {
    padding: 20px 20px 0 20px; /* 底部padding减小，紧凑一点 */
    background: #fff;
}

/* 头像和名字行 */
.forum-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.forum-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.forum-user-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* 帖子标题与内容 */
.forum-post-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    color: #000;
    margin-bottom: 12px;
}

.forum-post-body {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: justify;
    white-space: pre-wrap;
    margin-bottom: 15px;
}

/* 2. 回复区分割线 (修正：改为细线，不是粗条) */
.forum-reply-divider {
    height: 1px;           /* 只有1像素高度 */
    background: #f0f0f0;   /* 很浅的灰色 */
    width: 100%;
    border: none;
    margin-top: 5px;       /* 稍微留一点点间距 */
}

.forum-reply-title {
    padding: 15px 20px 5px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    background: #fff;
    border-bottom: none;
}
/* 3. 评论列表 */
.forum-comment-list {
    padding: 0 20px;
}

.forum-comment-item {
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 评论头部行 */
.fc-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.fc-floor-label {
    font-size: 13px;
    color: #999;
}

/* 楼主标识 (粉色背景风格 - 增强版) */
.fc-lz-badge {
    font-size: 11px;
    background: #e0e0e0;
    color: #333333;
    border: 1px solid #999999;
    padding: 0 6px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 500;
}

/* 评论内容 */
.fc-content {
    font-size: 16px; 
    color: #333;
    line-height: 1.6;
    text-align: justify;
}
