

/* --- 全局与根样式 (Global & Root) --- */
:root { --wechat-green: #07c160; --phone-width: 410px; --phone-height: 880px; --body-bg: #f5f5f7; --phone-bg: #f1f1f1; --header-bg: #f9f9f9; --header-text: #1d1d1f; --app-icon-text: #1d1d1f; --system-message-color: #a5a5a5; --user-bubble-bg: #95ec69; --user-bubble-text: #000000; --ai-bubble-bg: #ffffff; --ai-bubble-text: #1d1d1f; --input-area-bg: #f5f5f7; --input-bg: #ffffff; --input-border: #dcdcdc; --button-primary: #9a9a9a; --button-secondary: #8e8e8e; --button-text: #ffffff; --delete-bg: #000; --bubble-font-size: 17px; --bubble-padding: 8px 14px; --avatar-size: 40px; --message-gap: 10px; --image-url: url('https://tc-new.z.wiki/autoupload/f/g2E4rq2KW7hb1aP6h38mzQOl5k4rWd6ICs9RmUwdtjmyl5f0KlZfm6UsKj-HyTuv/20250918/3LJk/400X708/GIF_20250918214906766.gif/webp'); --work-page-bg: linear-gradient(135deg, #4a5568 0%, #718096 30%, #a0aec0 60%, #cbd5e0 100%); --work-card-text: #1d1d1f; --work-card-text-secondary: #4a4a4a; }
body.dark-mode, #phone-screen.dark-mode { --body-bg: #1c1c1e; --phone-bg: #000000; --header-bg: #000000; --header-text: #d9d9d9; --app-icon-text: #d9d9d9; --system-message-color: #8a8a8a; --user-bubble-bg: #27b561; --user-bubble-text: #111111; --ai-bubble-bg: #2c2c2e; --ai-bubble-text: #d9d9d9; --input-area-bg: #000000; --input-bg: #2c2c2c; --input-border: #3a3a3c; --button-primary: #07c160; --button-secondary: #3a3a3c; --button-text: #d9d9d9; --delete-bg: #ff3b30; --work-page-bg: linear-gradient(135deg, #1a202c 0%, #2d3748 30%, #4a5568 60%, #718096 100%); --work-card-text: #ffffff; --work-card-text-secondary: #e0e0e0; }
#phone-screen.bubble-small, #preview-phone-screen-container.bubble-small, #beautify-preview.bubble-small { --bubble-font-size: 14px; --bubble-padding: 6px 10px; --avatar-size: 32px; --message-gap: 8px; }
        #phone-screen.bubble-large, #preview-phone-screen-container.bubble-large, #beautify-preview.bubble-large { --bubble-font-size: 20px; --bubble-padding: 10px 18px; --avatar-size: 48px; --message-gap: 12px; }
        
        /* 开关样式 */
        .switch .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: .4s; }
        .switch input:checked + .slider { background-color: #007aff; }
        .switch input:checked + .slider:before { transform: translateX(26px); }
        
        /* 滑块样式 */
        input[type="range"] {
            -webkit-appearance: none;
            appearance: none;
        }
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #34C759;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(52, 199, 89, 0.4);
            transition: all 0.2s;
        }
        input[type="range"]::-webkit-slider-thumb:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(52, 199, 89, 0.6);
        }
        input[type="range"]::-moz-range-thumb {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #34C759;
            cursor: pointer;
            border: none;
            box-shadow: 0 2px 8px rgba(52, 199, 89, 0.4);
            transition: all 0.2s;
        }
        input[type="range"]::-moz-range-thumb:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(52, 199, 89, 0.6);
        }
        
        /* 论坛滑块 - 黑白方框风格 */
        #forum-refresh-interval {
            height: 6px;
            border-radius: 3px;
            background: #E0E0E0;
            outline: none;
        }
        #forum-refresh-interval::-webkit-slider-thumb {
            width: 20px;
            height: 20px;
            border-radius: 0;
            background: #000000;
            border: 2px solid #000000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        #forum-refresh-interval::-webkit-slider-thumb:hover {
            background: #1a1a1a;
            border-color: #1a1a1a;
            box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
        }
        #forum-refresh-interval::-moz-range-thumb {
            width: 20px;
            height: 20px;
            border-radius: 0;
            background: #000000;
            border: 2px solid #000000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        #forum-refresh-interval::-moz-range-thumb:hover {
            background: #1a1a1a;
            border-color: #1a1a1a;
            box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
        }
        #forum-refresh-interval::-webkit-slider-runnable-track {
            background: #E0E0E0;
            border-radius: 3px;
        }
        #forum-refresh-interval::-moz-range-track {
            background: #E0E0E0;
            border-radius: 3px;
        }
* { -webkit-tap-highlight-color: transparent; }
input, textarea, [contenteditable] { touch-action: manipulation; user-select: text; -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; }
/* ▼▼▼ iOS全屏适配：参考index9的简洁方案 ▼▼▼ */
html {
    -webkit-text-size-adjust: 100%;
    height: 100%; /* 确保html元素也能撑满 */
}

body { 
    margin: 0; 
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-color: var(--phone-bg); 
    overflow: hidden; 
    touch-action: manipulation; 
    user-select: none; 
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    -webkit-touch-callout: none; 
    -webkit-tap-highlight-color: transparent;
    height: 100%; /* 让body也撑满父元素(html) */
}

/* 确保所有输入框和文本区域可以正常选择和输入 */
input, textarea, [contenteditable="true"] {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    cursor: text !important;
}

/* iOS拖拽防护 - 消息气泡和交互元素 */
.message-bubble, .message-wrapper, .message-content {
    touch-action: manipulation !important;
    -webkit-user-drag: none !important;
    -webkit-touch-callout: none !important;
}

/* 防止聊天区域的意外拖拽 */
#chat-screen, #phone-screen {
    touch-action: manipulation !important;
    -webkit-user-drag: none !important;
}

/* iOS设备专用拖拽防护 */
@supports (-webkit-touch-callout: none) {
    /* iOS设备的额外保护 */
    .message-wrapper, .message-bubble, .content {
        -webkit-user-drag: none !important;
        -webkit-touch-callout: none !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }
    
    /* 聊天消息区域严格禁用拖拽 */
    .chat-messages {
        -webkit-user-drag: none !important;
        -webkit-touch-callout: none !important;
        touch-action: pan-y !important; /* 只允许垂直滚动 */
    }
    
    /* 确保所有文本内容不会被拖拽 */
    .chat-messages * {
        -webkit-user-drag: none !important;
        -webkit-touch-callout: none !important;
    }
}

/* iOS编辑框按钮点击优化 */
.input-action-btn {
    /* iOS触摸优化 */
    touch-action: manipulation !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
    /* 增加按钮尺寸 */
    min-width: 44px !important;
    min-height: 44px !important;
    /* 提供反馈 */
    transition: transform 0.1s ease !important;
}

.input-action-btn:active {
    transform: scale(0.95) !important;
}

/* iOS专用按钮优化 */
@supports (-webkit-touch-callout: none) {
    .input-action-btn {
        min-width: 48px !important;
        min-height: 48px !important;
        /* 扩大点击区域 */
        position: relative;
    }
    
    /* 增加不可见的点击区域 */
    .input-action-btn::before {
        content: '';
        position: absolute;
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
        background: transparent;
        border-radius: 50%;
        z-index: -1;
    }
    
    /* 为所有编辑框相关按钮增加触摸优化 */
    #show-actions-btn, #send-as-user-btn, #call-api-btn, 
    #send-user-entry-btn, #generate-ai-narrative-btn {
        min-width: 48px !important;
        min-height: 48px !important;
        padding: 8px !important;
    }
    
    /* 输入区域按钮容器优化 */
    .input-wrapper {
        touch-action: manipulation !important;
    }
    
    /* 消息输入区域整体优化 */
    .message-input-area {
        touch-action: manipulation !important;
        -webkit-user-select: none !important;
    }
    
    /* 确保按钮不会被遮挡 */
    .input-wrapper .input-action-btn {
        z-index: 10 !important;
        pointer-events: auto !important;
    }
    
    /* 防止快速连击问题 */
    .input-action-btn {
        will-change: transform !important;
    }
    
    /* iOS Safari特定修复 */
    .input-action-btn:hover {
        background-color: var(--accent-color) !important;
    }
    
    .input-action-btn.secondary:hover {
        background-color: var(--bubble-ai) !important;
    }
}

