/* ========== Glimmer OS - Complete Styles for index_v2.html ========== */

/* ========== 🚫 全局强制隐藏手机外壳侧边按键 ========== */
/* 确保在任何界面（锁屏、主屏、应用内）都不会出现黑色侧边按键 */
body::before,
body::after,
html::before,
html::after {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    content: none !important;
}

/* ========== Custom Fonts ========== */
@font-face {
    font-family: 'Bold';
    src: url('../Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Jason Handwriting';
    src: url('../JasonHandwriting9p.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* ========== CSS Variables ========== */
:root {
    /* === 原有变量 === */
    --primary-color: #5a7fff;
    --primary-light: rgba(90, 127, 255, 0.1);
    --primary-medium: rgba(90, 127, 255, 0.5);
    --glass-opacity: 0.7;
    --blur-amount: 20px;
    --border-radius: 16px;
    --bg-image: '';
    --bg-position: center;
    --bg-size: cover;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --spring-easing: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --elastic-easing: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --smooth-easing: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* === 🎨 全局主题变量系统 (Light Mode) === */
    --bg-body: #eae6e9;
    --bg-screen: linear-gradient(135deg, #f7f3f0 0%, #eaddf7 100%);
    --surface-card: rgba(255, 252, 250, 0.7);
    --border-card: rgba(255, 255, 255, 0.9);
    --shadow-card: 0 10px 30px rgba(189, 175, 175, 0.1);
    --text-main: #6d6466;
    --text-muted: #aeb0b8;
    --text-primary: #6d6466;
    --text-secondary: #aeb0b8;
    --text-tertiary: #c5c7cf;
    --icon-cocoa: #8d6e63;
    --icon-taro: #9575cd;
    --icon-pink: #f48fb1;
    --icon-blue: #90caf9;
    --starscape-opacity: 0;
    
    /* === 🌟 日间模式毛玻璃变量（纯白高透）=== */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-text: #6d6466;
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    
    /* === 🎨 Taro 主题：燕麦 & 香芋配色方案 (Macaron True Soft) === */
    --bg-gradient-taro: linear-gradient(135deg, #f7f3f0 0%, #eaddf7 100%);
    --glass-card-taro: rgba(255, 252, 250, 0.7);
    --glass-card-border-taro: rgba(255, 255, 255, 0.9);
    --text-dark-taro: #6d6466; 
    --text-med-taro: #aeb0b8;
    --color-cocoa: #d7ccc8; 
    --color-cocoa-dark: #8d6e63;
    --color-taro: #e1d5e7;
    --color-taro-dark: #9575cd;
    --accent-pink-taro: #f48fb1; 
    --accent-blue-taro: #90caf9;
}

/* === 🌙 Dark Mode 全局变量 === */
[data-theme="dark"],
body.dark-mode {
    --bg-body: #050505;
    --bg-screen: linear-gradient(180deg, #16141a 0%, #0a090c 100%);
    --surface-card: rgba(255, 255, 255, 0.04);
    --border-card: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 15px 35px rgba(0, 0, 0, 0.4);
    --text-main: #e8e6e3;
    --text-muted: #9a95a3;
    --text-primary: #e8e6e3;
    --text-secondary: #9a95a3;
    --text-tertiary: #6a6672;
    --icon-cocoa: #e6cbb3;
    --icon-taro: #d1c4e9;
    --icon-pink: #f8bbd0;
    --icon-blue: #b3e5fc;
    --starscape-opacity: 1;
    
    /* 毛玻璃变量（深邃黑透）*/
    --glass-bg: rgba(30, 30, 30, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-text: #e8e6e3;
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ========== 全局滚动条隐藏（强制） ========== */
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

* {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}

/* 确保所有元素都没有滚动条 */
html, body, div, section, article, aside {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html::-webkit-scrollbar, 
body::-webkit-scrollbar, 
div::-webkit-scrollbar {
    display: none !important;
}

/* Dark mode variables moved to [data-theme="dark"] section above */

/* ========== Global Reset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
    /* 🔧 iOS 全屏支持 */
    height: -webkit-fill-available;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #ffd6e8 0%, #e6d9ff 50%, #d6e9ff 100%);
    overflow: hidden;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    backdrop-filter: none !important;
    filter: none !important;
    /* 🔧 iOS 全屏支持 */
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* 🔧 iOS 全屏模式修复 */
body.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    height: 100% !important;
    overflow: hidden !important;
    -webkit-overflow-scrolling: touch !important; /* iOS 滚动优化 */
}

/* ========== Phone Container ========== */
.phone-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #b8a4d5 0%, #9b8ec4 100%);
    backdrop-filter: none !important;
    filter: none !important;
}

.phone-frame {
    width: 100%;
    max-width: 414px;
    height: 100vh;
    max-height: 896px;
    background: var(--bg-body);
    /* 🚨 强制手机壳作为绝对定位的参照系 + 彻底关住房门的黑魔法 */
    position: relative !important;
    overflow: hidden !important;
    transform: translateZ(0) !important; /* 黑魔法：创建层叠上下文，彻底锁住 fixed 元素 */
    z-index: 10;
    
    /* 🎨 严格按照 iPhone 15 Pro 设计 - 纯白色边框 */
    border: 6px solid #fff !important;
    border-radius: 44px;
    
    /* 🎨 优化后的手机边框阴影 */
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    
    isolation: isolate;
    transition: background 0.3s ease;
}

/* === 🌌 星空动画层 === */
.starscape {
    position: absolute;
    inset: 0;
    opacity: var(--starscape-opacity);
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.5s ease;
    overflow: hidden;
    border-radius: 44px;
}

.starscape .stars {
    position: absolute;
    inset: 0;
    background: transparent;
    animation: twinkleSlow 3s ease-in-out infinite;
}

.starscape .stars::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(2px 2px at 15% 90%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%, 100% 100%, 50% 50%, 80% 10%, 90% 60%, 33% 80%, 15% 90%;
    opacity: 0.7;
    box-shadow:
        10vw 10vh #fff, 20vw 15vh #fff, 30vw 80vh #fff,
        40vw 40vh #fff, 50vw 55vh #fff, 60vw 20vh #fff,
        70vw 75vh #fff, 80vw 90vh #fff, 90vw 30vh #fff,
        15vw 25vh #fff, 25vw 60vh #fff, 35vw 10vh #fff,
        45vw 70vh #fff, 55vw 35vh #fff, 65vw 85vh #fff,
        75vw 50vh #fff, 85vw 65vh #fff, 95vw 45vh #fff;
    animation: twinkleSlow 3s ease-in-out infinite alternate;
}

.starscape .meteor {
    position: absolute;
    width: 1px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(-45deg);
    animation: meteorFall 3s ease-in infinite;
    opacity: 0;
}

.starscape .meteor.m1 {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.starscape .meteor.m2 {
    top: 30%;
    left: 70%;
    animation-delay: 1.5s;
}

@keyframes twinkleSlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes meteorFall {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-45deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(300px) translateY(300px) rotate(-45deg);
    }
}

/* ========== 页面全屏覆盖（修复状态栏断层） ========== */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: none; /* 默认隐藏 */
    overflow: hidden;
}

.page.active {
    display: flex;
    z-index: 100;
}

/* 主屏幕透明 */
#home {
    z-index: 1 !important;
    background: transparent !important;
    display: flex !important; /* 主屏幕默认显示 */
}

/* 焕彩应用背景 - 使用主题变量 */
#screen-settings {
    background: var(--bg-screen) !important;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease;
}

/* 其他应用默认背景 */
.page:not(#home):not(#screen-settings) {
    background: var(--bg-body);
    transition: background 0.3s ease;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* 主屏幕在最底层 */
#home {
    z-index: 1 !important;
    background: transparent !important; /* 主屏幕使用渐变背景 */
}

/* === 屏幕内容容器 === */
.screen-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-screen);
    transition: background 0.3s ease;
}

/* iPhone 15 Pro 灵动岛 - 完全隐藏避免黑条 */
.phone-frame::before,
.phone-frame::after {
    display: none !important;
    content: none !important;
}


/* 电源键 - 右侧 */
body::before {
    /* 🚫 强制隐藏侧边按键（永久） */
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    /* 以下样式已失效，但保留注释供参考 */
    /*
    content: '';
    position: fixed;
    right: calc(50% - 207px - 3px);
    top: calc(50vh - 300px);
    width: 3px;
    height: 80px;
    background: linear-gradient(90deg, #5a5a5a 0%, #3a3a3a 50%, #4a4a4a 100%);
    border-radius: 0 2px 2px 0;
    z-index: 11;
    box-shadow: 
        inset 0 1px 1px rgba(0, 0, 0, 0.3),
        inset 0 -1px 1px rgba(255, 255, 255, 0.2);
    */
}

/* ========== 壁纸 ========== */
.wallpaper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-screen);
    background-size: cover;
    background-position: center;
    z-index: 0;
    pointer-events: none !important;
    transition: background 0.3s ease;
}