/* iOS朋友圈页面专用优化 */
@supports (-webkit-touch-callout: none) {
    /* 朋友圈主容器优化 */
    #hub-page-moments {
        -webkit-overflow-scrolling: touch !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        touch-action: pan-y !important;
    }
    
    /* 朋友圈内容区域优化 */
    #moments-feed {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* 动态卡片优化 */
    .moment-post {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: visible !important; /* 改为visible，防止弹出菜单被裁剪 */
        position: relative !important; /* 为选择框提供定位参考 */
    }
    
    /* 动态卡片条目 - 确保评论按钮可见 */
    .qzone-post-item {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
    
    /* 评论底部区域 - 确保评论按钮不被裁剪 */
    .post-footer {
        overflow: visible !important;
    }
    
    /* 评论输入区域 - 确保按钮显示 */
    .comment-section {
        overflow: visible !important;
    }
    
    /* 朋友圈动态卡片 - 确保有足够内边距 */
    .qzone-post-item {
        padding: 12px !important;
    }
    
    /* 评论头像进一步缩小 - 节省空间 */
    .comment-section .comment-avatar {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* 评论输入框 - 超紧凑，给按钮留足空间 */
    .comment-section .comment-input {
        width: 0 !important;
        max-width: none !important;
        flex: 1 1 auto !important;
        min-width: 60px !important;
        padding: 5px 8px !important;
        font-size: 11px !important;
        margin-right: 0 !important;
    }
    
    /* 发送按钮 - 极简样式，确保显示 */
    .comment-send-btn {
        flex-shrink: 0 !important;
        width: 45px !important;
        min-width: 45px !important;
        max-width: 45px !important;
        padding: 5px 6px !important;
        font-size: 10px !important;
        white-space: nowrap !important;
        margin-left: 0 !important;
    }
    
    /* 评论区容器 - 确保flex布局 */
    .comment-section {
        overflow: visible !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        gap: 4px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* 评论底部整体布局 - 极度紧凑 */
    .post-footer {
        display: flex !important;
        gap: 4px !important;
        padding: 8px 10px !important;
        margin-top: 10px !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 图片网格在小屏幕设备上的特殊优化 */
    .post-images-grid {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* 确保所有朋友圈元素不会超出屏幕 */
    .moment-post * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* 文本内容自动换行 */
    .post-body .post-text {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
    }
    
    /* 针对iPhone等小屏幕设备的特别优化 */
    @media (max-width: 390px) {
        .post-images-grid.image-count-1 { 
            max-width: calc(100vw - 80px) !important; 
        }
        .post-images-grid.image-count-2, 
        .post-images-grid.image-count-4 { 
            max-width: calc(100vw - 80px) !important; 
        }
        .post-images-grid.image-count-3, 
        .post-images-grid.image-count-5, 
        .post-images-grid.image-count-6, 
        .post-images-grid.image-count-7, 
        .post-images-grid.image-count-8, 
        .post-images-grid.image-count-9 { 
            max-width: calc(100vw - 80px) !important; 
        }
    }
}
/* ▲▲▲ iOS全屏适配结束 ▲▲▲ */

/* === 性能优化CSS === */
*{will-change:auto;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.screen{transform:translateZ(0);-webkit-transform:translateZ(0)}
img{image-rendering:optimizeSpeed;image-rendering:-webkit-optimize-contrast;image-rendering:optimize-contrast}
#phone-screen,.app-header,.chat-messages,.chat-input-area{transform:translateZ(0);-webkit-transform:translateZ(0)}

@font-face { 
    font-family: 'MyCustomFont'; 
    src: url('https://files.catbox.moe/o17bhh.ttf') format('truetype'); 
    font-display: swap; 
    font-weight: normal;
    font-style: normal;
}
@font-face { 
    font-family: 'MyDiaryFont'; 
    src: url('https://files.catbox.moe/nlu6ea.ttf') format('truetype'); 
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

/* --- 加载屏幕样式 --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    border-radius: 20px;
    background: url('https://i.postimg.cc/svxxqxHz/IMG-9981.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    animation: pulse 2s infinite;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.loading-text {
    color: #333333;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 500;
}

.loading-progress {
    color: #666666;
    font-size: 14px;
}

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

/* --- 动画定义 (Keyframes) --- */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 接收按钮旋转动画 */
@keyframes receive-button-spin { 
    from { transform: translateY(2px) rotate(0deg); } 
    to { transform: translateY(2px) rotate(360deg); } 
}

#dynamic-action-btn.spinning {
    animation: receive-button-spin 1s linear infinite;
    transform-origin: center center;
}

/* 确保旋转时不被其他transform覆盖 */
#dynamic-action-btn.spinning:active {
    animation: receive-button-spin 1s linear infinite;
    transform: translateY(2px) rotate(0deg) scale(0.95);
    transform-origin: center center;
}
@keyframes status-popup-animation { 0% { opacity: 0; transform: translate(-50%, 10px); } 15% { opacity: 1; transform: translate(-50%, -10px); } 85% { opacity: 1; transform: translate(-50%, -10px); } 100% { opacity: 0; transform: translate(-50%, -20px); } }
@keyframes music-progress { from { width: 0%; } to { width: 100%; } }
@keyframes slideUpFadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOutIslandContent { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeInIslandContent { to { opacity: 1; } }
@keyframes bounce-dot { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }
@keyframes slideDownReply { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.message-appear-animation { animation: slideUpFadeIn 0.4s cubic-bezier(0.21, 0.6, 0.25, 1) forwards; }

/* --- 修正动态按钮的大小 --- */
#dynamic-action-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0; /* 防止按钮被压缩 */
}

/* --- 核心布局与屏幕 (Core Layout & Screens) --- */
/* ▼▼▼ iOS全屏适配：参考index9的简洁phone-screen ▼▼▼ */
#phone-screen { 
    width: 100%; 
    /* Use 100vh to ensure it fills the entire screen height */
    height: 100vh; 
    position: relative; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    background-color: var(--phone-bg);
    /* 防止整个屏幕被拖拽 */
    touch-action: manipulation;
    overscroll-behavior: none;
}
/* ▲▲▲ iOS全屏适配结束 ▲▲▲ */
.screen { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: var(--phone-bg); 
    display: flex; 
    flex-direction: column; 
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s; 
    z-index: 1;
    /* 防止屏幕拖拽 */
    touch-action: manipulation;
    overscroll-behavior: contain;
}
.screen.active { opacity: 1; visibility: visible; z-index: 10; }
/* ▼▼▼ iOS全屏适配：参考index9的简洁app-header ▼▼▼ */
.app-header { 
    flex-shrink: 0; 
    padding: 15px 20px; 
    /* 核心：使用 calc() 自动加上顶部的安全距离 */
    padding-top: calc(15px + env(safe-area-inset-top));
    background-color: rgba(247, 247, 247, 0.8); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 18px; 
    font-weight: 600;
    position: relative;
    z-index: 15;
}
/* ▲▲▲ iOS全屏适配结束 ▲▲▲ */
.app-header h2 { margin: 0; font-size: 17px; font-weight: 600; color: var(--header-text); position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); }
.app-header .back-btn { font-size: 24px; color: var(--header-text); cursor: pointer; border: none; padding: 5px 10px; background: none; }
.app-header .header-actions { display: flex; align-items: center; gap: 0px; }
.app-header .action-btn { font-size: 28px; color: var(--button-primary); cursor: pointer; border: none; background: none; font-weight: 300; padding-right: 5px;}
.app-header .settings-btn { font-size: 16px; font-weight: 500; color: var(--button-primary); background: none; border: none; padding: 5px; cursor: pointer; }
#view-mode-toggle-btn { position: fixed; top: 15px; right: 20px; width: 40px; height: 40px; background-color: rgba(0, 0, 0, 0.5); color: white; border-radius: 50%; display: none; justify-content: center; align-items: center; font-size: 18px; cursor: pointer; z-index: 1000; box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: all 0.2s ease; }
#view-mode-toggle-btn:hover { background-color: rgba(0, 0, 0, 0.7); }

/* --- 状态栏与灵动岛 (Status Bar & Dynamic Island) --- */
/* ▼▼▼ iOS全屏适配：status-bar样式优化 ▼▼▼ */
#status-bar { 
    background-color: transparent !important; 
    height: 60px; 
    position: absolute; 
    /* iOS安全区域适配：调整顶部位置避免遮挡灵动岛 */
    top: calc(5px + env(safe-area-inset-top)); 
    left: 0; 
    width: 100%; 
    padding: 0 20px; 
    /* iOS安全区域适配：左右内边距避免刘海屏遮挡 */
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
    /* 核心修改：默认隐藏status-bar，避免与header产生双重偏移 */
    display: none; 
    justify-content: space-between; 
    align-items: center; 
    box-sizing: border-box; 
    pointer-events: none; 
    transition: transform 0.3s ease-in-out; 
    z-index: 150; 
}
/* 当需要显示status-bar时，通过特定class控制 */
#phone-screen.show-status-bar #status-bar {
    display: flex;
}
/* ▲▲▲ iOS全屏适配结束 ▲▲▲ */
#status-bar.hidden { transform: translateY(-150%); }
#status-bar-time, .status-bar-right { display: none !important; }
#phone-screen.index3-display-mode #status-bar-time, #phone-screen.index3-display-mode .status-bar-right { display: block !important; }
#phone-screen.index3-display-mode .status-bar-right { 
    display: flex !important; 
    position: relative; 
    right: 30px; 
}
#phone-screen.index3-display-mode #status-bar-time { 
    position: relative; 
    left: 35px; 
}
#status-bar-time { font-size: 15px; font-weight: 800; color: black; position: relative; left: 35px; }
.status-bar-right { display: flex; align-items: center; gap: 7px; position: relative; right: 30px; }
.signal-icon { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.signal-icon .bar { width: 3px; background-color: black; border-radius: 2px; }
.signal-icon .bar1 { height: 25%; }
.signal-icon .bar2 { height: 50%; }
.signal-icon .bar3 { height: 75%; }
.signal-icon .bar4 { height: 100%; }
.battery-icon { width: 24px; height: 11px; border: 1.5px solid black; border-radius: 5px; position: relative; padding: 1px; }
.battery-icon::after { content: ''; position: absolute; right: -3px; top: 4px; width: 1.5px; height: 4px; background-color: black; border-radius: 0 1px 1px 0; }
.battery-icon .battery-level { height: 100%; width: 100%; background-color: black; border-radius: 4px; }
#dynamic-island { position: absolute; z-index: 110; top: 60px; left: 50%; transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.5s ease; opacity: 0; transform: translate(-50%, -150%); display: flex; align-items: center; box-sizing: border-box; }
#dynamic-island.visible { opacity: 1; transform: translate(-50%, 0); }
#dynamic-island.default-pill { top: 25px; width: 120px; height: 36px; background-color: transparent; border-radius: 18px; padding: 0 15px; justify-content: center; cursor: default; }
#dynamic-island.notification-banner { width: 95%; height: auto; min-height: 85px; border-radius: 28px; background-color: rgba(28, 28, 30, 0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); padding: 12px 18px; justify-content: flex-start; gap: 12px; cursor: pointer; }
#dynamic-island.expanded-retraction { width: 90%; height: auto; min-height: 80px; border-radius: 40px; background-color: #000000; padding: 12px 18px; justify-content: center; cursor: default; top: 6px; transform: translateX(-50%); }
.notification-content-wrapper, .island-content-wrapper { display: flex; align-items: center; gap: 12px; width: 100%; }
.notification-avatar { width: 45px; height: 45px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.notification-text-content { display: flex; flex-direction: column; gap: 2px; color: white; overflow: hidden; text-align: left; }
.notification-title { font-size: 16px; font-weight: 600; white-space: nowrap; }
.notification-body { font-size: 14px; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.island-retraction-view { width: 100%; text-align: center; color: white; opacity: 0; animation: fadeInIslandContent 0.5s 0.3s forwards; }
.island-retraction-view p { margin: 0; }
.island-retraction-view .label { font-size: 13px; color: #a0a0a0; margin-bottom: 8px; }
.island-retraction-view .content { font-size: 15px; font-weight: 500; color: #ffffff; word-wrap: break-word; }
.island-retraction-view .timestamp { font-size: 12px; color: #a0a0a0; margin-top: 8px; }
.island-retraction-view.fading-out { animation: fadeOutIslandContent 0.3s ease-out forwards; }

/* --- 主屏幕与小组件 (Home Screen & Widgets) --- */
#home-screen { 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: center; 
    /* 核心修改：使用 calc() 加上顶部安全距离，适配iOS刘海屏 */
    padding: 90px 20px 10px 20px;
    padding-top: calc(40px + env(safe-area-inset-top)) !important;
    box-sizing: border-box; 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat; 
    background-color: #ffffff; 
}

/* --- 主页时间显示 --- */
#home-time-display { 
    position: absolute; 
    /* 核心修改：使用 calc() 加上顶部安全距离，适配iOS刘海屏 */
    top: calc(120px + env(safe-area-inset-top)); 
    left: 50%; 
    transform: translateX(-50%) scale(var(--home-time-scale, 1)); 
    transform-origin: center top;
    text-align: center; 
    z-index: 5; 
    color: white; 
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); 
    transition: transform 0.3s ease;
}

.home-time-text { 
    font-size: calc(var(--global-font-size, 16px) * 3.5); 
    font-weight: 300; 
    line-height: 1; 
    margin-bottom: 5px; 
    letter-spacing: -1px; 
}

.home-date-text { 
    font-size: calc(var(--global-font-size, 16px) * 0.9); 
    font-weight: 400; 
    opacity: 0.9; 
    letter-spacing: 0.5px; 
}
.app-icon { display: flex; flex-direction: column; align-items: center; cursor: pointer; text-align: center; }
.app-icon .icon-bg { width: 62px; height: 62px; border-radius: 15px; background-color: #ffffff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); display: flex; justify-content: center; align-items: center; font-size: 24px; font-weight: bold; color: #333; margin-bottom: 8px; transition: transform 0.2s; }
.app-icon .app-label { font-size: 12px; color: var(--app-icon-text); background-color: rgba(255,255,255,0.3); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); padding: 2px 4px; border-radius: 4px;}
.home-content-wrapper { display: flex; justify-content: space-between; width: 100%; margin-top: 10px; gap: 8px; align-items: flex-start; }
.home-widget-area, .home-app-grid-area { width: calc(50% - 6.5px); }
.home-widget-area { display: flex; flex-direction: column; align-items: center; }
.widget-placeholder { width:91%; aspect-ratio: 1 / 1; background-color: transparent; border-radius: 23px; display: flex; justify-content: center; align-items: center; }
.widget-label { font-size: 12px; margin-top: 8px; color: var(--app-icon-text); background-color: rgba(255,255,255,0.3); padding: 2px 5px; border-radius: 4px; }
.home-app-grid-area { aspect-ratio: 1 / 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; }
.home-dock-wrapper { 
    width: calc(100% - 20px); 
    padding: 12px; 
    background-color: rgba(255,255,255,0.25); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
    border-radius: 25px; 
    display: flex; 
    justify-content: center; 
    gap: 30px; 
    box-sizing: border-box; 
    margin-top: auto; 
    /* 核心修改：使用 calc() 加上底部安全距离，适配iOS小黑条 */
    margin-bottom: calc(10px + env(safe-area-inset-bottom));
}
#new-decorative-widget { position: relative; width: 95%; margin: 0 auto 30px auto; aspect-ratio: 1 / 1; }
.new-widget-part { position: absolute; cursor: pointer; background-size: cover; background-position: center; transition: all 0.2s ease; background-color: transparent; }
.new-widget-part:active { transform: scale(0.98); }
#new-widget-bg { width: 100%; height: 80%; top: 0; left: 0; border-radius: 24px; z-index: 1; }
#new-widget-footer { width: 100%; height: 50%; bottom: 0; left: 0; border-radius: 24px; z-index: 2; }
#new-widget-avatar { width: 108px; height: 108px; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; z-index: 3; }

/* --- 聊天界面 (Chat Screen) --- */
.chat-messages { 
    flex: 1; 
    min-height: 0; 
    padding: 15px 15px 120px 15px; /* 增加20px默认安全距离 */ 
    overflow-y: auto; 
    overflow-x: hidden;
    touch-action: pan-y !important; /* 只允许垂直滚动，禁用拖拽 */
    -webkit-overflow-scrolling: touch; 
    display: flex; 
    flex-direction: column; 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat; 
    transition: padding-bottom 0.3s ease-in-out; 
    width: 100%; 
    box-sizing: border-box; 
    /* 防止页面拖拽和长按时的页面滚动 */
    touch-action: pan-y; 
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}
.message-wrapper { 
    display: flex; 
    gap: var(--message-gap); 
    max-width: 85%; 
    align-items: flex-start; 
    margin-bottom: 17px;
    /* 防止消息被拖拽 */
    touch-action: manipulation;
}
.message-wrapper.user { align-self: flex-end; flex-direction: row-reverse; }
.message-wrapper.ai { align-self: flex-start; }
.message-wrapper .avatar { width: var(--avatar-size); height: var(--avatar-size); border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.message-wrapper.ai .avatar { margin-left: -2px; }
.message-wrapper.user .avatar { margin-right: -2px; }
.message-bubble { 
    position: relative; 
    max-width: 100%; 
    word-break: break-word; 
    line-height: 1.5; 
    font-size: var(--bubble-font-size);
    /* 防止消息气泡被拖拽 */
    touch-action: manipulation;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}
.message-bubble .content { 
    padding: var(--bubble-padding); 
    border-radius: 5px; 
    position: relative;
    /* 防止内容被拖拽 */
    touch-action: manipulation;
    -webkit-user-drag: none;
    user-select: text;
    -webkit-user-select: text;
}
.message-bubble.user .content { padding-left: 11px; }
.message-bubble.ai .content { padding-right: 11px; }

/* --- 群聊发送者姓名样式 --- */
.message-bubble .sender-name {
    font-size: 12px;
    color: #999999;
    margin-bottom: 2px;
    padding: 0 4px;
    line-height: 1.2;
    font-weight: normal;
    position: relative;
    z-index: 10;
}

/* --- 群聊气泡贴图修正 (基于参考气泡，调整sender-name对定位的影响) --- */
/* 为了修复群聊中由于sender-name导致的贴图偏移问题，需要为自定义贴图模式添加群聊特殊处理 */

/* 当气泡包含sender-name时，调整贴图位置 */
.message-bubble.ai:has(.sender-name)::before {
    /* 左上角贴图需要向上偏移以补偿sender-name的高度 */
    transform: translate(-10px, -20px) !important;
}

.message-bubble.ai:has(.sender-name)::after {
    /* 右上角贴图需要向上偏移以补偿sender-name的高度 */
    transform: translate(12px, -20px) !important;
}

.message-bubble.ai:has(.sender-name) .content::before {
    /* 左下角贴图保持原位 */
    transform: translate(-7px, 22px) !important;
}

.message-bubble.ai:has(.sender-name) .content::after {
    /* 右下角贴图保持原位 */
    transform: translate(5px, 21px) !important;
}

/* 备用方案：如果浏览器不支持:has()选择器，使用JavaScript添加的类名 */
.message-bubble.ai.has-sender-name::before {
    transform: translate(-10px, -20px) !important;
}

.message-bubble.ai.has-sender-name::after {
    transform: translate(12px, -20px) !important;
}
#phone-screen:not(.custom-bubble-mode-active) .message-bubble.user .content { background-color: var(--user-bubble-bg); color: var(--user-bubble-text); }
#phone-screen:not(.custom-bubble-mode-active) .message-bubble.ai .content { background-color: var(--ai-bubble-bg); color: var(--ai-bubble-text); }
#phone-screen:not(.custom-bubble-mode-active) .message-bubble.ai .content:not(.voice-content)::after { content: ''; position: absolute; left: -4px; top: 16px; width: 8px; height: 8px; background-color: var(--ai-bubble-bg); transform: rotate(45deg); z-index: 0; border-bottom-left-radius: 1px; }
#phone-screen:not(.custom-bubble-mode-active) .message-bubble.user .content:not(.location-content):not(.voice-content):not(.image-content)::after { content: ''; position: absolute; right: -4px; top: 16px; width: 8px; height: 8px; background-color: var(--user-bubble-bg); transform: rotate(45deg); z-index: 0; border-top-right-radius: 1px; }
.message-bubble.system { align-self: center; background-color: transparent; color: var(--system-message-color); font-size: 12px; padding: 4px 10px; }
.message-bubble.system.retraction-notice { cursor: pointer; text-decoration: underline; transition: color 0.2s; }
.message-bubble.system.retraction-notice:hover { color: #2a3a69; }
.message-bubble.system.clickable-log { cursor: pointer; background-color: #e0e0e0; color: #556693; font-weight: 500; transition: background-color 0.2s, transform 0.1s; }
.message-bubble.system.clickable-log:active { background-color: #d1d1d1; transform: scale(0.98); }
.message-bubble.is-voice-message .content { padding: 0 !important; background-color: transparent !important; }
.voice-message-body { display: flex; align-items: center; cursor: pointer; padding: 10px 14px; border-radius: 5px; }
.message-bubble.user .voice-message-body { flex-direction: row-reverse; background-color: var(--user-bubble-bg); }
.message-bubble.ai .voice-message-body { background-color: var(--ai-bubble-bg); }
.voice-play-icon { height: 20px; width: auto; vertical-align: middle; }
.voice-duration { font-size: 15px; font-weight: normal; color: var(--ai-bubble-text); margin: 0 5px; }
.message-bubble.user .voice-duration { color: var(--user-bubble-text); }
.voice-text-bubble { opacity: 0; transition: opacity 0.3s ease-in-out; margin-top: -12px; }
.voice-text-bubble .avatar { visibility: hidden; }
.message-bubble.voice-text-translation .content { background-color: #ffffff !important; color: #000000 !important; }
.message-bubble.voice-text-translation .content::after { display: none !important; }
.content.just-image-content { padding: 0; background-color: transparent !important; border-radius: 8px; overflow: hidden; }
.content.just-image-content img { max-width: 180px; max-height: 180px; display: block; border-radius: 8px; }
.message-bubble .content.just-image-content::after { display: none; }
/* ▼▼▼ 复杂HTML页面渲染样式 ▼▼▼ */
.content.html-page-content { 
    padding: 0 !important; 
    background-color: transparent !important; 
    border-radius: 8px; 
    overflow: visible !important; 
    position: relative;
    width: auto !important;
    max-width: none !important;
    display: block !important;
}
.content.html-page-content iframe { 
    display: block; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
    border-radius: 8px;
    min-width: 280px;
    min-height: 400px;
}
.message-bubble .content.html-page-content::after { display: none !important; }
.message-bubble .content.html-page-content::before { display: none !important; }
.message-bubble.user .content.html-page-content::before,
.message-bubble.ai .content.html-page-content::before { display: none !important; }
.message-bubble.user .content.html-page-content::after,
.message-bubble.ai .content.html-page-content::after { display: none !important; }
/* 确保消息气泡本身不限制宽度 */
.message-bubble:has(.html-page-content) {
    max-width: none !important;
}
.message-wrapper:has(.html-page-content) {
    max-width: none !important;
}
/* ▲▲▲ 复杂HTML页面渲染样式结束 ▲▲▲ */
.content.image-text-content { padding: 0; width: 160px; aspect-ratio: 1 / 1; background-color: transparent !important; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid #e0e0e0; position: relative; }
.content.image-text-content::after { display: none; }
.image-text-cover { display: flex; justify-content: center; align-items: center; height: 100%; background-color: #ffffff; color: #8c8c8c; font-size: 14px; font-weight: 500; }
.image-text-details { padding: 10px 14px; background-color: #ffffff; line-height: 1.6; font-size: 16px; height: 100%; box-sizing: border-box; overflow-y: auto; }
.content.location-content { padding: 0; width: 250px; height: 125px; background-image: url('https://i.postimg.cc/W4fnCkhM/IMG-5405.png'); background-size: cover; background-position: center; border-radius: 8px; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; border: 1px solid #e5e5e5; }
.location-text-overlay { background-color: rgba(255, 255, 255, 0.85); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); padding: 8px 10px; color: #000; font-size: 14px; font-weight: 500; }
.content.transfer-content { padding: 0; width: 250px; background-color: #F8A94A; border-radius: 5px; color: white; }
.message-bubble .content.transfer-content::after { display: none !important; }
.transfer-top-section { display: flex; align-items: center; gap: 12px; padding: 12px; }
.transfer-icon { flex-shrink: 0; width: 38px; height: 38px; background-color: transparent; border: 2px solid white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 24px; font-weight: 600; color: white; box-sizing: border-box; }
.transfer-details { font-size: 15px; font-weight: 500; line-height: 1.3; }
.transfer-details .transfer-amount { font-weight: 600; }
.transfer-details .transfer-remark { font-size: 13px; font-weight: normal; opacity: 0.9; }
.transfer-footer { padding: 6px 12px; font-size: 12px; color: white; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.message-bubble.user .content.transfer-content { background-color: #F8A94A; color: white; }
.message-bubble.ai .content.transfer-content { color: white; }
.ai-status-popup { position: absolute; transform: translateX(-50%); background-color: #ffcddf; color: #5b3a4c; padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 500; z-index: 5; white-space: nowrap; opacity: 0; pointer-events: none; animation: status-popup-animation 4s ease-out forwards; }
.message-wrapper.editing-highlight .content { background-color: #d8f5c6 !important; }
.inline-edit-textarea { width: 100%; box-sizing: border-box; border: 1px solid #dcdcdc; border-radius: 12px; padding: 10px 14px; font-size: 17px; line-height: 1.5; resize: none; overflow-y: hidden; background-color: var(--ai-bubble-bg); color: var(--ai-bubble-text); transition: border-color 0.2s; font-family: 'Consolas', 'Monaco', 'Courier New', monospace; }
.inline-edit-textarea:focus { outline: none; border-color: #b0b0b0; }
/* 为特殊格式消息编辑添加明显的视觉提示 */
.inline-edit-textarea.special-format { background-color: #f8f9fa; border-color: #007AFF; box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1); }
.inline-edit-textarea.special-format::placeholder { color: #666; font-style: italic; }
.inline-edit-buttons { display: flex; justify-content: center; gap: 12px; margin-top: 10px; }
.inline-edit-buttons button { border-radius: 20px; }
#reply-preview-container { padding: 0 8px; background-color: var(--input-area-bg); }
#reply-preview-bar { display: none; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 4px; margin-bottom: 5px; animation: slideDownReply 0.2s ease-out; }
.reply-preview-content { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--system-message-color); }
.reply-to-author { font-weight: 600; color: var(--ai-bubble-text); margin-right: 5px; }
#cancel-reply-btn { border: none; background: none; font-size: 20px; color: var(--system-message-color); cursor: pointer; padding: 0 5px; }
.quote-reply-container { display: flex; margin-top: -10px; margin-bottom: 17px; padding: 0 50px; box-sizing: border-box; width: 100%; }
.quote-reply-container.ai { justify-content: flex-start; }
.quote-reply-container.user { justify-content: flex-end; }
.quote-reply-box { background-color: #E1E1E1; padding: 7px 10px; border-radius: 5px; font-size: 13px; color: #656565; display: inline-block; max-width: calc(100% - 100px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-messages.offline-mode { padding-left: 0; padding-right: 0; padding-bottom: 50px; background-color: #ffffff; color: #3b2f2f; padding-top: 40px; font-family: 'MyCustomFont', serif; }
.chat-messages.offline-mode .message-wrapper { flex-direction: column; align-items: center; gap: 0; max-width: 100%; padding: 8px 0; }
.chat-messages.offline-mode .message-wrapper .avatar { width: 100%; height: 70px; border-radius: 0; object-fit: cover; margin-bottom: 20px; }
.chat-messages.offline-mode .message-bubble { width: 85%; max-width: 500px; font-size: 16px; line-height: 1.7; padding: 0; box-sizing: border-box; }
.chat-messages.offline-mode .message-bubble .content { text-align: left; background-color: transparent !important; color: inherit !important; padding: 0; border-radius: 0; }
.chat-messages.offline-mode .message-bubble .content::after { display: none !important; }
#phone-screen.offline-active #status-bar, #phone-screen.offline-active #ai-status-bubble, #phone-screen.offline-active #toggle-sticker-panel-btn, #phone-screen.offline-active #toggle-actions-panel-btn { display: none; }
#phone-screen.offline-active .app-header { background-color: #ffffff !important; border-bottom: none; padding-top: 8px; padding-bottom: 8px; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#phone-screen.offline-active .app-header h2 { 
    display: block; 
    color: #3b2f2f; 
    cursor: pointer; 
    transition: opacity 0.2s ease; 
}
#phone-screen.offline-active .app-header h2:hover { 
    opacity: 0.7; 
}
#phone-screen.offline-active .chat-input-area { background-color: #ffffff; border-top-color: #eee; border-radius: 0; }
#phone-screen.offline-active .app-header .back-btn, #phone-screen.offline-active .app-header .settings-btn { color: #9a9a9a; }
#phone-screen.offline-active #dynamic-action-btn { background-color: transparent !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23f3e9db'%3E%3Cpath d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: 90%; width: 36px; height: 36px; border-radius: 0; font-size: 0; transition: none; }
#phone-screen.offline-active #dynamic-action-btn.processing { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E"); }
#phone-screen.offline-active #dynamic-action-btn:active:not(.spinning) { transform: none; background-color: transparent !important; }

/* 线下模式旋转动画 */
#phone-screen.offline-active #dynamic-action-btn.spinning {
    animation: receive-button-spin 1s linear infinite;
    transform-origin: center center;
}

/* --- 聊天输入区域与面板 (Chat Input & Panels) --- */
/* ▼▼▼ iOS全屏适配：参考index9的简洁chat-input-area ▼▼▼ */
.chat-input-area { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background-color: rgba(247, 247, 247, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    transform: translateY(280px); 
    transition: transform 0.3s ease-in-out; 
    touch-action: manipulation;
    flex-shrink: 0;
    padding: 8px;
    /* This is the key: adds padding equal to the height of the "black bar" */
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 5px;
}
/* ▲▲▲ iOS全屏适配结束 ▲▲▲ */ 

/* ▼▼▼ iOS/Safari专用样式 - 通过JavaScript动态添加 ▼▼▼ */
/* 让顶部栏和底部栏变窄，为内容区域腾出更多空间 */

/* 用户选择的平台模式样式 - 优先级高于自动检测 */
/* iOS模式 - 用户手动选择 */
.user-platform-ios .app-header {
    padding-top: calc(3px + env(safe-area-inset-top)) !important;
    padding-bottom: 3px !important;
    min-height: auto !important;
    /* 防止页面下移的关键修复 */
    position: relative !important;
    top: 0 !important;
    transform: none !important;
}

.user-platform-ios #chat-screen .chat-input-area {
    padding: 6px !important;
    padding-bottom: calc(4px + env(safe-area-inset-bottom)) !important;
    bottom: -35px !important;
}

.user-platform-ios .screen:not(#chat-screen) .chat-input-area {
    padding: 4px !important;
    padding-bottom: calc(4px + env(safe-area-inset-bottom)) !important;
    bottom: -35px !important;
}

/* iOS模式下增加聊天消息底部安全距离 */
.user-platform-ios .chat-messages {
    padding-bottom: 110px !important; /* 增加40px安全距离 */
}

/* iOS模式下朋友圈弹出菜单调整 */
.user-platform-ios .interaction-popup {
    right: 0 !important; /* 紧贴右侧，防止超出屏幕 */
    transform-origin: right center !important; /* 从右侧展开 */
    min-width: auto !important;
    max-width: 90vw !important; /* 限制最大宽度，防止超出屏幕 */
}

.user-platform-ios .popup-action {
    padding: 6px 10px !important; /* 减小padding，使菜单更紧凑 */
    font-size: 12px !important; /* 稍微减小字体 */
}

.user-platform-ios .interaction-buttons {
    overflow: visible !important;
}

.user-platform-ios .moment-post {
    overflow: visible !important;
    position: relative !important; /* 为选择框提供定位参考 */
}

.user-platform-ios .post-body {
    overflow: visible !important;
}

.user-platform-ios .post-interactions {
    overflow: visible !important;
}

.user-platform-ios #moments-feed {
    overflow-x: visible !important;
}

.user-platform-ios #hub-page-moments {
    overflow-x: visible !important;
}

/* iOS模式下音乐播放器页面内容向下移动60px，背景保持铺满 */
.user-platform-ios #music-player-screen {
    top: 0 !important; /* 背景保持铺满整个屏幕 */
}

/* iOS模式下，让音乐页面的内容元素（除背景外）向下移动20px */
.user-platform-ios #music-player-screen .music-top-nav,
.user-platform-ios #music-player-screen .music-main-card,
.user-platform-ios #music-player-screen .music-chat-container,
.user-platform-ios #music-player-screen .music-floating-controls,
.user-platform-ios #music-player-screen #music-session-avatars,
.user-platform-ios #music-player-screen .lyric-player-container,
.user-platform-ios #music-player-screen .music-player-content {
    transform: translateY(20px) !important;
}

/* 确保播放列表overlay和sheet不被影响 */
.user-platform-ios #playlist-sheet-overlay {
    transform: none !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 150 !important;
}

.user-platform-ios #playlist-sheet {
    transform: translateY(100%) !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 160 !important;
}

.user-platform-ios #playlist-sheet.visible {
    transform: translateY(0) !important;
}

.user-platform-ios #music-search-panel {
    transform: translateY(20px) !important;
}

.user-platform-ios #tab-bar {
    padding-bottom: calc(6px + env(safe-area-inset-bottom)) !important;
    bottom: -35px !important;
    height: 30px !important;
}

.user-platform-ios #heart-voice-text {
    color: #333 !important;
    font-size: 16px !important;
    line-height: 1.8 !important;
    opacity: 1 !important;
    visibility: visible !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    text-align: left !important;
    /* 确保文字正常显示 */
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    /* 确保滚动正常 */
    max-height: 450px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

.user-platform-ios #heart-voice-overlay {
    z-index: 10000 !important;
}

.user-platform-ios #heart-voice-bubble {
    z-index: 10001 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* iOS模式下论坛顶部导航向下偏移 */
.user-platform-ios #forum-screen .forum-top-nav {
    padding-top: calc(10px + env(safe-area-inset-top)) !important;
}

/* iOS Safari 论坛样式优化 */
.user-platform-ios .forum-search-wrapper {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.user-platform-ios .forum-search-input {
    -webkit-text-size-adjust: 100%;
}

.user-platform-ios .forum-search-gen-btn {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.user-platform-ios .forum-select-input {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}



/* 安卓模式 - 完全模拟喵喵机2.html的样式 */
.user-platform-android * {
    box-sizing: border-box !important;
}

.user-platform-android *:before,
.user-platform-android *:after {
    box-sizing: border-box !important;
}

.user-platform-android html {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: var(--phone-bg) !important;
    overflow: hidden !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.user-platform-android body {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: var(--phone-bg) !important;
    overflow: hidden !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.user-platform-android #phone-screen {
    width: 100% !important;
    height: 100% !important;
    background-color: var(--phone-bg) !important;
    position: relative !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.user-platform-android .screen {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--phone-bg) !important;
}

/* 确保音乐播放器在安卓模式下也有正确的背景 */
.user-platform-android #music-player-screen {
    background: linear-gradient(to bottom, #4a4e69, #2b2d42) !important;
}

.user-platform-android .app-header {
    flex-shrink: 0 !important;
    padding: 10px 10px 12px 10px !important;
    background-color: #f1f1f1 !important;
    border-bottom: 1px solid var(--input-border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    position: relative !important;
}

/* 安卓模式下完全隐藏status-bar */
.user-platform-android #status-bar {
    display: none !important;
}

.user-platform-android #home-screen {
    padding-top: 90px !important;
}

.user-platform-android .chat-input-area {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #ffffff !important;
    border-top: 1px solid var(--input-border) !important;
    padding: 0 !important;
}

.user-platform-android .chat-input-row {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
}

/* Android模式下增加聊天消息底部安全距离 */
.user-platform-android .chat-messages {
    padding-bottom: 100px !important; /* 增加20px安全距离，优化与输入框的间距 */
}

.user-platform-android #tab-bar {
    bottom: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    background-color: var(--phone-bg) !important;
}

/* 安卓模式下的 index3-display-mode 特殊样式 - 与喵喵机2保持一致 */
.user-platform-android #phone-screen.index3-display-mode .app-header {
    padding: 60px 10px 12px 10px !important;
    background-color: #ededed !important;
}

.user-platform-android #phone-screen.index3-display-mode.dark-mode .app-header {
    background-color: #000000 !important;
}

/* 安卓模式下的 index3-display-mode 需要显示 status-bar */
.user-platform-android #phone-screen.index3-display-mode #status-bar {
    display: flex !important;
}

.user-platform-android #phone-screen.index3-display-mode #status-bar-time,
.user-platform-android #phone-screen.index3-display-mode .status-bar-right {
    display: block !important;
}

.user-platform-android #phone-screen.index3-display-mode .status-bar-right {
    display: flex !important;
    position: relative;
    right: 30px;
}

.user-platform-android #phone-screen.index3-display-mode #status-bar-time {
    position: relative;
    left: 35px;
}

/* 音乐播放器页面在安卓模式下的 index3-display-mode 保持透明背景 */
.user-platform-android #phone-screen.index3-display-mode #music-player-screen .app-header {
    background-color: transparent !important;
}

.user-platform-android #phone-screen.index3-display-mode.dark-mode #music-player-screen .app-header {
    background-color: transparent !important;
}