.lock-screen-wallpaper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/lockpaper.jpeg');
    background-size: cover;
    background-position: center;
    z-index: 0;
    pointer-events: none !important;
}

/* ========== 锁屏 ========== */
.lock-screen, #lock-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: var(--surface-card);
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    cursor: grab;
    transition: background 0.3s ease;
    user-select: none;
    pointer-events: auto;
    touch-action: none;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.lock-screen:active {
    cursor: grabbing;
}

#lock-screen[style*="display: none"],
#lock-screen.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
    z-index: -1 !important;
}

.lock-screen-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 80px 20px 60px;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.lock-time {
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.lock-hours {
    font-size: 80px;
    font-weight: 200;
    letter-spacing: -3px;
}

.lock-date {
    font-size: 18px;
    margin-top: 8px;
    font-weight: 400;
}

.lock-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lock-hint {
    color: #fff;
    font-size: 14px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ========== 主屏幕 ========== */
.screen-content, #screen-content {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1 !important;
    display: flex;
    flex-direction: column;
}

/* ========== 页面系统 (强制重写) ========== */
/* 1. 屏幕容器：占满全屏，默认隐藏 */
.page {
    display: none !important; /* 默认都不显示 */
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 10;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden !important;
    flex-direction: column;
}

/* 2. 激活状态：显示并置顶 */
.page.active {
    display: flex !important; /* 激活时显示 */
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    z-index: 100 !important; /* 保证在最上层 */
    pointer-events: auto !important;
}

/* 3. 主页特殊处理：初始可见 */
#home {
    background: transparent !important;
    display: none !important; /* 默认也隐藏 */
    z-index: 1;
    visibility: hidden !important;
    pointer-events: none !important;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 4. 主页激活时 */
#home.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 1 !important;
}

/* ========== APP Header ========== */
.app-header {
    display: flex;
    align-items: center;
    padding: 50px 20px 16px; /* 🔧 增加顶部padding，避开灵动岛 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    position: relative; /* 🔧 确保正确定位 */
    z-index: 100; /* 🔧 确保在最上层 */
}

/* 🌙 夜间模式 - App Header */
body.dark-mode .app-header {
    background: rgba(26, 26, 46, 0.85) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.app-header h1 {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    transition: color 0.3s ease;
}

/* 🌙 夜间模式 - 标题文字 */
body.dark-mode .app-header h1 {
    color: var(--dark-text-primary, #f0f0f0) !important;
}

.back-btn, .add-btn, .menu-btn, .chat-menu-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative; /* 🔧 确保可点击 */
    z-index: 10; /* 🔧 确保在最上层 */
}

/* 🌙 夜间模式 - 按钮 */
body.dark-mode .back-btn,
body.dark-mode .add-btn,
body.dark-mode .menu-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--dark-text-primary, #f0f0f0) !important;
}

.back-btn:hover, .add-btn:hover, .menu-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05); /* 🔧 添加交互反馈 */
}

body.dark-mode .back-btn:hover,
body.dark-mode .add-btn:hover,
body.dark-mode .menu-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    min-height: 0;
    background: transparent;
}

/* ========== 按钮样式 ========== */
.btn-glass {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    background: var(--surface-card);
    backdrop-filter: blur(40px);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: rgba(100, 150, 255, 0.3) !important;
    border-color: rgba(100, 150, 255, 0.4) !important;
    color: var(--text-main) !important;
}

/* ========== 输入框 ========== */
.glass-input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(40px);
    font-size: 14px;
    color: var(--text-main);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.glass-input:focus {
    outline: none;
    border-color: rgba(100, 150, 255, 0.4);
    background: rgba(255, 255, 255, 0.8);
}

.setting-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ========== 桌面 ========== */
.home-screen {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.home-pages-container {
    width: 100%;
    height: 100%;
    display: flex;
    overflow: visible;
    position: relative;
    touch-action: pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.home-pages-container::-webkit-scrollbar {
    display: none;
}

.home-page {
    width: 100%;
    min-width: 100%;
    flex-shrink: 0;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========== 精简时钟 ========== */
.compact-clock {
    position: absolute;
    top: 10px;
    left: 24px;
    z-index: 5;
    pointer-events: none;
}

.compact-time {
    font-size: 48px;
    font-weight: 300;
    color: var(--text-main);
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.3);
    letter-spacing: -2px;
    transition: color 0.3s ease;
    display: flex;
    align-items: baseline;
}

.compact-date {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    margin-top: 4px;
    transition: color 0.3s ease;
}

/* ========== Bento 磁贴区 ========== */
.bento-section {
    display: flex !important;
    gap: 12px;
    padding: 0 20px;
    height: auto !important;
    min-height: 200px;
    overflow: visible !important;
    margin-top: 80px;
    margin-bottom: 20px;
}

.bento-card {
    background: rgba(255, 245, 250, 0.7);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.identity-card {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.identity-card:active {
    transform: scale(0.98);
}

.identity-avatar-large {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ffd6e7 0%, #e6d6ff 100%);
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex !important;
    flex-shrink: 0;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 182, 193, 0.25);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.identity-avatar-large:hover {
    transform: scale(1.05);
}

.identity-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.avatar-placeholder {
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.identity-status {
    text-align: center;
    width: 100%;
}

.identity-name, .identity-persona {
    display: block !important;
    color: var(--text-main) !important;
    text-align: center;
    min-height: 18px;
    transition: color 0.3s ease;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding: 4px 8px;
    border-radius: 8px;
}

.identity-name:hover, .identity-persona:hover {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.03);
}

.identity-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #2d2d2d !important;
}

.identity-persona {
    font-size: 11px;
    color: var(--text-tertiary) !important;
    font-weight: 400;
    transition: color 0.3s ease;
}

.bento-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.memory-card {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    padding-bottom: 20px !important;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
    height: auto !important;
    min-height: 100px !important;
    background-size: cover !important;
    overflow: visible !important;
}

.memory-card:active {
    transform: scale(0.98);
}

.genesis-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    gap: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.8) 0%, rgba(240, 230, 255, 0.8) 100%);
    transition: transform 0.2s ease;
}

.genesis-card:active {
    transform: scale(0.98);
}

.memory-image {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.memory-placeholder {
    font-size: 26px;
}

.memory-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.genesis-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.3s ease;
}

/* ========== 应用图标区 ========== */
.apps-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 24px 24px;
}

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

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.app-icon:active {
    transform: scale(0.9);
}

.icon-wrapper {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all 0.2s ease;
}

.app-icon:hover .icon-wrapper {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.icon-label {
    font-size: 12px;
    color: var(--text-main);
    text-align: center;
    max-width: 64px;
    transition: color 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* ========== Dock 栏 ========== */
.dock {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(40px);
    border-radius: 24px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

.dock .app-icon {
    gap: 6px;
}

.dock .icon-wrapper {
    width: 52px;
    height: 52px;
}

/* ========== 页面指示器 ========== */
.page-indicators {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 999;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}

.indicator.active {
    width: 20px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.9);
}

/* ========== API 设置界面（万象 App）========== */
.setting-group {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(40px);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.setting-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.setting-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.setting-buttons .btn-glass {
    flex: 1;
}

#genesis .app-content {
    padding: 20px;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========== 响应式调整 ========== */
@media (max-width: 414px) {
    .phone-frame {
        border-radius: 0;
        max-width: 100%;
        max-height: 100%;
    }
    
    .compact-time {
        font-size: 40px;
    }
    
    .bento-section {
        padding: 0 16px;
    }
    
    .apps-section {
        padding: 0 20px 20px;
    }
}

/* ========== 新桌面设计 (Dual Screen) ========== */

/* Dual Screen 专用变量 */
.dual-screen-home {
    --glass-bg-dual: rgba(255, 255, 255, 0.25);
    --glass-border-dual: 1px solid rgba(255, 255, 255, 0.35);
    --glass-shadow-dual: 0 10px 30px rgba(0, 0, 0, 0.05);
    --icon-bg-dual: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.2) 100%);
    --icon-shadow-dual: 
        inset 1px 1px 2px rgba(255,255,255,0.8), 
        inset -1px -1px 2px rgba(0,0,0,0.1),
        0 5px 15px rgba(0,0,0,0.1);
    --page-padding-dual: 24px;
}

/* 滑动容器 (Snap Scroll) */
.scroll-container {
    flex: 1;
    display: flex;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x proximity;  /* mandatory → proximity 让滑动更流畅 */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    cursor: grab;
    user-select: none;
    /* 添加滚动平滑过渡 */
    scroll-padding: 0;
}

.scroll-container:active {
    cursor: grabbing;
}

.scroll-container::-webkit-scrollbar { 
    display: none;
}

/* 确保应用图标在拖拽时仍可点击 */
.scroll-container .app-item,
.scroll-container .widget {
    pointer-events: auto;
    user-select: none;
}

/* 单页布局 */
.dual-page {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 10px var(--page-padding-dual, 24px) 140px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    grid-gap: 15px 15px;
    align-content: start;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 组件 (Widgets) */
.widget {
    background: var(--glass-bg-dual, rgba(255, 255, 255, 0.25));
    backdrop-filter: blur(25px);
    border: var(--glass-border-dual, 1px solid rgba(255, 255, 255, 0.35));
    border-radius: 28px;
    box-shadow: var(--glass-shadow-dual, 0 10px 30px rgba(0, 0, 0, 0.05));
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 大组件 (4x2) */
.widget-lg {
    grid-column: span 4;
    grid-row: span 2;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 中组件 (2x2) */
.widget-md {
    grid-column: span 2;
    grid-row: span 2;
    padding: 16px;
    box-sizing: border-box;
    justify-content: space-between;
}

/* 组件内部元素 */
.avatar-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.music-disc {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* App 图标 */
.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.app-item:active {
    transform: scale(0.95);
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--icon-bg-dual, linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.2) 100%));
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: var(--icon-shadow-dual);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.icon-box:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.5);
}

.icon-box i {
    font-size: 28px;
    background: linear-gradient(180deg, #FFFFFF 0%, #D6D6D6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}

.app-name {
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* 分页指示器 (Dual Screen) */
.dots {
    position: absolute;
    bottom: 120px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 200;
    pointer-events: none;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
    padding: 4px;
}

.dot.active {
    background: #fff;
    transform: scale(1.2);
}

.dot:hover {
    background: rgba(255,255,255,0.7);
}

/* Dock (Dual Screen) */
.dock-glass {
    position: absolute;
    bottom: 25px;
    left: 20px;
    right: 20px;
    height: 85px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(40px);
    border-radius: 35px;
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    z-index: 100;
}

.dock-glass .app-name {
    display: none;
}

.dock-glass .app-item {
    margin-top: 0;
}

/* 角标 */
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: rgba(255,255,255,0.95);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ========== Echo App - 马卡龙聊天风格 ========== */

/* Echo 页面专用变量 */
#echo {
    --macaron-bg: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 40%, #E0C3FC 100%);
    --candy-pink: #FFB7B2;
    --candy-mint: #B5EAD7;
    --candy-blue: #C7CEEA;
    --candy-yellow: #FFFFD8;
    --candy-purple: #E2F0CB;
    --text-main: #6c5ce7;
    --text-light: #a29bfe;
    --glass-panel: rgba(255, 255, 255, 0.65);
    --glass-border: 1px solid rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    --radius-box: 24px;
    --radius-btn: 16px;
    
    background: var(--macaron-bg);
    background-size: 200% 200%;
    animation: gradientMove 15s ease infinite;
    font-family: 'Quicksand', -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 侧边栏遮罩 */
.sidebar-mask {
    position: fixed;
    inset: 0;
    background: rgba(108, 92, 231, 0.1);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.sidebar-mask.active {
    opacity: 1;
    pointer-events: auto;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 0;
    right: -85%;
    width: 85%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
    z-index: 200;
    padding: 20px;
    box-sizing: border-box;
    transition: right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: #6c5ce7;
    margin-bottom: 10px;
}

/* 设置卡片 */
.setting-card {
    background: #fff;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-label {
    font-size: 12px;
    color: #b2bec3;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* 头像上传区 */
.avatar-uploader-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
    border: 1px dashed #dfe6e9;
    border-radius: 12px;
    padding: 10px;
}

.user-tag {
    font-size: 13px;
    font-weight: 600;
    color: #636e72;
}

.mini-avatar-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* 马卡龙下拉框 */
.macaron-select {
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: none;
    background: var(--candy-blue);
    color: #fff;
    font-weight: 600;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    text-align-last: center;
}

/* 开关 */
.row-switch {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch-btn {
    width: 44px;
    height: 24px;
    background: #dfe6e9;
    border-radius: 12px;
    position: relative;
    transition: 0.3s;
    cursor: pointer;
}

.switch-btn::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.switch-btn.on {
    background: var(--candy-mint);
}

.switch-btn.on::after {
    transform: translateX(20px);
}

/* Echo Header */
#echo .header {
    height: 65px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(15px);
    z-index: 100;
    border-bottom: var(--glass-border);
}

#echo .header-back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

#echo .header-back-btn:active {
    transform: scale(0.9);
    background: rgba(108, 92, 231, 0.1);
}

#echo .header-back-btn i {
    font-size: 20px;
    color: #6c5ce7;
}

#echo .header-center {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    margin: 0 8px;
}

#echo .header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
    align-items: flex-start; /* 防止子元素拉伸 */
}

#echo .header-name {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.3s;
}

#echo .header-name.typing-status {
    color: #6c5ce7;
    font-weight: 600;
    font-size: 14px;
    animation: typingPulse 1.5s ease-in-out infinite;
}

@keyframes typingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#echo .header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

/* 顶部交互按钮 (按照macaron.style) */
.top-interaction-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 6px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(108, 92, 231, 0.1);
    transition: 0.2s;
    /* 强制限制尺寸，防止拉伸成长白条 */
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    flex-shrink: 0 !important;
}

.top-interaction-btn:active {
    transform: scale(0.95);
    background: var(--candy-pink);
}

.top-interaction-btn img {
    display: block;
    width: 18px;
    height: 18px;
}

.top-interaction-icon {
    color: #fd79a8;
    font-size: 16px;
}

.top-interaction-text {
    font-size: 13px;
    font-weight: 700;
    color: #2d3436;
}

#echo .more-btn {
    font-size: 24px;
    color: #6c5ce7;
    cursor: pointer;
}

/* 聊天区域 */
#echo .chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 !important; /* 移除所有padding，让Tab栏紧贴底部 */
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: opacity 0.2s ease; /* 添加平滑过渡效果 */
}

#echo .msg-row {
    display: flex;
    flex-direction: row; /* 显式指定为水平排列 */
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

#echo .msg-row.user {
    justify-content: flex-end;
    flex-direction: row; /* 用户：气泡在左，头像在右 */
}

#echo .msg-row.ai {
    justify-content: flex-start;
    flex-direction: row; /* AI：头像在左，气泡在右 */
}

#echo .chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    flex-shrink: 0;
}

#echo .bubble {
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.5;
    max-width: 70%;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    word-wrap: break-word;
}

#echo .bubble.ai {
    background: rgba(255,255,255,0.85);
    color: #636e72;
    border-bottom-left-radius: 4px;
}

#echo .bubble.user {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* ========== 标签化消息样式 ========== */
#echo .msg-action {
    background: rgba(255, 243, 224, 0.9);
    color: #856404;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    margin: 4px 0;
    border-left: 3px solid #ffc107;
    max-width: 70%;
    font-style: italic;
}

#echo .msg-thought {
    background: rgba(232, 234, 246, 0.9);
    color: #4a5568;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    margin: 4px 0;
    border-left: 3px solid #6c5ce7;
    max-width: 70%;
    font-style: italic;
}

#echo .msg-speech {
    background: rgba(255, 255, 255, 0.85);
    color: #636e72;
    padding: 12px 18px;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    font-size: 15px;
    line-height: 1.5;
    margin: 4px 0;
    max-width: 70%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

/* 底部栏 */
#echo .bottom-bar {
    /* ❌ 旧版使用 absolute，新版改为 relative */
    position: relative;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(25px);
    padding: 12px 12px 20px; /* 降低 padding */
    z-index: 100;
    border-top: 1px solid rgba(255,255,255,0.5);
    flex-shrink: 0; /* 防止被压缩 */
}

#echo .input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* NPC 切换键 */
#echo .npc-key {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: #fff;
    color: #6c5ce7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: 0.2s;
}

#echo .npc-key:active {
    transform: scale(0.9);
    background: var(--candy-blue);
    color: #fff;
}

#echo .input-box {
    flex: 1;
    height: 44px;
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

#echo .input-box input {
    border: none;
    outline: none;
    flex: 1;
    font-family: inherit;
    font-size: 15px;
    background: transparent;
    color: #2d3436;
}

/* 加号按钮 */
#echo .plus-key {
    width: 36px;
    height: 36px;
    font-size: 28px;
    color: #b2bec3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

#echo .plus-key.active {
    transform: rotate(45deg);
    color: #6c5ce7;
}

/* 发送按钮 */
#echo .send-key {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    cursor: pointer;
    transition: 0.2s;
}

#echo .send-key:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

/* [已删除旧的 panel-drawer 和 macaron-grid 样式，使用新的 clean-drawer 架构] */

#echo .grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

#echo .grid-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: 0.2s;
}

#echo .grid-item:active .grid-icon-box {
    transform: scale(0.9);
    filter: brightness(0.9);
}

#echo .grid-label {
    font-size: 11px;
    color: #636e72;
    font-weight: 600;
}