/* ▲▲▲ iOS/Safari专用样式结束 ▲▲▲ */

.chat-input-area.panel-open { transform: translateY(0); }

.chat-input-row {
    display: flex;
    align-items: center; 
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

#chat-input { flex-grow: 1; border: none; border-radius: 5px; padding: 10px 15px; font-size: 15px; resize: none; max-height: 100px; background-color: var(--input-bg); touch-action: manipulation; user-select: text; -webkit-user-select: text; }
#chat-input:focus { outline: none; box-shadow: none; }

#toggle-actions-panel-btn { width: 27px; height: 27px; background-color: transparent; border: 1.5px solid #000000; border-radius: 50%; cursor: pointer; padding: 0; flex-shrink: 0; transition: all 0.2s ease-in-out; background-size: 55%; background-repeat: no-repeat; background-position: center; color: #000000; transform: translateY(-4px); }

#toggle-actions-panel-btn.active {
    transform: rotate(0deg); /* 我们删除了这里旧的位移代码 */
    border-color: #000000;
}

#toggle-actions-panel-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#dynamic-action-btn.processing {
    cursor: not-allowed;
    /* 我们删掉了灰色背景，并添加了旋转动画 */
    background-color: transparent ;
}

#dynamic-action-btn:active { transform: scale(0.95); }
#toggle-sticker-panel-btn { display: flex; justify-content: center; align-items: center; width: 27px; height: 27px; background-color: transparent; border: 1.5px solid #000000; border-radius: 50%; cursor: pointer; padding: 1px; box-sizing: border-box; flex-shrink: 0; transition: all 0.2s ease-in-out; color: #000000; transform: translateY(-4px); margin: 0 4px; }
#toggle-sticker-panel-btn svg { width: 100%; height: 100%; }
#chat-actions-panel, #sticker-panel { height: 280px; background-color: var(--input-area-bg); box-sizing: border-box; padding-bottom: 34px; }
#chat-actions-panel { padding: 20px 15px 25px 15px; }
.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: auto auto; gap: 25px 15px; justify-items: center; }
.action-grid-item { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.action-grid-item .icon { width: 58px; height: 58px; background-color: #ffffff; color: #000000; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-radius: 18px; display: flex; justify-content: center; align-items: center; font-size: 24px; }
.action-grid-item .label { font-size: 11px; color: #8a8a8a; }
#sticker-panel { display: none; flex-direction: column; align-items: stretch; }
#chat-sticker-grid, #sticker-grid-container, #manage-sticker-grid, #chat-sticker-grid-my, #chat-sticker-grid-ai { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 15px; overflow-y: auto; padding: 15px; flex-grow: 1; min-height: 0; }
.sticker-item { width: 70px; height: 70px; background-color: transparent; border-radius: 8px; object-fit: cover; cursor: pointer; transition: transform 0.2s; position: relative; }
.sticker-item:active { transform: scale(0.9); }
.sticker-item.selected { border: 3px solid #007AFF; }
.sticker-item.selected::after { content: '✓'; position: absolute; top: -5px; right: -5px; background-color: #007AFF; color: white; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; }
.add-sticker-slot { width: 70px; height: 70px; border: 2px dashed var(--input-border); border-radius: 8px; display: flex; justify-content: center; align-items: center; font-size: 30px; font-weight: 300; color: var(--input-border); cursor: pointer; background-color: var(--input-bg); transition: background-color 0.2s, border-color 0.2s; }
.add-sticker-slot:hover { background-color: var(--body-bg); border-color: #b5b5b5; }
#edit-message-bar { width: 100%; box-sizing: border-box; }

/* --- 音乐播放器 (Music Player) - 毛玻璃风格 --- */
#music-player-screen { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; 
    color: #ffffff; 
    display: flex; 
    flex-direction: column; 
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
}

/* 播放器样式 - 毛玻璃风格 */
.lyric-player-container {
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* 图片容器 - 16:9 横版 */
.player-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-image: var(--image-url);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-main-card.compact .player-image-wrapper {
    margin-bottom: 15px;
}

.play-pause-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
    z-index: 10;
}

.lyric-player-container.paused .play-pause-overlay {
    opacity: 1;
}

.lyrics-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    overflow: hidden;
    z-index: 5;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to top, black 60%, transparent 100%);
    mask-image: linear-gradient(to top, black 60%, transparent 100%);
}

#lyrics-container {
    text-align: center;
    position: absolute;
    width: 100%;
    top: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.lyric-line {
    padding: 10px 25px;
    font-size: 16px;
    line-height: 1.8;
    color: rgba(220, 220, 230, 0.7);
    transition: all 0.6s ease;
    white-space: pre-wrap;
    opacity: 0.8;
    font-weight: 500;
}

.lyric-line.played {
    color: rgba(220, 220, 230, 0.5);
    opacity: 0.7;
}

.lyric-line.active {
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 700;
    opacity: 1;
    transform: scale(1.05);
    text-shadow: 
        0 0 10px #FFFFFF,
        0 0 20px rgba(220, 220, 230, 0.7);
}

@media (max-width: 600px) {
    .lyric-line {
        font-size: 14px;
        padding: 8px 15px;
    }
    .lyric-line.active {
        font-size: 18px;
    }
}
#music-player-screen .app-header { 
    display: none !important; 
    height: 0 !important; 
    padding: 0 !important; 
    margin: 0 !important; 
    background-color: transparent !important; 
    border-bottom: none !important; 
}
#music-player-screen .back-btn, #music-player-screen h2, #music-player-screen .action-btn, #music-player-screen .settings-btn { color: #ffffff !important; }
#music-player-screen .header-actions { gap: 10px; }
#music-player-screen .settings-btn { 
    background-color: rgba(255, 255, 255, 0.1); 
    border-radius: 18px; 
    padding: 8px 12px; 
    transition: all 0.2s ease;
}
#music-player-screen .settings-btn:hover { 
    background-color: rgba(255, 255, 255, 0.2); 
    transform: translateY(-1px);
}

/* 新的毛玻璃顶部导航栏 */
.music-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5px;
    color: white;
    font-size: 24px;
    max-width: 100%;
    margin: 0;
    position: relative;
    z-index: 20;
}

.music-nav-left, .music-nav-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 80px;
}

.music-nav-left {
    justify-content: flex-start;
    padding-left: 5px;
}

.music-nav-right {
    justify-content: flex-end;
    padding-right: 5px;
}

.music-nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: relative;
}

.music-nav-avatar {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.music-nav-avatar:first-child {
    margin-right: -5px;
    z-index: 1;
}

.music-nav-avatar:last-child {
    margin-left: -5px;
    z-index: 1;
}

.music-nav-avatar:hover {
    transform: scale(1.15) translateY(-5px);
    z-index: 3;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.music-nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-headphone-icon {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    z-index: 2;
    filter: drop-shadow(0 3px 6px rgba(255, 255, 255, 0.4));
}

.music-nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.music-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* 主卡片容器 - 毛玻璃效果 */
.music-main-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    margin: 10px 5px 20px 5px;
    width: calc(100% - 17px);
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
}

.music-main-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset,
                0 0 20px rgba(255, 255, 255, 0.1);
}

.music-main-card.compact {
    padding: 20px;
}

/* 浮动控制按钮样式 - 隐藏原有的 */
.music-floating-controls {
    display: none !important;
}

/* 聊天区域 - 毛玻璃卡片 */
.music-chat-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 30px 40px;
    margin: 20px 5px 20px 5px;
    width: calc(100% - 17px);
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border: 1px solid rgba(255, 255, 255, 0.18);
    height: 500px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.music-chat-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset,
                0 0 20px rgba(255, 255, 255, 0.1);
}

.music-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.music-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.music-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.music-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s;
}

.music-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.music-chat-messages .message {
    display: flex;
    gap: 12px;
    max-width: 75%;
    animation: messageIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.music-chat-messages .message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.music-chat-messages .message-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.music-chat-messages .message-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 14px 18px;
    border-radius: 18px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.music-chat-messages .message-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.music-chat-messages .message.sent .message-content {
    background: rgba(108, 92, 231, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.music-chat-messages .message-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 6px;
}

.music-chat-input {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.music-chat-input input {
    flex: 1;
    min-width: 0; /* 允许flex项目收缩到比内容更小 */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 10px 16px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.music-chat-input input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15),
                0 0 15px rgba(255, 255, 255, 0.2);
}

.music-chat-input input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.music-chat-input button {
    flex-shrink: 0; /* 防止按钮被压缩 */
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 10px 16px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: auto;
    min-width: 45px;
}

.music-chat-input button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.2),
                0 0 20px rgba(255, 255, 255, 0.1);
}

.music-chat-input button:active {
    transform: translateY(0px);
}

/* 音乐聊天加载动画 - 三个点 */
.music-typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}

.music-typing-dots span {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: inline-block;
    animation: bounce-dot 1.4s infinite ease-in-out both;
}

.music-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.music-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* 音乐播放器响应式样式 */
@media (max-width: 768px) {
    #music-player-screen {
        padding: 5px;
    }

    .music-top-nav {
        padding: 10px 5px;
    }

    .music-nav-left {
        padding-left: 5px;
    }

    .music-nav-right {
        padding-right: 5px;
    }

    .music-main-card {
        padding: 20px;
        margin: 5px 3px 10px 3px;
        width: calc(100% - 13px);
        box-sizing: border-box;
    }

    .music-main-card.compact {
        padding: 15px;
    }

    .player-image-wrapper {
        margin-bottom: 15px;
    }

    .music-main-card.compact .player-image-wrapper {
        margin-bottom: 10px;
    }

    .music-chat-container {
        padding: 20px;
        height: auto;
        min-height: 350px;
        margin: 10px 3px 20px 3px;
        width: calc(100% - 13px);
        box-sizing: border-box;
    }
    
    .music-nav-avatar {
        width: 60px;
        height: 60px;
    }

    .music-headphone-icon {
        font-size: 24px;
        top: -20px;
    }
    
    .music-control-btn.large {
        width: 60px;
        height: 60px;
        min-width: 60px;
        min-height: 60px;
    }

    .music-control-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .music-control-btn.small {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .music-song-title {
        font-size: 18px;
    }

    .music-song-artist {
        font-size: 14px;
    }
}

/* 确保在小屏幕设备上有适当的响应式布局 */
@media (max-width: 480px) {
    .music-floating-controls {
        padding: 0 16px;
        top: 20px;
    }
    
    .float-actions {
        gap: 8px;
    }
    
    .float-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 36px;
    }
    
    .float-back-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .player-buttons {
        padding: 0 10px;
        gap: 4px;
    }
    
    .player-buttons i {
        min-width: 44px;
        min-height: 44px;
        font-size: 22px;
        padding: 10px;
    }
    
    .player-buttons .fa-pause-circle, 
    .player-buttons .fa-play-circle {
        min-width: 56px;
        min-height: 56px;
        font-size: 28px;
    }
}

.float-back-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 22px;
    font-weight: 300;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.float-back-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.float-back-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.float-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.float-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.float-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.float-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 音乐控制区 */
.music-controls-area {
    margin-top: 0;
}

/* 歌曲信息 */
.music-song-info {
    text-align: center;
    margin-bottom: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    max-height: 200px;
    overflow: hidden;
}

.music-song-info:hover {
    transform: scale(1.02);
}

.music-song-info.collapsed {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

.music-song-title {
    color: white;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    display: inline-block;
}

.music-song-title::after {
    content: '▼';
    font-size: 14px;
    margin-left: 8px;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.music-song-info.collapsed .music-song-title::after {
    transform: rotate(180deg);
}

.music-song-artist {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}

/* 播放按钮组 */
.music-play-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    max-height: 100px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.music-play-buttons.collapsed {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

.music-control-btn {
    width: 55px;
    height: 55px;
    min-width: 55px;
    min-height: 55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    user-select: none;
    padding: 0;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

/* SVG图标样式 */
.music-control-btn svg {
    display: block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* 模式图标切换动画 */
.music-control-btn .mode-icon {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.music-control-btn .mode-icon[style*="display: none"] {
    opacity: 0;
    transform: scale(0.8);
}

.music-control-btn .mode-icon[style*="display: block"] {
    opacity: 1;
    transform: scale(1);
}

.music-control-btn.small {
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
    opacity: 0.9;
}

.music-control-btn.large {
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
    background: rgba(255, 182, 193, 0.3);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.3);
}

/* 播放/暂停按钮的图标切换 */
.music-control-btn.large .icon-play,
.music-control-btn.large .icon-pause {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.music-control-btn.large:hover svg {
    transform: scale(1.1);
}

.music-control-btn:hover {
    transform: scale(1.1) translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2),
                0 0 15px rgba(255, 255, 255, 0.3);
}

.music-control-btn.small:hover {
    opacity: 1;
}

.music-control-btn.large:hover {
    background: rgba(255, 182, 193, 0.5);
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.5),
                0 0 20px rgba(255, 182, 193, 0.4);
}

.music-control-btn:active {
    transform: scale(1.05) translateY(0);
}

/* SVG图标在按钮悬停时的额外效果 */
.music-control-btn:hover svg {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

/* 新进度条样式 - 完全重写 */
.music-progress-container {
    width: 100%;
    margin: 15px 0;
    padding: 0;
    display: block !important;
    visibility: visible !important;
}

.music-progress-bar {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: 0 15px;
    cursor: pointer;
    overflow: hidden;
    display: block !important;
}

.music-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    min-width: 2px;
    background: linear-gradient(90deg, #FF69B4, #FFB6C1);
    border-radius: 4px;
    transition: width 0.1s linear;
    display: block !important;
    box-shadow: 0 0 8px rgba(255, 105, 180, 0.5);
}

.music-progress-time {
    display: flex !important;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 8px;
    padding: 0 15px;
}

/* 展开提示 */
.music-expand-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.music-expand-hint.show {
    max-height: 30px;
    opacity: 1;
    margin-top: 10px;
}

.music-expand-hint:hover {
    color: rgba(255, 255, 255, 0.8);
}

.music-player-content { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    padding: 0; 
    box-sizing: border-box; 
    position: relative;
    min-height: auto;
}

/* --- 全局音乐播放条 (参考代码风格) --- */
#top-music-player-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50; 
    padding: 8px 12px; 
    box-sizing: border-box;
    display: none;        
    align-items: center;  
    gap: 8px;             
    flex-wrap: nowrap;
    transition: all 0.3s ease;
    /* 半透明磨砂视觉样式 */
    background-color: rgba(0, 0, 0, 0.1); 
    backdrop-filter: blur(5px);
    border: none;
    box-shadow: none;
    /* 下方圆角 */
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* 默认文字和图标颜色 */
#top-music-player-bar .music-info .title,
#top-music-player-bar .lyrics-container,
#top-music-player-bar .svg-icon {
    color: #fff;
}

/* 进度条样式 */
.progress-bar-top {
    width: 100%;
    height: 2px;
    background-color: rgba(255,255,255,0.3);
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
}

.progress-bar-top::after {
    content: '';
    display: block;
    height: 100%;
    background-color: var(--accent-color);
    width: var(--progress, 0%);
    transition: width 0.1s linear;
}

.progress-handle-top {
    position: absolute;
    top: 50%;
    left: var(--progress, 0%);
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
#player-album-art-container { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; 
    height: 100%; 
    z-index: 1;
    overflow: hidden;
    border-radius: 12px;
}
.album-art-area { position: relative; width: 100%; height: 280px; margin-top: 10px; display: flex; justify-content: center; align-items: center; }
.album-cover { width: 250px; height: 250px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); z-index: 10; }
.vinyl { width: 240px; height: 240px; background-color: #282828; border-radius: 50%; z-index: 5; display: flex; justify-content: center; align-items: center; margin-left: -120px; box-shadow: 0 5px 15px rgba(0,0,0,0.4); animation: spin 12s linear infinite; animation-play-state: paused; }
.vinyl.playing { animation-play-state: running; }
.vinyl::before { content: ''; position: absolute; width: 100%; height: 100%; border-radius: 50%; background-image: repeating-radial-gradient(circle at center, rgba(255,255,255,0.03) 0, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 100%); background-size: 3px 3px; }
.vinyl-label { width: 90px; height: 90px; border-radius: 50%; overflow: hidden; position: relative; }
.vinyl-label img { width: 100%; height: 100%; object-fit: cover; }
.vinyl-label::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 15px; height: 15px; background-color: #1a1a1a; border-radius: 50%; border: 2px solid #333; z-index: 15; }
#player-album-art.playing { animation-play-state: running; }
#player-album-art { width: 100%; height: 100%; object-fit: cover; }
#player-song-info { 
    text-align: center; 
    margin: 0 0 20px 0;
    padding: 0 30px;
}
#player-song-title { 
    font-size: 22px; 
    font-weight: 600; 
    margin: 0 0 6px 0; 
    line-height: 1.2; 
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
#player-song-artist { 
    font-size: 15px; 
    color: #c9cddb; 
    margin: 0; 
    opacity: 0.9; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
/* 旧的进度条样式已移除，使用新的 .music-progress-container */
/* 旧的进度条样式已全部移除 */
.player-buttons { 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    margin: 0 30px;
    padding: 0;
    gap: 8px;
}

.player-buttons i { 
    color: rgba(255, 255, 255, 0.9); 
    font-size: 26px; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    padding: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-buttons i:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.player-buttons i:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.player-buttons .fa-pause-circle, 
.player-buttons .fa-play-circle { 
    font-size: 32px;
    min-width: 64px;
    min-height: 64px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.player-buttons .fa-pause-circle:hover, 
.player-buttons .fa-play-circle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px) scale(1.05);
}
#player-lyrics-container { width: 100%; height: 120px; margin-top: 25px; overflow: hidden; -webkit-mask-image: linear-gradient( transparent, black 20%, black 80%, transparent ); mask-image: linear-gradient( transparent, black 20%, black 80%, transparent ); }
#player-lyrics-content { width: 100%; height: 100%; overflow-y: scroll; scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth; }
#player-lyrics-content::-webkit-scrollbar { display: none; }
.lyric-line { text-align: center; padding: 8px 20px; margin: 0; font-size: 16px; color: var(--system-message-color); transition: all 0.4s ease; line-height: 1.5; opacity: 0.7; }
.lyric-line.active { font-size: 18px; font-weight: 600; color: var(--header-text); opacity: 1; }
#music-player-bar { flex-shrink: 0; padding: 8px 15px; background-color: rgba(128, 128, 128, 0.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden; }
#music-player-bar .album-art { width: 40px; height: 40px; border-radius: 4px; background-color: #555; background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iNCIgZmlsbD0iIzMzMzMzMyIvPgo8cGF0aCBkPSJNMTIgMTBWMzBMMjggMjBMMTIgMTBaIiBmaWxsPSIjNjY2NjY2Ii8+Cjwvc3ZnPgo='); background-size: cover; background-position: center; }
#music-player-bar .song-info { flex-grow: 1; min-width: 0; color: var(--header-text); }
#music-player-bar .song-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#music-player-bar .song-artist { font-size: 12px; color: var(--system-message-color); white-space: nowrap; }
#music-player-bar .stop-music-btn { font-size: 22px; color: var(--system-message-color); background: none; border: none; cursor: pointer; padding: 5px; }
#music-player-bar .progress-bar { position: absolute; bottom: 0; left: 0; height: 2px; background-color: var(--wechat-green); width: 0%; animation: music-progress 180s linear forwards; }
/* --- 音乐搜索面板样式 --- */
#music-search-panel {
  position: absolute;
  width: 90%;
  height: 70%;
  max-width: 280px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  background: rgba(42, 45, 66, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  padding: 15px;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  color: #ffffff;
}

#music-search-panel .playlist-header {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  gap: 8px;
}

#music-search-input {
  flex-grow: 1;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  outline: none;
}

#music-search-input:focus {
  background-color: #ffffff;
}








#search-results-body {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 5px;
}

.search-result-item {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.9); /* 更亮的白色背景 */
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.search-result-item:hover {
  background-color: rgba(255, 255, 255, 1); /* 纯白色背景 */
  transform: scale(1.02);
}

.search-result-cover {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(45deg, #ff6b9d, #c44569);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.search-result-item .info {
  flex-grow: 1;
  min-width: 0;
}

.search-result-item .title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  color: #000000; /* 黑色字体 */
}

.search-result-item .artist {
  font-size: 12px;
  color: #666666; /* 深灰色字体 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#music-session-avatars { display: none; justify-content: center; align-items: center; margin: 15px 0; position: relative; height: 60px; }
.session-avatar { width: 55px; height: 55px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
#music-partner-avatar { margin-left: -15px; }

/* --- 日记页面 (Diary Screen) --- */
  #diary-screen { 
    background-color: var(--body-bg); 
    display: flex !important;
    flex-direction: column !important;
  }
  #diary-screen .app-header { justify-content: space-between; align-items: center; }
.character-selector-container { flex-grow: 1; display: flex; justify-content: center; align-items: center; margin: 0 15px; }
#diary-character-selector { background-color: transparent; border: 1px solid var(--input-border); border-radius: 20px; padding: 8px 15px; font-size: 16px; color: var(--header-text); min-width: 120px; text-align: center; }
#diary-character-selector:focus { outline: none; border-color: var(--wechat-green); }

/* 日记页面多选功能样式 */
.diary-actions-container { display: flex; align-items: center; gap: 0px; }
#diary-multi-select-btn:hover { background-color: rgba(0,0,0,0.1); }
#diary-screen.multi-select-mode #diary-multi-select-btn { 
    background-color: var(--wechat-green); 
    color: white; 
}