/* 颜色类 */
.bg-pink { background: #FFB7B2; }
.bg-mint { background: #B5EAD7; }
.bg-blue { background: #C7CEEA; }
.bg-purple { background: #a29bfe; }
.bg-yellow { background: #ffeaa7; }
.bg-red { background: #ff7675; }

/* 双击消息菜单 */
.message-context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 300;
    min-width: 160px;
    animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
}

.context-menu-item:hover {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
}

.context-menu-item i {
    font-size: 16px;
}

/* 侧边栏设置样式 */
.setting-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.setting-section:last-child {
    border-bottom: none;
}

.setting-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108, 92, 231, 0.2), transparent);
    margin: 24px 0;
}

.setting-section.danger-zone {
    border: 2px solid #e74c3c;
    border-radius: 12px;
    padding: 15px;
    background: rgba(231, 76, 60, 0.05);
    margin-top: 20px;
}

.setting-title {
    font-size: 15px;
    font-weight: 700;
    color: #6c5ce7;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: 2px solid #f1f2f6;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    color: #2d3436;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.setting-btn:hover {
    border-color: #6c5ce7;
    background: rgba(108, 92, 231, 0.05);
    transform: translateY(-1px);
}

.setting-btn-sm {
    padding: 6px 12px;
    border: 1px solid #dfe6e9;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
    color: #636e72;
}

.setting-btn-sm:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
}

.danger-btn {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
}

.danger-btn:hover {
    background: #e74c3c !important;
    color: #fff !important;
}

.setting-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #636e72;
    margin: 12px 0 6px;
}

/* ========== 📖 单选按钮组样式 ========== */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover {
    background: rgba(108, 92, 231, 0.05);
    border-color: rgba(108, 92, 231, 0.4);
}

.radio-option.active {
    background: rgba(108, 92, 231, 0.1);
    border-color: #6c5ce7;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.2);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #b2bec3;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.radio-option.active .radio-circle {
    border-color: #6c5ce7;
    background: #6c5ce7;
}

.radio-option.active .radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-text {
    flex: 1;
}

.radio-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 2px;
}

.radio-option.active .radio-title {
    color: #6c5ce7;
}

.radio-desc {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
}

.setting-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #f1f2f6;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}

.setting-input:focus {
    border-color: #6c5ce7;
    background: rgba(108, 92, 231, 0.02);
}

.setting-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 2px solid #f1f2f6;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.setting-textarea:focus {
    border-color: #6c5ce7;
    background: rgba(108, 92, 231, 0.02);
}

.avatar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.avatar-label {
    font-size: 13px;
    font-weight: 600;
    color: #636e72;
}

.avatar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-avatar-preview {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.setting-switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.setting-switch-row span {
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
}

.setting-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
}

.setting-switch input[type="checkbox"] {
    width: 40px;
    height: 20px;
    position: relative;
    appearance: none;
    background: #dfe6e9;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
}

.setting-switch input[type="checkbox"]:checked {
    background: #6c5ce7;
}

.setting-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-switch input[type="checkbox"]:checked::before {
    left: 22px;
}

.setting-switch span {
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
}

.setting-select {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: 2px solid #f1f2f6;
    background: #fff;
    border-radius: 10px;
    font-weight: 600;
    color: #2d3436;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-select:hover {
    border-color: #6c5ce7;
}

.setting-select:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

/* 挂载系统展开样式 */
.mount-expandable {
    margin-bottom: 12px;
}

.mount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, rgba(162, 155, 254, 0.1), rgba(108, 92, 231, 0.1));
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.mount-header:hover {
    background: linear-gradient(135deg, rgba(162, 155, 254, 0.2), rgba(108, 92, 231, 0.2));
}

.mount-header span {
    font-size: 14px;
    font-weight: 600;
    color: #6c5ce7;
}

.mount-header i {
    font-size: 20px;
    color: #6c5ce7;
    transition: transform 0.3s;
}

.mount-content {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
    margin-top: -10px;
    padding-top: 15px;
}

.mount-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.mount-checkbox-item:hover {
    background: rgba(108, 92, 231, 0.05);
}

.mount-checkbox-item input[type="checkbox"],
.mount-checkbox-item input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.mount-checkbox-item span {
    font-size: 14px;
    color: #2d3436;
}

.mount-empty {
    text-align: center;
    padding: 20px;
    color: #b2bec3;
    font-size: 13px;
}

/* 头像源选择菜单 */
.avatar-source-menu {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.avatar-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.avatar-menu-content {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.avatar-menu-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 16px;
    text-align: center;
}

.avatar-menu-btn {
    width: 100%;
    padding: 14px;
    margin-bottom: 10px;
    border: 2px solid #f1f2f6;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 15px;
    color: #2d3436;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.avatar-menu-btn:active {
    transform: scale(0.98);
    background: rgba(108, 92, 231, 0.05);
    border-color: #6c5ce7;
}

.avatar-menu-btn i {
    font-size: 20px;
    color: #6c5ce7;
}

.avatar-menu-btn.cancel {
    border-color: #dfe6e9;
    color: #636e72;
    margin-top: 8px;
}

.avatar-menu-btn.cancel:active {
    background: #f8f9fa;
    border-color: #dfe6e9;
}

/* ========== 小剧场卡片系统 ========== */
.card-container {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

/* 小票卡片 */
.card-receipt {
    width: 100%;
    max-width: 300px;
}

.receipt-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Courier New', monospace;
    position: relative;
}

.receipt-card::before,
.receipt-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(
        45deg,
        transparent 33.33%,
        #fff 33.33%,
        #fff 66.66%,
        transparent 66.66%
    ),
    linear-gradient(
        -45deg,
        transparent 33.33%,
        #fff 33.33%,
        #fff 66.66%,
        transparent 66.66%
    );
    background-size: 8px 16px;
    background-position: 0 -4px, 4px -4px;
}

.receipt-card::before {
    top: -4px;
}

.receipt-card::after {
    bottom: -4px;
}

.receipt-header {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
}

.receipt-title {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    margin: 10px 0;
}

.receipt-item {
    font-size: 13px;
    margin: 8px 0;
    color: #333;
}

.receipt-price {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin: 15px 0;
    color: #000;
}

.receipt-footer {
    text-align: center;
    font-size: 16px;
    color: #000;
    margin: 10px 0;
}

.receipt-time {
    text-align: center;
    font-size: 11px;
    color: #999;
    margin-top: 10px;
}

/* 评论卡片 */
.card-comment {
    width: 100%;
    max-width: 350px;
}

.comment-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-user {
    font-size: 14px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 6px;
}

.comment-text {
    font-size: 14px;
    color: #636e72;
    line-height: 1.5;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #b2bec3;
}

.comment-actions i {
    cursor: pointer;
    transition: color 0.2s;
}

.comment-actions i:hover {
    color: #ff7675;
}

/* 酒店预订卡片 */
.card-hotel {
    width: 100%;
    max-width: 350px;
}

.hotel-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    color: #fff;
    display: flex;
    gap: 15px;
    align-items: center;
}

.hotel-icon {
    font-size: 48px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.hotel-info {
    flex: 1;
}

.hotel-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hotel-details {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.5;
}

/* NPC 头像 */
/* NPC 头像样式 (按照macaron.style) */
#echo .npc-avatar-box {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 2px;
    border: 2px dashed #ccc;
    transition: 0.3s;
    overflow: hidden;
}

#echo .npc-avatar-box.active {
    border-color: #0d47a1;
    border-style: solid;
    box-shadow: 0 0 12px rgba(13, 71, 161, 0.3);
}

#echo .npc-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* 用户头像框 (按照macaron.style) */
#echo .user-avatar-box {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    cursor: pointer;
    overflow: hidden;
}

#echo .user-avatar-box.active {
    border: 3px solid #0d47a1;
    border-style: solid;
    box-shadow: 0 0 12px rgba(13, 71, 161, 0.4);
    transform: scale(1.05);
}

#echo .user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ========== 马卡龙风格弹窗 ========== */
.macaron-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.macaron-alert.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.macaron-alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.macaron-alert-emoji {
    font-size: 24px;
    line-height: 1;
}

.macaron-alert-text {
    font-size: 15px;
    font-weight: 600;
    color: #2d3436;
    font-family: 'Quicksand', sans-serif;
}

/* ========== 星遇 - 毛玻璃画廊 ========== */
#contact-list {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    overflow-y: auto;
    height: calc(100% - 60px);
    align-content: start;
}

/* 空状态 */
.contact-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    opacity: 0.6;
}

.contact-empty-icon {
    font-size: 80px;
    color: #b2bec3;
}

.contact-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #636e72;
    text-align: center;
}

.contact-empty-hint {
    font-size: 14px;
    color: #b2bec3;
    text-align: center;
}

/* 毛玻璃卡片 */
.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px 15px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(180deg, rgba(162, 155, 254, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.25);
    border-color: #a29bfe;
}