/* 日记项多选样式 */
#diary-screen.multi-select-mode .diary-item { 
    padding-left: 60px; 
    position: relative; 
}
.diary-selection-indicator { 
    width: 22px; 
    height: 22px; 
    border: 1.5px solid #c7c7c7; 
    border-radius: 50%; 
    position: absolute; 
    left: 20px; 
    top: 50%; 
    transform: translateY(-50%) scale(0.5); 
    opacity: 0; 
    transition: all 0.2s ease-in-out; 
    background-color: white; 
    cursor: pointer;
}
#diary-screen.multi-select-mode .diary-selection-indicator { 
    transform: translateY(-50%) scale(1); 
    opacity: 1; 
}
.diary-item.selected .diary-selection-indicator { 
    background-color: #07c160; 
    border-color: #07c160; 
}
.diary-item.selected .diary-selection-indicator::after { 
    content: ''; 
    position: absolute; 
    left: 7px; 
    top: 4px; 
    width: 5px; 
    height: 10px; 
    border: solid white; 
    border-width: 0 2px 2px 0; 
    transform: rotate(45deg); 
}
.diary-item.selected::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 122, 255, 0.15); 
    border-radius: 15px; 
    pointer-events: none; 
}
/* 日记界面毛玻璃风格设计 */
.diary-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    padding: 15px 20px 20px 20px; /* 减少顶部padding，为滚动留出更多空间 */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-height: 0; /* 确保flex子元素可以收缩 */
    overflow: hidden; /* 防止内容溢出，让子容器处理滚动 */
}

#diary-list-container { 
    flex: 1 !important; 
    overflow-y: auto !important; 
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 5px 0 !important; 
    min-height: 0 !important; /* 这是关键 - 允许flex项目收缩到内容以下 */
    max-height: 100% !important; /* 确保不超过父容器高度 */
    -webkit-overflow-scrolling: touch !important; 
    overscroll-behavior: contain !important; 
    /* 覆盖其他.list-container的grid样式 */
    grid-template-columns: none !important;
    grid-auto-rows: none !important;
    gap: 0 !important;
    align-content: initial !important;
    /* 确保在iOS Safari上正常工作 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* 毛玻璃卡片样式 */
.diary-item { 
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    margin: 0 15px 10px 15px; /* 添加左右边距来替代容器的padding */
    flex-shrink: 0; /* 防止项目被压缩 */
}

/* 悬浮效果 */
.diary-item:hover { 
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 发光边框效果 */
.diary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), transparent, rgba(255, 255, 255, 0.3));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.diary-item:hover::before {
    opacity: 1;
}

.diary-item-avatar { 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    object-fit: cover; 
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.diary-item:hover .diary-item-avatar {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.diary-item-content { 
    flex: 1; 
    text-align: left;
    overflow: hidden;
}

.diary-item-header { 
    display: flex; 
    flex-direction: row;
    align-items: baseline; 
    margin-bottom: 8px; 
    gap: 10px;
}

.diary-item-character { 
    font-size: 16px; 
    font-weight: 600; 
    color: #000000;
    text-shadow: none;
    white-space: nowrap;
}

.diary-item-date { 
    font-size: 12px; 
    color: #666666;
    white-space: nowrap;
}

.diary-item-preview { 
    font-size: 14px; 
    color: #333333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    text-align: left;
}

/* 空状态样式 */
.diary-empty-state { 
    text-align: center; 
    padding: 80px 20px; 
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    grid-column: 1 / -1;
}

.diary-empty-state .empty-icon { 
    font-size: 64px; 
    margin-bottom: 20px; 
    opacity: 0.8;
}

.diary-empty-state .empty-text { 
    font-size: 18px; 
    line-height: 1.6; 
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 日记生成按钮动画 */
#diary-generate-btn.spinning {
    animation: receive-button-spin 1s linear infinite;
    transform-origin: center center;
}
#diary-generate-btn.spinning:active {
    animation: receive-button-spin 1s linear infinite;
    transform: translateY(2px) rotate(0deg) scale(0.95);
    transform-origin: center center;
}
#diary-generate-btn:active { transform: scale(0.95); }

/* --- 通话界面 (Call Screens) --- */
#videocall-screen { background-color: #1c1c1e; }
#call-log-screen .videocall-overlay { flex: 1; min-height: 0; overflow-y: auto; }
.videocall-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.videocall-overlay { 
    position: relative; 
    z-index: 2; 
    width: 100%; 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    padding: 70px 20px 20px 20px; 
    box-sizing: border-box; 
    overflow: hidden; /* 防止外层滚动 */
}
#videocall-my-preview { position: absolute; top: 60px; right: 20px; width: 100px; height: 170px; border: none; border-radius: 8px; overflow: hidden; z-index: 10; }
#videocall-my-avatar { width: 100%; height: 100%; object-fit: cover; }
#videocall-messages { 
    flex: 1; 
    display: block; /* 改为block布局，更适合滚动 */
    overflow-y: scroll !important; 
    -webkit-overflow-scrolling: touch !important; 
    padding: 90px 10px 10px 10px; 
    scroll-behavior: smooth;
    min-height: 0; 
    touch-action: pan-y !important; 
    overscroll-behavior: contain;
    position: relative;
}

/* 专门为视频通话界面添加滚动支持 */
#videocall-screen #videocall-messages {
    overflow-y: scroll !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 确保在视频通话界面中消息可以滚动 */
#videocall-screen .videocall-overlay {
    touch-action: pan-y !important;
}