.contact-card:hover::before {
    opacity: 1;
}

.contact-card:active {
    transform: translateY(-2px) scale(1.01);
}

/* 头像 */
.contact-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 4px solid #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.contact-card:hover .contact-avatar {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}

/* 信息区 */
.contact-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.contact-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-desc {
    font-size: 12px;
    color: #636e72;
    text-align: center;
    line-height: 1.4;
    max-height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
    padding: 0 5px;
}

.contact-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.contact-tags .tag {
    padding: 3px 8px;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

/* 添加按钮卡片 */
.contact-add-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px dashed #b2bec3;
    min-height: 180px;
    gap: 10px;
}

.contact-add-card:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: #6c5ce7;
    border-style: solid;
    transform: translateY(-4px);
}

.contact-add-card:active {
    transform: translateY(-2px) scale(0.98);
}

.contact-add-icon {
    font-size: 48px;
    color: #b2bec3;
    transition: all 0.3s ease;
}

.contact-add-card:hover .contact-add-icon {
    color: #6c5ce7;
    transform: rotate(90deg);
}

.contact-add-text {
    font-size: 14px;
    font-weight: 600;
    color: #636e72;
}

.contact-add-card:hover .contact-add-text {
    color: #6c5ce7;
}

/* ========== 角色编辑页面 ========== */
#contact-edit {
    --char-theme: #6c5ce7;
}

/* 头像上传区 */
.char-avatar-area {
    display: flex;
    justify-content: center;
    padding: 30px 0 20px;
}

.char-avatar-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.char-avatar-wrapper:hover {
    transform: scale(1.05);
}

.char-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 35px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.char-avatar-wrapper:hover .char-avatar-img {
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.3);
}

.char-camera-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 34px;
    height: 34px;
    background: var(--char-theme);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
    transition: all 0.2s ease;
}

.char-avatar-wrapper:hover .char-camera-btn {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.5);
}

/* 卡片容器 */
.char-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.char-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--char-theme);
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 1px;
    border-bottom: 1px dashed #dfe6e9;
    padding-bottom: 8px;
}

/* 输入控件 */
.char-input-row {
    margin-bottom: 15px;
}

.char-input-row:last-child {
    margin-bottom: 0;
}

.char-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2d3436;
}

.char-input-box {
    width: 100%;
    border: 2px solid #f1f2f6;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: inherit;
}

.char-input-box:focus {
    background: #fff;
    border-color: var(--char-theme);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.char-textarea {
    resize: none;
    height: 80px;
}

.char-textarea-lg {
    resize: none;
    height: 120px;
}

/* 数字人格卡 */
.char-digital-card {
    border: 2px solid var(--char-theme);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
}

.char-digital-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--char-theme);
    opacity: 0.03;
    pointer-events: none;
}

.char-d-row {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.char-d-avatar-box {
    width: 60px;
    height: 60px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.char-d-avatar-box:hover {
    transform: scale(1.05);
}

.char-d-avatar {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    object-fit: cover;
    border: 2px dashed #b2bec3;
    transition: all 0.2s ease;
}

.char-d-avatar-box:hover .char-d-avatar {
    border-color: var(--char-theme);
    border-style: solid;
}

.char-d-edit {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--char-theme);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* 保存按钮 */
.char-save-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 15px 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    z-index: 150;
}

.char-btn-main {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.3);
}

.char-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

.char-btn-main:active {
    transform: translateY(0);
}

/* ========== 角色详情模态窗 ========== */
.character-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.character-modal.show {
    opacity: 1;
}

.modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.character-modal.show .modal-content {
    transform: scale(1);
}

/* 角色弹窗的标题样式（仅限角色弹窗） */
.character-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 30px 25px 20px;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
    position: relative;
}

.modal-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.modal-title {
    flex: 1;
    min-width: 0;
}

.modal-title h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.modal-title p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========================================
   🌟 全局毛玻璃弹窗样式（强制应用）
   ======================================== */

.modal-body,
.glass,
.glass-panel,
.popup,
.modal-content,
.sidebar,
.contact-menu-content,
.avatar-menu-content,
.character-modal .modal-content {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--glass-text) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    box-shadow: var(--glass-shadow) !important;
}

.modal-body {
    padding: 25px;
}

.modal-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.modal-tags .tag {
    padding: 6px 14px;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #dfe6e9;
    background: #fff;
    color: #2d3436;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.modal-btn.primary {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
    border-color: transparent;
}

.modal-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

/* ========== Echo 聊天列表视图 ========== */
.chat-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    gap: 12px;
}

.chat-list-header h2 {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.chat-list-header .back-btn,
.chat-list-header .menu-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-list-header .back-btn:hover,
.chat-list-header .menu-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.chat-list-header .back-btn:active,
.chat-list-header .menu-btn:active {
    transform: scale(0.95);
}

.chat-list-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

/* 🌙 夜间模式 - 聊天列表项 */
body.dark-mode .chat-list-item {
    background: rgba(30, 30, 35, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

.chat-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.2);
    border-color: #a29bfe;
    background: rgba(255, 255, 255, 0.85);
}

/* 🌙 夜间模式 - hover状态 */
body.dark-mode .chat-list-item:hover {
    background: rgba(40, 40, 50, 0.7) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

.chat-list-item:active {
    transform: scale(0.98);
}

.chat-list-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-list-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-preview {
    font-size: 13px;
    color: #636e72;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* 未读消息徽章（红色） */
.chat-list-badge {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff7675 0%, #e74c3c 100%);
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* 空状态提示 */
.chat-list-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 20px;
}

.chat-list-empty-icon {
    font-size: 64px;
    opacity: 0.3;
}

.chat-list-empty-text {
    font-size: 16px;
    color: #636e72;
    text-align: center;
}

.chat-list-empty-hint {
    font-size: 14px;
    color: #b2bec3;
    text-align: center;
}

/* ========== 联系人菜单 ========== */
.contact-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
}

.contact-menu-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s;
}

.contact-menu-content {
    position: relative;
    background: #fff;
    width: 100%;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.1);
}

.contact-menu-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
    text-align: center;
    margin-bottom: 20px;
}

.contact-menu-btn {
    display: block;
    width: 100%;
    padding: 16px;
    margin-bottom: 12px;
    text-align: left;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-menu-btn i {
    font-size: 20px;
}

.contact-menu-btn:active {
    transform: scale(0.97);
}

.contact-menu-btn.cancel {
    background: #f1f2f6;
    color: #636e72;
    text-align: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
/* ============================================ */
/* ǿ��ҳ�������߼� - �������г�ͻ���� */
/* ============================================ */

/* 1. Ĭ����������ҳ�� */
/* ========== 页面容器（修复全屏覆盖） ========== */
.page {
    display: none !important;
    position: absolute !important;
    top: 0; /* 🎨 从顶部开始，完全覆盖 */
    left: 0;
    width: 100%;
    height: 100%; /* 🎨 完整高度，无需减去状态栏 */
    background-color: #f2f2f7 !important; /* 纯色背景，盖住底层壁纸 */
    z-index: 10;
    overflow: hidden !important;
}

/* 2. 只有带 active 的才显示 */
.page.active {
    display: flex !important;
    flex-direction: column !important;
    z-index: 100 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* 3. 确保主屏幕在最底层，但也能通过 active 显示 */
#home {
    z-index: 1 !important;
    background: transparent !important;
}

#home.active {
    z-index: 50 !important;
    display: flex !important;
}

/* 焕彩应用使用 Taro 渐变背景 */
#screen-settings {
    background: var(--bg-gradient-taro, linear-gradient(135deg, #f7f3f0 0%, #eaddf7 100%)) !important;
}

/* 4. �༭ҳ��ǿ��ȫ������ */
.full-screen-edit-page {
    display: none !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #f5f5f7 !important;
    z-index: 200 !important;
}

.full-screen-edit-page.active {
    display: flex !important;
    flex-direction: column !important;
}

/* 5. ��ֹ��ҳ�������ʾ */
.phone-frame > .screen-content > .page:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ========== Echo Tab 栏修复 - 移除多余空白 ========== */
/* 强制主容器无padding，让Tab栏紧贴底部 */
#echo {
    padding: 0 !important;
}

#echo .chat-area {
    padding: 0 !important;
}

.echo-tabs {
    margin: 0 !important;
}

.chat-list-container {
    margin: 0 !important;
}

/* ========== 聊天列表新样式 (来自 AI-Social-App) ========== */
/* 使用 .chat-item 类名以区别于旧样式 */
.chat-item {
    background: var(--card-bg, #ffffff);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    transition: transform 0.1s;
    cursor: pointer;
    margin-bottom: 12px;
}

/* 🌙 夜间模式 - 聊天列表项液态玻璃 */
body.dark-mode .chat-item {
    background: rgba(30, 30, 35, 0.6) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

.chat-item:active {
    transform: scale(0.98);
}

/* 头像区域 */
.avatar-box {
    width: 50px;
    height: 50px;
    position: relative;
    flex-shrink: 0;
}

/* 单人头像 */
.single-avatar {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    object-fit: cover;
}

/* 群聊堆叠头像 */
.group-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.stack-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    position: absolute;
    object-fit: cover;
}

.stack-img.s-1 {
    bottom: 0;
    left: 0;
    z-index: 2;
}

.stack-img.s-2 {
    top: 0;
    right: 0;
    z-index: 1;
    opacity: 0.8;
}

/* 文字内容 */
.chat-info {
    flex: 1;
    overflow: hidden;
}

.chat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main, #2d3436);
}

.chat-time {
    font-size: 11px;
    color: var(--text-sub, #b2bec3);
    font-weight: 600;
}

.chat-msg {
    font-size: 13px;
    color: #636e72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sender-highlight {
    color: var(--accent, #6c5ce7);
    font-weight: 600;
    margin-right: 4px;
}

/* 未读红点 */
.badge {
    background: var(--pink, #fd79a8);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(253, 121, 168, 0.3);
}

/* ========== 朋友圈样式 (来自 AI-Social-App) ========== */
/* 动态卡片 */
.feed-card {
    background: #fff;
    margin: 0 20px 25px;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.feed-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.feed-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: cover;
}

.feed-meta {
    flex: 1;
}

.feed-meta h4 {
    margin: 0;
    font-size: 15px;
    color: var(--text-main, #2d3436);
}

.feed-meta span {
    font-size: 11px;
    color: var(--text-sub, #b2bec3);
}

.feed-text {
    font-size: 14px;
    line-height: 1.6;
    color: #2d3436;
    margin-bottom: 12px;
}

.feed-imgs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.feed-imgs img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.feed-imgs img:hover {
    transform: scale(1.05);
}

/* 底部按钮栏 */
.feed-actions {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #f5f6fa;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #636e72;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.action-btn i {
    font-size: 18px;
}

.action-btn.active {
    color: var(--pink, #fd79a8);
}

.action-btn:hover {
    color: var(--accent, #6c5ce7);
}

/* === 评论区 (核心交互) === */
.comment-section {
    margin-top: 15px;
    background: #f8f9fa;
    border-radius: 16px;
    padding: 15px;
    display: none;
    animation: slideDown 0.2s ease-out;
}

.comment-section.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-item {
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.c-name {
    color: var(--accent, #6c5ce7);
    font-weight: 700;
    margin-right: 4px;
}

.c-text {
    color: #636e72;
}

.input-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.c-input {
    flex: 1;
    border: none;
    background: #fff;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
}

.c-send {
    background: var(--accent, #6c5ce7);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0 15px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.c-send:hover {
    background: var(--text-light, #a29bfe);
}

.c-send:active {
    transform: scale(0.95);
}

/* ========== AI������ť�������� ========== */
@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

.interact-key {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd6e8 0%, #e6d9ff 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s var(--spring-easing);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.interact-key:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.interact-key:active {
    transform: scale(0.95);
}

.interact-key.shaking {
    animation: shake 0.5s infinite;
}

/* ========== Ⱥ�Ĳ������ʽ ========== */
.group-members-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: rgba(108, 92, 231, 0.05);
    border-radius: 12px;
}

.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.member-card.selected {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: #fff;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.member-card.selected .member-avatar {
    border-color: #fff;
}

.member-name {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
}

/* ========== 🎨 焕彩应用强制修复 ========== */

/* 1. App 全屏覆盖（修复状态栏断层） */
.page {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10 !important;
    background: #f2f2f7 !important; /* 盖住底层壁纸 */
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.page:not(.active) {
    display: none !important;
}

/* 主屏幕在最底层 */
#home {
    z-index: 1 !important;
    background: transparent !important;
}

/* 焕彩应用使用 Taro 渐变背景 */
#screen-settings {
    background: var(--bg-gradient-taro, linear-gradient(135deg, #f7f3f0 0%, #eaddf7 100%)) !important;
}

/* 2. 主屏时间透明且穿透点击 */
.taro-status-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 414px !important;
    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none !important;
    z-index: 1000 !important;
    pointer-events: none !important; /* 穿透点击 */
}

.taro-status-header > * {
    pointer-events: auto !important; /* 恢复子元素点击 */
}

/* 3. 主屏时间文字颜色 */
.taro-status-header.text-dark {
    color: #333 !important;
}

.taro-status-header.text-light {
    color: var(--text-dark-taro, #6d6466) !important;
}

/* ========================================================================== */
/* 夜间模式全局样式 - 最高优先级 */
/* ========================================================================== */

/* 当body有dark-mode类时的全局样式 */
body.dark-mode {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%) !important;
    color: #f0f0f0 !important;
}

/* 手机容器背景 */
body.dark-mode .phone-container {
    background: linear-gradient(135deg, #16213e 0%, #0f1419 100%) !important;
}

/* 所有页面容器 - 超高优先级 */
body.dark-mode .page,
body.dark-mode .screen,
body.dark-mode .persons-page,
body.dark-mode .contact-page,
body.dark-mode .beings-page,
body.dark-mode #persons,
body.dark-mode #contact,
body.dark-mode #beings,
body.dark-mode #echo,
body.dark-mode #genesis {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%) !important;
    color: #f0f0f0 !important;
}

/* 焕彩界面专用 - 深色渐变 */
body.dark-mode #screen-settings {
    background: linear-gradient(180deg, #2a2a3e 0%, #1f1f2e 100%) !important;
}

/* Taro主屏幕背景 */
body.dark-mode .taro-home {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%) !important;
}

/* 所有卡片 - 液态毛玻璃质感 */
body.dark-mode .card,
body.dark-mode .taro-setting-card,
body.dark-mode .settings-group,
body.dark-mode .contact-card,
body.dark-mode .persona-card,
body.dark-mode .being-card,
body.dark-mode .swiper-slide {
    background: rgba(30, 30, 30, 0.6) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    color: #f0f0f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* 所有头部 */
body.dark-mode .header,
body.dark-mode .app-header,
body.dark-mode .taro-nav-bar {
    background: rgba(26, 26, 46, 0.95) !important;
    color: #f0f0f0 !important;
}

/* 所有标题文字 */
body.dark-mode .header-title,
body.dark-mode .taro-card-title,
body.dark-mode .taro-section-header,
body.dark-mode .taro-wp-label,
body.dark-mode .taro-font-item,
body.dark-mode .taro-app-name,
body.dark-mode .taro-bi-text,
body.dark-mode .taro-pc-name,
body.dark-mode .taro-pc-role,
body.dark-mode h1,
body.dark-mode h2, 
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode .app-title,
body.dark-mode .persona-name,
body.dark-mode .contact-name,
body.dark-mode .being-name {
    color: #f0f0f0 !important;
}

/* 所有段落和文字 */
body.dark-mode p,
body.dark-mode span:not(.badge),
body.dark-mode div:not(.btn):not(.button),
body.dark-mode label {
    color: #f0f0f0 !important;
}

/* 所有输入框 */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .search-input {
    background: rgba(30, 30, 45, 0.8) !important;
    color: #f0f0f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* CSS编辑器 */
body.dark-mode .taro-code-area {
    background: rgba(20, 20, 30, 0.9) !important;
    color: #f0f0f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* 按钮 */
body.dark-mode button:not(.btn-primary):not([class*="primary"]):not(.taro-save-btn) {
    background: rgba(50, 50, 70, 0.8) !important;
    color: #f0f0f0 !important;
}

/* 手机框架 */
body.dark-mode .phone-frame {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%) !important;
}

/* 主屏幕 */
body.dark-mode #home {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%) !important;
    color: #f0f0f0 !important;
}

/* 列表项 */
body.dark-mode .list-item,
body.dark-mode .contact-item,
body.dark-mode .being-item,
body.dark-mode .list-wrap > *,
body.dark-mode .content-area > * {
    background: rgba(40, 40, 60, 0.5) !important;
    color: #f0f0f0 !important;
}

/* 图标 */
body.dark-mode i {
    color: #f0f0f0 !important;
}

/* 圆形按钮 */
body.dark-mode .circle-btn {
    background: rgba(50, 50, 70, 0.8) !important;
    color: #f0f0f0 !important;
}

/* 过滤栏 */
body.dark-mode .filter-bar {
    background: rgba(26, 26, 46, 0.9) !important;
}

/* Swiper 容器 */
body.dark-mode .swiper-container {
    background: transparent !important;
}

/* 确保壁纸预览框可见 */
body.dark-mode .taro-wp-preview {
    opacity: 0.8;
}

/* 模式切换按钮高亮 */
body.dark-mode .taro-mode-option.active {
    background: rgba(100, 100, 140, 0.8) !important;
}

/* Echo聊天气泡 */
body.dark-mode .message-bubble {
    background: rgba(50, 50, 70, 0.8) !important;
    color: #f0f0f0 !important;
}

body.dark-mode .message-bubble.me {
    background: rgba(90, 90, 140, 0.8) !important;
}

/* 编辑页面 */
body.dark-mode .full-screen-edit-page {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%) !important;
}

/* 保存栏 */
body.dark-mode .save-bar,
body.dark-mode .taro-save-bar {
    background: rgba(26, 26, 46, 0.95) !important;
    backdrop-filter: blur(20px) !important;
}

/* 底部保存按钮保持原色 */
body.dark-mode .taro-save-btn {
    background: var(--color-cocoa-dark, #8d6e63) !important;
    color: #fff !important;
}

/* 日期文字 */
body.dark-mode .taro-date-big {
    color: #f0f0f0 !important;
}

/* 状态栏文字 */
body.dark-mode .taro-status-header {
    color: #f0f0f0 !important;
}

/* =========================================
   🔧 UniversalUploader - 通用上传器样式
   液态玻璃拟态设计
   ========================================= */

/* 遮罩层 - 在手机屏幕内显示 */
.uploader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: uploaderFadeIn 0.3s ease;
}

.uploader-overlay.uploader-show {
    display: flex;
}

@keyframes uploaderFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹窗主体 - 适配手机屏幕 */
.uploader-modal {
    width: 85%;
    max-width: 320px;
    max-height: 80%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: uploaderSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes uploaderSlideIn {
    from {
        transform: scale(0.9) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 内容容器 */
.uploader-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* 滚动条样式 */
.uploader-content::-webkit-scrollbar {
    width: 8px;
}

.uploader-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.uploader-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.uploader-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 头部 */
.uploader-header {
    padding: 30px 25px 25px;
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.uploader-icon {
    font-size: 48px;
    margin-bottom: 10px;
    animation: uploaderIconPulse 2s ease-in-out infinite;
}

@keyframes uploaderIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.uploader-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.uploader-subtitle {
    font-size: 14px;
    color: #666;
}

.uploader-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 20px;
    color: #666;
}

.uploader-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

/* 主体内容 */
.uploader-body {
    padding: 25px;
}

/* 区域标题 */
.uploader-section {
    margin-bottom: 20px;
}

.uploader-section-title {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.uploader-section-title i {
    font-size: 16px;
}

/* 输入框组 */
.uploader-input-group {
    display: flex;
    gap: 10px;
}

.uploader-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    color: #333;
    outline: none;
    transition: 0.2s;
}

.uploader-input:focus {
    border-color: #4fc3f7;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.1);
}

.uploader-input::placeholder {
    color: #999;
}

/* 按钮 */
.uploader-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.uploader-btn-primary {
    background: linear-gradient(135deg, #4fc3f7, #2196f3);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

.uploader-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.4);
}

.uploader-btn-primary:active {
    transform: translateY(0);
}

.uploader-btn-secondary {
    background: rgba(79, 195, 247, 0.1);
    color: #2196f3;
    border: 2px solid rgba(79, 195, 247, 0.3);
}

.uploader-btn-secondary:hover {
    background: rgba(79, 195, 247, 0.2);
    border-color: rgba(79, 195, 247, 0.5);
}

/* 分隔线 */
.uploader-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #999;
    font-size: 13px;
}

.uploader-divider::before,
.uploader-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.uploader-divider span {
    padding: 0 15px;
}

/* 拖拽区域 */
.uploader-drop-zone {
    border: 2px dashed rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    transition: 0.3s;
    cursor: pointer;
}

.uploader-drop-zone:hover {
    border-color: #4fc3f7;
    background: rgba(79, 195, 247, 0.05);
}

.uploader-drop-zone.uploader-drag-over {
    border-color: #2196f3;
    background: rgba(79, 195, 247, 0.15);
    transform: scale(1.02);
}

.uploader-drop-zone > i {
    font-size: 48px;
    color: #4fc3f7;
    margin-bottom: 15px;
    display: block;
}

.uploader-drop-text {
    font-size: 16px;
    color: #555;
    margin-bottom: 8px;
}

.uploader-drop-hint {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

/* 底部 */
.uploader-footer {
    padding: 15px 25px 25px;
    background: rgba(0, 0, 0, 0.02);
}

.uploader-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.uploader-tip i {
    font-size: 16px;
    color: #4fc3f7;
}

/* 加载状态 */
.uploader-loading {
    text-align: center;
    padding: 60px 20px;
}

.uploader-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(79, 195, 247, 0.2);
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: uploaderSpin 1s linear infinite;
}

@keyframes uploaderSpin {
    to { transform: rotate(360deg); }
}

.uploader-loading-text {
    font-size: 16px;
    color: #666;
}

/* 错误提示 */
.uploader-error {
    padding: 12px 16px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 12px;
    color: #d32f2f;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: uploaderShake 0.5s ease;
}

@keyframes uploaderShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.uploader-error i {
    font-size: 20px;
}

/* 夜间模式适配 */
body.dark-mode .uploader-modal {
    background: rgba(30, 30, 35, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .uploader-header {
    background: linear-gradient(180deg, rgba(40, 40, 45, 0.8) 0%, rgba(30, 30, 35, 0.4) 100%);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .uploader-title {
    color: #f0f0f0;
}

body.dark-mode .uploader-subtitle {
    color: #aaa;
}

body.dark-mode .uploader-close {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

body.dark-mode .uploader-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .uploader-section-title {
    color: #ddd;
}

body.dark-mode .uploader-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
}

body.dark-mode .uploader-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #4fc3f7;
}

body.dark-mode .uploader-drop-zone {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .uploader-drop-zone:hover {
    background: rgba(79, 195, 247, 0.1);
}

body.dark-mode .uploader-drop-text {
    color: #ddd;
}

body.dark-mode .uploader-drop-hint {
    color: #888;
}

body.dark-mode .uploader-footer {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode .uploader-tip {
    color: #aaa;
}

body.dark-mode .uploader-loading-text {
    color: #aaa;
}

/* ========== 星汇弹窗位置修正 ========== */
/* 确保所有弹窗在手机内部 */
#starhub .modal-mask {
    position: absolute !important; /* 相对于#starhub定位 */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: auto !important; /* 确保可点击 */
}

#starhub .modal-mask.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ========== 星汇横向滚动优化 ========== */
/* 隐藏横向滚动条但保持可滚动 */
#starhub-chips-container::-webkit-scrollbar {
    height: 0px !important;
    display: none !important;
}

#starhub-chips-container {
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    scroll-snap-type: x proximity;
}

/* 确保chip不会被压缩 */
#starhub-chips-container .chip {
    flex-shrink: 0 !important;
    min-width: fit-content !important;
    padding: 8px 16px !important;
}

/* 内容纵向滚动优化 */
.scroll-content,
#starhub-content-area {
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    overflow-y: scroll !important;
}

#starhub-content-area::-webkit-scrollbar,
.scroll-content::-webkit-scrollbar {
    width: 0px !important;
    display: none !important;
}

/* 确保标签容器可以完整滚动 */
#starhub-chips-container {
    scroll-padding-right: 20px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: scroll !important;
}

/* 强制标签栏可滑动 */
#starhub .cat-scroll,
#starhub [style*="overflow-x"] {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 确保chip不会被压缩 */
#starhub .chip {
    flex-shrink: 0 !important;
}

/* Chip样式优化 */
.chip {
    transition: all 0.3s ease !important;
}

.chip:active {
    transform: scale(0.95) !important;
}

/* 身份选择器hover效果 */
.identity-option:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: translateX(3px);
}

.identity-option input:checked + div {
    opacity: 1;
}

/* 确认按钮hover效果 */
#confirm-identity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ========== 通知中心样式 ========== */
/* 通知项hover效果 - 亮白风格 */
.notif-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3) !important;
    background: rgba(255, 255, 255, 1) !important;
}

/* 毛玻璃输入框样式 */
.glass-input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    backdrop-filter: blur(10px);
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    outline: none;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.glass-input option {
    background: #667eea;
    color: white;
}

/* 通知列表滚动条优化 */
#notif-list-starhub::-webkit-scrollbar {
    width: 4px;
}

#notif-list-starhub::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

#notif-list-starhub::-webkit-scrollbar-thumb {
    background: rgba(161, 140, 209, 0.3);
    border-radius: 2px;
}

#notif-list-starhub::-webkit-scrollbar-thumb:hover {
    background: rgba(161, 140, 209, 0.5);
}

/* 红点脉动动画 */
#notif-badge {
    animation: notif-pulse 2s infinite;
}

@keyframes notif-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Toast提示动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* ========== 星汇登录页样式修正 ========== */
/* 确保登录页铺满手机屏幕但不溢出 */
#view-login-starhub {
    position: absolute !important; /* 限制在父容器(.page)内 */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(45deg, #ff9a9e, #fad0c4, #fad0c4, #a18cd1, #fbc2eb) !important;
    background-size: 400% 400% !important;
    animation: gradientBG 15s ease infinite !important;
    z-index: 100 !important;
    /* 移除 display: flex !important; 让 JS 可以控制显示/隐藏 */
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 40px 20px !important;
    overflow-y: auto !important; /* 允许垂直滚动防止内容溢出 */
}

/* 渐变动画 */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   🌟 强制修复所有弹窗的毛玻璃质感
   ======================================== */

/* 所有模态框容器 */
.modal,
.modal-mask,
.sidebar-mask,
.contact-menu-mask,
.avatar-menu-overlay,
.avatar-source-menu .avatar-menu-overlay,
.all-characters-modal-overlay,
.group-chat-selector-overlay,
.list-menu-overlay {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* ========================================
   🎨 统一头像选择器样式
   ======================================== */

.avatar-setter-group {
    position: relative;
}

.avatar-setter-group .avatar-preview {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.avatar-setter-group .avatar-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15) !important;
}

.avatar-setter-group .avatar-actions {
    display: flex;
    gap: 10px;
}

.avatar-setter-group .btn-icon {
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.avatar-setter-group .btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    background: #fff !important;
}

.avatar-setter-group .btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
}