#videocall-screen {
    touch-action: pan-y !important;
}
.videocall-message { 
    color: white; 
    text-align: center; 
    padding: 5px 12px; 
    background-color: rgba(0, 0, 0, 0.4); 
    border-radius: 10px; 
    font-size: 16px; 
    max-width: 90%; 
    word-break: break-word; 
    margin: 0 auto 10px auto; /* 居中对齐并增加间距 */
    display: block;
}
.videocall-message.user-call { color: rgba(255, 255, 255, 0.95); }
.videocall-message.ai-call { color: rgba(255, 255, 255, 0.75); }
.videocall-message.ai-call i { font-style: italic; opacity: 0.7; }
.videocall-message.loading { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: transparent; 
    margin: 0 auto 10px auto;
}
.videocall-message.loading span { width: 8px; height: 8px; margin: 0 2px; background-color: rgba(255, 255, 255, 0.6); border-radius: 50%; display: inline-block; animation: bounce-dot 1.4s infinite ease-in-out both; }
.videocall-message.loading span:nth-child(1) { animation-delay: -0.32s; }
.videocall-message.loading span:nth-child(2) { animation-delay: -0.16s; }
.videocall-controls { display: flex; flex-direction: column; gap: 15px; padding-top: 15px; }
.videocall-input-area { display: flex; width: 100%; gap: 10px; }
#videocall-input { flex-grow: 1; background-color: rgba(255, 255, 255, 0.1); border: none; color: white; border-radius: 8px; padding: 10px; transition: background-color 0.2s; }
#videocall-input:focus { outline: none; box-shadow: none; }
#videocall-input::placeholder { color: #d1d1d1; }
#videocall-send-btn { background-color: rgba(0, 0, 0, 0.4); color: rgba(255, 255, 255, 0.6); border: none; border-radius: 8px; padding: 0 15px; }
.videocall-main-actions { display: flex; justify-content: space-evenly; align-items: center; gap:5px; width: 100%; }
.videocall-action-item { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 70px; text-align: center; }
.action-label { color: white; font-size: 13px; font-weight: 500; }
.placeholder-action-btn { width: 70px; height: 70px; background-color: rgba(128, 128, 128, 0.3); border-radius: 50%; }
.placeholder-action-btn svg { width: 32px; height: 32px; color: white; margin-top: 18px; }
#videocall-hangup-btn { background-color: #ff3b30; background-image: url('https://i.postimg.cc/bNHGPnGM/IMG-5742.png'); background-size: 80%; background-repeat: no-repeat; background-position: center; width: 70px; height: 70px; border-radius: 50%; border: none; cursor: pointer; }
#incoming-call-screen, #outgoing-call-screen { background-color: #2E3331; justify-content: space-between; padding: 60px 20px 80px 20px; box-sizing: border-box; }
.incoming-call-overlay { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.caller-info { color: white; text-align: center; margin-top: 40px; }
.caller-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin-bottom: 20px; }
#incoming-call-name { font-size: 28px; font-weight: 500; margin: 0 0 10px 0; }
#incoming-call-reason { font-size: 16px; opacity: 0.8; }
.call-actions { display: flex; justify-content: space-around; width: 100%; }
.call-action-item { display: flex; flex-direction: column; align-items: center; gap: 10px; color: white; font-size: 14px; }
.call-action-btn { width: 70px; height: 70px; border-radius: 50%; border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; color: white; }
.call-action-btn img { display: block; width: 100%; height: 100%; object-fit: contain; }
.call-action-btn.decline { background-color: #ff3b30; }
.call-action-btn.accept { background-color: #34c759; }
#call-duration-timer { position: absolute; top: 80px; left: 50%; transform: translateX(-50%); color: white; background-color: rgba(0, 0, 0, 0.4); padding: 4px 12px; border-radius: 10px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; font-weight: 500; z-index: 11; display: none; }

/* --- 朋友圈 (Moments) --- */
#hub-page-moments { 
    background-color: #FFFFFF; 
    overflow-y: auto; 
    overflow-x: hidden !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
#moments-header { position: relative; height: calc(var(--phone-width) * 0.6); flex-shrink: 0;}
#moments-cover-img { width: 100%; height: 100%; object-fit: cover; background-color: #ccc; cursor: pointer; }
#moments-user-avatar { position: absolute; right: 15px; bottom: -20px; width: 70px; height: 70px; border: 2px solid white; border-radius: 8px; object-fit: cover; background-color: #eee; cursor: pointer; }
#moments-manage-btn.active { background: #07c160; color: white; }
.moment-checkbox-container { position: absolute; top: 10px; left: 10px; width: 24px; height: 24px; z-index: 10; }
.moment-checkbox { width: 24px; height: 24px; border: 2px solid #07c160; border-radius: 50%; background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.moment-checkbox.checked { background: #07c160; }
.moment-checkbox.checked::after { content: '✓'; color: white; font-size: 16px; font-weight: bold; }
#moments-action-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: var(--phone-width); background: white; border-top: 1px solid #e5e5e5; padding: 10px 15px; display: none; align-items: center; justify-content: space-between; z-index: 100; }
#moments-action-bar.active { display: flex; }
#moments-feed { 
    padding: 40px 15px 15px 15px; 
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}
.moment-post { 
    display: flex; 
    gap: 10px; 
    padding-bottom: 20px; 
    margin-bottom: 20px; 
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: visible; /* 改为visible，防止弹出菜单被裁剪 */
    position: relative; /* 为选择框提供定位参考 */
}
.moment-post:not(:last-child) { border-bottom: 1px solid #f0f0f0; }
.moment-post .avatar { width: 45px; height: 45px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.moment-post .post-body { 
    display: flex; 
    flex-direction: column; 
    gap: 7px; 
    width: 100%;
    max-width: calc(100% - 55px); /* 减去头像宽度和间距 */
    min-width: 0; /* 重要：防止flex子元素超出容器 */
    overflow-x: visible; /* 改为visible，防止弹出菜单被裁剪 */
}
.post-body .author-name { font-weight: 600; color: #556693; }
.post-body .post-text { line-height: 1.5; word-break: break-word; }
.post-body .post-image { width: 180px; height: 180px; }
.post-body .post-location { font-size: 12px; color: #556693; }
.post-images-grid { display: grid; gap: 4px; margin-top: 8px; }
.post-image-item { position: relative; aspect-ratio: 1 / 1; background-color: #e9ecef; border-radius: 6px; overflow: hidden; cursor: pointer; }
.post-image-item .image-text-cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; background-color: #f7f7f7; color: #8c8c8c; font-size: 14px; font-weight: 500; transition: opacity 0.2s ease-out; }
.post-image-item .image-text-details { position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding: 10px; background-color: #ffffff; color: #333; line-height: 1.5; font-size: 14px; box-sizing: border-box; overflow-y: auto; display: none; touch-action: pan-y; }
.post-images-grid.image-count-1 { grid-template-columns: 1fr; max-width: min(260px, calc(100vw - 90px)); }
.post-images-grid.image-count-2, .post-images-grid.image-count-4 { grid-template-columns: repeat(2, 1fr); max-width: min(260px, calc(100vw - 90px)); }
.post-images-grid.image-count-3, .post-images-grid.image-count-5, .post-images-grid.image-count-6, .post-images-grid.image-count-7, .post-images-grid.image-count-8, .post-images-grid.image-count-9 { grid-template-columns: repeat(3, 1fr); max-width: min(320px, calc(100vw - 90px)); }
.post-interactions { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #8a8a8a; margin-top: 10px;}
.interaction-buttons { position: relative; overflow: visible; }
.interaction-toggle-btn { background-color: #f7f7f7; color: #576b95; border: none; border-radius: 4px; padding: 0 8px; line-height: 18px; height: 18px; font-size: 20px; font-weight: bold; cursor: pointer; position: relative; top: 4px; }
.interaction-popup { position: absolute; right: 35px; bottom: -2px; display: flex; background-color: #4b5154; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,0.2); overflow: hidden; transform: scale(0); transform-origin: right center; transition: transform 0.1s ease-out; white-space: nowrap; z-index: 100; }
.interaction-popup.active { transform: scale(1); }
.popup-action { color: white; padding: 8px 15px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.popup-action:hover { background-color: #3a3a3a; }
.popup-divider { width: 1px; background-color: #606060; margin: 6px 0; }
.moment-interaction-area { background-color: #f7f7f7; border-radius: 4px; margin-top: 10px; padding: 1px 10px 8px 10px; position: relative; overflow: hidden; }
.moment-interaction-area::before { content: ''; position: absolute; top: -6px; left: 15px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #f7f7f7; }
.moment-interaction-area b { font-weight: 500; color: #576b95; }
.moment-interaction-area .comment-item span { color: #333; }
.moment-interaction-area .likes-list { background-color: transparent; padding: 4px 0; margin: 0; color: #556693; font-size: 14px; word-break: break-all; }
.likes-list + .moment-comments-section { border-top: 1px solid #e5e5e5; margin-top: 6px; padding-top: 6px; }
.comments-list { padding-top: 8px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; margin-bottom: 8px; }
.comment-item { line-height: 1.5; }
.comment-item b { margin-right: 5px; }
.comment-input-area { display: flex; gap: 8px; overflow: hidden; max-height: 0; transition: max-height 0.3s ease-out, margin-top 0.3s ease-out; margin-top: 0; }
.comment-input-area.active { max-height: 50px; margin-top: 8px; }
.comment-input-area input { flex-grow: 1; border: 1px solid #e5e5e5; border-radius: 15px; padding: 6px 12px; font-size: 14px; outline: none; }
.comment-input-area button { border: none; background-color: var(--button-primary); color: white; border-radius: 15px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.gossip-post-item { background-color: var(--ai-bubble-bg); border-radius: 5px; box-shadow: none; overflow: hidden; display: flex; flex-direction: column; border: none; padding: 0; margin-bottom: 25px; }
.gossip-post-image { width: 100%; height: auto; aspect-ratio: 7 / 3; object-fit: cover; background-color: #f0f0f0; }
.gossip-post-text-wrapper { padding: 15px; }
.gossip-post-title { font-size: 18px; font-weight: 600; color: var(--header-text); margin: 0 0 8px 0; }
.gossip-post-content { font-size: 15px; line-height: 1.6; color: var(--ai-bubble-text); white-space: pre-wrap; word-break: break-word; margin: 0; }

/* --- 列表与通用组件 (Lists & Common Components) --- */
.list-container { 
    overflow-y: auto; 
    flex-grow: 1; 
    background-color: var(--phone-bg);
}
.list-item { background-color: #ffffff; display: flex; align-items: center; overflow: hidden; padding: 12px 15px; position: relative; }
.list-item::after { content: ''; position: absolute; bottom: 0; left: 70px; right: 0; height: 1px; background-color: #f0f0f0; }
.list-item:last-child::after { display: none; }
.list-item-content { flex-grow: 1; display: flex; align-items: center; cursor: pointer; min-width: 0; }
.list-item.edit-mode .list-item-content { transform: translateX(35px); }
.delete-button { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background-color: #ff3b30; color: white; font-size: 16px; border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; position: absolute; left: 15px; opacity: 0; transform: scale(0.5); transition: all 0.2s ease-in-out; }
.list-item.edit-mode .delete-button { opacity: 1; transform: scale(1); }
.list-item-avatar { width: 50px; height: 50px; border-radius: 5px; margin-right: 15px; object-fit: cover; flex-shrink: 0; }
.list-item-info { display: flex; flex-direction: column; justify-content: center; gap: 4px; flex-grow: 1; min-width: 0; }
.list-item-name { font-size: 16px; color: var(--header-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-last-message { font-size: 13px; color: #8e8e93; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 商品卡片样式 - 覆盖默认的横向布局 */
.shop-item.list-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center;
    padding: 16px !important;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}
.shop-item.list-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.shop-item.list-item::after {
    display: none; /* 移除底部分隔线 */
}
/* 商品描述支持多行显示 */
.shop-item .shop-description {
    font-size: 13px;
    color: var(--system-message-color);
    margin-bottom: 8px;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    /* 不限制行数，完整显示所有内容 */
}

/* 搜索结果项样式 */
.search-result-item { background-color: #ffffff; padding: 15px; margin-bottom: 8px; border-radius: 8px; cursor: pointer; border: 1px solid #f0f0f0; transition: background-color 0.2s ease; }
.search-result-item:hover { background-color: #f8f8f8; }
.search-result-item:last-child { margin-bottom: 0; }
.search-result-content { font-size: 15px; line-height: 1.4; color: var(--header-text); margin-bottom: 8px; }
.search-result-content .highlight { background-color: #ffeb3b; padding: 2px 4px; border-radius: 3px; font-weight: 500; }
.search-result-context { margin-bottom: 8px; }
.context-message { font-size: 13px; line-height: 1.4; margin-bottom: 4px; padding: 6px 8px; border-radius: 4px; }
.context-message:last-child { margin-bottom: 0; }
.context-message.before { background-color: #f5f5f5; color: #666; opacity: 0.8; }
.context-message.current { background-color: #e3f2fd; color: var(--header-text); font-weight: 500; }
.context-message.current .highlight { background-color: #ffeb3b; padding: 2px 4px; border-radius: 3px; font-weight: 600; }
.context-message.after { background-color: #f5f5f5; color: #666; opacity: 0.8; }
.search-result-meta { display: flex; justify-content: flex-end; align-items: center; font-size: 12px; color: #8e8e93; }
.search-result-role { font-weight: 500; }
.toggle-switch { width: 52px; height: 32px; background-color: #e9e9eb; border-radius: 16px; position: relative; cursor: pointer; transition: background-color 0.2s ease-in-out; z-index: 10; flex-shrink: 0; }
.toggle-switch.active { background-color: var(--wechat-green); }
.toggle-knob { width: 28px; height: 28px; background-color: white; border-radius: 50%; position: absolute; top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: transform 0.2s ease-in-out; pointer-events: none; }
.toggle-switch.active .toggle-knob { transform: translateX(20px); }
.settings-item .toggle-switch { pointer-events: auto; position: relative; z-index: 20; }
#chat-background-activity-toggle { pointer-events: auto !important; z-index: 30 !important; }
.segmented-control { display: flex; background-color: #e9e9eb; border-radius: 8px; padding: 2px; }
.segmented-control-button { background-color: transparent; border: none; border-radius: 6px; padding: 4px 12px; font-size: 14px; font-weight: 500; color: #000000; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.segmented-control-button.active { background-color: #ffffff; color: #000000; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.main-hub-content { flex-grow: 1; overflow-y: hidden; position: relative; }
.hub-page { display: none; height: 100%; flex-direction: column; overflow-y: auto; }
.hub-page.active { display: flex; }
#hub-page-chat { background-color: var(--phone-bg); }
/* ▼▼▼ iOS全屏适配：参考index9的简洁tab-bar ▼▼▼ */
#tab-bar { 
    flex-shrink: 0; 
    display: flex; 
    justify-content: space-around; 
    padding: 0; 
    /* 核心：为底部增加安全距离 */
    padding-bottom: env(safe-area-inset-bottom);
    background-color: #f7f7f7; 
    border-top: 1px solid #e0e0e0; 
    height: 68px; 
    background-image: url('https://i.postimg.cc/t43vKXtz/IMG-5838.png'); 
    background-size: 100% 100%; 
    background-position: center; 
    background-repeat: no-repeat;
}
/* ▲▲▲ iOS全屏适配结束 ▲▲▲ */
.tab-item .icon, .tab-item .tab-label { opacity: 0; }
.tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #7a7e83; cursor: pointer; flex: 1; }
.tab-item .icon { width: 26px; height: 26px; }
.tab-item .icon svg { width: 100%; height: 100%; }
.tab-label { font-size: 10px; line-height: 1.2; }
.group-avatar-container { width: 50px; height: 50px; border-radius: 5px; margin-right: 15px; flex-shrink: 0; background-color: #e5e5e5; overflow: hidden; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 2px; padding: 2px; box-sizing: border-box; }
.group-avatar-container .member-avatar { width: 14px; height: 14px; object-fit: cover; border-radius: 2px; }

/* --- 设置与表单 (Settings & Forms) --- */
.settings-page-content { padding: 20px; overflow-y: auto; flex-grow: 1; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; color: #333; font-weight: 500; }
.form-group input, .form-group select, .form-group .selection-box, .form-group textarea { width: 100%; padding: 12px; border: 1px solid var(--input-border); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.form-group input:focus, .form-group textarea:focus { border-color: #9dc6cd; box-shadow: 0 0 0 2px rgba(157, 198, 205, 0.4); outline: none; }
.form-group .avatar-preview { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; border: 1px solid var(--input-border); vertical-align: middle; margin-right: 10px; }
.form-group .wallpaper-preview { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--input-border); margin-top: 5px; cursor: pointer; background-color: #ffffff; }
.form-group .upload-btn { padding: 8px 12px; border: 1px solid #ccc; background-color: #f0f0f0; border-radius: 5px; cursor: pointer; color: #696969; }
.form-group .wallpaper-actions { display: flex; gap: 10px; margin-top: 8px; justify-content: space-between; align-items: center; }
.form-group .wallpaper-actions .upload-btn { margin-left: 8px; }
.form-group .selection-box { display: flex; justify-content: space-between; align-items: center; background-color: #f9f9f9; cursor: pointer; }
.form-group .selection-box .placeholder { color: #8a8a8a; }
.settings-actions { padding: 20px 15px; border-top: none; background-color: transparent; display: flex; gap: 15px; justify-content: space-between; }
.settings-actions button { padding: 16px 20px; border-radius: 50px; border: none; cursor: pointer; font-size: 16px; font-weight: 600; flex: 1; min-height: 48px; }
.fetch-btn, .action-btn-secondary { background-color: var(--button-secondary); color: var(--button-text); }
.save-btn { background-color: var(--button-primary); color: var(--button-text); }
.set-primary-btn { background-color: #34c759; color: white; }
.set-primary-btn:active { background-color: #2ca54b; }
.item-value-status { color: var(--system-message-color); font-size: 14px; }
#create-chat-screen, #create-chat-screen .app-header, #create-group-chat-screen, #create-group-chat-screen .app-header, #icon-settings-screen, #icon-settings-screen .app-header, #widget-settings-screen, #widget-settings-screen .app-header, #prompt-list-screen, #prompt-editor-screen, #prompt-list-screen .app-header, #prompt-editor-screen .app-header, #api-settings-screen, #api-settings-screen .app-header, #persona-editor-screen, #persona-editor-screen .app-header, #ai-persona-list-screen, #my-persona-list-screen, #ai-persona-list-screen .app-header, #my-persona-list-screen .app-header { background-color: #ffffff; border-bottom: none; }
#create-chat-screen .settings-page-content, #create-group-chat-screen .settings-page-content, #icon-settings-screen .settings-page-content, #widget-settings-screen .settings-page-content, #prompt-list-screen .list-container, #prompt-editor-screen .settings-page-content { background-color: #ffffff; }
#create-chat-screen .form-group input[type="text"], #create-chat-screen .form-group .selection-box, #create-group-chat-screen .form-group input[type="text"], #create-group-chat-screen .form-group .selection-box { border-radius: 12px; border: 1px solid #e0e0e0; background-color: #f9f9f9; }
#create-chat-screen .form-group input[type="text"]:focus, #create-group-chat-screen .form-group input[type="text"]:focus { box-shadow: none; outline: none; background-color: #ffffff; border-color: #c7c7c7; }
#create-group-chat-screen .settings-page-content { display: flex; flex-direction: column; gap: 15px; }
#create-group-chat-screen .form-group:last-of-type { flex-grow: 1; display: flex; flex-direction: column; min-height: 0; }
#create-group-chat-screen #group-ai-persona-list-container { flex-grow: 1; border: none; background-color: #ffffff; border-radius: 0; }
#create-group-chat-screen .form-group input[type="text"] { padding-left: 14px; padding-right: 14px; }
#create-group-chat-screen .persona-checkbox-item { gap: 12px; position: relative; padding: 12px 15px; }
#create-group-chat-screen .persona-checkbox-item::after { content: ''; position: absolute; bottom: 0; left: 85px; right: 0; height: 1px; background-color: #f0f0f0; }
#create-group-chat-screen .persona-checkbox-item:last-child::after { display: none; }
.persona-checkbox-item { display: flex; align-items: center; padding: 10px 15px; }
.persona-checkbox-item input[type="checkbox"] { width: 20px; height: 20px; margin-right: 15px; accent-color: var(--wechat-green); }
.persona-checkbox-item .list-item-avatar { width: 40px; height: 40px; margin-right: 10px; }
.persona-checkbox-item .list-item-name { font-size: 15px; }
#create-group-chat-screen .persona-checkbox-item input[type="checkbox"] { -webkit-appearance: none; appearance: none; background-color: #f0f0f0; margin: 0 5px 0 0; font: inherit; color: currentColor; width: 20px; height: 20px; border: none; border-radius: 50%; transform: translateY(0); display: grid; place-content: center; cursor: pointer; transition: all 0.2s ease-in-out; }
#create-group-chat-screen .persona-checkbox-item input[type="checkbox"]:checked { background-color: var(--wechat-green); }
#create-group-chat-screen .persona-checkbox-item input[type="checkbox"]:checked::before { content: ''; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -2px); }
.widget-settings-content { flex-grow: 1; position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; }
#widget-preview-container { position: relative; width: 90%; max-width: 380px; aspect-ratio: 1 / 1; transform: translateY(-90px); }
#widget-preview-container .new-widget-part { position: absolute; background-size: cover; background-position: center; background-repeat: no-repeat; background-color: #ffffff; box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
#widget-preview-bg { width: 100%; height: 80%; top: 0; left: 0; border-radius: 28px; z-index: 1; }
#widget-preview-footer { width: 100%; height: 50%; bottom: 0; left: 0; border-radius: 28px; z-index: 2; }
#widget-preview-avatar { width: 108px; height: 108px; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; z-index: 3; border: none; }
#widget-actions-container { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 380px; display: flex; flex-direction: row; justify-content: space-between; gap: 10px; z-index: 10; }
#widget-actions-container .upload-btn { background-color: rgba(241, 241, 241, 0.5); color: #000000; padding: 12px 0; border-radius: 40px; border: 1px solid #eee; font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color 0.2s; flex: 1; margin: 0; }
#widget-actions-container .upload-btn:active { background-color: rgba(241, 241, 241, 0.8); }
#widget-settings-screen .settings-actions { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 380px; display: flex; gap: 15px; z-index: 10; }
#widget-settings-screen .settings-actions button { flex: 1; padding: 14px 0; border-radius: 50px; border: none; font-size: 16px; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
#widget-settings-screen .settings-actions .action-btn-secondary { background-color: #f1f1f1; color: #000000; }
#widget-settings-screen .settings-actions .save-btn { background-color: #000000; color: #ffffff; }
#icon-settings-screen .actions-grid { grid-template-columns: repeat(3, 1fr); gap: 25px; }
#icon-settings-screen .actions-grid .action-grid-item:first-child { grid-column: 1 / -1; margin-bottom: 25px; }
#icon-settings-screen .actions-grid .action-grid-item:first-child .icon { width: 95px; height: 95px; box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
#icon-settings-screen .action-grid-item .icon { transition: transform 0.2s ease, box-shadow 0.2s ease; }
#icon-settings-screen .action-grid-item:hover .icon { transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }
#icon-settings-screen #cancel-icon-changes-btn { background-color: #ffffff; color: #000000; border: 1px solid #e0e0e0; }
#icon-settings-screen #save-icon-changes-btn { background-color: #000000; color: #ffffff; border: none; }
#settings-hub-screen .settings-page-content, #settings-hub-screen .app-header { background-color: var(--body-bg); border-bottom: none; }
#settings-hub-screen .settings-page-content { padding-top: 20px; }
#prompt-editor-screen input[type="text"], #prompt-editor-screen textarea { border-radius: 12px; border: 1px solid #dde2e8; background-color: #ffffff; }
#prompt-editor-screen input[type="text"]:focus, #prompt-editor-screen textarea:focus { box-shadow: none; border-color: #dde2e8; outline: none; }
#persona-editor-screen .settings-page-content { display: flex; flex-direction: column; }
#persona-editor-screen .form-group:nth-of-type(1) { order: 2; }
#persona-editor-screen .form-group:nth-of-type(2) { order: 1; }
#persona-editor-screen .form-group:nth-of-type(3) { order: 3; }
#persona-editor-screen .form-group:nth-of-type(2) > div { display: flex; flex-direction: column; align-items: center; gap: 15px; transform: translateX(8px); }
#persona-editor-screen .form-group:nth-of-type(2) > label { display: none; }
#persona-editor-screen #preset-avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: none; box-shadow: 0 0 0 1px #dde2e8; }
#persona-editor-screen input[type="text"], #persona-editor-screen textarea { background-color: #ffffff; border-radius: 15px; border: 1px solid #dde2e8; padding: 12px 16px; }
#persona-editor-screen input[type="text"]:focus, #persona-editor-screen textarea:focus { outline: none; box-shadow: none; border-color: #dde2e8; }
#persona-editor-screen .upload-btn { background: none; border: none; padding: 0; color: #8a8a8a; font-size: 15px; font-weight: 500; cursor: pointer; }
#persona-editor-screen .settings-actions { flex-direction: column; gap: 12px; padding: 15px 35px 40px 35px; }
#persona-editor-screen .settings-actions button { flex: none; width: 100%; }
#persona-editor-screen .settings-actions .save-btn { background-color: #000000; color: #ffffff; }
#persona-editor-screen .settings-actions .action-btn-secondary { background-color: #f1f1f1; color: #000000; }
#ai-persona-list-screen .list-container, #my-persona-list-screen .list-container { flex-grow: 1; overflow-y: auto; min-height: 0; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: min-content; gap: 15px; align-content: start; padding: 20px; background-color: transparent; }
#ai-persona-list-screen .list-item, #my-persona-list-screen .list-item { position: relative; padding: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1 / 1; box-shadow: 0 4px 12px rgba(0,0,0,0.1); background-color: #eee; }
#ai-persona-list-screen .list-item-content, #my-persona-list-screen .list-item-content { display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; cursor: pointer; }
#ai-persona-list-screen .list-item-avatar, #my-persona-list-screen .list-item-avatar { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
#ai-persona-list-screen .list-item-name, #my-persona-list-screen .list-item-name { position: absolute; bottom: 0; left: 0; right: 0; margin: 0; padding: 20px 12px 12px 12px; color: white; font-size: 16px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); text-align: center; }
#ai-persona-list-screen .list-item.edit-mode .delete-button, #my-persona-list-screen .list-item.edit-mode .delete-button { position: absolute; top: 8px; right: 8px; z-index: 2; }
#ai-persona-list-screen .list-item::after, #my-persona-list-screen .list-item::after { display: none; }
#action-view-diary .icon { background-image: url('https://files.catbox.moe/56re65.png'); background-size: 85%; background-position: center; background-repeat: no-repeat; background-color: transparent; }
#action-listen-music .icon { background-color: transparent; }
#chat-settings-screen .settings-page-content { background-color: var(--body-bg); padding: 0 15px; }
.settings-section { background-color: var(--ai-bubble-bg); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.settings-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; position: relative; cursor: pointer; min-height: 24px; }
.settings-item:not(:last-child)::after { content: ''; position: absolute; bottom: 0; left: 15px; right: 0; height: 1px; background-color: var(--input-border); }
.settings-item:has(.toggle-switch) { cursor: default; }
.settings-item .item-label { font-size: 16px; color: var(--header-text); }
.settings-item .item-value-container { display: flex; align-items: center; gap: 8px; color: var(--system-message-color); font-size: 16px; }
.settings-item .disclosure-indicator { font-size: 20px; font-weight: 200; color: var(--system-message-color); opacity: 0.5; }
.settings-item input[type="text"] { border: none; background: none; text-align: right; color: var(--system-message-color); font-size: 16px; padding: 0; width: 150px; }
.settings-item input[type="text"]:focus { outline: none; box-shadow: none; }
.settings-item .upload-btn { display: none; }
.settings-item .avatar-preview { width: 32px; height: 32px; border-radius: 5px; object-fit: cover; border: none; }
.settings-item input[type="number"] { border: none; background-color: transparent; font-size: 16px; color: var(--system-message-color); text-align: right; outline: none; -moz-appearance: textfield; appearance: textfield; }
.settings-item input[type="number"]::-webkit-outer-spin-button, .settings-item input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#settings-profile-item { padding-top: 15px; padding-bottom: 15px; }
#settings-profile-item .settings-profile-avatar { width: 60px; height: 60px; border-radius: 50%; box-shadow: none; }
#settings-profile-item .settings-profile-name { font-size: 18px; font-weight: 500; }
.settings-profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.settings-profile-name { font-size: 22px; font-weight: 600; color: var(--header-text); }
#chat-settings-btn { font-size: 24px; font-weight: bold; letter-spacing: 2px; line-height: 1; padding-bottom: 5px; }
#delete-contact-btn { cursor: pointer; transition: background-color 0.2s; }
#delete-contact-btn:active { background-color: #f0f0f0; }
#api-settings-screen .settings-page-content { padding-left: 35px; padding-right: 35px; }
#api-settings-screen .form-group input, #api-settings-screen .form-group select { background-color: #f1f1f1; border: none; border-radius: 14px; text-align: center; }
#api-settings-screen .form-group input:focus, #api-settings-screen .form-group select:focus { box-shadow: none; outline: none; }
#api-settings-screen .settings-actions { flex-direction: column; border-top: none; gap: 12px; align-items: center; padding: 60px 35px 40px 60px; }
#api-settings-screen .settings-actions button { width: 60%; flex: none; border-radius: 50px; border: none; padding-top: 12px; padding-bottom: 12px; }
#api-settings-screen .fetch-btn { background-color: #f1f1f1; color: #000000; }
#api-settings-screen .save-btn { background-color: #000000; color: #ffffff; }
#home-settings-screen { background-color: #f1f1f1; position: relative; }
#home-settings-screen .app-header { background-color: transparent; border-bottom: none; position: relative; z-index: 2; }
#home-settings-screen #home-wallpaper-preview { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; border: none; z-index: 1; margin: 0; }
#home-settings-screen .wallpaper-actions { position: absolute; bottom: 150px; left: 50%; transform: translateX(-50%); width: 80%; display: flex; flex-direction: column; gap: 12px; z-index: 2; }
#home-settings-screen .settings-actions { position: relative; z-index: 2; background-color: transparent; border-top: none; padding: 15px 35px 40px 35px; width: 100%; box-sizing: border-box; }
#home-settings-screen .settings-actions button, #home-settings-screen .wallpaper-actions button { width: 100%; border-radius: 50px; border: none; font-weight: 600; padding-top: 12px; padding-bottom: 12px; }
#home-settings-screen .wallpaper-actions button { background-color: rgba(241, 241, 241, 0.4); color: #000000; }
#home-settings-screen .settings-actions .save-btn { background-color: #000000; color: #ffffff; }
#disclaimer-screen .settings-page-content, #donation-page-screen .settings-page-content { background-color: var(--body-bg); }
.disclaimer-text-container { padding: 20px 15px; font-size: 16px; line-height: 1.8; color: var(--ai-bubble-text); }
.disclaimer-text-container p { margin-bottom: 1.5em; }
#donation-qr-container { text-align: center; padding: 40px 20px; }
#donation-qr-container img { max-width: 80%; height: auto; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

/* --- 弹窗与覆盖层 (Modals & Overlays) --- */
.modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; justify-content: center; align-items: center; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.modal-content { background: rgba(44, 44, 46, 0.9); padding-top: 20px; border-radius: 14px; width: 270px; color: #fff; box-shadow: none; transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); overflow: hidden; }
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-content h3 { font-size: 17px; font-weight: 600; margin: 0 20px 5px; text-align: center; }
.modal-content p { font-size: 13px; text-align: center; margin: 0 20px 20px; color: #e5e5ea; }
.modal-buttons { display: flex; border-top: 1px solid rgba(84, 84, 88, 0.65); }
.modal-buttons button { flex: 1; padding: 12px; border: none; background-color: transparent; color: #0A84FF; cursor: pointer; font-size: 17px; transition: background-color 0.2s; }
.modal-buttons button:hover { background-color: rgba(255,255,255,0.05); }
.modal-buttons button:disabled { color: #545458; cursor: not-allowed; background-color: transparent; }
.modal-box { background: white; border-radius: 12px; width: 85%; padding: 20px; box-sizing: border-box; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.modal-box h3 { text-align: center; margin-top: 0; }
.modal-box .settings-actions { border-top: none; padding: 10px 0 0 0; }
#playlist-sheet-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.3); z-index: 150; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
#playlist-sheet-overlay.visible { opacity: 1; pointer-events: auto; }
#playlist-sheet { position: absolute; bottom: 0; left: 0; right: 0; height: 450px; background: rgba(28, 28, 30, 0.85); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-top-left-radius: 20px; border-top-right-radius: 20px; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); z-index: 160; display: flex; flex-direction: column; padding-bottom: 30px; }
#playlist-sheet.visible { transform: translateY(0); }
.playlist-header { padding: 10px 20px; text-align: center; flex-shrink: 0; cursor: grab; color: #fff; }
.handle-bar { width: 40px; height: 5px; background-color: rgba(255, 255, 255, 0.3); border-radius: 2.5px; margin: 0 auto; }
.playlist-title-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.playlist-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.add-music-btn { 
    background: rgba(0, 122, 255, 0.8); 
    color: white; 
    border: none; 
    width: 28px; 
    height: 28px; 
    border-radius: 14px; 
    font-size: 18px; 
    font-weight: bold; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.3s ease; 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.add-music-btn:hover { 
    background: rgba(0, 122, 255, 1); 
    transform: scale(1.1); 
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4); 
}

/* 音乐搜索页面样式 */
.music-search-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.search-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2129;
    margin: 0 0 15px 0;
    padding-left: 5px;
}

.search-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007AFF;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-btn {
    padding: 12px 20px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: #0056b3;
}

.search-btn:active {
    transform: scale(0.98);
}

.search-results {
    min-height: 100px;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
}

.search-placeholder {
    text-align: center;
    color: #8a8d91;
    padding: 30px 20px;
    font-size: 15px;
}

.music-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 8px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e1e5e9;
}

.music-result-item:hover {
    background: #f0f8ff;
    border-color: #007AFF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
}

.music-result-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin-right: 12px;
    background: #e1e5e9;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.music-result-info {
    flex: 1;
    min-width: 0;
}

.music-result-title {
    font-size: 16px;
    font-weight: 500;
    color: #1d2129;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-result-artist {
    font-size: 14px;
    color: #8a8d91;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-result-source {
    background: #007AFF;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    flex-shrink: 0;
}

.add-to-playlist-btn {
    background: #34C759;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.add-to-playlist-btn:hover {
    background: #30B050;
    transform: scale(1.05);
}

.add-to-playlist-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}
#playlist-content { list-style: none; margin: 0; padding: 0 10px; overflow-y: auto; color: #fff; }
#playlist-content li { display: flex; align-items: center; padding: 10px; border-radius: 8px; cursor: pointer; transition: background-color 0.2s ease; }
#playlist-content li:hover { background-color: rgba(255, 255, 255, 0.1); }
#playlist-content li.playing { background-color: rgba(0, 122, 255, 0.2); }
.playlist-item-cover { width: 40px; height: 40px; border-radius: 4px; margin-right: 15px; object-fit: cover; }
.playlist-item-info { flex-grow: 1; overflow: hidden; }
.playlist-item-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
#playlist-content li.playing .playlist-item-title { color: #44a0ff; }
.playlist-item-artist { font-size: 12px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playing-indicator { font-size: 14px; color: #44a0ff; margin-left: 10px; display: none; }
#playlist-content li.playing .playing-indicator { display: block; }

/* 删除按钮样式 */
.delete-track-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #999;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.delete-track-btn:hover {
    background: rgba(255, 59, 48, 0.8);
    color: #fff;
    opacity: 1;
    transform: scale(1.1);
}

.delete-track-btn:active {
    transform: scale(0.95);
}
#add-song-modal { display: none; }
#add-song-modal.active { display: flex; }
#custom-confirm-modal { z-index: 200; }
#custom-confirm-text { text-align: center; margin: 20px 0; line-height: 1.5; }
#persona-selection-modal { justify-content: flex-end !important; background: rgba(0,0,0,0.4); align-items: center; z-index: 100; }
#persona-selection-modal .modal-box { background-color: #ffffff; padding-bottom: 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding-bottom: 30px; margin-bottom: 0; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.1, 0.7, 0.5, 1); }
#persona-selection-modal.active .modal-box { transform: translateY(0); }
#persona-selection-modal .app-header { background-color: #ffffff !important; border-bottom: none !important; position: relative; height: 25px; padding: 15px 0 !important; }
#persona-selection-modal .app-header h2 { position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -90%) !important; color: #000000; }
#modal-persona-list { background-color: #ffffff; display: flex; flex-direction: column; gap: 8px; padding: 15px; padding-top: 8px; padding-bottom: 30px; max-height: 450px; overflow-y: auto; -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%); mask-image: linear-gradient(to bottom, black 90%, transparent 100%); }
#modal-persona-list .list-item-content { position: relative; display: flex; align-items: center; height: 65px; flex-shrink: 0; padding: 0 16px 0 24px; border-radius: 12px; overflow: hidden; background-size: auto 400%; background-position: right; background-repeat: no-repeat; justify-content: flex-start; border-bottom: none; }
#modal-persona-list .list-item-content::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to right, rgba(240, 240, 245, 0.98) 15%, rgba(240, 240, 245, 0) 85% ); z-index: 1; }
#modal-persona-list .list-item-name { font-size: 18px; font-weight: 500; color: #000000; text-shadow: none; position: relative; z-index: 2; margin-left: 20px; }
#modal-persona-list .list-item-avatar { display: none; }
#persona-selection-modal .settings-actions { background-color: #ffffff !important; border-top: none !important; padding: 15px 15px 30px 15px; }
#persona-selection-modal .settings-actions .action-btn-secondary { background-color: #f0f0f0; color: #000000; }
#persona-selection-modal .settings-actions .save-btn { background-color: #000000; color: #ffffff; }
.multiselect-header { display: none; width: 100%; justify-content: space-between; align-items: center; }
.multiselect-header .cancel-btn, .multiselect-header .delete-action-btn { background: none; border: none; font-size: 16px; font-weight: 500; color: var(--header-text); cursor: pointer; padding: 8px 10px; }
.multiselect-header .delete-action-btn { color: #ff3b30; }
#chat-screen.multi-select-active .app-header h2, #chat-screen.multi-select-active .app-header .back-btn, #chat-screen.multi-select-active .app-header .settings-btn { display: none; }
#chat-screen.multi-select-active .app-header .multiselect-header { display: flex; }
.message-selection-indicator { width: 22px; height: 22px; border: 1.5px solid #c7c7c7; border-radius: 50%; position: absolute; left: -4px; top: 50%; transform: translateY(-50%) scale(0.5); opacity: 0; transition: all 0.2s ease-in-out; background-color: var(--phone-bg); }
#chat-screen.multi-select-active .message-selection-indicator { transform: translateY(-50%) scale(1); opacity: 1; }
.message-wrapper.selected .message-selection-indicator { background-color: #07c160; border-color: #07c160; }
.message-wrapper.selected .message-selection-indicator::after { content: ''; position: absolute; left: 7px; top: 4px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.message-wrapper.selected::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 122, 255, 0.15); border-radius: 8px; pointer-events: none; }
#chat-screen.multi-select-active .message-wrapper { padding-left: 45px; position: relative; }
#chat-screen.multi-select-active .chat-input-area { display: none; }
#chat-screen.multi-select-active .chat-messages { padding-bottom: 15px !important; }
#message-context-menu { position: absolute; display: flex; background-color: #4b5154; border-radius: 8px; padding: 5px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); z-index: 200; opacity: 0; transform: scale(0.9); pointer-events: none; transition: opacity 0.1s ease-out, transform 0.1s ease-out; }
#message-context-menu.visible { opacity: 1; transform: scale(1); pointer-events: auto; }
.context-menu-item { color: white; padding: 8px 12px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.context-menu-item:hover { background-color: #606060; }
.context-menu-item:first-child:hover { border-radius: 4px 0 0 4px; }
.context-menu-item:last-child:hover { border-radius: 0 4px 4px 0; }

/* --- 响应式与媒体查询 (Responsive & Media Queries) --- */
@media (max-width: 420px) { 
    html, body { display: block; background-color: var(--phone-bg); } 
    #phone-screen { border-radius: 0; position: relative; } 
    
    /* iPhone16等现代手机音乐播放器按钮优化 */
    .player-buttons {
        margin: 0 20px !important;
        padding: 0 !important;
        gap: 15px !important;
        justify-content: center !important;
        max-width: 100% !important;
    }
    
    .player-buttons i {
        font-size: 22px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 6px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    .player-buttons .fa-pause-circle, 
    .player-buttons .fa-play-circle {
        font-size: 26px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        padding: 8px !important;
    }
    
    /* 音乐播放器内容区域优化 */
    .music-player-content {
        padding: 15px 0 25px !important;
    }
    
    /* 进度条容器优化 - 已移除旧样式 */
    
    /* 歌曲信息优化 */
    #player-song-info {
        padding: 0 25px !important;
        margin: 0 0 15px 0 !important;
    }
    
    /* 歌词容器优化 */
    #player-lyrics-container {
        margin-top: 18px !important;
    }
}

/* iPhone 14/15/16 Pro Max 等大屏手机优化 */
@media (min-width: 421px) and (max-width: 480px) {
    .player-buttons {
        margin: 0 25px !important;
        gap: 18px !important;
    }
    
    .player-buttons i {
        font-size: 24px !important;
        min-width: 46px !important;
        min-height: 46px !important;
        padding: 7px !important;
    }
    
    .player-buttons .fa-pause-circle, 
    .player-buttons .fa-play-circle {
        font-size: 28px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        padding: 9px !important;
    }
}

@media (min-width: 481px) { body { background-color: var(--body-bg); display: flex; justify-content: center; align-items: center; } #phone-screen { width: 410px; height: 880px; border-radius: 47px; box-shadow: 0 0 0 1px #dcdcdc; } #view-mode-toggle-btn { display: flex; } }
body.force-fullscreen { padding: 0 !important; align-items: flex-start !important; }
body.force-fullscreen #phone-screen { width: 100vw !important; height: 100% !important; min-height: 100vh; border-radius: 0 !important; box-shadow: none !important; }
body.force-fullscreen #view-mode-toggle-btn { display: none !important; }

/* 显示模式切换 - index 3 样式 */
#phone-screen.index3-display-mode .app-header { 
    padding: 60px 10px 12px 10px !important; 
    background-color: #ededed !important; 
}
/* 音乐播放器页面的 header 保持透明背景 */
#phone-screen.index3-display-mode #music-player-screen .app-header {
    background-color: transparent !important;
}
#phone-screen.index3-display-mode #status-bar { 
    display: flex !important; 
}
#phone-screen.index3-display-mode.dark-mode .app-header { 
    background-color: #000000 !important; 
}
/* 音乐播放器页面在暗色模式下也保持透明背景 */
#phone-screen.index3-display-mode.dark-mode #music-player-screen .app-header {
    background-color: transparent !important;
}

/* --- 美化预览专用 (Beautify Preview) --- */
#custom-beautification-screen .settings-actions button { font-weight: 500; }
#beautify-preview { width: 100%; min-height: 350px; display: flex; justify-content: center; align-items: center; background-color: transparent; border: none; padding: 0; box-sizing: border-box; overflow: visible; }
.preview-bubble { padding: 8px 12px; border-radius: 8px; max-width: 70%; font-size: 14px; line-height: 1.5; }
.preview-bubble.ai { background-color: var(--ai-bubble-bg); color: var(--ai-bubble-text); align-self: flex-start; }
.preview-bubble.user { background-color: var(--user-bubble-bg); color: var(--user-bubble-text); align-self: flex-end; }
#beautify-preview-modal { z-index: 300; }
#preview-phone-screen-container { width: 350px; height: 400px; background-color: var(--phone-bg); border-radius: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #ccc; position: relative; }
#preview-phone-screen-container .preview-header { flex-shrink: 0; height: 45px; background-color: var(--header-bg); border-bottom: 1px solid var(--input-border); display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; color: var(--header-text); padding: 15px 20px 10px; text-align: center; position: relative; }
#preview-phone-screen-container .preview-header span:first-child { font-size: 18px; }
.preview-time { font-weight: 600; color: var(--header-text); }
#close-beautify-preview-btn { position: absolute; top: 10px; right: 15px; font-size: 24px; color: var(--system-message-color); background: none; border: none; cursor: pointer; }
.preview-messages { flex-grow: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
#preview-phone-screen-container .preview-footer { flex-shrink: 0; height: 50px; background-color: var(--input-area-bg); border-top: 1px solid var(--input-border); display: flex; align-items: center; padding: 8px 12px; gap: 8px; box-sizing: border-box; }
#preview-phone-screen-container .preview-footer .input-placeholder { flex-grow: 1; height: 100%; background-color: var(--input-bg); border-radius: 6px; }
#preview-phone-screen-container .preview-footer .send-placeholder { width: 50px; height: 100%; background-color: var(--wechat-green); border-radius: 17px; }
.preview-chat-footer-wrapper { flex-shrink: 0; background-color: var(--input-area-bg); border-top: 0.5px solid var(--input-border); pointer-events: none; }
.preview-textarea-placeholder { flex-grow: 1; height: 38px; border-radius: 5px; background-color: var(--input-bg); }
#preview-messages-container { flex-grow: 1; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
#preview-chat-input { flex-grow: 1; border: none; border-radius: 5px; padding: 10px 15px; font-size: 15px; resize: none; max-height: 100px; background-color: var(--input-bg); color: var(--ai-bubble-text); }
#preview-chat-input:focus { outline: none; box-shadow: none; }
#preview-plus-btn, #preview-emoji-btn, #preview-dynamic-btn { flex-shrink: 0; cursor: pointer; transition: all 0.2s ease-in-out; transform: translateY(-4px); }
#preview-plus-btn { width: 27px; height: 27px; background-color: transparent; border: 1.5px solid #000; border-radius: 50%; }
#preview-emoji-btn { display: flex; justify-content: center; align-items: center; width: 27px; height: 27px; background-color: transparent; border: 1.5px solid #000; border-radius: 50%; padding: 1px; box-sizing: border-box; color: #000; margin: 0 4px; }
#preview-dynamic-btn { width: 36px; height: 36px; border: none; border-radius: 50%; }

/* === 表情包消息特殊样式 - 隐藏淡蓝色渐变遮罩 === */

/* 为包含表情包的消息气泡隐藏渐变背景层 */
.message-bubble.user .content.just-image-content::before,
.message-bubble.ai .content.just-image-content::before {
    display: none !important; /* 隐藏淡蓝色渐变遮罩 */
}

/* 确保表情包消息气泡的装饰贴纸容器也不显示渐变背景 */
.message-bubble.user .content.just-image-content::after,
.message-bubble.ai .content.just-image-content::after {
    background-image: none !important; /* 移除装饰贴纸 */
    background: transparent !important; /* 确保背景透明 */
}

/* 可选：如果需要保持表情包的装饰贴纸但去掉渐变遮罩，可以使用下面的规则替代上面的 ::after 规则 */
/*
.message-bubble.user .content.just-image-content::after,
.message-bubble.ai .content.just-image-content::after {
    background-color: transparent !important;
    box-shadow: none !important;
}
*/

/* ====================================== 
   播放页面返回按钮旋转 
   ====================================== */
/* 将播放页面左上角的返回图标顺时针旋转90度 */
#music-player-back-btn-float {
    transform: rotate(90deg) translateY(2px) !important;
}

#music-player-back-btn-float:hover {
    transform: rotate(90deg) translateY(-2px) !important;
}

#music-player-back-btn-float:active {
    transform: rotate(90deg) translateY(0px) scale(0.95) !important;
}

/* ====================================== 
   聊天框请求回复按钮SVG化 
   ====================================== */
/* 将聊天框右边的请求回复按钮改为使用旧版本图标 */
/* 已移除默认的旋转箭头图标，使用HTML中设置的背景图片 */

/* ====================================== 
   音乐播放页面请求回复按钮SVG化 
   ====================================== */
/* 将音乐播放页面聊天框右边的请求回复按钮从emoji改为SVG格式 */
#music-receive-btn::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 隐藏原有的emoji文本 */
#music-receive-btn {
    font-size: 0 !important;
}

/* 禁用状态的按钮 */
#music-receive-btn:disabled::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,0.4)'%3E%3Cpath d='M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E");
    opacity: 0.6;
}



/* ==================== */


/* --- 手绘风格心声弹窗样式 --- */
#heart-voice-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(74, 68, 65, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.4s ease-out;
    pointer-events: none;
    cursor: pointer;
}

#heart-voice-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

#heart-voice-bubble {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0;
    padding: 35px 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    color: #4a4441;
    cursor: default;
    transform: scale(0.95) rotate(-1deg);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    background-color: #f7f4ed;
    background-image: url('https://www.transparenttextures.com/patterns/light-paper-fibers.png');
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 8px;
    max-height: calc(100vh - 40px);
    overflow: visible;
}

#heart-voice-overlay.show #heart-voice-bubble {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

.hand-drawn-border {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    fill: none;
    stroke: #4a4441;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.close-popup-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #4a4441;
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.close-popup-btn:hover {
    opacity: 1;
    transform: rotate(90deg) scale(1.1);
}

.menu-content {
    overflow-y: auto;
    padding-right: 10px;
    max-height: calc(100vh - 120px);
}

.menu-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    position: relative;
}

.menu-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="10" viewBox="0 0 100 10" xmlns="http://www.w3.org/2000/svg"><path d="M2 5 Q 25 2, 50 5 T 98 5" fill="none" stroke="%23c2b8b1" stroke-width="2" stroke-linecap="round"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

.menu-section-title {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.2em;
    margin-bottom: 20px;
    color: #4a4441;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.title-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu-item {
    margin-bottom: 18px;
}

.menu-item-name {
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    color: #777;
    margin-bottom: 5px;
    display: block;
}

.menu-item-description {
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.9;
    color: #5c5551;
    padding-left: 15px;
    border-left: 1px solid #dcd6c8;
}

.inner-thoughts {
    font-style: italic;
    background: linear-gradient(120deg, #fff5ee, #fef0e6);
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #ddb892;
    color: #6b5b73;
}

.dark-thoughts {
    background: linear-gradient(120deg, #2a2a2a, #1a1a1a);
    color: #ccc;
    padding: 15px;
    border-radius: 8px;
    font-style: italic;
    border: 1px solid #444;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
}

.stat-item {
    background: rgba(220, 214, 200, 0.3);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dcd6c8;
}

.stat-label {
    font-weight: bold;
    color: #4a4441;
    margin-bottom: 5px;
}

.menu-content::-webkit-scrollbar {
    width: 8px;
}
.menu-content::-webkit-scrollbar-track {
    background: transparent;
}
.menu-content::-webkit-scrollbar-thumb {
    background: #dcd6c8;
    border-radius: 4px;
}
.menu-content::-webkit-scrollbar-thumb:hover {
    background: #c2b8b1;
}

/* 自动弹窗切换按钮 - 手绘风格 */
.auto-popup-toggle {
    position: absolute;
    top: 18px;
    right: 60px;
    width: 36px;
    height: 36px;
    border: 2px solid #4a4441;
    border-radius: 50%;
    background: #f7f4ed;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    color: #4a4441;
    opacity: 0.7;
}

.auto-popup-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.auto-popup-toggle:active {
    transform: scale(0.95);
}

.auto-popup-toggle.disabled {
    background: #e8e4dc;
    border-color: #a39d96;
    color: #a39d96;
}

.auto-popup-toggle.disabled:hover {
    background: #ddd9d1;
}

.auto-popup-icon {
    transition: all 0.3s ease;
}

.auto-popup-toggle.disabled .toggle-on {
    display: none;
}

.auto-popup-toggle.disabled .toggle-off {
    display: block !important;
}

/* 响应式优化 - 针对小屏幕设备 */
@media (max-width: 540px) {
    #heart-voice-bubble {
        padding: 30px 25px;
        max-height: calc(100vh - 40px);
    }
    
    .menu-item-name {
        font-size: 14px;
    }
    
    .menu-item-description {
        font-size: 14px;
        line-height: 1.7;
    }
    
    .menu-section-title {
        font-size: 14px;
    }
    
    .auto-popup-toggle {
        right: 55px;
        width: 32px;
        height: 32px;
    }
    
    .close-popup-btn {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
}

/* 让聊天标题可点击 */
#chat-title {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

#chat-title:hover {
    opacity: 0.7;
}


/* ==================== */


/* 打工页面毛玻璃卡片 Hover 效果 */
.work-glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 打工时长按钮 Hover 效果 */
.work-hour-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 255, 255, 0.3) !important;
}

.work-hour-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* 开始打工按钮 Hover 效果 */
#start-work-btn:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5), 0 0 20px rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

#start-work-btn:active {
    transform: translateY(-2px);
}

/* 滑块样式 */
#work-hours-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#work-hours-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.5);
}

#work-hours-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#work-hours-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.5);
}


/* ==================== */


/* --- 评论回复功能样式 --- */
/* 回复评论的显示样式 */
.comment-reply-info {
    font-weight: 600;
    color: var(--accent-color);
}

/* 评论项可点击样式 */
.comment-item[onclick] {
    transition: background-color 0.2s ease;
}

.comment-item[onclick]:hover {
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

/* 取消回复按钮 */
.qzone-cancel-reply-btn {
    transition: all 0.2s ease !important;
}

.qzone-cancel-reply-btn:hover {
    background-color: #e0e0e0 !important;
    transform: translateY(-50%) scale(1.1) !important;
}


/* ==================== */


/* 日记阅读弹窗样式 */
@import url('https://fonts.googleapis.com/css2?family=Zhi+Mang+Xing&display=swap');

@font-face {
    font-family: 'DiaryFont';
    src: url('https://s3plus.meituan.net/opapisdk/op_ticket_885190757_1756870268092_qdqqd_k7tugt.ttf') format('truetype');
    font-display: swap;
}

#diary-reading-modal {
    z-index: 1000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#diary-reading-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.diary-reading-container {
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    background-color: #f9f9f9;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#diary-reading-modal.visible .diary-reading-container {
    transform: scale(1);
}

.diary-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.diary-close-btn:hover {
    background: rgba(255,255,255,1);
    transform: scale(1.1);
}

.diary-module-card {
    background-color: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.diary-header-section {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.diary-date-box {
    flex: 1;
    background-color: #f5f5f5;
    border-radius: 16px;
    padding: 10px;
    text-align: center;
}

.diary-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
}

.diary-number {
    font-size: 36px;
    font-weight: 300;
    color: #444;
    line-height: 1.2;
}

.diary-vitals-box {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 5px 0;
}

.diary-vital-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diary-vital-label {
    font-size: 10px;
    color: #aaa;
    width: 50px;
    text-transform: uppercase;
}

.diary-vital-icons {
    font-size: 16px;
    letter-spacing: 5px;
}

.diary-section-title {
    font-size: 10px;
    color: #bbb;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 15px;
}

.diary-habit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 15px;
}

.diary-habit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
}

.diary-habit-check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    display: inline-block;
}

.diary-habit-check.done {
    background-color: #FBC531;
    border-color: #FBC531;
}

.diary-with-whom p {
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 20px;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin: 0;
}

.diary-dual-section {
    display: flex;
    gap: 15px;
}

.diary-dual-section .diary-module-card {
    flex: 1;
}

.diary-dual-section .diary-section-title {
    font-size: 10px;
    color: #bbb;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.diary-dual-section ul {
    list-style: none;
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 18px;
    color: #555;
    line-height: 1.8;
    margin: 0;
    padding: 0;
}

.diary-achievements ul {
    list-style: none;
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 18px;
    color: #555;
    line-height: 1.8;
    padding-left: 5px;
    margin: 0;
}

#diary-content-text {
    font-family: 'DiaryFont', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* iOS全屏模式优化 */
html.user-platform-ios .diary-reading-container {
    max-width: 340px !important;
    max-height: 80vh !important;
    padding: 20px !important;
    margin: 15px !important;
}

/* iOS模式下的小屏幕优化 */
@media (max-width: 400px) {
    html.user-platform-ios .diary-reading-container {
        max-width: 320px !important;
        max-height: 75vh !important;
        padding: 18px !important;
        margin: 10px !important;
    }
}

/* 响应式设计 */
@media (max-width: 400px) {
    .diary-reading-container {
        max-width: 95%;
        padding: 20px;
    }
    
    .diary-header-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .diary-dual-section {
        flex-direction: column;
    }
}


/* ==================== */


                @keyframes bounce {
                    0%, 80%, 100% { transform: scale(0); }
                    40% { transform: scale(1); }
                }
                

/* ==================== */

/* ==================== 总结功能 Neumorphism 样式 ==================== */

/* 模态窗口基础 */
.neuro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neuro-modal-container {
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #E8ECEF;
    border-radius: 20px;
    box-shadow:
        12px 12px 24px rgba(163, 177, 198, 0.6),
        -12px -12px 24px rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.neuro-modal-container-sm {
    max-width: 500px;
}

.neuro-modal-container-lg {
    max-width: 900px;
}

/* Header */
.neuro-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(163, 177, 198, 0.2);
}

.neuro-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.neuro-back-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E8ECEF;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.5),
        -4px -4px 8px rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.neuro-back-btn:active {
    box-shadow:
        inset 2px 2px 4px rgba(163, 177, 198, 0.5),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
}

.neuro-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E8ECEF;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.5),
        -4px -4px 8px rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.neuro-close-btn:active {
    box-shadow:
        inset 2px 2px 4px rgba(163, 177, 198, 0.5),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
}

/* Body */
.neuro-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Footer */
.neuro-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(163, 177, 198, 0.2);
}

/* 按钮 */
.neuro-btn-primary {
    flex: 1;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    box-shadow:
        4px 4px 8px rgba(0, 122, 255, 0.3),
        -2px -2px 6px rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

.neuro-btn-primary:active {
    box-shadow:
        inset 2px 2px 4px rgba(0, 100, 200, 0.5),
        inset -2px -2px 4px rgba(100, 150, 255, 0.3);
}

.neuro-btn-secondary {
    flex: 1;
    background: #E8ECEF;
    color: #007AFF;
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.4),
        -4px -4px 8px rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.neuro-btn-secondary:active {
    box-shadow:
        inset 2px 2px 4px rgba(163, 177, 198, 0.5),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
}

/* 记忆卡片 */
.summary-cards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-card {
    background: #FEFAF3;
    border-radius: 16px;
    padding: 20px;
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.5);
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.summary-card-time {
    font-size: 13px;
    color: #999;
}

.summary-card-content {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.summary-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.summary-card-btn {
    background: #E8ECEF;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    box-shadow:
        3px 3px 6px rgba(163, 177, 198, 0.4),
        -3px -3px 6px rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.summary-card-btn:active {
    box-shadow:
        inset 2px 2px 4px rgba(163, 177, 198, 0.4),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
}

.summary-card-btn.delete {
    color: #ff3b30;
}

/* 空状态 */
.summary-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
}

/* 设置页面 */
.neuro-settings-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.neuro-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.neuro-setting-label {
    font-size: 15px;
    color: #333;
}

/* 滑块 */
.neuro-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.neuro-slider {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: #E8ECEF;
    box-shadow:
        inset 2px 2px 4px rgba(163, 177, 198, 0.4),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
    outline: none;
    -webkit-appearance: none;
}

.neuro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.neuro-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007AFF;
    cursor: pointer;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
}

.neuro-slider-value {
    font-size: 14px;
    font-weight: 500;
    color: #007AFF;
    min-width: 60px;
    text-align: right;
}

/* 提示词区域 */
.neuro-prompt-section {
    margin-top: 24px;
}

.neuro-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.neuro-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.neuro-tab {
    flex: 1;
    background: #E8ECEF;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    box-shadow:
        4px 4px 8px rgba(163, 177, 198, 0.4),
        -4px -4px 8px rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.neuro-tab.active {
    color: #007AFF;
    box-shadow:
        inset 2px 2px 4px rgba(163, 177, 198, 0.4),
        inset -2px -2px 4px rgba(255, 255, 255, 0.5);
}

.neuro-textarea {
    width: 100%;
    background: #FEFAF3;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    resize: vertical;
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.5);
    font-family: inherit;
}

.neuro-textarea:focus {
    outline: none;
}

/* 提示信息 */
.neuro-hint {
    background: #FFF9E6;
    border-left: 3px solid #FFD700;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12px;
    color: #856404;
    line-height: 1.6;
}

.neuro-prompt-hint {
    background: #E8F4FF;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.hint-title {
    font-size: 13px;
    font-weight: 500;
    color: #0066CC;
    margin-bottom: 8px;
}

.hint-list {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    color: #555;
}

.hint-list code {
    background: rgba(0, 122, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #007AFF;
}

/* 总结预览 */
.summary-preview-content {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.neuro-card {
    background: #FEFAF3;
    border-radius: 16px;
    padding: 20px;
    box-shadow:
        inset 3px 3px 6px rgba(163, 177, 198, 0.3),
        inset -3px -3px 6px rgba(255, 255, 255, 0.5);
}

/* 精炼对比 */
.refine-comparison-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.refine-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.refine-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.refine-column-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.word-count-badge {
    background: #007AFF;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.refine-content {
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.8;
}

.refine-arrow {
    display: flex;
    align-items: center;
    font-size: 24px;
    color: #007AFF;
    font-weight: bold;
}

/* 响应式 */
@media (max-width: 768px) {
    .neuro-modal-container {
        width: 95%;
        max-height: 90vh;
    }

    .refine-comparison-container {
        flex-direction: column;
    }

    .refine-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }
}