.avatar-setter-group .btn-icon i {
    transition: transform 0.2s ease;
}

.avatar-setter-group .btn-icon:hover i {
    transform: scale(1.1);
}

/* 摇骰子特效 */
@keyframes dice-roll {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.avatar-setter-group .btn-icon:hover .ri-dice-line {
    animation: dice-roll 0.5s ease-in-out;
}

/* 其他星汇视图容器样式 */
#view-home-starhub,
#view-detail-starhub,
#view-editor-starhub {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(45deg, #ff9a9e, #fad0c4, #fad0c4, #a18cd1, #fbc2eb) !important;
    background-size: 400% 400% !important;
    animation: gradientBG 15s ease infinite !important;
    z-index: 50 !important; /* 确保在登录页下方 */
}

/* ========================================================================
   🚨 强制红包系统沙盒约束（紧急修复补丁）
   ======================================================================== */

/* 强制手机壳作为绝对定位参照系（已在 .phone-frame 中设置） */
.phone-container {
    position: relative !important;
}

/* 强制所有红包相关的弹窗、遮罩、详情页被锁死在手机壳内 */
.modal-overlay, 
#modal-rp-open,
#modal-send-rp,
#rp-details-view,
.red-packet-detail-modal, 
.red-packet-modal,
[class*="modal-mask"],
.player-modal,
.reader-overlay {
    position: absolute !important; /* 严禁使用 fixed */
    top: 0 !important; 
    left: 0 !important; 
    right: 0 !important; 
    bottom: 0 !important;
    width: 100% !important; 
    height: 100% !important;
    margin: 0 !important;
    z-index: 9999;
}

/* 定位面板单独处理，确保未打开时不阻挡点击且不可见 */
.loc-panel {
    position: absolute !important;
    top: 0 !important; 
    left: 0 !important; 
    right: 0 !important; 
    bottom: 0 !important;
    width: 100% !important; 
    height: 100% !important;
    margin: 0 !important;
    z-index: 9999;
    pointer-events: none !important;
    display: none !important; /* 🔧 默认隐藏 */
    flex-direction: column;
}

.loc-panel.open {
    display: flex !important; /* 🔧 打开时显示 */
    pointer-events: auto !important;
}

/* 确保 iphone-frame 也被约束（如果项目使用） */
.iphone-frame {
    position: relative !important;
    overflow: hidden !important;
}

/* 强制所有全屏遮罩层使用 absolute */
[class*="overlay"]:not(.avatar-menu-overlay):not(.all-characters-modal-overlay) {
    position: absolute !important;
}

/* ========== 🍎 苹果级毛玻璃 Toast 样式 ========== */
.glass-toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translate(-50%, -20px) scale(0.95);
    opacity: 0;
    /* 极低透明度的渐变底色，模拟玻璃表面的光影 */
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 100%) !important;
    /* 核心魔法：超大模糊 + 180%的色彩饱和度折射 */
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    /* 玻璃高光边缘 */
    border: 1px solid rgba(255,255,255,0.5) !important;
    border-bottom-color: rgba(255,255,255,0.2) !important;
    border-right-color: rgba(255,255,255,0.2) !important;
    /* 柔和的弥散阴影 */
    box-shadow: 0 12px 40px rgba(0,0,0,0.1), inset 0 0 0 1px rgba(255,255,255,0.3) !important;
    border-radius: 16px !important;
    padding: 14px 20px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: max-content !important;
    max-width: 85vw !important;
    z-index: 9999 !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.glass-toast.show {
    transform: translate(-50%, 0) scale(1) !important;
    opacity: 1 !important;
}

.glass-toast i {
    font-size: 20px !important;
    flex-shrink: 0 !important;
    margin-top: 1px !important;
}

.glass-toast .toast-text {
    color: #455a64 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    word-break: break-word !important;
}

.glass-toast.success i {
    color: #10b981 !important;
}

.glass-toast.error i {
    color: #ef4444 !important;
}

.glass-toast.warning i {
    color: #f59e0b !important;
}

.glass-toast.info i {
    color: #3b82f6 !important;
}

/* 夜间模式适配 */
body.dark-mode .glass-toast,
body[data-theme="dark"] .glass-toast {
    background: linear-gradient(135deg, rgba(50,50,65,0.5) 0%, rgba(35,35,50,0.3) 100%) !important;
    border-color: rgba(255,255,255,0.15) !important;
    border-bottom-color: rgba(255,255,255,0.05) !important;
    border-right-color: rgba(255,255,255,0.05) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.1) !important;
}

body.dark-mode .glass-toast .toast-text,
body[data-theme="dark"] .glass-toast .toast-text {
    color: #b0bec5 !important;
}

/* ==========================================
   手机端外壳切换 - 双状态控制
   ========================================== */
@media screen and (max-width: 768px) {
    /* 基础：防止页面滚动 */
    body {
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    
    /* 过渡动画 */
    .phone-frame {
        transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    }

    /* =========================================
       状态 A：带壳模式（默认，body 没有 .is-fullscreen）
       完整显示手机外壳，等比缩小居中
       ========================================= */
    body:not(.is-fullscreen) .phone-container {
        width: 100vw !important;
        height: 100vh !important; /* iOS fallback */
        height: 100dvh !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    body:not(.is-fullscreen) .phone-frame {
        width: 375px !important;
        height: 812px !important;
        border-radius: 55px !important;
        border: 6px solid #fff !important;
        box-shadow: 0 0 0 12px rgba(255,255,255,0.3), 0 30px 60px rgba(0,0,0,0.3) !important;
        position: relative !important;
        transform: scale(calc(min(85vw / 390, 85vh / 860))) !important; /* iOS fallback */
        transform: scale(calc(min(85vw / 390, 85dvh / 860))) !important;
        transform-origin: center center !important;
        overflow: hidden !important;
    }

    /* =========================================
       状态 B：沉浸全屏模式（body.is-fullscreen）
       扒掉所有外壳，铺满真机屏幕（iOS 兼容）
       ========================================= */
    body.is-fullscreen .phone-container {
        width: 100vw !important;
        width: 100% !important; /* iOS 额外兼容 */
        height: 100vh !important; /* iOS fallback */
        height: 100dvh !important;
        height: 100% !important; /* iOS 额外兼容 */
        min-height: -webkit-fill-available !important; /* iOS 特殊修复 */
        display: flex !important;
        padding: 0 !important;
        margin: 0 !important;
        position: fixed !important; /* iOS 修复：固定定位 */
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 9999 !important; /* 确保在最上层 */
        -webkit-overflow-scrolling: touch !important;
    }
    
    body.is-fullscreen .phone-frame {
        width: 100vw !important;
        width: 100% !important; /* iOS 额外兼容 */
        height: 100vh !important; /* iOS fallback */
        height: 100dvh !important;
        height: 100% !important; /* iOS 额外兼容 */
        min-height: -webkit-fill-available !important; /* iOS 特殊修复 */
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        position: relative !important;
        transform: none !important;
        -webkit-transform: none !important; /* iOS 前缀 */
        overflow: hidden !important;
        max-width: none !important; /* 移除宽度限制 */
    }
    
    body.is-fullscreen #phone-screen {
        width: 100vw !important;
        width: 100% !important; /* iOS 额外兼容 */
        height: 100vh !important; /* iOS fallback */
        height: 100dvh !important;
        height: 100% !important; /* iOS 额外兼容 */
        min-height: -webkit-fill-available !important; /* iOS 特殊修复 */
        border-radius: 0 !important;
        position: relative !important;
    }

    /* 全屏模式安全距离（防刘海遮挡） */
    body.is-fullscreen .status-header {
        padding-top: max(20px, env(safe-area-inset-top)) !important;
    }
    body.is-fullscreen .dock-container {
        padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    }
}
